fix: expose host GPU utilities to services

This commit is contained in:
2026-07-29 14:06:11 +08:00
parent 123488d36b
commit 4d3f9c71d2
+5 -1
View File
@@ -6,6 +6,10 @@ let
cfg = config.services.nPanel;
packageForSystem = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
# GPU driver utilities belong to the active NixOS generation. They cannot be
# selected from nixpkgs here because they must match the host's configured
# NVIDIA driver.
hostRuntimeBin = "/run/current-system/sw/bin";
toolPath = lib.makeBinPath [
pkgs.bash
pkgs.coreutils
@@ -94,7 +98,7 @@ EOF
Group = "root";
SupplementaryGroups = [ "docker" ];
WorkingDirectory = "/var/lib/npanel";
Environment = [ "PATH=${toolPath}" ];
Environment = [ "PATH=${hostRuntimeBin}:${toolPath}" ];
# The process sees fixed compatibility paths. Custom locations are bound
# into that view; default locations need no self-bind mount.