diff --git a/common/global/default.nix b/common/global/default.nix index bec37a8..3134a4e 100644 --- a/common/global/default.nix +++ b/common/global/default.nix @@ -44,7 +44,10 @@ # firmware update fwupd.enable = true; - snapshot_manager.enable = lib.mkDefault true; + snapshot_manager = { + enable = lib.mkDefault true; + PYTHONPATH = "${inputs.self}/"; + }; zfs = { trim.enable = lib.mkDefault true; diff --git a/common/global/snapshot_manager.nix b/common/global/snapshot_manager.nix index 9bffd9e..d2126fb 100644 --- a/common/global/snapshot_manager.nix +++ b/common/global/snapshot_manager.nix @@ -16,6 +16,12 @@ in default = ./snapshot_config.toml; description = "Path to the snapshot_manager TOML config."; }; + PYTHONPATH = lib.mkOption { + type = lib.types.str; + description = '' + the PYTHONPATH to use for the snapshot_manager service. + ''; + }; EnvironmentFile = lib.mkOption { type = lib.types.nullOr (lib.types.coercedTo lib.types.path toString lib.types.str); default = null; @@ -35,7 +41,7 @@ in after = [ "zfs-import.target" ]; path = [ pkgs.zfs ]; environment = { - PYTHONPATH = "${../..}/"; + PYTHONPATH = cfg.PYTHONPATH; }; serviceConfig = { Type = "oneshot"; diff --git a/systems/jeeves/services/systemd.nix b/systems/jeeves/services/systemd.nix index 89de998..61862bd 100644 --- a/systems/jeeves/services/systemd.nix +++ b/systems/jeeves/services/systemd.nix @@ -1,5 +1,6 @@ { pkgs, + self, ... }: let @@ -22,7 +23,7 @@ in description = "validates startup"; path = [ pkgs.zfs ]; environment = { - PYTHONPATH = "${../../..}/"; + PYTHONPATH = "${self}/"; }; serviceConfig = { EnvironmentFile = "${vars.secrets}/services/server-validation";