updated PYTHONPATH to "${self}/"

This commit is contained in:
2025-11-10 21:19:34 -05:00
parent ae882ba578
commit d6d48516ea
3 changed files with 13 additions and 3 deletions

View File

@@ -44,7 +44,10 @@
# firmware update # firmware update
fwupd.enable = true; fwupd.enable = true;
snapshot_manager.enable = lib.mkDefault true; snapshot_manager = {
enable = lib.mkDefault true;
PYTHONPATH = "${inputs.self}/";
};
zfs = { zfs = {
trim.enable = lib.mkDefault true; trim.enable = lib.mkDefault true;

View File

@@ -16,6 +16,12 @@ in
default = ./snapshot_config.toml; default = ./snapshot_config.toml;
description = "Path to the snapshot_manager TOML config."; 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 { EnvironmentFile = lib.mkOption {
type = lib.types.nullOr (lib.types.coercedTo lib.types.path toString lib.types.str); type = lib.types.nullOr (lib.types.coercedTo lib.types.path toString lib.types.str);
default = null; default = null;
@@ -35,7 +41,7 @@ in
after = [ "zfs-import.target" ]; after = [ "zfs-import.target" ];
path = [ pkgs.zfs ]; path = [ pkgs.zfs ];
environment = { environment = {
PYTHONPATH = "${../..}/"; PYTHONPATH = cfg.PYTHONPATH;
}; };
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";

View File

@@ -1,5 +1,6 @@
{ {
pkgs, pkgs,
self,
... ...
}: }:
let let
@@ -22,7 +23,7 @@ in
description = "validates startup"; description = "validates startup";
path = [ pkgs.zfs ]; path = [ pkgs.zfs ];
environment = { environment = {
PYTHONPATH = "${../../..}/"; PYTHONPATH = "${self}/";
}; };
serviceConfig = { serviceConfig = {
EnvironmentFile = "${vars.secrets}/services/server-validation"; EnvironmentFile = "${vars.secrets}/services/server-validation";