diff --git a/README.md b/README.md new file mode 100644 index 0000000..22fc06e --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +## Installing to a new machine + +1. add the config +2. boot to installer iso on target host +3. gather the hardware information +4. create disk configuration +5. install system + +m1 +root +flatware-theorize-sleet + +names + +- foundry +- anvil +- cauldron +- bellows +- hammer +- strike +- temper +- quench diff --git a/clan.nix b/clan.nix index 2d030e3..92e13a2 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"; }; @@ -43,6 +43,15 @@ roles.peer.tags.all = { }; }; + zitadel = { + module = { + name = "@amarth/zitadel"; + input = "amarth-services"; + }; + + roles.controller.machines."m1" = {}; + }; + k3s = { module = { name = "@amarth/k3s"; @@ -53,6 +62,7 @@ roles.agent.machines."c2" = {}; roles.agent.machines."c3" = {}; +>>>>>>> 81bc14dcb9b649451939a01d3828ca4c170dc897 }; }; diff --git a/flake.lock b/flake.lock index 90ca109..429d372 100644 --- a/flake.lock +++ b/flake.lock @@ -1,27 +1,27 @@ { "nodes": { - "amarth": { + "amarth-services": { "inputs": { "clan-core": "clan-core", "flake-parts": "flake-parts_2", "nixpkgs": [ - "amarth", + "amarth-services", "clan-core", "nixpkgs" ] }, "locked": { - "lastModified": 1758024845, - "narHash": "sha256-aMhb+b0LA3IxoaXJ+5YoGSs5mf/N18z+/tj+NjASTmU=", + "lastModified": 1758130572, + "narHash": "sha256-OB5KCrv3X1x2aTT9tE/6w2H/FD8EZurh7debKLtDyBM=", "ref": "refs/heads/main", - "rev": "ceed1a0cdf5b72c290ad5e060f8a68539847df67", - "revCount": 8, + "rev": "7e0a5243647dceeb09ff3095938282370f4047d4", + "revCount": 10, "type": "git", - "url": "https://git.amarth.cloud/amarth/services.git" + "url": "https://git.amarth.cloud/amarth/services" }, "original": { "type": "git", - "url": "https://git.amarth.cloud/amarth/services.git" + "url": "https://git.amarth.cloud/amarth/services" } }, "clan-core": { @@ -53,21 +53,25 @@ "inputs": { "data-mesher": "data-mesher_2", "disko": "disko_2", - "flake-parts": "flake-parts_3", + "flake-parts": [ + "flake-parts" + ], "nix-darwin": "nix-darwin_2", "nix-select": "nix-select_2", "nixos-facter-modules": "nixos-facter-modules_2", - "nixpkgs": "nixpkgs_2", + "nixpkgs": [ + "nixpkgs" + ], "sops-nix": "sops-nix_2", "systems": "systems_2", "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1758021280, - "narHash": "sha256-tnXjO1KpfFRKqe9tPZ5ZrM6O2E1DG2nJiE0QKJACPG8=", - "rev": "f2134754c5f0fdca982487de82a16428021a0e0e", + "lastModified": 1758121565, + "narHash": "sha256-y37cz5A+EFMBvWi0/S+wrkTMHGQnDb7cifqZoIfSRHE=", + "rev": "b7798f54666fe61d8b16b5c45c39fac97e2d2e60", "type": "tarball", - "url": "https://git.clan.lol/api/v1/repos/clan/clan-core/archive/f2134754c5f0fdca982487de82a16428021a0e0e.tar.gz" + "url": "https://git.clan.lol/api/v1/repos/clan/clan-core/archive/b7798f54666fe61d8b16b5c45c39fac97e2d2e60.tar.gz" }, "original": { "type": "tarball", @@ -77,17 +81,17 @@ "data-mesher": { "inputs": { "flake-parts": [ - "amarth", + "amarth-services", "clan-core", "flake-parts" ], "nixpkgs": [ - "amarth", + "amarth-services", "clan-core", "nixpkgs" ], "treefmt-nix": [ - "amarth", + "amarth-services", "clan-core", "treefmt-nix" ] @@ -131,10 +135,28 @@ "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", + "amarth-services", "clan-core", "nixpkgs" ] @@ -177,7 +199,7 @@ "flake-parts": { "inputs": { "nixpkgs-lib": [ - "amarth", + "amarth-services", "clan-core", "nixpkgs" ] @@ -199,7 +221,7 @@ "flake-parts_2": { "inputs": { "nixpkgs-lib": [ - "amarth", + "amarth-services", "nixpkgs" ] }, @@ -220,7 +242,6 @@ "flake-parts_3": { "inputs": { "nixpkgs-lib": [ - "clan-core", "nixpkgs" ] }, @@ -241,7 +262,7 @@ "nix-darwin": { "inputs": { "nixpkgs": [ - "amarth", + "amarth-services", "clan-core", "nixpkgs" ] @@ -268,11 +289,11 @@ ] }, "locked": { - "lastModified": 1757430124, - "narHash": "sha256-MhDltfXesGH8VkGv3hmJ1QEKl1ChTIj9wmGAFfWj/Wk=", + "lastModified": 1758102940, + "narHash": "sha256-wwqf3+A8EiqwWpcAaPN20QXJLlpGPpwtLTrzgnngI2o=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "830b3f0b50045cf0bcfd4dab65fad05bf882e196", + "rev": "ebd0bfc11fc2b5cff37401e9b3703881ad5fabbd", "type": "github" }, "original": { @@ -352,31 +373,49 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 315532800, - "narHash": "sha256-h8Sx4S+/0FpodZji6W9lHzwY5BcuUG85Aj3GfhvGC2o=", - "rev": "a650b5d0de99158323597f048667c4d914243224", - "type": "tarball", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.11pre845298.a650b5d0de99/nixexprs.tar.xz" + "lastModified": 1722073938, + "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz" + "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": { - "amarth": "amarth", + "amarth-services": "amarth-services", "clan-core": "clan-core_2", - "nixpkgs": [ - "clan-core", - "nixpkgs" - ] + "devshell": "devshell", + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_3" } }, "sops-nix": { "inputs": { "nixpkgs": [ - "amarth", + "amarth-services", "clan-core", "nixpkgs" ] @@ -449,7 +488,7 @@ "treefmt-nix": { "inputs": { "nixpkgs": [ - "amarth", + "amarth-services", "clan-core", "nixpkgs" ] diff --git a/flake.nix b/flake.nix index ffd0b70..a8fabd8 100644 --- a/flake.nix +++ b/flake.nix @@ -1,44 +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 = "git+https://git.amarth.cloud/amarth/services.git"; + 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 ]; + # }; + # }); + # }; }