activitywatch

This commit is contained in:
caandt 2024-12-31 21:25:02 -05:00
parent 56dc8655f8
commit 881eae6894
5 changed files with 46 additions and 28 deletions

View file

@ -9,4 +9,5 @@
home.username = "ahnwuoa"; home.username = "ahnwuoa";
xresources.properties."Xft.dpi" = 120; xresources.properties."Xft.dpi" = 120;
u.has.activitywatch = true;
} }

View file

@ -9,16 +9,5 @@
]; ];
home.username = "ahnwuoa"; home.username = "ahnwuoa";
services.activitywatch = { u.has.activitywatch = true;
enable = true;
watchers = {
aw-watcher-afk.package = pkgs.activitywatch;
aw-watcher-window.package = pkgs.activitywatch;
};
};
systemd.user.targets.activitywatch = {
Unit.Requires = lib.mkForce ["autostart.target"];
Unit.After = lib.mkForce ["autostart.target"];
Install.WantedBy = lib.mkForce ["autostart.target"];
};
} }

25
user/activitywatch.nix Normal file
View file

@ -0,0 +1,25 @@
{
config,
lib,
pkgs,
...
}:
lib.mkIf config.u.has.activitywatch {
services.activitywatch = {
enable = true;
watchers = {
aw-watcher-afk.package = pkgs.activitywatch;
aw-watcher-window.package = pkgs.activitywatch;
};
};
systemd.user.targets.activitywatch = {
Unit.Requires = lib.mkForce ["autostart.target"];
Unit.After = lib.mkForce ["autostart.target"];
Install.WantedBy = lib.mkForce ["autostart.target"];
};
home.packages = with pkgs; [
activitywatch
python312Packages.aw-client
python312Packages.aw-core
];
}

View file

@ -4,6 +4,7 @@
... ...
}: { }: {
imports = [ imports = [
./activitywatch.nix
./autostart.nix ./autostart.nix
./bin ./bin
./config ./config

View file

@ -43,22 +43,24 @@
}); });
description = "list of file manager bookmarks"; description = "list of file manager bookmarks";
}; };
has = { has = let
graphical = lib.mkOption { mkOpt = name:
lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
description = "enable graphical settings"; description = "enable ${name}";
default = true; default = true;
}; };
wine = lib.mkOption { mkOptF = name:
lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
description = "enable wine settings"; description = "enable ${name}";
default = true; default = false;
};
prog = lib.mkOption {
type = lib.types.bool;
description = "enable prog settings";
default = true;
}; };
in {
graphical = mkOpt "graphical";
wine = mkOpt "wine";
prog = mkOpt "prog";
activitywatch = mkOptF "activitywatch";
}; };
lib = lib.mkOption { lib = lib.mkOption {
type = lib.types.attrs; type = lib.types.attrs;