diff --git a/flake.lock b/flake.lock index 7d14df7..90e434b 100644 --- a/flake.lock +++ b/flake.lock @@ -23,6 +23,35 @@ "type": "github" } }, + "clan-core": { + "inputs": { + "data-mesher": "data-mesher", + "disko": "disko", + "flake-parts": "flake-parts", + "nix-darwin": "nix-darwin", + "nix-select": "nix-select", + "nixos-facter-modules": "nixos-facter-modules", + "nixpkgs": [ + "nixpkgs" + ], + "sops-nix": "sops-nix", + "systems": "systems_2", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1746799285, + "narHash": "sha256-wRii4X2t8bAvtJTy6O9NPCdWB2NnP9B/utYHf7Qpf2g=", + "ref": "refs/heads/main", + "rev": "b306c748b872527838b922226c2e7570937c131d", + "revCount": 6737, + "type": "git", + "url": "https://git.clan.lol/clan/clan-core" + }, + "original": { + "type": "git", + "url": "https://git.clan.lol/clan/clan-core" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -45,6 +74,37 @@ "type": "github" } }, + "data-mesher": { + "inputs": { + "flake-parts": [ + "clan-core", + "flake-parts" + ], + "nixpkgs": [ + "clan-core", + "nixpkgs" + ], + "systems": [ + "clan-core", + "systems" + ], + "treefmt-nix": [ + "clan-core", + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1746628829, + "narHash": "sha256-q77HWbHlJTXFVRD2kRnYwqGfbGmCm9XYPG0ZgLLVh8M=", + "rev": "9a3856421bd6733192b57037cdf26712d73c0871", + "type": "tarball", + "url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/9a3856421bd6733192b57037cdf26712d73c0871.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.clan.lol/clan/data-mesher/archive/main.tar.gz" + } + }, "deploy-rs": { "inputs": { "flake-compat": "flake-compat", @@ -68,6 +128,27 @@ } }, "disko": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746729224, + "narHash": "sha256-9R4sOLAK1w3Bq54H3XOJogdc7a6C2bLLmatOQ+5pf5w=", + "owner": "nix-community", + "repo": "disko", + "rev": "85555d27ded84604ad6657ecca255a03fd878607", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "disko_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -103,6 +184,27 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -159,6 +261,40 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746708654, + "narHash": "sha256-GeC99gu5H6+AjBXsn5dOhP4/ApuioGCBkufdmEIWPRs=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "6cb36e8327421c61e5a3bbd08ed63491b616364a", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "repo": "nix-darwin", + "type": "github" + } + }, + "nix-select": { + "locked": { + "lastModified": 1745005516, + "narHash": "sha256-IVaoOGDIvAa/8I0sdiiZuKptDldrkDWUNf/+ezIRhyc=", + "rev": "69d8bf596194c5c35a4e90dd02c52aa530caddf8", + "type": "tarball", + "url": "https://git.clan.lol/api/v1/repos/clan/nix-select/archive/69d8bf596194c5c35a4e90dd02c52aa530caddf8.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.clan.lol/clan/nix-select/archive/main.tar.gz" + } + }, "nixlib": { "locked": { "lastModified": 1736643958, @@ -174,6 +310,21 @@ "type": "github" } }, + "nixos-facter-modules": { + "locked": { + "lastModified": 1743671943, + "narHash": "sha256-7sYig0+RcrR3sOL5M+2spbpFUHyEP7cnUvCaqFOBjyU=", + "owner": "nix-community", + "repo": "nixos-facter-modules", + "rev": "58ad9691670d293a15221d4a78818e0088d2e086", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-facter-modules", + "type": "github" + } + }, "nixos-generators": { "inputs": { "nixlib": "nixlib", @@ -244,8 +395,9 @@ "root": { "inputs": { "agenix": "agenix", + "clan-core": "clan-core", "deploy-rs": "deploy-rs", - "disko": "disko", + "disko": "disko_2", "home-manager": "home-manager_2", "impermanence": "impermanence", "nixos-generators": "nixos-generators", @@ -253,6 +405,27 @@ "nixpkgs": "nixpkgs_2" } }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746485181, + "narHash": "sha256-PxrrSFLaC7YuItShxmYbMgSuFFuwxBB+qsl9BZUnRvg=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "e93ee1d900ad264d65e9701a5c6f895683433386", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -283,9 +456,45 @@ "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": 1746216483, + "narHash": "sha256-4h3s1L/kKqt3gMDcVfN8/4v2jqHrgLIe4qok4ApH5x4=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "29ec5026372e0dec56f890e50dbe4f45930320fd", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1701680307, diff --git a/flake.nix b/flake.nix index cc093e6..1b8a7e5 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ outputs = inputs@{ nixpkgs, + clan-core, deploy-rs, home-manager, impermanence, @@ -28,27 +29,41 @@ system = "aarch64-linux"; }; }; + clan = clan-core.lib.buildClan { + self = self; + meta.name = "blossom"; + machines = { + crocus = { + nixpkgs.hostPlatform = "x86_64-linux"; + imports = [ + ./hosts/crocus + ]; + }; + }; + }; in { - nixosConfigurations = - let - mkNixosConfig = - hostname: - { system }: - lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs self; - inherit (import ./parts) keys; - }; - modules = [ - ./hosts/${hostname} - ./modules - ./system - ]; - }; - in - builtins.mapAttrs mkNixosConfig hosts; + inherit (clan) clanInternals nixosConfigurations; + clan = { inherit (clan) templates; }; + # nixosConfigurations = + # let + # mkNixosConfig = + # hostname: + # { system }: + # lib.nixosSystem { + # inherit system; + # specialArgs = { + # inherit inputs self; + # inherit (import ./parts) keys; + # }; + # modules = [ + # ./hosts/${hostname} + # ./modules + # ./system + # ]; + # }; + # in + # builtins.mapAttrs mkNixosConfig hosts; # Raspberry Pi 4 installer ISO. packages.aarch64-linux.installer-sd-image = nixos-generators.nixosGenerate { @@ -121,6 +136,7 @@ "${system}".default = pkgs.mkShell { packages = [ inputs.agenix.packages.x86_64-linux.default + clan-core.packages.${system}.clan-cli pkgs.nil # Nix language server pkgs.nixfmt-rfc-style pkgs.opentofu @@ -164,6 +180,10 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; + clan-core = { + url = "git+https://git.clan.lol/clan/clan-core"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; nixConfig = { diff --git a/hosts/crocus/default.nix b/hosts/crocus/default.nix index d8ad527..7ea7c4b 100644 --- a/hosts/crocus/default.nix +++ b/hosts/crocus/default.nix @@ -11,6 +11,8 @@ inputs.disko.nixosModules.disko ./disk.nix ./radicle.nix + ./modules + ./system ]; networking.hostName = "crocus";