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
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05-small";
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-09-11 23:19:38 +02:00
|
|
|
outputs = { nixpkgs, nixpkgs-unstable, nixos-generators, ... }:
|
|
|
|
let
|
|
|
|
# Shairport Sync with metadata and MQTT support.
|
|
|
|
shairportSyncExtendedNixpkgsUnstableOverlay = final: prev: {
|
|
|
|
shairport-sync = (prev.shairport-sync.override { enableMetadata = 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 ];
|
|
|
|
});
|
|
|
|
};
|
|
|
|
in {
|
2023-09-11 21:40:35 +02:00
|
|
|
colmena = {
|
|
|
|
meta = {
|
|
|
|
nixpkgs = nixpkgs.legacyPackages."x86_64-linux";
|
|
|
|
nodeNixpkgs = {
|
2023-09-11 23:19:38 +02:00
|
|
|
audio = nixpkgs-unstable.legacyPackages."x86_64-linux".extend shairportSyncExtendedNixpkgsUnstableOverlay;
|
2023-09-11 21:40:35 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
audio = {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "audio.z9.ccchh.net";
|
|
|
|
targetPort = 22;
|
2023-09-14 20:19:49 +02:00
|
|
|
targetUser = "colmena-deploy";
|
2023-09-14 21:02:27 +02:00
|
|
|
tags = [ "thinkcccluster" ];
|
2023-09-11 21:40:35 +02:00
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
./config/hosts/audio
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-09-11 23:20:34 +02:00
|
|
|
packages.x86_64-linux = {
|
2023-09-14 20:23:00 +02:00
|
|
|
proxmox-nixos-template = nixos-generators.nixosGenerate {
|
2023-09-11 23:20:34 +02:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./config/nixos-generators/proxmox.nix
|
|
|
|
./config/common
|
|
|
|
./config/proxmox-vm
|
|
|
|
];
|
|
|
|
format = "proxmox";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|