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-09-14 14:43:49 +02:00
|
|
|
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.05";
|
2023-07-10 15:30:51 +02:00
|
|
|
};
|
|
|
|
|
2023-09-14 14:43:49 +02:00
|
|
|
outputs = { self, nixpkgs, nixpkgs-unstable, nixos-generators, simple-nixos-mailserver, ... }@inputs: let
|
2023-07-30 01:38:31 +02:00
|
|
|
hosts = import ./hosts.nix inputs;
|
2023-08-07 00:58:45 +02:00
|
|
|
helper = import ./helper.nix inputs;
|
2023-07-27 21:59:24 +02:00
|
|
|
in {
|
2023-07-16 02:00:44 +02:00
|
|
|
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;
|
2023-08-07 00:58:45 +02:00
|
|
|
|
|
|
|
specialArgs = {
|
2023-09-14 14:43:49 +02:00
|
|
|
inherit hosts simple-nixos-mailserver;
|
2023-08-07 00:58:45 +02:00
|
|
|
};
|
2023-07-30 01:38:31 +02:00
|
|
|
};
|
|
|
|
} // builtins.mapAttrs (helper.generateColmenaHost) hosts;
|
2023-07-26 01:09:38 +02:00
|
|
|
|
2023-07-27 21:59:24 +02:00
|
|
|
hydraJobs = {
|
2023-09-14 14:43:49 +02:00
|
|
|
nixConfigurations = builtins.mapAttrs (host: helper.generateNixConfiguration host { inherit hosts simple-nixos-mailserver; }) 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 = [
|
2023-09-14 14:43:49 +02:00
|
|
|
./config/common
|
|
|
|
./config/nixos-generators
|
|
|
|
./config/environments/proxmox-vm
|
2023-07-26 01:09:38 +02:00
|
|
|
];
|
|
|
|
format = "proxmox";
|
|
|
|
};
|
|
|
|
};
|
2023-07-27 21:59:24 +02:00
|
|
|
|
2023-07-31 15:38:08 +02:00
|
|
|
# Binary cache hint
|
|
|
|
nixConfig = {
|
|
|
|
extra-substituters = [
|
|
|
|
"https://nix-cache.nekover.se"
|
|
|
|
];
|
|
|
|
extra-trusted-public-keys = [
|
|
|
|
"nix-cache.nekover.se:f/VfGqC5lctLzOa6pLLDmEkihcip4WYpYShlW3rivLU="
|
|
|
|
];
|
|
|
|
};
|
2023-07-10 15:30:51 +02:00
|
|
|
};
|
|
|
|
}
|