Restructure and clean up code

This commit is contained in:
Pim Kunis 2024-09-07 13:59:04 +02:00
parent 660191ab42
commit 6dd363a2a8
37 changed files with 17 additions and 1423 deletions

View file

@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
export KUBECTL_APPLYSET=true
vals eval -fail-on-missing-key-in-map <$MANIFEST | kubectl apply -f - --prune --applyset $APPLYSET --namespace $NAMESPACE

View file

@ -42,13 +42,13 @@
outputs =
inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.meld inputs [
./flake-parts/scripts
./flake-parts/checks.nix
./flake-parts/deploy.nix
./flake-parts/nixos.nix
./flake-parts/shell.nix
./flake-parts/utils
./flake-parts/machines
./scripts
./checks.nix
./deploy.nix
./nixos.nix
./shell.nix
./utils
./machines
] // (flake-utils.lib.eachDefaultSystem (system: {
formatter = nixpkgs.legacyPackages.${system}.nixfmt;
}));

View file

@ -1,6 +1,12 @@
{ pkgs, self, config, lib, inputs, machine, ... }: {
{ self, pkgs, config, lib, inputs, machine, ... }: {
imports = [
"${self}/nixos-modules"
./storage.nix
./backups.nix
./networking
./data-sharing.nix
./monitoring
./k3s
./tailscale.nix
machine.nixosModule
inputs.disko.nixosModules.disko
inputs.sops-nix.nixosModules.sops
@ -140,7 +146,7 @@
sops = {
age.keyFile = "/root/.config/sops/age/keys.txt";
defaultSopsFile = ./secrets/nixos.yaml;
defaultSopsFile = "${self}/secrets/nixos.yaml";
};
};
}

View file

@ -1,6 +0,0 @@
lib: rec {
net = import ./net.nix lib;
globals = import ./globals.nix;
imagePath = name: "nix:0${globals.imageDir}/${name}.tar";
}

View file

@ -1,65 +0,0 @@
{
routerPublicIPv4 = "192.145.57.90";
routerPublicIPv6 = "2a0d:6e00:1a77::1";
bind9Ipv6 = "2a0d:6e00:1a77:30::134";
# Load balancer IPv4
traefikIPv4 = "192.168.30.128";
kmsIPv4 = "192.168.30.129";
inbucketIPv4 = "192.168.30.130";
piholeIPv4 = "192.168.30.131";
gitIPv4 = "192.168.30.132";
transmissionIPv4 = "192.168.30.133";
bind9IPv4 = "192.168.30.134";
dnsmasqIPv4 = "192.168.30.135";
minecraftIPv4 = "192.168.30.136";
jellyseerrIPv4 = "192.168.30.137";
syncthingIPv4 = "192.168.30.138";
longhornIPv4 = "192.168.30.139";
radarrIPv4 = "192.168.30.140";
prowlarrIPv4 = "192.168.30.141";
sonarrIPv4 = "192.168.30.142";
bazarrIPv4 = "192.168.30.143";
paperlessIPv4 = "192.168.30.144";
radicaleIPv4 = "192.168.30.145";
freshrssIPv4 = "192.168.30.146";
immichIPv4 = "192.168.30.147";
nextcloudIPv4 = "192.168.30.148";
imageDir = "/var/docker_images";
images = {
jellyfin = "jellyfin/jellyfin:10.9.9";
deluge = "linuxserver/deluge:2.1.1";
jellyseerr = "fallenbagel/jellyseerr:1.9.2";
radarr = "lscr.io/linuxserver/radarr:5.9.1";
prowlarr = "lscr.io/linuxserver/prowlarr:1.21.2";
sonarr = "lscr.io/linuxserver/sonarr:4.0.8";
bazarr = "lscr.io/linuxserver/bazarr:1.4.3";
atuin = "ghcr.io/atuinsh/atuin:18.3.0";
postgres14 = "postgres:14";
kms = "teddysun/kms:latest";
paperless = "ghcr.io/paperless-ngx/paperless-ngx:2.11.6";
redis7 = "docker.io/library/redis:7";
nextcloud = "nextcloud:29.0.5";
postgres15 = "postgres:15";
inbucket = "inbucket/inbucket:edge";
syncthing = "lscr.io/linuxserver/syncthing:1.27.10";
radicale = "tomsquest/docker-radicale:3.2.3.0";
ntfy = "binwiederhier/ntfy:v2.11.0";
forgejo = "codeberg.org/forgejo/forgejo:8.0.1";
pihole = "pihole/pihole:2024.07.0";
immich = "ghcr.io/immich-app/immich-server:v1.114.0";
immich-machine-learning = "ghcr.io/immich-app/immich-machine-learning:v1.114.0";
immich-redis = "docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e";
immich-postgres = "docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0";
kitchenowl = "tombursch/kitchenowl:v0.5.2";
cyberchef = "mpepping/cyberchef:latest";
freshrss = "freshrss/freshrss:1.24.3";
bind9 = "ubuntu/bind9:9.18-22.04_beta";
dnsmasq = "dockurr/dnsmasq:2.90";
attic = "git.kun.is/home/atticd:fd910d91c2143295e959d2c903e9ea25cf94ba27";
hedgedoc = "quay.io/hedgedoc/hedgedoc:1.9.9";
minecraft = "itzg/minecraft-server:latest";
};
}

File diff suppressed because it is too large Load diff

View file

@ -1,11 +0,0 @@
{
imports = [
./storage.nix
./backups.nix
./networking
./data-sharing.nix
./monitoring
./k3s
./tailscale.nix
];
}

View file

@ -16,7 +16,7 @@ in
specialArgs = { inherit self inputs machine machines; };
modules = [
"${self}/configuration.nix"
"${self}/modules"
{ networking.hostName = name; }
];
});