Changes over time...

This commit is contained in:
niten 2024-03-23 14:23:28 -07:00
parent 7677ab3f4f
commit ebd1be3428
7 changed files with 9816 additions and 2210 deletions

View File

@ -1,39 +1,37 @@
{ inputs, deployment-hosts, description, enable-rollback ? true, ... }: { inputs, deployment-hosts, description, enable-rollback ? true, ... }:
with inputs.nixpkgs.lib; let with inputs.nixpkgs.lib;
let
network-config = { network-config = {
nixpkgs = inputs.nixpkgs; nixpkgs = inputs.nixpkgs;
network = { network = {
inherit description; inherit description;
enableRollback = enable-rollback; enableRollback = enable-rollback;
storage.legacy = { storage.legacy = { databasefile = "~/.nixops/deployments.nixops"; };
databasefile = "~/.nixops/deployments.nixops";
};
}; };
}; };
host-config = hostname: inputs.fudo-nixos.nixopsHostConfigurations.${hostname}; host-config = hostname:
inputs.fudo-nixos.nixopsHostConfigurations.${hostname};
host-ip = hostname: domain: let host-ip = hostname: domain:
zone-hosts = inputs.fudo-entities.entities.zones.${domain}.hosts; let zone-hosts = inputs.fudo-entities.entities.zones.${domain}.hosts;
in zone-hosts.${hostname}.ipv4-address; in zone-hosts.${hostname}.ipv4-address;
host-uber-secrets = hostname: { config, ... }: let host-uber-secrets = hostname:
uber-secrets = config.fudo.secrets.files.host-filesystem-keys; { config, ... }:
in { let uber-secrets = config.fudo.secrets.files.host-filesystem-keys;
config.deployment.keys = mkIf (hasAttr hostname uber-secrets) in {
(mapAttrs (secret: secret-file: { config.deployment.keys = mkIf (hasAttr hostname uber-secrets) (mapAttrs
keyFile = secret-file; (secret: secret-file: {
user = "root"; keyFile = secret-file;
permissions = "0400"; user = "root";
}) uber-secrets.${hostname}); permissions = "0400";
}; }) uber-secrets.${hostname});
};
in network-config // (mapAttrs (hostname: hostOpts: { in network-config // (mapAttrs (hostname: hostOpts: {
imports = [ imports = [ (host-config hostname) (host-uber-secrets hostname) ];
(host-config hostname)
(host-uber-secrets hostname)
];
deployment.targetHost = host-ip hostname hostOpts.domain; deployment.targetHost = host-ip hostname hostOpts.domain;
}) deployment-hosts) }) deployment-hosts)

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
description = "Fudo NixOps network."; description = "Fudo NixOps network.";
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-22.11"; nixpkgs.url = "nixpkgs/nixos-23.11";
fudo-secrets.url = "path:/secrets"; fudo-secrets.url = "path:/secrets";
@ -12,7 +12,7 @@
}; };
fudo-entities = { fudo-entities = {
url = "git+ssh://fudo_git@git.fudo.org:2222/fudo-nix/entities.git"; url = "git+https://fudo.dev/nix/entities.git";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
@ -28,7 +28,8 @@
nixopsConfigurations.default = let nixopsConfigurations.default = let
description = "Fudo NixOps Network"; description = "Fudo NixOps Network";
fudo-site = site: site == "nuttyclub" || site == "worldstream"; fudo-site = site:
site == "nuttyclub" || site == "worldstream" || site == "portage";
deployment-hosts = filterAttrs (hostname: hostOpts: deployment-hosts = filterAttrs (hostname: hostOpts:
hostOpts.nixos-system && (fudo-site hostOpts.site)) hostOpts.nixos-system && (fudo-site hostOpts.site))

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
description = "Informis NixOps network."; description = "Informis NixOps network.";
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-22.11"; nixpkgs.url = "nixpkgs/nixos-23.11";
fudo-nixos = { fudo-nixos = {
url = "path:/state/deploy/config"; url = "path:/state/deploy/config";
@ -10,7 +10,7 @@
}; };
fudo-entities = { fudo-entities = {
url = "git+ssh://fudo_git@git.fudo.org:2222/fudo-nix/entities.git"; url = "git+https://fudo.dev/nix/entities.git";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
description = "Seattle Fudo NixOps network."; description = "Seattle Fudo NixOps network.";
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-22.11"; nixpkgs.url = "nixpkgs/nixos-23.11";
fudo-secrets.url = "path:/secrets"; fudo-secrets.url = "path:/secrets";
@ -13,7 +13,7 @@
}; };
fudo-entities = { fudo-entities = {
url = "git+ssh://fudo_git@git.fudo.org:2222/fudo-nix/entities.git"; url = "git+https://fudo.dev/nix/entities.git";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };