chore(nixbuild): add sshKey field and finalize fish init

- Added `sshKey` field for all builder configurations in `nixbuild.nix` to standardize access keys.
- Replaced `programs.fish.shellInit` with `environment.shellInit` and introduced `programs.fish.loginShellInit` for improved Nix path initialization.
This commit is contained in:
Harald Hoyer 2025-11-13 11:51:57 +01:00
parent cd86d39ec1
commit 18844d662b

View file

@ -11,6 +11,7 @@ with lib.metacfg;
maxJobs = 4; maxJobs = 4;
speedFactor = 3; speedFactor = 3;
sshUser = "harald"; sshUser = "harald";
sshKey = "/etc/ssh/nix-builder-key";
} }
{ {
hostName = "rialo"; hostName = "rialo";
@ -18,6 +19,7 @@ with lib.metacfg;
maxJobs = 4; maxJobs = 4;
speedFactor = 3; speedFactor = 3;
sshUser = "harald"; sshUser = "harald";
sshKey = "/etc/ssh/nix-builder-key";
} }
{ {
hostName = "sgx"; hostName = "sgx";
@ -25,24 +27,31 @@ with lib.metacfg;
maxJobs = 4; maxJobs = 4;
speedFactor = 1; speedFactor = 1;
sshUser = "harald"; sshUser = "harald";
sshKey = "/etc/ssh/nix-builder-key";
} }
]; ];
nix.settings = { nix.settings = {
substituters = [ /*
"https://cache.nixos.org" substituters = [
"ssh-ng://harald@m4?ssh-key=/etc/ssh/nix-builder-key" "https://cache.nixos.org"
"ssh-ng://harald@rialo?ssh-key=/etc/ssh/nix-builder-key" "ssh-ng://harald@m4?ssh-key=/etc/ssh/nix-builder-key"
"ssh-ng://harald@sgx?ssh-key=/etc/ssh/nix-builder-key" "ssh-ng://harald@rialo?ssh-key=/etc/ssh/nix-builder-key"
]; "ssh-ng://harald@sgx?ssh-key=/etc/ssh/nix-builder-key"
];
*/
builders-use-substitutes = true; builders-use-substitutes = true;
}; };
# Ensure Nix is in PATH for SSH sessions # Ensure Nix is in PATH for SSH sessions
programs.fish.shellInit = '' environment.shellInit = ''
if [ -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then if [ -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fi fi
''; '';
programs.fish.loginShellInit = ''
set -gx PATH /nix/var/nix/profiles/default/bin $PATH
set -gx PATH /run/current-system/sw/bin $PATH
'';
} }