Changes over time...
This commit is contained in:
parent
7677ab3f4f
commit
ebd1be3428
|
@ -1,28 +1,29 @@
|
||||||
{ 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, ... }:
|
||||||
|
let uber-secrets = config.fudo.secrets.files.host-filesystem-keys;
|
||||||
in {
|
in {
|
||||||
config.deployment.keys = mkIf (hasAttr hostname uber-secrets)
|
config.deployment.keys = mkIf (hasAttr hostname uber-secrets) (mapAttrs
|
||||||
(mapAttrs (secret: secret-file: {
|
(secret: secret-file: {
|
||||||
keyFile = secret-file;
|
keyFile = secret-file;
|
||||||
user = "root";
|
user = "root";
|
||||||
permissions = "0400";
|
permissions = "0400";
|
||||||
|
@ -30,10 +31,7 @@ with inputs.nixpkgs.lib; let
|
||||||
};
|
};
|
||||||
|
|
||||||
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
|
@ -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
|
@ -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
|
@ -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";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue