diff --git a/modules/flake-module.nix b/modules/flake-module.nix index 2e45663..52959c2 100644 --- a/modules/flake-module.nix +++ b/modules/flake-module.nix @@ -6,13 +6,7 @@ # FIXME: switch to VPN later { networking.firewall.allowedTCPPorts = [ 9273 ]; } - inputs.clan-core.nixosModules.clanCore ./admins.nix - { - # TODO: use buildClan - clanCore.clanDir = "${./..}"; - clanCore.machineName = "web01"; - } ]; hetzner-ax102.imports = [ diff --git a/targets/flake-module.nix b/targets/flake-module.nix index 46a529e..3352963 100644 --- a/targets/flake-module.nix +++ b/targets/flake-module.nix @@ -1,24 +1,17 @@ -{ lib, self, ... }: -let - entries = builtins.attrNames (builtins.readDir ./.); - configs = builtins.filter (dir: builtins.pathExists (./. + "/${dir}/configuration.nix")) entries; -in +{ self, inputs, ... }: { - flake.nixosConfigurations = lib.listToAttrs - (builtins.map - (name: - lib.nameValuePair - (builtins.replaceStrings [ "." ] [ "-" ] name) - (lib.nixosSystem { - system = "x86_64-linux"; - # Make flake available in modules - specialArgs = { - self = { - inherit (self) inputs nixosModules packages; - }; - }; - - modules = [ (./. + "/${name}/configuration.nix") ]; - })) - configs); + flake.nixosConfigurations = inputs.clan-core.lib.buildClan { + directory = self; + # Make flake available in modules + specialArgs = { + self = { + inherit (self) inputs nixosModules packages; + }; + }; + machines = { + web01 = { modulesPath, ... }: { + imports = [ (./web01/configuration.nix) ]; + }; + }; + }; }