base substitutor list on whether it is an installer

This commit is contained in:
Charlotte 🦝 Delenk 2024-11-06 09:05:41 +01:00
parent 51fe8f9f0a
commit c6e07e644a
4 changed files with 13 additions and 14 deletions

View file

@ -39,9 +39,5 @@ in {
exec ${pkgs.disko}/bin/disko-install --flake "${nixos-config}#not522" --disk main "${nixos-config.nixosConfigurations.not522.config.disko.devices.disk.main.device}" exec ${pkgs.disko}/bin/disko-install --flake "${nixos-config}#not522" --disk main "${nixos-config.nixosConfigurations.not522.config.disko.devices.disk.main.device}"
'') '')
]; ];
nix.settings.substituters = lib.mkForce [ isInstaller = true;
"https://attic.chir.rs/chir-rs/"
"https://hydra.chir.rs"
"https://cache.nixos.org"
];
} }

View file

@ -18,9 +18,5 @@
./graphical.nix ./graphical.nix
]; ];
}; };
nix.settings.substituters = lib.mkForce [ isInstaller = true;
"https://attic.chir.rs/chir-rs/"
"https://hydra.chir.rs"
"https://cache.nixos.org"
];
} }

View file

@ -16,4 +16,5 @@ with lib; {
"${home-manager}/nixos" "${home-manager}/nixos"
]; ];
options.isGraphical = mkEnableOption "Whether or not this configuration is a graphical install"; options.isGraphical = mkEnableOption "Whether or not this configuration is a graphical install";
options.isInstaller = mkEnableOption "Whether or not this configuration is an installer and has no access to secrets";
} }

View file

@ -1,13 +1,19 @@
{config, ...}: { {
config,
lib,
...
}:
with lib; {
imports = [ imports = [
./link-inputs.nix ./link-inputs.nix
./lix.nix ./lix.nix
./autoupdater.nix ./autoupdater.nix
]; ];
nix.settings = { nix.settings = {
substituters = [ substituters = mkMerge [
"https://attic.chir.rs/chir-rs/" ["https://attic.chir.rs/chir-rs/"]
"https://hydra.int.chir.rs" (mkIf (!config.isInstaller) ["https://hydra.int.chir.rs"])
(mkIf config.isInstaller ["https://hydra.chir.rs"])
]; ];
trusted-public-keys = [ trusted-public-keys = [
"nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg=" "nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg="