From 20e79cbe8339113d946d5cd6e1a8242e726c6ecb Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Tue, 26 Oct 2021 14:04:24 -0400 Subject: [PATCH] phpipam: add configFile setting --- modules/phpipam.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/phpipam.nix b/modules/phpipam.nix index 23cf0ae..a8a35ef 100644 --- a/modules/phpipam.nix +++ b/modules/phpipam.nix @@ -17,7 +17,7 @@ let installPhase = '' cp -r "$src" "$out" chmod +w "$out" - mv "$out/config.docker.php" "$out/config.php" + echo '"$out/config.php" ''; }; @@ -33,6 +33,12 @@ in enable = lib.mkEnableOption "Enable phpipam"; + configFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; + description = "Path to phpipam configuration file"; + default = null; + }; + hostname = lib.mkOption { type = lib.types.str; default = "localhost"; @@ -47,6 +53,11 @@ in config = lib.mkIf cfg.enable { + environment.etc."phpipam_config.php" = + if cfg.configFile == null + then { text = ""; } + else { source = cfg.configFile; }; + systemd.services = builtins.mapAttrs (_: script: { inherit script;