nix-config/flake.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

783 lines
22 KiB
Nix
Raw Normal View History

{
description = "C3D2 NixOS configurations";
2020-06-11 07:50:42 +02:00
inputs = {
# use sandro's fork full with cherry-picked fixes
nixos.url = "github:SuperSandro2000/nixpkgs/nixos-22.11";
2022-06-16 23:48:49 +02:00
nixpkgs-mobilizon.url = "github:minijackson/nixpkgs/init-mobilizon";
nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2022-05-31 12:47:58 +02:00
nixos-hardware.url = "github:nixos/nixos-hardware";
2022-09-14 23:16:06 +02:00
affection-src = {
url = "git+https://gitea.nek0.eu/nek0/affection";
inputs = {
nixpkgs.follows = "nixos";
2022-09-17 17:52:56 +02:00
flake-utils.follows = "flake-utils";
2022-09-14 23:16:06 +02:00
};
};
bevy-mandelbrot = {
# url = "github:matelab/bevy_mandelbrot";
url = "git+https://gitea.c3d2.de/astro/bevy-mandelbrot.git?ref=main";
inputs = {
naersk.follows = "naersk";
2022-09-17 17:52:56 +02:00
nixpkgs.follows = "nixos";
2022-09-14 23:16:06 +02:00
rust-overlay.follows = "rust-overlay";
};
};
bevy-julia = {
# url = "github:matelab/bevy_julia";
url = "git+https://gitea.c3d2.de/astro/bevy-julia.git?ref=main";
inputs = {
nixpkgs.follows = "nixos";
# breaks the build:
# naersk.follows = "naersk";
# naersk.inputs.nixpkgs.follows = "nixpkgs";
rust-overlay.follows = "rust-overlay";
};
};
2022-11-03 20:49:26 +01:00
caveman = {
url = "git+https://gitea.c3d2.de/astro/caveman.git?ref=main";
inputs = {
nixpkgs.follows = "nixos";
utils.follows = "flake-utils";
fenix.follows = "fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
naersk.follows = "naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs";
};
};
2022-05-31 12:47:58 +02:00
fenix = {
url = "github:nix-community/fenix";
2022-07-24 03:58:12 +02:00
inputs.nixpkgs.follows = "nixos";
2022-05-31 12:47:58 +02:00
};
2022-08-18 23:59:07 +02:00
flake-utils.url = "github:numtide/flake-utils";
harmonia = {
url = "github:helsinki-systems/harmonia";
flake = false;
};
2022-05-31 12:47:58 +02:00
heliwatch = {
url = "git+https://gitea.c3d2.de/astro/heliwatch.git";
2022-04-17 22:45:05 +02:00
inputs = {
2022-05-31 12:47:58 +02:00
fenix.follows = "fenix";
2022-07-24 03:58:12 +02:00
nixpkgs.follows = "nixos";
2022-05-31 12:47:58 +02:00
naersk.follows = "naersk";
2022-09-03 01:26:45 +02:00
utils.follows = "flake-utils";
2022-04-17 22:45:05 +02:00
};
};
2022-06-28 20:34:54 +02:00
hydra-ca.url = "github:mlabs-haskell/hydra/aciceri/ca-derivations";
2022-05-31 12:47:58 +02:00
microvm = {
url = "github:astro/microvm.nix";
2022-08-18 23:59:07 +02:00
inputs = {
nixpkgs.follows = "nixos";
flake-utils.follows = "flake-utils";
};
2022-04-24 21:56:45 +02:00
};
2022-05-31 12:47:58 +02:00
naersk = {
url = "github:nix-community/naersk";
2022-09-17 17:52:56 +02:00
inputs = {
nixpkgs.follows = "nixos";
};
2022-05-31 12:47:58 +02:00
};
oparl-scraper = {
url = "github:offenesdresden/ratsinfo-scraper/oparl";
flake = false;
};
2022-05-31 12:47:58 +02:00
openwrt = {
url = "git+https://git.openwrt.org/openwrt/openwrt.git?ref=openwrt-21.02";
flake = false;
};
openwrt-imagebuilder = {
url = "github:astro/nix-openwrt-imagebuilder";
2022-04-17 22:45:05 +02:00
inputs = {
2022-07-24 03:58:12 +02:00
nixpkgs.follows = "nixos";
2022-05-31 12:47:58 +02:00
};
};
2022-09-14 23:16:06 +02:00
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
2022-09-17 17:52:56 +02:00
flake-utils.follows = "flake-utils";
2022-09-14 23:16:06 +02:00
nixpkgs.follows = "nixos";
};
};
2022-05-31 12:47:58 +02:00
scrapers = {
url = "git+https://gitea.c3d2.de/astro/scrapers.git";
flake = false;
};
skyflake = {
url = "github:astro/skyflake";
inputs = {
microvm.follows = "microvm";
nixpkgs.follows = "nixos";
};
};
2022-09-19 23:57:54 +02:00
sshlogd = {
url = "git+https://gitea.c3d2.de/astro/sshlogd.git?ref=main";
inputs = {
utils.follows = "flake-utils";
naersk.follows = "naersk";
nixpkgs.follows = "nixos";
fenix.follows = "fenix";
};
};
2022-05-31 12:47:58 +02:00
secrets = {
url = "git+ssh://gitea@gitea.c3d2.de/c3d2-admins/secrets.git";
inputs = {
2022-07-24 03:58:12 +02:00
nixpkgs.follows = "nixos";
2022-04-17 22:45:05 +02:00
};
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs = {
2022-07-24 03:58:12 +02:00
nixpkgs.follows = "nixos";
nixpkgs-22_05.follows = "nixos";
2022-04-17 22:45:05 +02:00
};
};
2022-05-31 12:47:58 +02:00
spacemsg = {
url = "github:astro/spacemsg";
flake = false;
};
ticker = {
url = "git+https://gitea.c3d2.de/astro/ticker.git";
2022-07-16 01:05:49 +02:00
inputs = {
fenix.follows = "fenix";
# TODO: build regression in https://github.com/nix-community/naersk/commit/6944160c19cb591eb85bbf9b2f2768a935623ed3
# naersk.follows = "naersk";
2022-07-24 03:58:12 +02:00
nixpkgs.follows = "nixos";
2022-08-18 23:59:07 +02:00
utils.follows = "flake-utils";
2022-07-16 01:05:49 +02:00
};
2022-05-31 12:47:58 +02:00
};
tigger = {
url = "github:astro/tigger";
flake = false;
};
tracer = {
# url = "git+https://gitea.nek0.eu/nek0/tracer";
url = "git+https://gitea.c3d2.de/astro/tracer";
inputs = {
2022-09-14 23:16:06 +02:00
affection-src.follows = "affection-src";
nixpkgs.follows = "nixos";
flake-utils.follows = "flake-utils";
};
2022-09-01 21:28:20 +02:00
};
2022-05-31 12:47:58 +02:00
yammat = {
2022-06-16 22:51:51 +02:00
url = "git+https://gitea.c3d2.de/C3D2/yammat.git?ref=nix";
2022-07-24 03:58:12 +02:00
inputs.nixpkgs.follows = "nixos";
2022-05-12 02:58:47 +02:00
};
2022-05-31 12:47:58 +02:00
zentralwerk = {
url = "git+https://gitea.c3d2.de/zentralwerk/network.git";
inputs = {
2022-07-24 03:58:12 +02:00
nixpkgs.follows = "nixos";
2022-05-31 12:47:58 +02:00
openwrt.follows = "openwrt";
openwrt-imagebuilder.follows = "openwrt-imagebuilder";
};
};
2020-06-11 07:50:42 +02:00
};
2020-04-15 19:00:56 +02:00
2022-11-03 20:49:26 +01:00
outputs = inputs@{ self, fenix, harmonia, heliwatch, microvm, naersk, nixos, nixos-hardware, nixos-unstable, caveman, oparl-scraper, scrapers, secrets, skyflake, sshlogd, sops-nix, spacemsg, ticker, tigger, yammat, zentralwerk, ... }:
2021-02-22 12:31:58 +01:00
let
2022-07-24 03:58:12 +02:00
inherit (nixos) lib;
2021-02-24 11:52:19 +01:00
extractZwHosts = { hosts4, hosts6, ... }:
2022-01-13 18:38:36 +01:00
lib.recursiveUpdate (
builtins.foldl' (result: name:
2022-01-13 18:38:36 +01:00
lib.recursiveUpdate result {
2021-10-31 19:00:03 +01:00
"${name}".ip4 = hosts4."${name}";
}
) {} (builtins.attrNames hosts4)
) (
builtins.foldl' (result: ctx:
builtins.foldl' (result: name:
2022-01-13 18:38:36 +01:00
lib.recursiveUpdate result {
2021-10-31 19:00:03 +01:00
"${name}".ip6 = hosts6."${ctx}"."${name}";
}
2021-10-31 19:00:03 +01:00
) result (builtins.attrNames hosts6."${ctx}")
) {} (builtins.attrNames hosts6)
);
zwHostRegistry = {
hosts =
builtins.foldl' (result: net:
2022-01-13 18:38:36 +01:00
lib.recursiveUpdate result (extractZwHosts zentralwerk.lib.config.site.net."${net}")
) {} [ "core" "cluster" "c3d2" "serv" "flpk" "pub" ];
};
2022-01-16 13:26:37 +01:00
extraHostRegistry.hosts = import ./host-registry.nix;
2022-01-13 18:38:36 +01:00
hostRegistry = lib.recursiveUpdate zwHostRegistry extraHostRegistry;
in {
overlays = import ./overlays {
inherit nixos-unstable;
inherit (inputs) tracer bevy-mandelbrot bevy-julia;
};
2021-02-26 20:22:15 +01:00
2022-12-04 08:53:28 +01:00
legacyPackages = lib.attrsets.mapAttrs (_: pkgs:
2022-09-01 21:28:20 +02:00
pkgs.appendOverlays [
fenix.overlays.default
2022-09-01 21:28:20 +02:00
naersk.overlay
self.overlays
2022-09-01 21:28:20 +02:00
]) nixos.legacyPackages;
2022-12-04 07:46:56 +01:00
packages = import ./packages.nix { inherit hostRegistry inputs lib microvm secrets self; };
2020-08-04 17:15:07 +02:00
2021-02-22 12:31:58 +01:00
nixosConfigurations = let
nixosSystem' =
# Our custom NixOS builder
2022-07-24 03:58:12 +02:00
{ nixpkgs ? inputs.nixos, modules, extraArgs ? {}, specialArgs ? { }, system ? "x86_64-linux" }:
nixpkgs.lib.nixosSystem {
2022-06-24 01:02:11 +02:00
inherit specialArgs system;
modules = [
2022-12-04 08:53:28 +01:00
({ ... }: {
_module.args = extraArgs // {
inherit hostRegistry inputs zentralwerk;
};
2022-03-29 00:01:14 +02:00
nixpkgs = {
2022-12-04 09:17:37 +01:00
overlays = [ self.overlays ];
2022-03-29 00:01:14 +02:00
};
2021-02-22 12:31:58 +01:00
})
self.nixosModules.c3d2
2022-09-28 21:10:09 +02:00
./modules/audio-server.nix
./modules/c3d2.nix
./modules/stats.nix
./modules/pi-sensors.nix
] ++ modules;
};
2021-02-22 12:31:58 +01:00
in {
2022-07-23 00:06:12 +02:00
auth = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/auth
2022-07-23 00:06:12 +02:00
];
# nixpkgs = inputs.nixos-unstable;
2022-07-23 00:06:12 +02:00
};
2020-08-04 17:15:07 +02:00
2022-07-16 02:03:47 +02:00
broker = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/broker
2022-07-16 02:03:47 +02:00
];
};
2022-08-05 19:08:22 +02:00
factorio = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/factorio
];
2022-08-21 22:58:22 +02:00
nixpkgs = inputs.nixos-unstable;
2022-08-05 19:08:22 +02:00
};
2021-02-26 20:22:15 +01:00
freifunk = nixosSystem' {
2021-03-05 01:16:57 +01:00
modules = [
self.nixosModules.microvm
./hosts/freifunk
2022-01-13 18:38:36 +01:00
{
2021-03-05 01:16:57 +01:00
nixpkgs.overlays = with secrets.overlays; [
freifunk ospf
];
2022-01-13 18:38:36 +01:00
}
2021-03-05 01:16:57 +01:00
];
2021-02-26 20:22:15 +01:00
};
2022-07-16 20:38:23 +02:00
ftp = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/ftp
2022-07-16 20:38:23 +02:00
];
};
2021-10-02 20:28:30 +02:00
gitea = nixosSystem' {
modules = [
2022-06-20 22:10:23 +02:00
self.nixosModules.microvm
./hosts/gitea
2021-10-02 20:28:30 +02:00
];
# nixpkgs = inputs.nixos-unstable;
2021-10-02 20:28:30 +02:00
};
2021-02-22 13:21:31 +01:00
glotzbert = nixosSystem' {
modules = [
./hosts/glotzbert
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-pc-ssd
2022-08-07 18:52:11 +02:00
# TODO: migrate away from secrets repo
2021-03-12 17:06:37 +01:00
secrets.nixosModules.admins
];
2021-02-22 13:21:31 +01:00
};
2022-06-21 22:00:17 +02:00
hedgedoc = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/hedgedoc
2022-06-21 22:00:17 +02:00
];
# nixpkgs = inputs.nixos-unstable;
2022-06-21 22:00:17 +02:00
};
2021-02-22 13:21:31 +01:00
pulsebert = nixosSystem' {
2021-09-23 19:34:09 +02:00
modules = [
./hosts/pulsebert
2022-09-04 13:13:59 +02:00
# build: outputs.nixosConfigurations.pulsebert.config.system.build.sdImage
# run: unzstd -cd result/sd-image/nixos-sd-image-*-aarch64-linux.img.zst | pv -br | sudo dd bs=4M of=/dev/sdX
"${inputs.nixos-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel.nix"
2022-09-25 19:47:58 +02:00
{
nixpkgs = {
hostPlatform = "aarch64-linux";
# buildPlatform = "x86_64-linux";
};
}
2021-09-23 19:34:09 +02:00
];
# nixpkgs = inputs.nixos-unstable;
2021-02-22 13:21:31 +01:00
};
2020-08-04 17:15:07 +02:00
2021-09-23 03:32:17 +02:00
radiobert = nixosSystem' {
modules = [
2022-12-04 08:53:28 +01:00
({ ... }:
{
nixpkgs.overlays = [ heliwatch.overlay ];
2022-01-13 18:38:36 +01:00
})
2021-09-23 03:32:17 +02:00
./hosts/radiobert
];
system = "aarch64-linux";
};
2022-11-01 00:21:38 +01:00
nncp = nixosSystem' {
modules = [
self.nixosModules.microvm
self.nixosModules.nncp
./hosts/nncp
];
};
2022-01-15 11:28:23 +01:00
2021-09-27 22:19:24 +02:00
dacbert = nixosSystem' {
modules = [
2021-10-07 20:19:48 +02:00
nixos-hardware.nixosModules.raspberry-pi-4
2022-03-16 23:16:02 +01:00
self.nixosModules.rpi-netboot
2021-09-27 22:19:24 +02:00
./hosts/dacbert
];
system = "aarch64-linux";
};
2022-03-13 23:49:12 +01:00
rpi-netboot = nixosSystem' {
modules = [
2022-07-24 03:58:12 +02:00
{ _module.args = { inherit nixos; }; }
2022-03-13 23:49:12 +01:00
nixos-hardware.nixosModules.raspberry-pi-4
self.nixosModules.rpi-netboot
2022-03-13 23:49:12 +01:00
./hosts/rpi-netboot
];
system = "aarch64-linux";
2022-09-26 22:45:34 +02:00
};
schalter = nixosSystem' {
modules = [
2022-09-26 22:45:34 +02:00
"${nixos}/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix"
({ lib, ... }: {
networking.hostName = "schalter";
hardware.enableRedistributableFirmware = true;
#networking.wireless.enable = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
boot = {
loader = {
grub.enable = false;
raspberryPi = {
enable = true;
version = 1;
2022-09-26 22:45:34 +02:00
uboot.enable = false;
};
2022-09-26 22:45:34 +02:00
generic-extlinux-compatible.enable = lib.mkForce false;
};
# supportedFilesystems = lib.mkForce [ "vfat" "ext4" ];
tmpOnTmpfs = true;
};
nixpkgs.config.packageOverrides = pkgs: {
makeModulesClosure = x:
# prevent kernel install fail due to missing modules
pkgs.makeModulesClosure (x // { allowMissing = true; });
};
sdImage = {
compressImage = false;
imageBaseName = "schalter";
firmwareSize = 512;
};
2022-09-26 22:45:34 +02:00
nixpkgs.crossSystem = nixos.lib.systems.examples.raspberryPi;
})
];
2022-09-26 22:45:34 +02:00
system = "x86_64-linux";
2022-03-13 23:49:12 +01:00
};
2021-03-06 01:13:27 +01:00
matemat = nixosSystem' {
modules = [
2022-06-17 21:27:38 +02:00
self.nixosModules.microvm
./hosts/matemat
2021-03-10 01:54:28 +01:00
yammat.nixosModule
2022-08-07 18:52:11 +02:00
# TODO: migrate away from secrets repo
secrets.nixosModules.admins
2022-01-13 20:20:48 +01:00
{ nixpkgs.overlays = [ secrets.overlays.matemat ]; }
2021-03-06 01:13:27 +01:00
];
};
2021-03-06 02:57:35 +01:00
scrape = nixosSystem' {
modules = [
2022-06-17 00:05:21 +02:00
self.nixosModules.microvm
./hosts/scrape
2022-06-17 00:05:21 +02:00
{
nixpkgs.overlays = [ secrets.overlays.scrape ];
_module.args = { inherit scrapers; };
}
2021-03-06 02:57:35 +01:00
];
};
2021-03-11 15:59:00 +01:00
dn42 = nixosSystem' {
modules = [
2022-06-16 23:17:10 +02:00
self.nixosModules.microvm
./hosts/dn42
{
2021-03-11 15:59:00 +01:00
nixpkgs.overlays = [ secrets.overlays.dn42 ];
}
2021-03-11 15:59:00 +01:00
];
};
2021-03-11 16:40:39 +01:00
grafana = nixosSystem' {
modules = [
2022-06-18 02:09:33 +02:00
self.nixosModules.microvm
./hosts/grafana
2021-03-11 16:40:39 +01:00
];
# nixpkgs = nixos-unstable;
2021-03-11 16:40:39 +01:00
};
2021-03-12 21:45:12 +01:00
hydra = nixosSystem' {
modules = [
self.nixosModules.cluster
skyflake.nixosModules.default
(harmonia + "/module.nix")
2022-05-05 22:34:51 +02:00
./hosts/hydra
{
_module.args = {
inherit self;
inherit (inputs) hydra-ca;
};
}
2021-03-12 21:45:12 +01:00
];
# nixpkgs = nixos-unstable;
2021-03-12 21:45:12 +01:00
};
2021-03-22 16:22:57 +01:00
mucbot = nixosSystem' {
modules = [
{ _module.args = { inherit tigger; }; }
2021-03-22 16:22:57 +01:00
"${tigger}/module.nix"
{ nixpkgs.overlays = [ secrets.overlays.mucbot ]; }
./hosts/mucbot
2022-11-02 23:37:01 +01:00
self.nixosModules.cluster-options
2021-03-22 16:22:57 +01:00
];
};
2021-06-23 21:59:10 +02:00
public-access-proxy = nixosSystem' {
modules = [
2022-06-16 22:23:36 +02:00
self.nixosModules.microvm
./hosts/public-access-proxy
2021-06-23 21:59:10 +02:00
];
};
2021-09-08 01:22:40 +02:00
ticker = nixosSystem' {
modules = [
2022-06-16 21:26:57 +02:00
self.nixosModules.microvm
ticker.nixosModules.ticker
./hosts/ticker
2021-09-08 01:22:40 +02:00
];
};
2021-09-10 00:21:38 +02:00
spaceapi = nixosSystem' {
modules = [
2022-06-16 21:38:53 +02:00
self.nixosModules.microvm
2021-09-10 00:21:38 +02:00
"${spacemsg}/spaceapi/module.nix"
./hosts/spaceapi
2021-09-10 00:21:38 +02:00
];
};
2021-09-10 22:59:40 +02:00
stream = nixosSystem' {
modules = [
2022-11-26 00:37:22 +01:00
self.nixosModules.cluster-options
./hosts/stream
2021-09-10 22:59:40 +02:00
];
};
mobilizon = nixosSystem' {
# TODO: pending https://github.com/NixOS/nixpkgs/pull/119132
nixpkgs = inputs.nixpkgs-mobilizon;
modules = [
2022-06-16 23:48:49 +02:00
self.nixosModules.microvm
./hosts/mobilizon
];
};
2021-10-06 02:55:30 +02:00
c3d2-web = nixosSystem' {
modules = [
2022-07-24 03:58:12 +02:00
{ _module.args = { inherit nixos; }; }
2022-06-18 02:42:41 +02:00
self.nixosModules.microvm
./hosts/c3d2-web
2022-01-13 18:38:36 +01:00
{ nixpkgs.overlays = [ secrets.overlays.c3d2-web ]; }
2021-10-06 02:55:30 +02:00
];
};
2021-10-07 23:00:50 +02:00
sdrweb = nixosSystem' {
modules = [
2022-11-06 13:28:55 +01:00
self.nixosModules.cluster-options
2021-10-30 02:02:08 +02:00
{ nixpkgs.overlays = [ secrets.overlays.mucbot ]; }
2021-11-09 01:23:35 +01:00
heliwatch.nixosModules.heliwatch
./hosts/sdrweb
2021-10-07 23:00:50 +02:00
];
# nixpkgs = nixos-unstable;
2021-10-07 23:00:50 +02:00
};
2021-10-15 02:07:50 +02:00
bind = nixosSystem' {
modules = [
2022-01-13 18:38:36 +01:00
{ nixpkgs.overlays = with secrets.overlays; [ bind ]; }
2022-06-18 02:43:11 +02:00
self.nixosModules.microvm
./hosts/bind
2021-10-15 02:07:50 +02:00
];
};
2021-10-18 03:46:25 +02:00
jabber = nixosSystem' {
modules = [
2022-01-13 18:38:36 +01:00
{ nixpkgs.overlays = with secrets.overlays; [ jabber ]; }
2022-06-20 00:15:34 +02:00
self.nixosModules.microvm
./hosts/jabber
2021-10-18 03:46:25 +02:00
];
};
2021-12-24 03:18:20 +01:00
blogs = nixosSystem' {
modules = [
self.nixosModules.plume
2022-06-20 00:06:32 +02:00
self.nixosModules.microvm
./hosts/blogs
2021-12-24 03:18:20 +01:00
];
};
2022-11-24 18:48:34 +01:00
server8 = nixosSystem' {
modules = [
./hosts/server8
self.nixosModules.cluster-network
self.nixosModules.cluster
skyflake.nixosModules.default
{ _module.args = { inherit self; }; }
];
};
2022-06-18 01:07:43 +02:00
server9 = nixosSystem' {
modules = [
./hosts/server9
microvm.nixosModules.host
self.nixosModules.microvm-host
2022-06-18 01:07:43 +02:00
self.nixosModules.cluster-network
self.nixosModules.cluster
skyflake.nixosModules.default
2022-06-18 01:07:43 +02:00
{ _module.args = { inherit self; }; }
];
};
2022-05-14 20:33:56 +02:00
server10 = nixosSystem' {
modules = [
./hosts/server10
2022-05-15 02:46:14 +02:00
microvm.nixosModules.host
self.nixosModules.microvm-host
self.nixosModules.cluster-network
self.nixosModules.cluster
skyflake.nixosModules.default
{ _module.args = { inherit self; }; }
2022-05-14 20:33:56 +02:00
];
};
2022-05-28 00:12:18 +02:00
oparl = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/oparl
{
_module.args = { inherit oparl-scraper; };
}
2022-05-28 00:12:18 +02:00
];
};
2022-06-01 20:46:47 +02:00
leon = nixosSystem' {
modules = [
2022-11-21 03:22:40 +01:00
self.nixosModules.cluster-options
./hosts/leon
2022-06-01 20:46:47 +02:00
];
};
2022-09-05 22:17:11 +02:00
leoncloud = nixosSystem' {
modules = [
2022-11-25 23:05:32 +01:00
self.nixosModules.cluster-options
2022-09-05 22:17:11 +02:00
./hosts/leoncloud
];
};
2022-06-07 20:15:09 +02:00
nfsroot = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/nfsroot
{
2022-07-24 03:58:12 +02:00
_module.args.tftproots = nixos.lib.filterAttrs (name: _:
builtins.match ".+-tftproot" name != null
) self.packages.x86_64-linux;
}
];
2022-06-07 20:15:09 +02:00
};
2022-06-08 22:55:35 +02:00
riscbert = nixosSystem' {
modules = [
nixos-hardware.nixosModules.starfive-visionfive-v1
2022-06-08 22:55:35 +02:00
./hosts/riscbert
2022-10-13 20:03:37 +02:00
{
nixpkgs.crossSystem = {
config = "riscv64-unknown-linux-gnu";
system = "riscv64-linux";
};
}
2022-06-08 22:55:35 +02:00
];
# nixpkgs = nixos-unstable;
2022-09-05 04:18:00 +02:00
system = "x86_64-linux";
2022-06-08 22:55:35 +02:00
};
2022-06-18 00:50:08 +02:00
direkthilfe = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/direkthilfe
2022-06-18 00:50:08 +02:00
];
};
2022-06-23 18:38:42 +02:00
mediawiki = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/mediawiki
2022-06-23 18:38:42 +02:00
];
# nixpkgs = nixos-unstable;
2022-06-23 18:38:42 +02:00
};
2022-07-06 21:09:04 +02:00
gnunet = nixosSystem' {
modules = [
2022-11-17 17:53:26 +01:00
self.nixosModules.cluster-options
./hosts/gnunet
2022-07-06 21:09:04 +02:00
];
# nixpkgs = nixos-unstable;
2022-07-06 21:09:04 +02:00
};
2022-09-15 20:32:50 +02:00
zengel = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/zengel
];
};
2022-09-19 23:57:54 +02:00
sshlog = nixosSystem' {
modules = [
2022-11-20 21:02:58 +01:00
self.nixosModules.cluster-options
2022-09-19 23:57:54 +02:00
sshlogd.nixosModule
./hosts/sshlog
];
};
2022-10-22 21:38:12 +02:00
network-homepage = nixosSystem' {
modules = [
self.nixosModules.microvm
./hosts/network-homepage
];
};
2022-11-03 20:49:26 +01:00
caveman = nixosSystem' {
modules = [
self.nixosModules.microvm
caveman.nixosModule
./hosts/caveman
];
};
2022-11-21 19:39:38 +01:00
owncast = nixosSystem' {
modules = [
self.nixosModules.cluster-options
./hosts/owncast
];
# nixpkgs = nixos-unstable;
2022-11-21 19:39:38 +01:00
};
2022-11-27 01:14:30 +01:00
prometheus = nixosSystem' {
modules = [
self.nixosModules.cluster-options
./hosts/prometheus
];
};
2022-11-30 00:34:54 +01:00
mastodon = nixosSystem' {
modules = [
self.nixosModules.cluster-options
./hosts/mastodon
];
};
2020-08-04 17:15:07 +02:00
};
2022-01-13 18:38:36 +01:00
nixosModules = {
2022-01-18 21:44:17 +01:00
c3d2 = {
2022-01-16 00:09:17 +01:00
imports = [
sops-nix.nixosModule
2022-10-31 20:30:25 +01:00
./modules/audio-server.nix
./modules/autoupdate.nix
./modules/backup.nix
2022-01-16 00:09:17 +01:00
./modules/c3d2.nix
2022-01-18 15:39:35 +01:00
./modules/nncp.nix
2022-10-31 20:30:25 +01:00
./modules/logging.nix
./modules/stats.nix
2022-01-16 00:09:17 +01:00
];
2022-01-16 13:26:37 +01:00
c3d2.hosts = hostRegistry.hosts;
2022-01-16 00:09:17 +01:00
c3d2.users = import ./users.nix;
2022-09-28 21:10:09 +02:00
c3d2.nncp.neigh = import ./modules/nncp-relays.nix;
2022-01-16 00:09:17 +01:00
};
cluster = ./modules/cluster;
2022-11-02 23:37:01 +01:00
cluster-options = ./modules/cluster/deployment-options.nix;
cluster-network = ./modules/cluster/network.nix;
microvm.imports = [
microvm.nixosModules.microvm
./modules/microvm.nix
];
microvm-host = ./modules/microvm-host.nix;
2022-01-15 11:00:01 +01:00
nncp = ./modules/nncp.nix;
2022-01-13 18:38:36 +01:00
plume = {
imports = [ ./modules/plume.nix ];
nixpkgs.overlays = [ fenix.overlays.default naersk.overlay ];
2022-01-13 18:38:36 +01:00
};
rpi-netboot = ./modules/rpi-netboot.nix;
2022-01-13 18:38:36 +01:00
};
2021-11-10 00:33:29 +01:00
# `nix develop`
devShell = lib.mapAttrs (system: sopsPkgs:
2022-07-31 18:08:28 +02:00
with nixos.legacyPackages.${system};
mkShell {
sopsPGPKeyDirs = [ "./keys" ];
nativeBuildInputs = [
sopsPkgs.sops-import-keys-hook
];
}
) sops-nix.packages;
hydraJobs =
lib.mapAttrs (_: nixos.lib.hydraJob) (
lib.mapAttrs (_: nixosSystem:
nixosSystem.config.microvm.declaredRunner or nixosSystem.config.system.build.toplevel
) self.nixosConfigurations
// lib.mapAttrs' (hostname: nixosSystem: lib.nameValuePair
(hostname + "-simd")
(nixosSystem.config.microvm.declaredRunner or nixosSystem.config.system.build.toplevel hostname
(nixosSystem (nixosSystem.args // (with nixosSystem.args; {
hostname = hostname + "-simd";
modules = modules ++ [
{
sandro.simd.enable = lib.mkForce true;
}
];
inherit (inputs) nixpkgs;
})))
)
) self.nixosConfigurations
// nixos.lib.filterAttrs (name: attr:
2022-12-04 11:23:44 +01:00
(builtins.match ".+-tftproot" name != null && lib.isDerivation attr)
) self.packages.aarch64-linux
);
2021-02-22 12:31:58 +01:00
};
}