Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions pkgs/applications/misc/activitywatch/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{ 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 ];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not compile from source?

Copy link
Copy Markdown
Contributor Author

@chaoky chaoky Apr 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

activitywatch is composed of a lot of small services, the derivation proposed in the related issue is 380 lines long

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which is preferable if someone already has done the work

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try, what do you recommend for node packages? buildNpmPackage?

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 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down