nixos-conf/flake.nix

85 lines
2.3 KiB
Nix
Raw Permalink 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-06-09 00:16:35 +03:00
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-05-31 21:27:53 +03:00
};
outputs =
2025-06-09 00:16:35 +03:00
{
2025-06-11 22:16:27 +03:00
self,
2025-06-09 00:16:35 +03:00
nixpkgs,
nixvim,
disko,
...
}:
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;
2025-06-09 00:16:35 +03:00
inherit disko;
2025-06-05 01:12:48 +03:00
};
system = "x86_64-linux";
modules = [
{ networking.hostName = host; }
2025-06-09 00:16:35 +03:00
disko.nixosModules.disko
2025-06-05 01:12:48 +03:00
./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;
2025-06-09 00:16:35 +03:00
inherit disko;
2025-06-05 01:12:48 +03:00
};
system = "aarch64-linux";
modules = [
{ networking.hostName = host; }
./hosts/aarch64-linux/${host}/configuration.nix
];
}
)
) aarch64-linux-hosts
)
);
2025-06-12 00:22:47 +03:00
hydraJobs.hosts = builtins.mapAttrs (
_: host: host.config.system.build.toplevel
) self.nixosConfigurations;
2025-06-14 14:03:58 +03:00
hydraJobs.isos.installer = self.nixosConfigurations.installer.config.system.build.isoImage;
2025-05-31 21:27:53 +03:00
};
}