2023-09-11 23:20:34 +02:00
|
|
|
{
|
|
|
|
description = "CCCHH Nix Infrastructure";
|
|
|
|
|
|
|
|
inputs = {
|
2023-09-14 20:44:54 +02:00
|
|
|
# Use the NixOS small channels for nixpkgs.
|
|
|
|
# https://nixos.org/manual/nixos/stable/#sec-upgrading
|
|
|
|
# https://github.com/NixOS/nixpkgs
|
2024-06-17 20:59:03 +02:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05-small";
|
2023-09-11 21:40:35 +02:00
|
|
|
|
2023-09-11 23:20:34 +02:00
|
|
|
# Add nixos-generators as an input.
|
|
|
|
# See here: https://github.com/nix-community/nixos-generators#using-in-a-flake
|
|
|
|
nixos-generators = {
|
|
|
|
url = "github:nix-community/nixos-generators";
|
2024-11-17 20:24:35 +01:00
|
|
|
#inputs.nixpkgs.follows = "nixpkgs";
|
2023-09-11 23:20:34 +02:00
|
|
|
};
|
2024-05-25 16:47:34 +02:00
|
|
|
|
|
|
|
# Add sops-nix as an input for secret management.
|
|
|
|
# See here: https://github.com/Mic92/sops-nix?tab=readme-ov-file#flakes-current-recommendation
|
|
|
|
sops-nix = {
|
|
|
|
url = "github:Mic92/sops-nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-11-17 20:29:04 +01:00
|
|
|
|
|
|
|
authorizedKeysRepo = {
|
|
|
|
url = "git+https://git.hamburg.ccc.de:CCCHH/infrastructure-authorized-keys.git?ref=trunk&rev=686a6af22f6696f0c0595c56f463c078550049fc";
|
|
|
|
flake = false;
|
|
|
|
};
|
2023-09-11 23:20:34 +02:00
|
|
|
};
|
|
|
|
|
2024-11-17 20:29:04 +01:00
|
|
|
outputs = { self, nixpkgs, nixos-generators, sops-nix, authorizedKeysRepo, ... }:
|
2023-09-11 23:19:38 +02:00
|
|
|
let
|
2024-11-17 20:29:04 +01:00
|
|
|
specialArgs = {
|
|
|
|
inherit authorizedKeysRepo;
|
|
|
|
};
|
2024-05-27 01:43:53 +02:00
|
|
|
system = "x86_64-linux";
|
2024-03-06 22:50:32 +01:00
|
|
|
in
|
|
|
|
{
|
2024-11-05 00:02:41 +01:00
|
|
|
overlays = {
|
|
|
|
shairportSyncAirplay2 = final: prev: {
|
|
|
|
shairport-sync = (prev.shairport-sync.override { enableMetadata = true; enableAirplay2 = true; }).overrideAttrs (finalAttr: previousAttr: {
|
|
|
|
# See: https://github.com/mikebrady/shairport-sync/blob/e78a88b64adfe7b5f88fd6faedf55c57445bb240/CONFIGURATION%20FLAGS.md
|
|
|
|
configureFlags = previousAttr.configureFlags ++ [ "--with-mqtt-client" ];
|
|
|
|
buildInputs = previousAttr.buildInputs ++ [ final.mosquitto ];
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
2024-11-05 22:43:53 +01:00
|
|
|
nixosModules = {
|
|
|
|
common = ./config/common;
|
|
|
|
proxmox-vm = ./config/proxmox-vm;
|
|
|
|
prometheus-exporter = ./config/extra/prometheus-exporter.nix;
|
|
|
|
};
|
2024-05-27 01:43:53 +02:00
|
|
|
nixosConfigurations = {
|
2024-11-02 22:39:24 +01:00
|
|
|
audio-hauptraum-kueche = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-11-05 00:02:41 +01:00
|
|
|
{ nixpkgs.overlays = [ self.overlays.shairportSyncAirplay2 ]; }
|
2024-03-06 22:50:32 +01:00
|
|
|
./config/hosts/audio-hauptraum-kueche
|
|
|
|
];
|
2024-01-20 21:34:09 +01:00
|
|
|
};
|
2023-09-11 21:40:35 +02:00
|
|
|
|
2024-11-02 22:39:24 +01:00
|
|
|
audio-hauptraum-tafel = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-11-05 00:02:41 +01:00
|
|
|
{ nixpkgs.overlays = [ self.overlays.shairportSyncAirplay2 ]; }
|
2024-03-06 22:50:32 +01:00
|
|
|
./config/hosts/audio-hauptraum-tafel
|
|
|
|
];
|
2023-09-11 21:40:35 +02:00
|
|
|
};
|
2023-09-14 22:12:38 +02:00
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
esphome = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-03-06 22:50:32 +01:00
|
|
|
./config/hosts/esphome
|
|
|
|
];
|
2023-11-04 20:49:02 +01:00
|
|
|
};
|
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
public-reverse-proxy = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-03-06 22:50:32 +01:00
|
|
|
./config/hosts/public-reverse-proxy
|
|
|
|
];
|
2023-11-04 22:20:49 +01:00
|
|
|
};
|
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
netbox = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-05-26 03:14:31 +02:00
|
|
|
sops-nix.nixosModules.sops
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.prometheus-exporter
|
2024-03-06 22:50:32 +01:00
|
|
|
./config/hosts/netbox
|
|
|
|
];
|
2023-09-14 22:12:38 +02:00
|
|
|
};
|
2023-09-14 23:52:20 +02:00
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
matrix = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-05-26 02:58:15 +02:00
|
|
|
sops-nix.nixosModules.sops
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.prometheus-exporter
|
2024-03-06 22:50:32 +01:00
|
|
|
./config/hosts/matrix
|
|
|
|
];
|
2023-09-14 23:52:20 +02:00
|
|
|
};
|
2023-10-06 05:33:28 +02:00
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
public-web-static = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-05-26 03:49:43 +02:00
|
|
|
sops-nix.nixosModules.sops
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.prometheus-exporter
|
2024-03-06 22:50:32 +01:00
|
|
|
./config/hosts/public-web-static
|
|
|
|
];
|
2023-10-06 05:33:28 +02:00
|
|
|
};
|
2023-10-07 04:29:08 +02:00
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
git = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-05-25 16:47:34 +02:00
|
|
|
sops-nix.nixosModules.sops
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.prometheus-exporter
|
2024-03-06 22:50:32 +01:00
|
|
|
./config/hosts/git
|
|
|
|
];
|
2023-10-07 04:29:08 +02:00
|
|
|
};
|
2024-01-14 23:19:41 +01:00
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
forgejo-actions-runner = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-05-26 02:50:08 +02:00
|
|
|
sops-nix.nixosModules.sops
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.prometheus-exporter
|
2024-03-06 22:50:32 +01:00
|
|
|
./config/hosts/forgejo-actions-runner
|
|
|
|
];
|
2024-01-14 23:19:41 +01:00
|
|
|
};
|
2024-04-14 18:46:51 +02:00
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
ptouch-print-server = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-04-14 18:46:51 +02:00
|
|
|
./config/hosts/ptouch-print-server
|
|
|
|
];
|
|
|
|
};
|
2024-05-17 20:42:48 +02:00
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
eh22-wiki = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
|
|
|
self.nixosModules.prometheus-exporter
|
2024-05-17 20:42:48 +02:00
|
|
|
./config/hosts/eh22-wiki
|
|
|
|
];
|
|
|
|
};
|
2024-05-26 14:39:28 +02:00
|
|
|
|
2024-05-27 01:43:53 +02:00
|
|
|
nix-box-june = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-05-27 01:43:53 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
|
|
|
self.nixosModules.prometheus-exporter
|
2024-05-26 14:39:28 +02:00
|
|
|
./config/hosts/nix-box-june
|
|
|
|
];
|
|
|
|
};
|
2024-06-08 20:18:59 +02:00
|
|
|
|
|
|
|
yate = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-06-08 20:18:59 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-06-08 20:18:59 +02:00
|
|
|
./config/hosts/yate
|
|
|
|
];
|
|
|
|
};
|
2024-06-10 15:38:48 +02:00
|
|
|
|
|
|
|
mqtt = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-06-10 15:38:48 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-06-10 15:38:48 +02:00
|
|
|
./config/hosts/mqtt
|
|
|
|
];
|
|
|
|
};
|
2024-06-20 23:45:44 +02:00
|
|
|
|
|
|
|
mjolnir = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-06-20 23:45:44 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-06-20 23:45:44 +02:00
|
|
|
sops-nix.nixosModules.sops
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.prometheus-exporter
|
2024-06-20 23:45:44 +02:00
|
|
|
./config/hosts/mjolnir
|
|
|
|
];
|
|
|
|
};
|
2024-06-22 04:20:38 +02:00
|
|
|
|
|
|
|
woodpecker = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-06-22 04:20:38 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-06-22 04:20:38 +02:00
|
|
|
sops-nix.nixosModules.sops
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.prometheus-exporter
|
2024-06-22 04:20:38 +02:00
|
|
|
./config/hosts/woodpecker
|
|
|
|
];
|
|
|
|
};
|
2024-08-04 02:19:26 +02:00
|
|
|
|
|
|
|
status = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-08-04 02:19:26 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-08-04 02:19:26 +02:00
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
./config/hosts/status
|
|
|
|
];
|
|
|
|
};
|
2024-08-10 22:38:05 +02:00
|
|
|
|
|
|
|
penpot = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-08-10 22:38:05 +02:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-08-10 22:38:05 +02:00
|
|
|
sops-nix.nixosModules.sops
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.prometheus-exporter
|
2024-08-10 22:38:05 +02:00
|
|
|
./config/hosts/penpot
|
|
|
|
];
|
|
|
|
};
|
2024-10-30 01:44:12 +01:00
|
|
|
|
|
|
|
hydra = nixpkgs.lib.nixosSystem {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit system specialArgs;
|
2024-10-30 01:44:12 +01:00
|
|
|
modules = [
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
|
|
|
self.nixosModules.prometheus-exporter
|
2024-10-30 01:44:12 +01:00
|
|
|
./config/hosts/hydra
|
|
|
|
];
|
|
|
|
};
|
2024-01-14 23:19:41 +01:00
|
|
|
};
|
2024-01-18 05:03:21 +01:00
|
|
|
|
2024-03-06 22:50:32 +01:00
|
|
|
packages.x86_64-linux = {
|
|
|
|
proxmox-nixos-template = nixos-generators.nixosGenerate {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit specialArgs;
|
2024-03-06 22:50:32 +01:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./config/nixos-generators/proxmox.nix
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-03-06 22:50:32 +01:00
|
|
|
];
|
|
|
|
format = "proxmox";
|
2024-01-18 05:03:21 +01:00
|
|
|
};
|
2023-09-11 21:40:35 +02:00
|
|
|
|
2024-03-06 22:50:32 +01:00
|
|
|
proxmox-chaosknoten-nixos-template = nixos-generators.nixosGenerate {
|
2024-11-17 20:29:04 +01:00
|
|
|
inherit specialArgs;
|
2024-03-06 22:50:32 +01:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./config/nixos-generators/proxmox-chaosknoten.nix
|
|
|
|
./config/proxmox-chaosknoten-additional-initial-config.nix
|
2024-11-05 22:43:53 +01:00
|
|
|
self.nixosModules.common
|
|
|
|
self.nixosModules.proxmox-vm
|
2024-03-06 22:50:32 +01:00
|
|
|
];
|
|
|
|
format = "proxmox";
|
|
|
|
};
|
2023-09-11 23:20:34 +02:00
|
|
|
};
|
2023-10-07 03:13:22 +02:00
|
|
|
|
2024-03-06 22:50:32 +01:00
|
|
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
|
2024-10-29 21:30:16 +01:00
|
|
|
|
|
|
|
hydraJobs = {
|
|
|
|
inherit (self) packages;
|
|
|
|
nixosConfigurations = builtins.mapAttrs (name: value: value.config.system.build.toplevel) self.nixosConfigurations;
|
|
|
|
};
|
2023-09-11 23:20:34 +02:00
|
|
|
};
|
|
|
|
}
|