nix-infra/flake.nix

272 lines
7.8 KiB
Nix
Raw Normal View History

{
description = "CCCHH Nix Infrastructure";
2024-11-12 22:36:51 +01:00
nixConfig = {
allow-import-from-derivation = true;
};
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";
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";
};
# 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, nixpkgs-unstable, nixos-generators, sops-nix, ... }:
let
system = "x86_64-linux";
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 ];
});
};
pkgs-unstable = nixpkgs-unstable.legacyPackages."x86_64-linux";
in
{
nixosConfigurations = {
audio-hauptraum-kueche = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
{ nixpkgs.overlays = [ shairportSync431ExtendedNixpkgsUnstableOverlay ]; }
./config/hosts/audio-hauptraum-kueche
];
};
audio-hauptraum-tafel = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
{ nixpkgs.overlays = [ shairportSync431ExtendedNixpkgsUnstableOverlay ]; }
./config/hosts/audio-hauptraum-tafel
];
};
2023-09-14 22:12:38 +02:00
esphome = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
./config/hosts/esphome
];
2023-11-04 20:49:02 +01:00
};
public-reverse-proxy = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
./config/hosts/public-reverse-proxy
];
2023-11-04 22:20:49 +01:00
};
netbox = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
sops-nix.nixosModules.sops
./config/extra/prometheus-exporter.nix
./config/hosts/netbox
];
2023-09-14 22:12:38 +02:00
};
2023-09-14 23:52:20 +02:00
matrix = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
sops-nix.nixosModules.sops
./config/extra/prometheus-exporter.nix
./config/hosts/matrix
];
2023-09-14 23:52:20 +02:00
};
public-web-static = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
sops-nix.nixosModules.sops
./config/extra/prometheus-exporter.nix
./config/hosts/public-web-static
];
};
git = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
sops-nix.nixosModules.sops
./config/extra/prometheus-exporter.nix
./config/hosts/git
];
};
forgejo-actions-runner = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
sops-nix.nixosModules.sops
./config/extra/prometheus-exporter.nix
./config/hosts/forgejo-actions-runner
];
};
ptouch-print-server = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
./config/hosts/ptouch-print-server
];
};
2024-05-17 20:42:48 +02:00
eh22-wiki = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
2024-05-17 20:42:48 +02:00
./config/common
./config/proxmox-vm
./config/extra/prometheus-exporter.nix
2024-05-17 20:42:48 +02:00
./config/hosts/eh22-wiki
];
};
nix-box-june = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
./config/extra/prometheus-exporter.nix
./config/hosts/nix-box-june
];
};
2024-06-08 20:18:59 +02:00
yate = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
./config/hosts/yate
];
};
mqtt = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
./config/hosts/mqtt
];
};
mjolnir = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
sops-nix.nixosModules.sops
./config/extra/prometheus-exporter.nix
./config/hosts/mjolnir
];
};
woodpecker = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
sops-nix.nixosModules.sops
./config/extra/prometheus-exporter.nix
./config/hosts/woodpecker
];
specialArgs = {
inherit pkgs-unstable;
};
};
2024-08-04 02:19:26 +02:00
status = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
sops-nix.nixosModules.sops
./config/hosts/status
];
};
penpot = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
sops-nix.nixosModules.sops
./config/extra/prometheus-exporter.nix
./config/hosts/penpot
];
};
2024-10-30 01:44:12 +01:00
hydra = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./config/common
./config/proxmox-vm
./config/extra/prometheus-exporter.nix
./config/hosts/hydra
];
};
};
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";
};
};
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;
};
};
}