clan-infra/targets/flake-module.nix

25 lines
697 B
Nix
Raw Normal View History

2023-07-04 14:43:31 +00:00
{ lib, self, ... }:
let
entries = builtins.attrNames (builtins.readDir ./.);
configs = builtins.filter (dir: builtins.pathExists (./. + "/${dir}/configuration.nix")) entries;
in
{
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 = {
2023-08-08 12:07:04 +00:00
inherit (self) inputs nixosModules packages;
2023-07-04 14:43:31 +00:00
};
};
modules = [ (./. + "/${name}/configuration.nix") ];
}))
configs);
}