mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +00:00
phpipam: add configFile setting
This commit is contained in:
parent
af27180da4
commit
20e79cbe83
1 changed files with 12 additions and 1 deletions
|
@ -17,7 +17,7 @@ let
|
|||
installPhase = ''
|
||||
cp -r "$src" "$out"
|
||||
chmod +w "$out"
|
||||
mv "$out/config.docker.php" "$out/config.php"
|
||||
echo '<?php require("config.docker.php"); require("/etc/phpipam_config.php");' >"$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;
|
||||
|
|
Loading…
Reference in a new issue