diff options
author | francescoDeSimone <francesco.desimone@canonical.com> | 2023-08-18 13:49:18 +0200 |
---|---|---|
committer | francescoDeSimone <francesco.desimone@canonical.com> | 2023-08-19 16:08:39 +0200 |
commit | 42f0af4abea7fb92a8cee685a69e75f74f5e2f14 (patch) | |
tree | 4c2fd66fac78e017491b839106f275599de3d3ee /nixos/modules/services/backup | |
parent | 9310806eb658aa43922d2503b54c8d9845299e90 (diff) |
nixos/duplicati: add package option
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r-- | nixos/modules/services/backup/duplicati.nix | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/services/backup/duplicati.nix b/nixos/modules/services/backup/duplicati.nix index 007396ebfc9b4..9b422635e7f08 100644 --- a/nixos/modules/services/backup/duplicati.nix +++ b/nixos/modules/services/backup/duplicati.nix @@ -10,6 +10,8 @@ in services.duplicati = { enable = mkEnableOption (lib.mdDoc "Duplicati"); + package = mkPackageOptionMD pkgs "duplicati" { }; + port = mkOption { default = 8200; type = types.port; @@ -53,7 +55,7 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.duplicati ]; + environment.systemPackages = [ cfg.package ]; systemd.services.duplicati = { description = "Duplicati backup"; @@ -63,7 +65,7 @@ in { User = cfg.user; Group = "duplicati"; - ExecStart = "${pkgs.duplicati}/bin/duplicati-server --webservice-interface=${cfg.interface} --webservice-port=${toString cfg.port} --server-datafolder=${cfg.dataDir}"; + ExecStart = "${cfg.package}/bin/duplicati-server --webservice-interface=${cfg.interface} --webservice-port=${toString cfg.port} --server-datafolder=${cfg.dataDir}"; Restart = "on-failure"; } (mkIf (cfg.dataDir == "/var/lib/duplicati") { @@ -83,4 +85,3 @@ in }; } - |