make all age use conditional

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-10-27 23:03:40 -05:00
parent b2f0476412
commit 3cb6fba59e
8 changed files with 73 additions and 9 deletions

View file

@ -1,17 +1,26 @@
{
config,
lib,
...
}:
let
hasSecret =
secret:
let
secrets = config.age.secrets or { };
in
secrets ? ${secret} && secrets.${secret} != null;
in
{
# Remote build off home lio computer
programs.ssh.extraConfig = ''
programs.ssh.extraConfig = lib.mkIf (hasSecret "nix2lio") ''
Host lio_
PubkeyAcceptedKeyTypes ssh-ed25519
ServerAliveInterval 60
IPQoS throughput
IdentityFile ${config.age.secrets.nix2lio.path}
'';
nix = {
nix = lib.mkIf (hasSecret "nix2lio") {
distributedBuilds = true;
buildMachines = [
{