From a9f45daac86748ac716ca41ab74a18ddf9822c1e Mon Sep 17 00:00:00 2001 From: K900 Date: Wed, 10 Jul 2024 15:24:47 +0300 Subject: [PATCH] Rename machine folders, clean up flake --- flake.nix | 90 +++++-------------- .../default.nix | 0 hosts/{cl.forkos.org => gerrit01}/default.nix | 0 .../default.nix | 0 .../default.nix | 0 5 files changed, 22 insertions(+), 68 deletions(-) rename hosts/{fodwatch.forkos.org => fodwatch}/default.nix (100%) rename hosts/{cl.forkos.org => gerrit01}/default.nix (100%) rename hosts/{meta01.nixpkgs.lahfa.xyz => meta01}/default.nix (100%) rename hosts/{wob-vpn-gw.forkos.org => wob-vpn-gw}/default.nix (100%) diff --git a/flake.nix b/flake.nix index cd135a9..a9ac2dc 100644 --- a/flake.nix +++ b/flake.nix @@ -69,7 +69,22 @@ nixosConfigurations = (colmena.lib.makeHive self.outputs.colmena).nodes; - colmena = { + colmena = let + commonModules = [ + inputs.agenix.nixosModules.default + inputs.hydra.nixosModules.hydra + + ./services + ./common + ]; + + makeBuilder = i: lib.nameValuePair "builder-${toString i}" { + imports = commonModules; + bagel.baremetal.builders = { enable = true; num = i; }; + }; + + builders = lib.listToAttrs (lib.genList makeBuilder 12); + in { meta.nixpkgs = import nixpkgs { localSystem = system; overlays = [ @@ -80,72 +95,11 @@ }; meta.specialArgs.inputs = inputs; - bagel-box = { - imports = [ - inputs.agenix.nixosModules.default - inputs.hydra.nixosModules.hydra - - ./services - ./common - ./hosts/bagel-box - ]; - }; - - meta01 = { - imports = [ - inputs.agenix.nixosModules.default - inputs.hydra.nixosModules.hydra - - ./services - ./common - ./hosts/meta01.nixpkgs.lahfa.xyz - ]; - }; - - gerrit01 = { - imports = [ - inputs.agenix.nixosModules.default - inputs.hydra.nixosModules.hydra - - ./services - ./common - ./hosts/cl.forkos.org - ]; - }; - - fodwatch = { - imports = [ - inputs.agenix.nixosModules.default - inputs.hydra.nixosModules.hydra - - ./services - ./common - ./hosts/fodwatch.forkos.org - ]; - }; - - wob-vpn-gw = { - imports = [ - inputs.agenix.nixosModules.default - inputs.hydra.nixosModules.hydra - - ./services - ./common - ./hosts/wob-vpn-gw.forkos.org - ]; - }; - - } // (lib.listToAttrs (lib.genList (i: lib.nameValuePair "builder-${toString i}" { - - imports = [ - inputs.agenix.nixosModules.default - inputs.hydra.nixosModules.hydra - ./services - ./common - { - bagel.baremetal.builders = { enable = true; num = i; }; - } - ]; - }) 12)); + bagel-box.imports = commonModules ++ [ ./hosts/bagel-box ]; + meta01.imports = commonModules ++ [ ./hosts/meta01 ]; + gerrit01.imports = commonModules ++ [ ./hosts/gerrit01 ]; + fodwatch.imports = commonModules ++ [ ./hosts/fodwatch ]; + wob-vpn-gw.imports = commonModules ++ [ ./hosts/wob-vpn-gw ]; + } // builders; }; } diff --git a/hosts/fodwatch.forkos.org/default.nix b/hosts/fodwatch/default.nix similarity index 100% rename from hosts/fodwatch.forkos.org/default.nix rename to hosts/fodwatch/default.nix diff --git a/hosts/cl.forkos.org/default.nix b/hosts/gerrit01/default.nix similarity index 100% rename from hosts/cl.forkos.org/default.nix rename to hosts/gerrit01/default.nix diff --git a/hosts/meta01.nixpkgs.lahfa.xyz/default.nix b/hosts/meta01/default.nix similarity index 100% rename from hosts/meta01.nixpkgs.lahfa.xyz/default.nix rename to hosts/meta01/default.nix diff --git a/hosts/wob-vpn-gw.forkos.org/default.nix b/hosts/wob-vpn-gw/default.nix similarity index 100% rename from hosts/wob-vpn-gw.forkos.org/default.nix rename to hosts/wob-vpn-gw/default.nix