nix: fix package singleton

This commit is contained in:
raf 2025-01-08 11:23:30 +03:00
parent 53d59bcd24
commit 957d52b64e
No known key found for this signature in database
GPG key ID: EED98D11B85A2819

View file

@ -37,11 +37,14 @@ in {
};
config = mkIf cfg.enable {
systemd.user.services."batmon" = {
description = "Power Monitoring Service";
environment.systemPackages = [cfg.package];
systemd.user.services.batmon = {
description = "Simple, reactive power management service";
documentation = "https://github.com/NotAShelf/batmon";
wants = ["power-profiles-daemon.service"];
wantedBy = ["default.target"];
environment.PATH = mkForce "/run/wrappers/bin:${lib.makeBinPath cfg.package}";
requires = ["power-profiles-daemon.service"];
wantedBy = ["multi-user.target"];
environment.PATH = mkForce "/run/wrappers/bin:${lib.makeBinPath [cfg.package]}";
script = ''
${lib.getExe cfg.package} --config ${builtins.toJSON cfg.settings}
'';