From c2fa2dcd349e1d45e2354ccb6ee248f16472a001 Mon Sep 17 00:00:00 2001 From: lordie Date: Fri, 7 Apr 2023 22:24:16 -0300 Subject: [PATCH 1/2] activitywatch: init at 0.12.1 --- .../misc/activitywatch/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/applications/misc/activitywatch/default.nix diff --git a/pkgs/applications/misc/activitywatch/default.nix b/pkgs/applications/misc/activitywatch/default.nix new file mode 100644 index 0000000000000..4197383c540a6 --- /dev/null +++ b/pkgs/applications/misc/activitywatch/default.nix @@ -0,0 +1,51 @@ +{ config, lib, stdenv, fetchzip, qt6, wrapGAppsNoGuiHook, glib-networking +, autoPatchelfHook }: + +stdenv.mkDerivation rec { + pname = "ActivityWatch"; + version = "0.12.1"; + + src = fetchzip { + url = + "https://github.com/ActivityWatch/activitywatch/releases/download/v${version}/activitywatch-v${version}-linux-x86_64.zip"; + hash = "sha256-VdnAKcLQBWBVZqRyD1xoYuAfvTeCtcFJp3/slkQ6ynk="; + }; + + buildInputs = [ qt6.qtbase glib-networking ]; + nativeBuildInputs = [ autoPatchelfHook wrapGAppsNoGuiHook ]; + dontWrapQtApps = true; + + installPhase = '' + installed=$out/opt/activitywatch + mkdir -p $out/bin $out/share/applications $out/opt/activitywatch + mv * $installed + + # Symlink executables to /bin + ln -s $installed/aw-qt $out/bin/aw-qt + for name in aw-server aw-server-rust aw-watcher-afk aw-watcher-window; do + ln -s $installed/$name/$name $out/bin/$name + done + + # Add .desktop file to share/applications + cp $installed/aw-qt.desktop $out/share/applications + + # Add logo to share/icons + mkdir -p $out/share/icons/hicolor/{128x128,512x512}/apps + ln -s $installed/media/logo/logo.png $out/share/icons/hicolor/512x512/apps/activitywatch.png + ln -s $installed/media/logo/logo-128.png $out/share/icons/hicolor/128x128/apps/activitywatch.png + ''; + + meta = with lib; { + description = + "ActivityWatch is an app that automatically tracks how you spend time on your devices."; + longDescription = '' + ActivityWatch is an app that automatically tracks how you spend time on your devices. + It is open source, privacy-first, cross-platform, and a great alternative to services like RescueTime, ManicTime, and WakaTime. + It can be used to keep track of your productivity, time spent on different projects, bad screen habits, or just to understand how you spend your time. + ''; + homepage = "https://github.com/ActivityWatch/activitywatch"; + license = licenses.mpl20; + platforms = platforms.linux; + maintainers = with maintainers; [ chaoky ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 53a4d1b299fe3..deada83dc6d86 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28721,6 +28721,8 @@ with pkgs; acorn = callPackage ../applications/networking/cluster/acorn { }; + activityWatch = callPackage ../applications/misc/activitywatch { }; + adobe-reader = pkgsi686Linux.callPackage ../applications/misc/adobe-reader { }; adl = callPackage ../applications/video/adl { }; From cc19650a9f5b1e17f091ee30ca722e3521010f04 Mon Sep 17 00:00:00 2001 From: Chaoky Date: Sat, 8 Apr 2023 17:41:54 -0300 Subject: [PATCH 2/2] activitywatch: lint Co-authored-by: Sandro --- pkgs/applications/misc/activitywatch/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/activitywatch/default.nix b/pkgs/applications/misc/activitywatch/default.nix index 4197383c540a6..b30944bb724e6 100644 --- a/pkgs/applications/misc/activitywatch/default.nix +++ b/pkgs/applications/misc/activitywatch/default.nix @@ -6,8 +6,7 @@ stdenv.mkDerivation rec { version = "0.12.1"; src = fetchzip { - url = - "https://github.com/ActivityWatch/activitywatch/releases/download/v${version}/activitywatch-v${version}-linux-x86_64.zip"; + url = "https://github.com/ActivityWatch/activitywatch/releases/download/v${version}/activitywatch-v${version}-linux-x86_64.zip"; hash = "sha256-VdnAKcLQBWBVZqRyD1xoYuAfvTeCtcFJp3/slkQ6ynk="; }; @@ -36,8 +35,7 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - description = - "ActivityWatch is an app that automatically tracks how you spend time on your devices."; + description = "ActivityWatch is an app that automatically tracks how you spend time on your devices."; longDescription = '' ActivityWatch is an app that automatically tracks how you spend time on your devices. It is open source, privacy-first, cross-platform, and a great alternative to services like RescueTime, ManicTime, and WakaTime.