nix-infra/flake.nix

48 lines
1.6 KiB
Nix
Raw Normal View History

2023-07-10 15:30:51 +02:00
{
inputs = {
2023-07-30 01:38:31 +02:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05-small";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small";
2023-07-26 01:09:38 +02:00
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-07-10 15:30:51 +02:00
};
2023-07-30 01:38:31 +02:00
outputs = { self, nixpkgs, nixpkgs-unstable, nixos-generators, ... }@inputs: let
hosts = import ./hosts.nix inputs;
2023-07-27 21:59:24 +02:00
helper = (import ./helper.nix) inputs;
in {
colmena = {
meta = {
2023-07-30 01:38:31 +02:00
# Set the default pkgs, which is pointless in this case,
# because nodeNixpkgs is overriding it anyway and a default value is generated.
# It is still needed for colmena to run.
nixpkgs = nixpkgs.legacyPackages."x86_64-linux";
2023-07-27 21:59:24 +02:00
2023-07-30 01:38:31 +02:00
# Specify nixpkgs to use for each host.
# The default is "nixpkgs" for "x86_64-linux" systems,
# but it is overridden by the host-specific "hostNixpkgs" and "system" attributes.
nodeNixpkgs = builtins.mapAttrs (name: host: host.pkgs) hosts;
};
} // builtins.mapAttrs (helper.generateColmenaHost) hosts;
2023-07-26 01:09:38 +02:00
2023-07-27 21:59:24 +02:00
hydraJobs = {
2023-07-30 01:38:31 +02:00
nixConfigurations = builtins.mapAttrs (helper.generateNixConfiguration) hosts;
2023-07-27 21:59:24 +02:00
};
2023-07-26 01:09:38 +02:00
# Generate a base VM image for Proxmox with `nix build .#base-proxmox`
packages.x86_64-linux = {
base-proxmox = nixos-generators.nixosGenerate {
system = "x86_64-linux";
modules = [
./configuration/common
./configuration/nixos-generators
./configuration/proxmox-vm
];
format = "proxmox";
};
};
2023-07-27 21:59:24 +02:00
2023-07-10 15:30:51 +02:00
};
}