make --config reference path to config, not the config itself
This commit is contained in:
parent
af8453bd5c
commit
c8e9c79f15
1 changed files with 5 additions and 1 deletions
|
@ -37,14 +37,18 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
# Create the batmon configuration file in /etc/batmon.json
|
||||||
|
environment.etc."batmon.json".source = format.generate "batmon.json" cfg.settings;
|
||||||
|
|
||||||
environment.systemPackages = [cfg.package];
|
environment.systemPackages = [cfg.package];
|
||||||
|
|
||||||
systemd.user.services.batmon = {
|
systemd.user.services.batmon = {
|
||||||
description = "Simple, reactive power management service";
|
description = "Simple, reactive power management service";
|
||||||
documentation = ["https://github.com/NotAShelf/batmon"];
|
documentation = ["https://github.com/NotAShelf/batmon"];
|
||||||
wantedBy = ["multi-user.target"];
|
wantedBy = ["multi-user.target"];
|
||||||
environment.PATH = mkForce "/run/wrappers/bin:${lib.makeBinPath [cfg.package]}";
|
environment.PATH = mkForce "/run/wrappers/bin:${lib.makeBinPath [cfg.package]}";
|
||||||
script = ''
|
script = ''
|
||||||
${lib.getExe cfg.package} --config ${builtins.toJSON cfg.settings}
|
${lib.getExe cfg.package} --config /etc/batmon.json
|
||||||
'';
|
'';
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
|
Reference in a new issue