Add sas private build flag

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-03-10 09:43:15 +00:00
parent 7a3129ba5f
commit 4d7e0d23aa
5 changed files with 39 additions and 11 deletions

View File

@@ -1,4 +1,10 @@
{ inputs, system, ... }:
{
config,
inputs,
system,
lib,
...
}:
let
selfPkgs = inputs.self.packages.${system};
in
@@ -22,9 +28,11 @@ in
IdentityFile /root/.ssh/ssh_sas_ed25519_key
'';
knownHostsFiles = with selfPkgs; [
ssh-known-hosts-github
ssh-known-hosts-sas-gitlab
];
knownHostsFiles =
with selfPkgs;
(
[ ssh-known-hosts-github ]
++ lib.lists.optionals config.sas.build.private [ ssh-known-hosts-sas-gitlab ]
);
};
}

View File

@@ -1,6 +1,8 @@
{ config, inputs, ... }:
{
imports = [
./options.nix
inputs.disko.nixosModules.disko
./format.nix
@@ -51,6 +53,8 @@
./users/nikara
];
sas.build.private = true;
networking.hostName = "elara";
i18n.defaultLocale = "en_US.UTF-8";
sops.defaultSopsFile = ./secrets/secrets.yaml;

9
hosts/elara/options.nix Normal file
View File

@@ -0,0 +1,9 @@
{ lib, ... }:
with lib;
{
options.sas.build.private = mkOption {
type = types.bool;
description = "Whether to build private SAS derivations (must be connected to the company VPN).";
default = false;
};
}

View File

@@ -86,11 +86,15 @@ in
};
};
userKnownHostsFiles = with selfPkgs; [
ssh-known-hosts-github
userKnownHostsFiles =
with selfPkgs;
(
[ ssh-known-hosts-github ]
++ lib.lists.optionals config.sas.build.private [
ssh-known-hosts-sas-gitlab
ssh-known-hosts-sas-gerrit
];
]
);
};
};
};

View File

@@ -6,6 +6,7 @@
config,
inputs,
system,
lib,
...
}:
let
@@ -48,7 +49,9 @@ in
};
};
userKnownHostsFiles = with selfPkgs; [ ssh-known-hosts-sas-cldlgn ];
userKnownHostsFiles =
with selfPkgs;
lib.lists.optionals config.sas.build.private [ ssh-known-hosts-sas-cldlgn ];
};
clipbook.bookmarks = {