diff --git a/nixos/flake-modules/clan.nix b/nixos/flake-modules/clan.nix new file mode 100644 index 0000000..4a2dd3d --- /dev/null +++ b/nixos/flake-modules/clan.nix @@ -0,0 +1,55 @@ +# clan.lol wiring for the homelab. +# +# Declares `sunken-ship` and `phantom-ship` as clan machines. Each machine's +# `imports` list is the NixOS module set that used to live in its own +# flake-module. clan-core produces `flake.nixosConfigurations.` from +# these, which is why the old per-host flake-modules were removed. +# +# The mac stays outside the clan — admin only, uses `clan machines update` +# to push to the servers. +{ config, inputs, ... }: +let + lib = inputs.nixpkgs.lib; + hmModule = { user, homeDirectory, stateVersion ? null, userImports ? [ ] }: + import ../lib/home-manager-user.nix { + inherit lib user homeDirectory stateVersion userImports; + }; +in { + imports = [ inputs.clan-core.flakeModules.default ]; + + clan = { + meta.name = "homelab"; + + # Preserve current network / init stack (no systemd-networkd/resolved, + # no boot.initrd.systemd, no extra debug packages). Revisit per-service + # in later stages rather than flipping this fleet-wide. + machines.sunken-ship = { + imports = [ + { clan.core.enableRecommendedDefaults = false; } + ../hosts/sunken-ship.nix + config.flake.nixosModules.dotfiles-rebuild + inputs.home-manager.nixosModules.home-manager + (hmModule { + user = "danny"; + homeDirectory = "/home/danny"; + stateVersion = "25.11"; + }) + ]; + }; + + machines.phantom-ship = { + imports = [ + { clan.core.enableRecommendedDefaults = false; } + inputs.nix-openclaw.nixosModules.openclaw-gateway + ../hosts/phantom-ship.nix + config.flake.nixosModules.dotfiles-rebuild + inputs.home-manager.nixosModules.home-manager + (hmModule { + user = "danny"; + homeDirectory = "/home/danny"; + stateVersion = "25.11"; + }) + ]; + }; + }; +} diff --git a/nixos/flake-modules/phantom-ship.nix b/nixos/flake-modules/phantom-ship.nix deleted file mode 100644 index 9a1ebbc..0000000 --- a/nixos/flake-modules/phantom-ship.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ inputs, config, ... }: { - flake.nixosConfigurations.phantom-ship = inputs.nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - inputs.nix-openclaw.nixosModules.openclaw-gateway - ../hosts/phantom-ship.nix - config.flake.nixosModules.dotfiles-rebuild - - inputs.home-manager.nixosModules.home-manager - (import ../lib/home-manager-user.nix { - lib = inputs.nixpkgs.lib; - user = "danny"; - homeDirectory = "/home/danny"; - stateVersion = "25.11"; - }) - ]; - }; -} diff --git a/nixos/flake-modules/sunken-ship.nix b/nixos/flake-modules/sunken-ship.nix deleted file mode 100644 index 0bf77ef..0000000 --- a/nixos/flake-modules/sunken-ship.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ inputs, config, ... }: { - flake.nixosConfigurations.sunken-ship = inputs.nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ../hosts/sunken-ship.nix - config.flake.nixosModules.dotfiles-rebuild - - inputs.home-manager.nixosModules.home-manager - (import ../lib/home-manager-user.nix { - lib = inputs.nixpkgs.lib; - user = "danny"; - homeDirectory = "/home/danny"; - stateVersion = "25.11"; - }) - ]; - }; -} diff --git a/nixos/flake.lock b/nixos/flake.lock index e2ee1ce..2de4459 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -1,6 +1,82 @@ { "nodes": { + "clan-core": { + "inputs": { + "data-mesher": "data-mesher", + "disko": "disko", + "flake-parts": [ + "flake-parts" + ], + "nix-darwin": "nix-darwin", + "nix-select": "nix-select", + "nixpkgs": [ + "nixpkgs" + ], + "sops-nix": "sops-nix", + "systems": "systems", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1776557977, + "narHash": "sha256-j+UWg3fR6jWKPqkPoqRf1a6nR1b/AnZXDuh04H+voUc=", + "rev": "e9ced950bedc726492e5cb52139bf5f17258dc69", + "type": "tarball", + "url": "https://git.clan.lol/api/v1/repos/clan/clan-core/archive/e9ced950bedc726492e5cb52139bf5f17258dc69.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.clan.lol/clan/clan-core/archive/main.tar.gz" + } + }, + "data-mesher": { + "inputs": { + "flake-parts": [ + "clan-core", + "flake-parts" + ], + "nixpkgs": [ + "clan-core", + "nixpkgs" + ], + "treefmt-nix": [ + "clan-core", + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1776506822, + "narHash": "sha256-WlxAhXEoDHbkfFw3uNYra0CXce7pBk314x9chPu7ycE=", + "rev": "c3f48f5931b27bb9cc58de8799d36ecefb867d98", + "type": "tarball", + "url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/c3f48f5931b27bb9cc58de8799d36ecefb867d98.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.clan.lol/clan/data-mesher/archive/main.tar.gz" + } + }, "disko": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1773889306, + "narHash": "sha256-PAqwnsBSI9SVC2QugvQ3xeYCB0otOwCacB1ueQj2tgw=", + "owner": "nix-community", + "repo": "disko", + "rev": "5ad85c82cc52264f4beddc934ba57f3789f28347", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "disko_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -58,7 +134,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1731533236, @@ -76,7 +152,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1681202837, @@ -170,6 +246,27 @@ } }, "nix-darwin": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775037210, + "narHash": "sha256-KM2WYj6EA7M/FVZVCl3rqWY+TFV5QzSyyGE2gQxeODU=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "06648f4902343228ce2de79f291dd5a58ee12146", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "repo": "nix-darwin", + "type": "github" + } + }, + "nix-darwin_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -213,6 +310,19 @@ "type": "github" } }, + "nix-select": { + "locked": { + "lastModified": 1763303120, + "narHash": "sha256-yxcNOha7Cfv2nhVpz9ZXSNKk0R7wt4AiBklJ8D24rVg=", + "rev": "3d1e3860bef36857a01a2ddecba7cdb0a14c35a9", + "type": "tarball", + "url": "https://git.clan.lol/api/v1/repos/clan/nix-select/archive/3d1e3860bef36857a01a2ddecba7cdb0a14c35a9.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.clan.lol/clan/nix-select/archive/main.tar.gz" + } + }, "nix-steipete-tools": { "inputs": { "nixpkgs": "nixpkgs" @@ -315,11 +425,12 @@ }, "root": { "inputs": { - "disko": "disko", + "clan-core": "clan-core", + "disko": "disko_2", "flake-parts": "flake-parts", "home-manager": "home-manager", "import-tree": "import-tree", - "nix-darwin": "nix-darwin", + "nix-darwin": "nix-darwin_2", "nix-openclaw": "nix-openclaw", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_3", @@ -327,17 +438,39 @@ "zen-browser": "zen-browser" } }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1776119890, + "narHash": "sha256-Zm6bxLNnEOYuS/SzrAGsYuXSwk3cbkRQZY0fJnk8a5M=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "d4971dd58c6627bfee52a1ad4237637c0a2fb0cd", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, "systems": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1774449309, + "narHash": "sha256-brhZ8DmuGtzkCYHJg4HEd602amKm89Y9ytsFZ5uWD1w=", "owner": "nix-systems", "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "rev": "c29398b59d2048c4ab79345812849c9bd15e9150", "type": "github" }, "original": { "owner": "nix-systems", + "ref": "future-26.11", "repo": "default", "type": "github" } @@ -357,6 +490,42 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775636079, + "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "vscode-server": { "inputs": { "flake-utils": "flake-utils_2", diff --git a/nixos/flake.nix b/nixos/flake.nix index c465290..8b802e3 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -24,6 +24,10 @@ nix-openclaw.url = "github:openclaw/nix-openclaw"; nix-openclaw.inputs.nixpkgs.follows = "nixpkgs"; + + clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz"; + clan-core.inputs.nixpkgs.follows = "nixpkgs"; + clan-core.inputs.flake-parts.follows = "flake-parts"; }; outputs = inputs @ { flake-parts, import-tree, ... }: