nixos-conf/flake.nix

67 lines
1.8 KiB
Nix
Raw Normal View History

2025-05-31 21:27:53 +03:00
{
description = "All system configurations for Vili Sinervä";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
2025-06-01 16:57:37 +03:00
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-05-31 21:27:53 +03:00
};
outputs =
{ nixpkgs, nixvim, ... }:
2025-05-31 21:27:53 +03:00
{
2025-06-05 01:12:48 +03:00
nixosConfigurations =
(
let
x86_64-hosts = builtins.filter (file: file != "aarch64-linux") (
builtins.attrNames (builtins.readDir ./hosts)
);
in
builtins.listToAttrs (
map (
host:
nixpkgs.lib.nameValuePair host (
nixpkgs.lib.nixosSystem {
specialArgs = {
nixpkgs-flake = nixpkgs;
inherit nixvim;
};
system = "x86_64-linux";
modules = [
{ networking.hostName = host; }
./hosts/${host}/configuration.nix
./hosts/${host}/state.nix
];
}
)
) x86_64-hosts
)
2025-06-01 13:34:34 +03:00
)
2025-06-05 01:12:48 +03:00
// (
let
aarch64-linux-hosts = (builtins.attrNames (builtins.readDir ./hosts/aarch64-linux));
in
builtins.listToAttrs (
map (
host:
nixpkgs.lib.nameValuePair host (
nixpkgs.lib.nixosSystem {
specialArgs = {
nixpkgs-flake = nixpkgs;
inherit nixvim;
};
system = "aarch64-linux";
modules = [
{ networking.hostName = host; }
./hosts/aarch64-linux/${host}/configuration.nix
];
}
)
) aarch64-linux-hosts
)
);
2025-05-31 21:27:53 +03:00
};
}