1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-19 01:29:46 +01:00
home-manager/tests/modules/services/activitywatch/basic-setup.nix

54 lines
1.7 KiB
Nix
Raw Normal View History

2023-08-04 13:56:37 +02:00
{ config, ... }:
let stubPackage = config.lib.test.mkStubPackage { };
in {
services.activitywatch = {
enable = true;
settings = {
port = 3012;
custom_static = { custom-watcher = stubPackage; };
};
watchers = {
# These are basically examples of a real world usage.
aw-watcher-afk.package = stubPackage;
aw-watcher-window.package = stubPackage;
custom-watcher = {
package = stubPackage;
settings = {
foo = "bar";
baz = 8;
};
settingsFilename = "config.toml";
};
another-custom-watcher = {
package = stubPackage;
settings = {
hello = "there";
world = "plan";
};
};
};
};
nmt.script = ''
# Basic check for the bare setup.
assertFileExists home-files/.config/systemd/user/activitywatch.service
assertFileExists home-files/.config/systemd/user/activitywatch.target
# Basic check for the watchers setup.
assertFileExists home-files/.config/systemd/user/activitywatch-watcher-aw-watcher-afk.service
assertFileExists home-files/.config/systemd/user/activitywatch-watcher-aw-watcher-window.service
# Checking for the generated configurations (and the ones that is not
# supposed to exist).
assertFileExists home-files/.config/activitywatch/aw-server-rust/config.toml
assertFileExists home-files/.config/activitywatch/custom-watcher/config.toml
assertFileExists home-files/.config/activitywatch/another-custom-watcher/another-custom-watcher.toml
assertPathNotExists home-files/.config/activitywatch/aw-watcher-afk/aw-watcher-afk.toml
assertPathNotExists home-files/.config/activitywatch/aw-watcher-window/aw-watcher-window.toml
'';
}