diff --git a/deployments/seattle/flake.lock b/deployments/seattle/flake.lock index e2f18e8..667fab2 100644 --- a/deployments/seattle/flake.lock +++ b/deployments/seattle/flake.lock @@ -82,7 +82,7 @@ "evil-org-mode": "evil-org-mode", "evil-quick-diff": "evil-quick-diff", "explain-pause-mode": "explain-pause-mode", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_3", "nix-straight": "nix-straight", "nixpkgs": "nixpkgs", "nose": "nose", @@ -262,6 +262,36 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1637014545, + "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1637014545, + "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { "locked": { "lastModified": 1623875721, "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", @@ -276,12 +306,52 @@ "type": "github" } }, + "fudo-entities": { + "inputs": { + "flake-utils": "flake-utils", + "fudo-lib": "fudo-lib", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "narHash": "sha256-DnIQNMu2E6gQh0SJk4h6iz2cL/vK6VIobp35hS7qQmo=", + "path": "/state/fudo-entities", + "type": "path" + }, + "original": { + "path": "/state/fudo-entities", + "type": "path" + } + }, + "fudo-entities_2": { + "inputs": { + "flake-utils": "flake-utils_2", + "fudo-lib": "fudo-lib_3", + "nixpkgs": [ + "fudo-nixos", + "nixpkgs" + ] + }, + "locked": { + "narHash": "sha256-DnIQNMu2E6gQh0SJk4h6iz2cL/vK6VIobp35hS7qQmo=", + "path": "/state/fudo-entities", + "type": "path" + }, + "original": { + "path": "/state/fudo-entities", + "type": "path" + } + }, "fudo-home": { "inputs": { "doom-emacs": "doom-emacs", "home-manager": "home-manager", "niten-doom-config": "niten-doom-config", - "nixpkgs": "nixpkgs_2" + "nixpkgs": [ + "fudo-nixos", + "nixpkgs" + ] }, "locked": { "narHash": "sha256-TpFI+nD+c9JXhKKDBgIHJhIfveTScBD6gotTPt8tvg4=", @@ -293,9 +363,55 @@ "type": "path" } }, + "fudo-lib": { + "locked": { + "narHash": "sha256-r8qffvJPWbBJmN32thMIxjdmY9X5VCc3TuyQyFAIdks=", + "path": "/state/fudo-lib", + "type": "path" + }, + "original": { + "path": "/state/fudo-lib", + "type": "path" + } + }, + "fudo-lib_2": { + "locked": { + "narHash": "sha256-gZAKO49RbpNWdmZaqrXnzCrLoSXsGV6H67f+mECJtCk=", + "path": "/state/fudo-lib", + "type": "path" + }, + "original": { + "path": "/state/fudo-lib", + "type": "path" + } + }, + "fudo-lib_3": { + "locked": { + "narHash": "sha256-r8qffvJPWbBJmN32thMIxjdmY9X5VCc3TuyQyFAIdks=", + "path": "/state/fudo-lib", + "type": "path" + }, + "original": { + "path": "/state/fudo-lib", + "type": "path" + } + }, + "fudo-lib_4": { + "locked": { + "narHash": "sha256-gZAKO49RbpNWdmZaqrXnzCrLoSXsGV6H67f+mECJtCk=", + "path": "/state/fudo-lib", + "type": "path" + }, + "original": { + "path": "/state/fudo-lib", + "type": "path" + } + }, "fudo-nixos": { "inputs": { + "fudo-entities": "fudo-entities_2", "fudo-home": "fudo-home", + "fudo-lib": "fudo-lib_4", "fudo-pkgs": "fudo-pkgs", "fudo-secrets": "fudo-secrets", "nixpkgs": [ @@ -303,7 +419,7 @@ ] }, "locked": { - "narHash": "sha256-1Z8ZrVFDTq9ohhYwD7Ti4KFYLgnRZG58OHvAQQAKZOU=", + "narHash": "sha256-mGmqObOimHmAWntx7GOHjLABKw+9ZMwVn19R7f6f93s=", "path": "/state/nixops/fudo-nixos", "type": "path" }, @@ -464,26 +580,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1636944046, - "narHash": "sha256-74KLDsiWSBsYXKj/ql9EGbw1TbIJRE7clFkhl30HV/c=", + "lastModified": 1637875414, + "narHash": "sha256-Ica++SXFuLyxX9Q7YxhfZulUif6/gwM8AEQYlUxqSgE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "46251a79f752ae1d46ef733e8e9760b6d3429da4", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-21.05", - "type": "indirect" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1637316267, - "narHash": "sha256-hfAA/0W3tycKKOSwP7Xt6FXLG9h/FgCu45wdGubHtV0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "24528474d2b3370f2f23879a557ae2cc92a5d50b", + "rev": "3bea86e918d8b54aa49780505d2d4cd9261413be", "type": "github" }, "original": { @@ -630,9 +731,11 @@ }, "root": { "inputs": { + "fudo-entities": "fudo-entities", + "fudo-lib": "fudo-lib_2", "fudo-nixos": "fudo-nixos", "fudo-secrets": "fudo-secrets_2", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" } }, "rotate-text": { diff --git a/deployments/seattle/flake.nix b/deployments/seattle/flake.nix index 331577d..8a8df13 100644 --- a/deployments/seattle/flake.nix +++ b/deployments/seattle/flake.nix @@ -11,14 +11,26 @@ # url = "git+ssh://fudo_git@git.fudo.org:2222/fudosys/NixOS.git?ref=nixops-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; + + fudo-entities = { + url = "path:/state/fudo-entities"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + fudo-lib = { + url = "path:/state/fudo-lib"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, fudo-nixos, fudo-secrets, ... } @ inputs: + outputs = { self, nixpkgs, fudo-nixos, fudo-entities, fudo-secrets, ... } @ inputs: with nixpkgs.lib; { nixopsConfigurations.default = let deployment-hosts = filterAttrs - (hostname: hostOpts: hostOpts.domain == "sea.fudo.org") - fudo-nixos.fudoHosts; + (hostname: hostOpts: + hostOpts.domain == "sea.fudo.org" && + hostOpts.nixos-system) + fudo-entities.entities.hosts; build-timestamp = self.sourceInfo.lastModified; @@ -26,7 +38,7 @@ inherit inputs build-timestamp; }; - host-configs = mapAttrs host-gen-config deployment-hosts; + common-configs = mapAttrs host-gen-config deployment-hosts; in { inherit nixpkgs; @@ -34,6 +46,6 @@ description = "Seattle NixOps network"; enableRollback = true; }; - } // host-configs; + } // common-configs; }; } diff --git a/deployments/seattle/host-config.nix b/deployments/seattle/host-config.nix index 6f42bca..4348368 100644 --- a/deployments/seattle/host-config.nix +++ b/deployments/seattle/host-config.nix @@ -1,6 +1,6 @@ -inputs: build-timestamp: hostname: hostOpts: +{ inputs, build-timestamp, ... }: -{ config, ... }: +hostname: hostOpts: let pkgs-for = system: import inputs.nixpkgs { @@ -17,25 +17,26 @@ let }; }; - host-ip = hostname: - inputs.fudo-nixos.fudoNetworks.${hostOpts.domain}.hosts.${hostname}.ipv4-address; + host-ip = + inputs.fudo-entities.entities.zones.${hostOpts.domain}.hosts.${hostname}.ipv4-address; +in { config, ... }: { + modules = [ + inputs.fudo-nixos.nixosConfigurations.${hostname} + ]; -in { - config = { - nixpkgs.pkgs = pkgs-for hostOpts.arch; + imports = [ + inputs.fudo-secrets.nixosModule + inputs.fudo-lib.nixosModule + ]; - imports = [ - inputs.fudo-nixos.nixosModule - inputs.fudo-secrets.nixosModule - ]; + nixpkgs.pkgs = pkgs-for hostOpts.arch; - instance = { - inherit hostname build-timestamp; - }; + instance = { + inherit hostname build-timestamp; + }; - deployments = { - targetHost = host-ip hostname; - }; + deployment = { + targetHost = host-ip; }; }