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
|
2023-12-05 17:33:49 +01:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11-small";
|
2023-09-14 20:44:54 +02:00
|
|
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-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";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
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";
|
|
|
|
};
|
2023-09-11 23:20:34 +02:00
|
|
|
};
|
|
|
|
|
2024-05-25 16:47:34 +02:00
|
|
|
outputs = { nixpkgs, nixpkgs-unstable, nixos-generators, sops-nix, ... }:
|
2023-09-11 23:19:38 +02:00
|
|
|
let
|
2023-10-15 21:44:25 +02:00
|
|
|
# Shairport Sync 4.3.1 (with nqptp 1.2.4) with metadata, MQTT and AirPlay 2 support.
|
|
|
|
shairportSync431ExtendedNixpkgsUnstableOverlay = final: prev: {
|
|
|
|
shairport-sync = (prev.shairport-sync.override { enableMetadata = true; enableAirplay2 = true; }).overrideAttrs (finalAttr: previousAttr: {
|
2023-09-11 23:19:38 +02:00
|
|
|
# See: https://github.com/mikebrady/shairport-sync/blob/e78a88b64adfe7b5f88fd6faedf55c57445bb240/CONFIGURATION%20FLAGS.md
|
|
|
|
configureFlags = previousAttr.configureFlags ++ [ "--with-mqtt-client" ];
|
|
|
|
buildInputs = previousAttr.buildInputs ++ [ final.mosquitto ];
|
2023-10-15 21:44:25 +02:00
|
|
|
# Use specific Shairport Sync and nqptp versions, since with those the
|
|
|
|
# following error doesn't happen:
|
|
|
|
# fatal error: The nqptp service on this system, which is required for
|
|
|
|
# Shairport Sync to operate, does not seem to be initialised.
|
2023-10-16 16:59:14 +02:00
|
|
|
#
|
|
|
|
# Also use a more recent dev version to fix Pipewire stuttering issue.
|
|
|
|
# See:
|
|
|
|
# https://github.com/mikebrady/shairport-sync/issues/1736
|
|
|
|
# https://github.com/mikebrady/shairport-sync/blob/a65ec2d7f1f380bbae196d7f8f1cd6a88ef5777b/RELEASENOTES-DEVELOPMENT.md#version-432-dev-51-g98679bbb
|
2023-10-15 21:44:25 +02:00
|
|
|
src = final.fetchFromGitHub {
|
|
|
|
owner = "mikebrady";
|
|
|
|
repo = finalAttr.pname;
|
2023-10-16 16:59:14 +02:00
|
|
|
rev = "98679bbb54f5aaeda859e34aa28425647b8d179e";
|
|
|
|
hash = "sha256-k0kcgtWk2xlG34lP0ryEaqdskYMNM68YnIRLwFR3jaY=";
|
2023-10-15 21:44:25 +02:00
|
|
|
};
|
|
|
|
});
|
|
|
|
nqptp = prev.nqptp.overrideAttrs (finalAttr: previousAttr: {
|
|
|
|
# See Shairport Sync version note.
|
|
|
|
src = final.fetchFromGitHub {
|
|
|
|
owner = "mikebrady";
|
|
|
|
repo = finalAttr.pname;
|
|
|
|
rev = "1.2.4";
|
|
|
|
hash = "sha256-roTNcr3v2kzE6vQ5plAVtlw1+2yJplltOYsGGibtoZo=";
|
|
|
|
};
|
|
|
|
# Custom install phase to avoid setcap.
|
|
|
|
# See:
|
|
|
|
# https://github.com/mikebrady/nqptp/blob/1.2.4/Makefile.am#L23
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp nqptp $out/bin/
|
|
|
|
'';
|
2023-09-11 23:19:38 +02:00
|
|
|
});
|
|
|
|
};
|
2024-01-20 21:34:09 +01:00
|
|
|
pkgs-unstable = nixpkgs-unstable.legacyPackages."x86_64-linux";
|
2024-03-06 22:50:32 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
colmena = {
|
|
|
|
meta = {
|
|
|
|
nixpkgs = nixpkgs.legacyPackages."x86_64-linux";
|
|
|
|
nodeNixpkgs = {
|
|
|
|
audio-hauptraum-kueche = nixpkgs-unstable.legacyPackages."x86_64-linux".extend shairportSync431ExtendedNixpkgsUnstableOverlay;
|
|
|
|
audio-hauptraum-tafel = nixpkgs-unstable.legacyPackages."x86_64-linux".extend shairportSync431ExtendedNixpkgsUnstableOverlay;
|
|
|
|
};
|
|
|
|
nodeSpecialArgs = {
|
|
|
|
git = { inherit pkgs-unstable; };
|
|
|
|
};
|
2023-09-11 21:40:35 +02:00
|
|
|
};
|
2024-03-06 22:50:32 +01:00
|
|
|
|
|
|
|
audio-hauptraum-kueche = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "audio-hauptraum-kueche.z9.ccchh.net";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "thinkcccluster" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
./config/hosts/audio-hauptraum-kueche
|
|
|
|
];
|
2024-01-20 21:34:09 +01:00
|
|
|
};
|
2023-09-11 21:40:35 +02:00
|
|
|
|
2024-03-06 22:50:32 +01:00
|
|
|
audio-hauptraum-tafel = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "audio-hauptraum-tafel.z9.ccchh.net";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "thinkcccluster" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
./config/hosts/audio-hauptraum-tafel
|
|
|
|
];
|
2023-09-11 21:40:35 +02:00
|
|
|
};
|
2023-09-14 22:12:38 +02:00
|
|
|
|
2024-03-06 22:50:32 +01:00
|
|
|
esphome = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "esphome.z9.ccchh.net";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "thinkcccluster" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
./config/hosts/esphome
|
|
|
|
];
|
2023-11-04 20:49:02 +01:00
|
|
|
};
|
|
|
|
|
2024-03-06 22:50:32 +01:00
|
|
|
public-reverse-proxy = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "public-reverse-proxy.z9.ccchh.net";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "thinkcccluster" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
./config/hosts/public-reverse-proxy
|
|
|
|
];
|
2023-11-04 22:20:49 +01:00
|
|
|
};
|
|
|
|
|
2024-03-06 22:50:32 +01:00
|
|
|
netbox = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "netbox-intern.hamburg.ccc.de";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "chaosknoten" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
./config/hosts/netbox
|
|
|
|
];
|
2023-09-14 22:12:38 +02:00
|
|
|
};
|
2023-09-14 23:52:20 +02:00
|
|
|
|
2024-03-06 22:50:32 +01:00
|
|
|
matrix = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "matrix-intern.hamburg.ccc.de";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "chaosknoten" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
2024-05-26 02:58:15 +02:00
|
|
|
sops-nix.nixosModules.sops
|
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-03-06 22:50:32 +01:00
|
|
|
public-web-static = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "public-web-static-intern.hamburg.ccc.de";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "chaosknoten" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
./config/hosts/public-web-static
|
|
|
|
];
|
2023-10-06 05:33:28 +02:00
|
|
|
};
|
2023-10-07 04:29:08 +02:00
|
|
|
|
2024-03-06 22:50:32 +01:00
|
|
|
git = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "git.hamburg.ccc.de";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "chaosknoten" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
2024-05-25 16:47:34 +02:00
|
|
|
sops-nix.nixosModules.sops
|
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-03-06 22:50:32 +01:00
|
|
|
forgejo-actions-runner = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "forgejo-actions-runner-intern.hamburg.ccc.de";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "chaosknoten" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
2024-05-26 02:50:08 +02:00
|
|
|
sops-nix.nixosModules.sops
|
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
|
|
|
|
|
|
|
ptouch-print-server = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "ptouch-print-server.z9.ccchh.net";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "thinkcccluster" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
./config/hosts/ptouch-print-server
|
|
|
|
];
|
|
|
|
};
|
2024-05-17 20:42:48 +02:00
|
|
|
|
|
|
|
eh22-wiki = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "eh22-wiki-intern.hamburg.ccc.de";
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "colmena-deploy";
|
|
|
|
tags = [ "chaosknoten" ];
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
./config/hosts/eh22-wiki
|
|
|
|
];
|
|
|
|
};
|
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 {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./config/nixos-generators/proxmox.nix
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
];
|
|
|
|
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 {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./config/nixos-generators/proxmox-chaosknoten.nix
|
|
|
|
./config/proxmox-chaosknoten-additional-initial-config.nix
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
];
|
|
|
|
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;
|
2023-09-11 23:20:34 +02:00
|
|
|
};
|
|
|
|
}
|