76 lines
2 KiB
Nix
76 lines
2 KiB
Nix
{
|
|
description = "All system configurations for Vili Sinervä";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
|
nixvim = {
|
|
url = "github:nix-community/nixvim";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
disko = {
|
|
url = "github:nix-community/disko";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
impermanence.url = "github:nix-community/impermanence";
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
nixvim,
|
|
disko,
|
|
impermanence,
|
|
sops-nix,
|
|
...
|
|
}:
|
|
{
|
|
nixosConfigurations =
|
|
let
|
|
hosts =
|
|
with builtins;
|
|
nixpkgs.lib.lists.flatten (
|
|
map (
|
|
system:
|
|
map (host: {
|
|
system = system;
|
|
name = nixpkgs.lib.strings.removeSuffix ".nix" host;
|
|
}) (attrNames (readDir ./hosts/${system}))
|
|
) (attrNames (readDir ./hosts))
|
|
);
|
|
in
|
|
builtins.listToAttrs (
|
|
map (
|
|
host:
|
|
nixpkgs.lib.nameValuePair host.name (
|
|
nixpkgs.lib.nixosSystem {
|
|
specialArgs = {
|
|
nixpkgs-flake = nixpkgs;
|
|
inherit nixvim;
|
|
inherit disko;
|
|
};
|
|
system = host.system;
|
|
modules = [
|
|
{ networking.hostName = host.name; }
|
|
./default.nix
|
|
./hosts/${host.system}/${host.name}.nix
|
|
|
|
disko.nixosModules.disko
|
|
impermanence.nixosModules.impermanence
|
|
sops-nix.nixosModules.sops
|
|
];
|
|
}
|
|
)
|
|
) hosts
|
|
);
|
|
hydraJobs.hosts = builtins.mapAttrs (
|
|
_: host: host.config.system.build.toplevel
|
|
) self.nixosConfigurations;
|
|
|
|
hydraJobs.isos.installer = self.nixosConfigurations.installer.config.system.build.isoImage;
|
|
};
|
|
}
|