nixos/flake/nixos.nix

38 lines
751 B
Nix
Raw Normal View History

2025-05-03 11:35:18 +08:00
{
inputs,
lib,
self,
...
}: let
rootPath = ./..;
inherit (self) outputs;
inherit (inputs) nixpkgs;
2025-05-03 11:35:18 +08:00
defaultNixosModule = import (rootPath + "/nixos/modules");
in {
flake = {
nixosModules.default = defaultNixosModule;
nixosConfigurations = let
makeNixosConfiguration = hostName:
nixpkgs.lib.nixosSystem {
2025-05-03 11:35:18 +08:00
modules =
[defaultNixosModule]
++ [
(rootPath + "/nixos/configurations/${hostName}")
2025-05-03 11:35:18 +08:00
];
specialArgs = {
inherit inputs outputs rootPath;
};
};
in
[
"Tytonidae"
"Cape"
"Akun"
]
|> (
with lib;
flip genAttrs makeNixosConfiguration
);
2025-05-03 11:35:18 +08:00
};
}