From c8e9c79f15af6f3b04e7e4b9f457434e85c1d678 Mon Sep 17 00:00:00 2001 From: Fazzi Date: Wed, 8 Jan 2025 09:17:11 +0000 Subject: [PATCH] make --config reference path to config, not the config itself --- nix/module.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nix/module.nix b/nix/module.nix index 4b39c8f..7e94df7 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -37,14 +37,18 @@ in { }; 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]; + systemd.user.services.batmon = { description = "Simple, reactive power management service"; documentation = ["https://github.com/NotAShelf/batmon"]; wantedBy = ["multi-user.target"]; environment.PATH = mkForce "/run/wrappers/bin:${lib.makeBinPath [cfg.package]}"; script = '' - ${lib.getExe cfg.package} --config ${builtins.toJSON cfg.settings} + ${lib.getExe cfg.package} --config /etc/batmon.json ''; serviceConfig = {