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;