diff --git a/clan.nix b/clan.nix index 3499d49..fa65e3a 100644 --- a/clan.nix +++ b/clan.nix @@ -1,7 +1,7 @@ { # Ensure this is unique among all clans you want to use. meta = { - name = "amarth"; + name = "amarth-infra"; description = "Amarth cloud"; }; @@ -45,8 +45,8 @@ zitadel = { module = { - name = "zitadel"; - input = "amarth"; + name = "@amarth/zitadel"; + input = "amarth-services"; }; roles.controller.machines."m1" = {}; diff --git a/flake.lock b/flake.lock index acbceee..429d372 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,29 @@ { "nodes": { + "amarth-services": { + "inputs": { + "clan-core": "clan-core", + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "amarth-services", + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758130572, + "narHash": "sha256-OB5KCrv3X1x2aTT9tE/6w2H/FD8EZurh7debKLtDyBM=", + "ref": "refs/heads/main", + "rev": "7e0a5243647dceeb09ff3095938282370f4047d4", + "revCount": 10, + "type": "git", + "url": "https://git.amarth.cloud/amarth/services" + }, + "original": { + "type": "git", + "url": "https://git.amarth.cloud/amarth/services" + } + }, "clan-core": { "inputs": { "data-mesher": "data-mesher", @@ -14,11 +38,40 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1756806573, - "narHash": "sha256-NHpnZrZ2bploGlGEUEvTvhDZRpI1yjFj72SSTmw56GI=", - "rev": "f97e22e125143e8e58325aa614aee59ed868296b", + "lastModified": 1757912940, + "narHash": "sha256-Xypz7pxa1L09GooMueosv0CRW4Cx5/gdtvSPBrnXf6M=", + "rev": "93280a9f987bbe689c74f1ea21d0c2fa4645c359", "type": "tarball", - "url": "https://git.clan.lol/api/v1/repos/clan/clan-core/archive/f97e22e125143e8e58325aa614aee59ed868296b.tar.gz" + "url": "https://git.clan.lol/api/v1/repos/clan/clan-core/archive/93280a9f987bbe689c74f1ea21d0c2fa4645c359.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.clan.lol/clan/clan-core/archive/main.tar.gz" + } + }, + "clan-core_2": { + "inputs": { + "data-mesher": "data-mesher_2", + "disko": "disko_2", + "flake-parts": [ + "flake-parts" + ], + "nix-darwin": "nix-darwin_2", + "nix-select": "nix-select_2", + "nixos-facter-modules": "nixos-facter-modules_2", + "nixpkgs": [ + "nixpkgs" + ], + "sops-nix": "sops-nix_2", + "systems": "systems_2", + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1758121565, + "narHash": "sha256-y37cz5A+EFMBvWi0/S+wrkTMHGQnDb7cifqZoIfSRHE=", + "rev": "b7798f54666fe61d8b16b5c45c39fac97e2d2e60", + "type": "tarball", + "url": "https://git.clan.lol/api/v1/repos/clan/clan-core/archive/b7798f54666fe61d8b16b5c45c39fac97e2d2e60.tar.gz" }, "original": { "type": "tarball", @@ -26,6 +79,36 @@ } }, "data-mesher": { + "inputs": { + "flake-parts": [ + "amarth-services", + "clan-core", + "flake-parts" + ], + "nixpkgs": [ + "amarth-services", + "clan-core", + "nixpkgs" + ], + "treefmt-nix": [ + "amarth-services", + "clan-core", + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1757905600, + "narHash": "sha256-Yd7buL9N7N7IaDVViItqP9HsECfnlDFykxvvNgMYcKk=", + "rev": "c10c4002bdc5aef040fcbb814d5f482e82dc8345", + "type": "tarball", + "url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/c10c4002bdc5aef040fcbb814d5f482e82dc8345.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.clan.lol/clan/data-mesher/archive/main.tar.gz" + } + }, + "data-mesher_2": { "inputs": { "flake-parts": [ "clan-core", @@ -41,18 +124,58 @@ ] }, "locked": { - "lastModified": 1756695982, - "narHash": "sha256-dyLhOSDzxZtRgi5aj/OuaZJUsuvo+8sZ9CU/qieZ15c=", - "rev": "cc8f26e7e6c2dc985526ba59b286ae5a83168cdb", + "lastModified": 1757905600, + "narHash": "sha256-Yd7buL9N7N7IaDVViItqP9HsECfnlDFykxvvNgMYcKk=", + "rev": "c10c4002bdc5aef040fcbb814d5f482e82dc8345", "type": "tarball", - "url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/cc8f26e7e6c2dc985526ba59b286ae5a83168cdb.tar.gz" + "url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/c10c4002bdc5aef040fcbb814d5f482e82dc8345.tar.gz" }, "original": { "type": "tarball", "url": "https://git.clan.lol/clan/data-mesher/archive/main.tar.gz" } }, + "devshell": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1741473158, + "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", + "owner": "numtide", + "repo": "devshell", + "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "disko": { + "inputs": { + "nixpkgs": [ + "amarth-services", + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1757508292, + "narHash": "sha256-7lVWL5bC6xBIMWWDal41LlGAG+9u2zUorqo3QCUL4p4=", + "owner": "nix-community", + "repo": "disko", + "rev": "146f45bee02b8bd88812cfce6ffc0f933788875a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "disko_2": { "inputs": { "nixpkgs": [ "clan-core", @@ -60,11 +183,11 @@ ] }, "locked": { - "lastModified": 1756733629, - "narHash": "sha256-dwWGlDhcO5SMIvMSTB4mjQ5Pvo2vtxvpIknhVnSz2I8=", + "lastModified": 1757508292, + "narHash": "sha256-7lVWL5bC6xBIMWWDal41LlGAG+9u2zUorqo3QCUL4p4=", "owner": "nix-community", "repo": "disko", - "rev": "a5c4f2ab72e3d1ab43e3e65aa421c6f2bd2e12a1", + "rev": "146f45bee02b8bd88812cfce6ffc0f933788875a", "type": "github" }, "original": { @@ -76,6 +199,7 @@ "flake-parts": { "inputs": { "nixpkgs-lib": [ + "amarth-services", "clan-core", "nixpkgs" ] @@ -94,19 +218,82 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "amarth-services", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "4524271976b625a4a605beefd893f270620fd751", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "4524271976b625a4a605beefd893f270620fd751", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ + "amarth-services", "clan-core", "nixpkgs" ] }, "locked": { - "lastModified": 1755825449, - "narHash": "sha256-XkiN4NM9Xdy59h69Pc+Vg4PxkSm9EWl6u7k6D5FZ5cM=", + "lastModified": 1757430124, + "narHash": "sha256-MhDltfXesGH8VkGv3hmJ1QEKl1ChTIj9wmGAFfWj/Wk=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "8df64f819698c1fee0c2969696f54a843b2231e8", + "rev": "830b3f0b50045cf0bcfd4dab65fad05bf882e196", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "repo": "nix-darwin", + "type": "github" + } + }, + "nix-darwin_2": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758102940, + "narHash": "sha256-wwqf3+A8EiqwWpcAaPN20QXJLlpGPpwtLTrzgnngI2o=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "ebd0bfc11fc2b5cff37401e9b3703881ad5fabbd", "type": "github" }, "original": { @@ -128,6 +315,19 @@ "url": "https://git.clan.lol/clan/nix-select/archive/main.tar.gz" } }, + "nix-select_2": { + "locked": { + "lastModified": 1755887746, + "narHash": "sha256-lzWbpHKX0WAn/jJDoCijIDss3rqYIPawe46GDaE6U3g=", + "rev": "92c2574c5e113281591be01e89bb9ddb31d19156", + "type": "tarball", + "url": "https://git.clan.lol/api/v1/repos/clan/nix-select/archive/92c2574c5e113281591be01e89bb9ddb31d19156.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.clan.lol/clan/nix-select/archive/main.tar.gz" + } + }, "nixos-facter-modules": { "locked": { "lastModified": 1756491981, @@ -143,6 +343,21 @@ "type": "github" } }, + "nixos-facter-modules_2": { + "locked": { + "lastModified": 1756491981, + "narHash": "sha256-lXyDAWPw/UngVtQfgQ8/nrubs2r+waGEYIba5UX62+k=", + "owner": "nix-community", + "repo": "nixos-facter-modules", + "rev": "c1b29520945d3e148cd96618c8a0d1f850965d8c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-facter-modules", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 315532800, @@ -156,16 +371,70 @@ "url": "https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1722073938, + "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1757745802, + "narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { - "clan-core": "clan-core", - "nixpkgs": [ - "clan-core", - "nixpkgs" - ] + "amarth-services": "amarth-services", + "clan-core": "clan-core_2", + "devshell": "devshell", + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_3" } }, "sops-nix": { + "inputs": { + "nixpkgs": [ + "amarth-services", + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1757449901, + "narHash": "sha256-qwN8nYdSRnmmyyi+uR6m4gXnVktmy5smG1MOrSFD8PI=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "3b4a369df9dd6ee171a7ea4448b50e2528faf850", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "sops-nix_2": { "inputs": { "nixpkgs": [ "clan-core", @@ -173,11 +442,11 @@ ] }, "locked": { - "lastModified": 1754988908, - "narHash": "sha256-t+voe2961vCgrzPFtZxha0/kmFSHFobzF00sT8p9h0U=", + "lastModified": 1758007585, + "narHash": "sha256-HYnwlbY6RE5xVd5rh0bYw77pnD8lOgbT4mlrfjgNZ0c=", "owner": "Mic92", "repo": "sops-nix", - "rev": "3223c7a92724b5d804e9988c6b447a0d09017d48", + "rev": "f77d4cfa075c3de66fc9976b80e0c4fc69e2c139", "type": "github" }, "original": { @@ -201,7 +470,44 @@ "type": "github" } }, + "systems_2": { + "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": [ + "amarth-services", + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756662192, + "narHash": "sha256-F1oFfV51AE259I85av+MAia221XwMHCOtZCMcZLK2Jk=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "1aabc6c05ccbcbf4a635fb7a90400e44282f61c4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { "inputs": { "nixpkgs": [ "clan-core", diff --git a/flake.nix b/flake.nix index be55ec0..a8fabd8 100644 --- a/flake.nix +++ b/flake.nix @@ -1,46 +1,81 @@ { inputs = { - clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz"; + nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; - nixpkgs.follows = "clan-core/nixpkgs"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; - amarth = { - url = "https://git.amarth.cloud/amarth/services"; + clan-core = { + url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-parts.follows = "flake-parts"; + }; + + devshell = { + url = "github:numtide/devshell"; + }; + + amarth-services = { + url = "git+https://git.amarth.cloud/amarth/services"; }; }; outputs = - { - self, - clan-core, - nixpkgs, - ... - }@inputs: - let - # Usage see: https://docs.clan.lol - clan = clan-core.lib.clan { - inherit self; - imports = [ ./clan.nix ]; - specialArgs = { inherit inputs; }; + inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } ({ self, pkgs, ... }: { + systems = [ + "x86_64-linux" + ]; + + imports = [ + inputs.clan-core.flakeModules.default + inputs.devshell.flakeModule + ./clan.nix + ]; + + perSystem = { system, ... }: { + devshells = { + default = { + packages = [ inputs.clan-core.packages.${system}.clan-cli ]; + }; + }; }; - in - { - inherit (clan.config) nixosConfigurations nixosModules clanInternals; - clan = clan.config; - # Add the Clan cli tool to the dev shell. - # Use "nix develop" to enter the dev shell. - devShells = - nixpkgs.lib.genAttrs - [ - "x86_64-linux" - "aarch64-linux" - "aarch64-darwin" - "x86_64-darwin" - ] - (system: { - default = clan-core.inputs.nixpkgs.legacyPackages.${system}.mkShell { - packages = [ clan-core.packages.${system}.clan-cli ]; - }; - }); - }; + }); + + # outputs = + # { + # self, + # clan-core, + # nixpkgs, + # ... + # }@inputs: + # let + # # Usage see: https://docs.clan.lol + # clan = clan-core.lib.clan { + # inherit self; + # imports = [ ./clan.nix ]; + # specialArgs = { inherit inputs; }; + # }; + # in + # { + # inherit (clan.config) nixosConfigurations nixosModules clanInternals; + # clan = clan.config; + # # Add the Clan cli tool to the dev shell. + # # Use "nix develop" to enter the dev shell. + # devShells = + # nixpkgs.lib.genAttrs + # [ + # "x86_64-linux" + # "aarch64-linux" + # "aarch64-darwin" + # "x86_64-darwin" + # ] + # (system: { + # default = clan-core.inputs.nixpkgs.legacyPackages.${system}.mkShell { + # packages = [ clan-core.packages.${system}.clan-cli ]; + # }; + # }); + # }; }