From 84f4b11b9ceaa65f6599779fba6f30249627e59d Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Tue, 15 Aug 2023 21:51:59 +0200 Subject: [PATCH] added config file to the nix store --- nix/module.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nix/module.nix b/nix/module.nix index a0ca3fa..b6c8a07 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -8,6 +8,9 @@ inputs: { cfg = config.dyn-gandi; package = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.default; inherit (lib) mkIf mkEnableOption mkOption types; + + format = pkgs.formats.json {}; + configFile = format.generate "config.json" cfg.settings; in { options.dyn-gandi = { enable = mkEnableOption "dyn-gandi"; @@ -42,14 +45,14 @@ in { environment = { systemPackages = [package]; - etc."dyn-gandi.json" = { - text = builtins.toJSON cfg.settings; - }; + # etc."dyn-gandi.json" = { + # text = builtins.toJSON cfg.settings; + # }; }; systemd.services.dyn-gandi = mkIf (cfg.timer != null) { - script = "${package}/bin/dyn_gandi"; # TODO: add config file via command line options + script = "${package}/bin/dyn_gandi --config ${configFile}"; serviceConfig = { Type = "oneshot";