June
c72b30aa6a
- use nqptp - use Shairport Sync and nqptp versions, which work - disable IPv6, since Shairport Sync doesn't work with it for some reason - configure firewall for AirPlay 2 - use correct subnet
159 lines
5 KiB
Nix
159 lines
5 KiB
Nix
{
|
|
description = "CCCHH Nix Infrastructure";
|
|
|
|
inputs = {
|
|
# Use the NixOS small channels for nixpkgs.
|
|
# https://nixos.org/manual/nixos/stable/#sec-upgrading
|
|
# https://github.com/NixOS/nixpkgs
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05-small";
|
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
|
|
|
# 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";
|
|
};
|
|
};
|
|
|
|
outputs = { nixpkgs, nixpkgs-unstable, nixos-generators, ... }:
|
|
let
|
|
# 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: {
|
|
# See: https://github.com/mikebrady/shairport-sync/blob/e78a88b64adfe7b5f88fd6faedf55c57445bb240/CONFIGURATION%20FLAGS.md
|
|
configureFlags = previousAttr.configureFlags ++ [ "--with-mqtt-client" ];
|
|
buildInputs = previousAttr.buildInputs ++ [ final.mosquitto ];
|
|
# 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.
|
|
src = final.fetchFromGitHub {
|
|
owner = "mikebrady";
|
|
repo = finalAttr.pname;
|
|
rev = "4.3.1";
|
|
hash = "sha256-Yj0SKMKACj2B/ADPkUzO4EvaYZX39erKmjaTsr5UN0s=";
|
|
};
|
|
});
|
|
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/
|
|
'';
|
|
});
|
|
};
|
|
in {
|
|
colmena = {
|
|
meta = {
|
|
nixpkgs = nixpkgs.legacyPackages."x86_64-linux";
|
|
nodeNixpkgs = {
|
|
audio = nixpkgs-unstable.legacyPackages."x86_64-linux".extend shairportSync431ExtendedNixpkgsUnstableOverlay;
|
|
};
|
|
};
|
|
|
|
audio = {
|
|
deployment = {
|
|
targetHost = "audio.z9.ccchh.net";
|
|
targetPort = 22;
|
|
targetUser = "colmena-deploy";
|
|
tags = [ "thinkcccluster" ];
|
|
};
|
|
imports = [
|
|
./config/common
|
|
./config/proxmox-vm
|
|
./config/hosts/audio
|
|
];
|
|
};
|
|
|
|
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
|
|
];
|
|
};
|
|
|
|
netbox = {
|
|
deployment = {
|
|
targetHost = "netbox-intern.hamburg.ccc.de";
|
|
targetPort = 22;
|
|
targetUser = "colmena-deploy";
|
|
tags = [ "chaosknoten" ];
|
|
};
|
|
imports = [
|
|
./config/common
|
|
./config/proxmox-vm
|
|
./config/hosts/netbox
|
|
];
|
|
};
|
|
|
|
matrix = {
|
|
deployment = {
|
|
targetHost = "matrix-intern.hamburg.ccc.de";
|
|
targetPort = 22;
|
|
targetUser = "colmena-deploy";
|
|
tags = [ "chaosknoten" ];
|
|
};
|
|
imports = [
|
|
./config/common
|
|
./config/proxmox-vm
|
|
./config/hosts/matrix
|
|
];
|
|
};
|
|
|
|
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
|
|
];
|
|
};
|
|
};
|
|
|
|
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";
|
|
};
|
|
|
|
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";
|
|
};
|
|
};
|
|
};
|
|
}
|