nix-infra/flake.nix
christian 53e33a6641
flake.lock: Update
Flake lock file updates:

• Updated input 'nixos-generators':
    'github:nix-community/nixos-generators/7c60ba4bc8d6aa2ba3e5b0f6ceb9fc07bc261565' (2024-10-21)
  → 'github:nix-community/nixos-generators/06ffce1a8d95e95c06a4bcfa117dd960b14a7101' (2024-11-14)
• Updated input 'nixos-generators/nixlib':
    'github:nix-community/nixpkgs.lib/cce4521b6df014e79a7b7afc58c703ed683c916e' (2024-10-20)
  → 'github:nix-community/nixpkgs.lib/e04234d263750db01c78a412690363dc2226e68a' (2024-11-10)
• Updated input 'nixos-generators/nixpkgs':
    follows 'nixpkgs'
  → 'github:NixOS/nixpkgs/aebe249544837ce42588aa4b2e7972222ba12e8f' (2024-11-10)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/11f65b4b0405cff5b54c813626bddcf5435d7ad2' (2024-11-09)
  → 'github:nixos/nixpkgs/bf6132dc791dbdff8b6894c3a85eb27ad8255682' (2024-11-17)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/f1675e3b0e1e663a4af49be67ecbc9e749f85eb7' (2024-11-10)
  → 'github:Mic92/sops-nix/472741cf3fee089241ac9ea705bb2b9e0bfa2978' (2024-11-17)
• Removed input 'sops-nix/nixpkgs-stable'
2024-11-17 20:25:16 +01:00

270 lines
8.1 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-24.05-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";
};
# 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";
};
};
outputs = { self, nixpkgs, nixos-generators, sops-nix, ... }:
let
system = "x86_64-linux";
in
{
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 ];
});
};
};
nixosModules = {
common = ./config/common;
proxmox-vm = ./config/proxmox-vm;
prometheus-exporter = ./config/extra/prometheus-exporter.nix;
};
nixosConfigurations = {
audio-hauptraum-kueche = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
{ nixpkgs.overlays = [ self.overlays.shairportSyncAirplay2 ]; }
./config/hosts/audio-hauptraum-kueche
];
};
audio-hauptraum-tafel = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
{ nixpkgs.overlays = [ self.overlays.shairportSyncAirplay2 ]; }
./config/hosts/audio-hauptraum-tafel
];
};
esphome = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
./config/hosts/esphome
];
};
public-reverse-proxy = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
./config/hosts/public-reverse-proxy
];
};
netbox = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
sops-nix.nixosModules.sops
self.nixosModules.prometheus-exporter
./config/hosts/netbox
];
};
matrix = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
sops-nix.nixosModules.sops
self.nixosModules.prometheus-exporter
./config/hosts/matrix
];
};
public-web-static = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
sops-nix.nixosModules.sops
self.nixosModules.prometheus-exporter
./config/hosts/public-web-static
];
};
git = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
sops-nix.nixosModules.sops
self.nixosModules.prometheus-exporter
./config/hosts/git
];
};
forgejo-actions-runner = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
sops-nix.nixosModules.sops
self.nixosModules.prometheus-exporter
./config/hosts/forgejo-actions-runner
];
};
ptouch-print-server = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
./config/hosts/ptouch-print-server
];
};
eh22-wiki = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
self.nixosModules.prometheus-exporter
./config/hosts/eh22-wiki
];
};
nix-box-june = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
self.nixosModules.prometheus-exporter
./config/hosts/nix-box-june
];
};
yate = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
./config/hosts/yate
];
};
mqtt = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
./config/hosts/mqtt
];
};
mjolnir = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
sops-nix.nixosModules.sops
self.nixosModules.prometheus-exporter
./config/hosts/mjolnir
];
};
woodpecker = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
sops-nix.nixosModules.sops
self.nixosModules.prometheus-exporter
./config/hosts/woodpecker
];
};
status = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
sops-nix.nixosModules.sops
./config/hosts/status
];
};
penpot = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
sops-nix.nixosModules.sops
self.nixosModules.prometheus-exporter
./config/hosts/penpot
];
};
hydra = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
self.nixosModules.common
self.nixosModules.proxmox-vm
self.nixosModules.prometheus-exporter
./config/hosts/hydra
];
};
};
packages.x86_64-linux = {
proxmox-nixos-template = nixos-generators.nixosGenerate {
system = "x86_64-linux";
modules = [
./config/nixos-generators/proxmox.nix
self.nixosModules.common
self.nixosModules.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
self.nixosModules.common
self.nixosModules.proxmox-vm
];
format = "proxmox";
};
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
hydraJobs = {
inherit (self) packages;
nixosConfigurations = builtins.mapAttrs (name: value: value.config.system.build.toplevel) self.nixosConfigurations;
};
};
}