refactor: Extract all image names

This commit is contained in:
Pim Kunis 2024-07-30 21:28:35 +02:00
parent 872f8fe89e
commit 5a6b9f203a
22 changed files with 80 additions and 131 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{ pkgs, myLib, ... }: {
kubernetes.resources =
let
atticSettings = {
@ -62,7 +62,7 @@
spec = {
containers.attic = {
image = "git.kun.is/home/atticd:fd910d91c2143295e959d2c903e9ea25cf94ba27";
image = myLib.globals.images.attic;
ports.web.containerPort = 8080;
args = [ "-f" "/etc/atticd/config.toml" ];
@ -111,7 +111,7 @@
spec = {
containers.postgres = {
image = "postgres:15";
image = myLib.globals.images.atticPostgres;
imagePullPolicy = "IfNotPresent";
ports.postgres.containerPort = 5432;

View file

@ -1,4 +1,4 @@
{
{ myLib, ... }: {
kubernetes.resources = {
secrets.database.stringData = {
databasePassword = "ref+sops://secrets/kubernetes.yaml#/atuin/databasePassword";
@ -28,7 +28,7 @@
containers = {
atuin = {
image = "ghcr.io/atuinsh/atuin:18.3.0";
image = myLib.globals.images.atuin;
imagePullPolicy = "IfNotPresent";
ports.web.containerPort = 8888;
args = [ "server" "start" ];
@ -51,7 +51,7 @@
};
database = {
image = "postgres:14";
image = myLib.globals.images.atuinPostgres;
ports.web.containerPort = 5432;
env = {

View file

@ -50,7 +50,7 @@ in
spec = {
containers = {
bind9-udp = {
image = "ubuntu/bind9:9.18-22.04_beta";
image = myLib.globals.images.bind9;
envFrom = [{ configMapRef.name = "bind9-env"; }];
ports.dns-udp = {
@ -73,7 +73,7 @@ in
};
bind9-tcp = {
image = "ubuntu/bind9:9.18-22.04_beta";
image = myLib.globals.images.bind9;
envFrom = [{ configMapRef.name = "bind9-env"; }];
ports.dns-tcp = {

View file

@ -1,4 +1,4 @@
{
{ myLib, ... }: {
kubernetes.resources = {
deployments.cyberchef.spec = {
replicas = 3;
@ -8,7 +8,7 @@
metadata.labels.app = "cyberchef";
spec.containers.cyberchef = {
image = "mpepping/cyberchef";
image = myLib.globals.images.cyberchef;
ports.web.containerPort = 8000;
};
};

View file

@ -23,7 +23,7 @@
spec = {
containers.dnsmasq = {
image = "dockurr/dnsmasq:2.90";
image = myLib.globals.images.dnsmasq;
ports.dns = {
containerPort = 53;

View file

@ -27,7 +27,7 @@
enableServiceLinks = false;
containers.forgejo = {
image = "codeberg.org/forgejo/forgejo:7.0.5";
image = myLib.globals.images.forgejo;
imagePullPolicy = "IfNotPresent";
env = {

View file

@ -19,7 +19,7 @@
spec = {
containers.freshrss = {
image = "freshrss/freshrss:1.24.1";
image = myLib.globals.images.freshrss;
imagePullPolicy = "IfNotPresent";
ports.web.containerPort = 80;

View file

@ -1,4 +1,4 @@
{ lib, ... }: {
{ lib, myLib, ... }: {
kubernetes.resources = {
configMaps.hedgedoc-config.data.config = lib.generators.toJSON { } {
useSSL = false;
@ -24,7 +24,7 @@
spec = {
containers.hedgedoc = {
image = "quay.io/hedgedoc/hedgedoc:1.9.9";
image = myLib.globals.images.hedgedoc;
ports.web.containerPort = 3000;
env = {
@ -87,7 +87,7 @@
spec = {
containers.postgres = {
image = "postgres:15";
image = myLib.globals.images.hedgedocPostgres;
imagePullPolicy = "IfNotPresent";
ports.postgres.containerPort = 5432;

View file

@ -28,7 +28,7 @@
enableServiceLinks = false;
containers.immich = {
image = "ghcr.io/immich-app/immich-server:v1.108.0";
image = myLib.globals.images.immich;
imagePullPolicy = "IfNotPresent";
ports.web.containerPort = 3001;
@ -67,7 +67,7 @@
volumes.cache.persistentVolumeClaim.claimName = "cache";
containers.machine-learning = {
image = "ghcr.io/immich-app/immich-machine-learning:v1.108.0";
image = myLib.globals.images.immichML;
imagePullPolicy = "IfNotPresent";
ports.ml.containerPort = 3003;
env.MACHINE_LEARNING_WORKER_TIMEOUT.value = "600";
@ -104,7 +104,7 @@
spec = {
containers.redis = {
image = "docker.io/redis:6.2-alpine@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900";
image = myLib.globals.images.immichRedis;
ports.redis.containerPort = 6379;
imagePullPolicy = "IfNotPresent";
};
@ -137,7 +137,7 @@
volumes.data.persistentVolumeClaim.claimName = "database";
containers.postgres = {
image = "docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0";
image = myLib.globals.images.immichPostgres;
imagePullPolicy = "IfNotPresent";
command = [ "postgres" ];
args = [ "-c" "shared_preload_libraries=vectors.so" "-c" "search_path=\"$$user\", public, vectors" "-c" "logging_collector=on" "-c" "max_wal_size=2GB" "-c" "shared_buffers=512MB" "-c" "wal_compression=on" ];

View file

@ -13,7 +13,7 @@
containers = {
inbucket = {
image = "inbucket/inbucket:edge";
image = myLib.globals.images.inbucket;
ports = {
web.containerPort = 9000;

View file

@ -1,4 +1,4 @@
{
{ myLib, ... }: {
kubernetes.resources = {
secrets.server.stringData.jwtSecretKey = "ref+sops://secrets/kubernetes.yaml#/kitchenowl/jwtSecretKey";
@ -21,7 +21,7 @@
volumes.data.persistentVolumeClaim.claimName = "data";
containers.kitchenowl = {
image = "tombursch/kitchenowl:v0.5.1";
image = myLib.globals.images.kitchenowl;
ports.web.containerPort = 8080;
imagePullPolicy = "IfNotPresent";

View file

@ -7,7 +7,7 @@
metadata.labels.app = "kms";
spec.containers.kms = {
image = "teddysun/kms";
image = myLib.globals.images.kms;
ports.kms.containerPort = 1688;
};
};

View file

@ -24,7 +24,7 @@
spec = {
containers.jellyfin = {
image = "jellyfin/jellyfin:10.9.8";
image = myLib.globals.images.jellyfin;
ports.web.containerPort = 8096;
imagePullPolicy = "IfNotPresent";
@ -95,7 +95,7 @@
spec = {
containers.deluge = {
image = "linuxserver/deluge:2.1.1";
image = myLib.globals.images.deluge;
imagePullPolicy = "IfNotPresent";
env = {
@ -155,7 +155,7 @@
volumes.config.persistentVolumeClaim.claimName = "jellyseerr";
containers.jellyseerr = {
image = "fallenbagel/jellyseerr:1.9.2";
image = myLib.globals.images.jellyseerr;
ports.web.containerPort = 5055;
imagePullPolicy = "IfNotPresent";
@ -201,7 +201,7 @@
spec = {
containers.radarr = {
image = "lscr.io/linuxserver/radarr:5.8.3";
image = myLib.globals.images.radarr;
ports.web.containerPort = 7878;
imagePullPolicy = "IfNotPresent";
@ -261,7 +261,7 @@
volumes.config.persistentVolumeClaim.claimName = "prowlarr";
containers.prowlarr = {
image = "lscr.io/linuxserver/prowlarr:1.21.2";
image = myLib.globals.images.prowlarr;
ports.web.containerPort = 9696;
imagePullPolicy = "IfNotPresent";
@ -308,7 +308,7 @@
spec = {
containers.sonarr = {
image = "lscr.io/linuxserver/sonarr:4.0.8";
image = myLib.globals.images.sonarr;
ports.web.containerPort = 8989;
imagePullPolicy = "IfNotPresent";
@ -366,7 +366,7 @@
spec = {
containers.bazarr = {
image = "lscr.io/linuxserver/bazarr:1.4.3";
image = myLib.globals.images.bazarr;
ports.web.containerPort = 6767;
imagePullPolicy = "IfNotPresent";

View file

@ -10,7 +10,7 @@
# volumes.data.persistentVolumeClaim.claimName = "data";
# containers.minecraft = {
# image = "itzg/minecraft-server";
# image = myLib.globals.images.minecraft;
# ports.minecraft.containerPort = 25565;
# env.EULA.value = "TRUE";

View file

@ -28,7 +28,7 @@
volumes.data.persistentVolumeClaim.claimName = "data";
containers.nextcloud = {
image = "nextcloud:28";
image = myLib.globals.images.nextcloud;
ports.web.containerPort = 80;
env = {
@ -79,7 +79,7 @@
spec = {
containers.postgres = {
image = "postgres:15";
image = myLib.globals.images.nextcloudPostgres;
imagePullPolicy = "IfNotPresent";
ports.postgres.containerPort = 5432;

View file

@ -1,4 +1,4 @@
{ lib, ... }: {
{ lib, myLib, ... }: {
kubernetes.resources = {
configMaps.ntfy.data.config = lib.generators.toYAML { } {
base-url = "https://ntfy.kun.is";
@ -29,7 +29,7 @@
spec = {
containers.ntfy = {
image = "binwiederhier/ntfy:v2.11.0";
image = myLib.globals.images.ntfy;
ports.web.containerPort = 80;
env.TZ.value = "Europe/Amsterdam";
args = [ "serve" ];

View file

@ -31,7 +31,7 @@
volumes.data.persistentVolumeClaim.claimName = "data";
containers.paperless = {
image = "ghcr.io/paperless-ngx/paperless-ngx:2.3";
image = myLib.globals.images.paperless;
imagePullPolicy = "IfNotPresent";
ports.web.containerPort = 8000;
@ -100,7 +100,7 @@
volumes.data.persistentVolumeClaim.claimName = "redisdata";
containers.redis = {
image = "docker.io/library/redis:7";
image = myLib.globals.images.paperlessRedis;
ports.redis.containerPort = 6379;
imagePullPolicy = "IfNotPresent";
@ -141,7 +141,7 @@
spec = {
containers.postgres = {
image = "postgres:15";
image = myLib.globals.images.paperlessPostgres;
ports.postgres.containerPort = 5432;
imagePullPolicy = "IfNotPresent";

View file

@ -19,7 +19,7 @@
spec = {
containers.pihole = {
image = "pihole/pihole:latest";
image = myLib.globals.images.pihole;
env = {
TZ.value = "Europe/Amsterdam";

View file

@ -50,7 +50,7 @@
spec = {
containers.radicale = {
image = "tomsquest/docker-radicale:3.2.2.0";
image = myLib.globals.images.radicale;
ports.web.containerPort = 5232;
imagePullPolicy = "IfNotPresent";

View file

@ -21,7 +21,7 @@
serviceAccountName = "syncthing";
containers.syncthing = {
image = "lscr.io/linuxserver/syncthing:1.23.6";
image = myLib.globals.images.syncthing;
ports.web.containerPort = 8384;
imagePullPolicy = "IfNotPresent";

View file

@ -25,4 +25,42 @@
freshrssIPv4 = "192.168.30.146";
immichIPv4 = "192.168.30.147";
nextcloudIPv4 = "192.168.30.148";
images = {
jellyfin = "jellyfin/jellyfin:10.9.8";
deluge = "linuxserver/deluge:2.1.1";
jellyseerr = "fallenbagel/jellyseerr:1.9.2";
radarr = "lscr.io/linuxserver/radarr:5.8.3";
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";
atuinPostgres = "postgres:14";
kms = "teddysun/kms";
paperless = "ghcr.io/paperless-ngx/paperless-ngx:2.3";
paperlessRedis = "docker.io/library/redis:7";
paperlessPostgres = "postgres:15";
nextcloud = "nextcloud:28";
nextcloudPostgres = "postgres:15";
inbucket = "inbucket/inbucket:edge";
syncthing = "lscr.io/linuxserver/syncthing:1.23.6";
radicale = "tomsquest/docker-radicale:3.2.2.0";
ntfy = "binwiederhier/ntfy:v2.11.0";
forgejo = "codeberg.org/forgejo/forgejo:7.0.5";
pihole = "pihole/pihole:latest";
immich = "ghcr.io/immich-app/immich-server:v1.108.0";
immichML = "ghcr.io/immich-app/immich-machine-learning:v1.108.0";
immichRedis = "docker.io/redis:6.2-alpine@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900";
immichPostgres = "docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0";
kitchenowl = "tombursch/kitchenowl:v0.5.1";
cyberchef = "mpepping/cyberchef";
freshrss = "freshrss/freshrss:1.24.1";
bind9 = "ubuntu/bind9:9.18-22.04_beta";
dnsmasq = "dockurr/dnsmasq:2.90";
attic = "git.kun.is/home/atticd:fd910d91c2143295e959d2c903e9ea25cf94ba27";
atticPostgres = "postgres:15";
hedgedoc = "quay.io/hedgedoc/hedgedoc:1.9.9";
hedgedocPostgres = "postgres:15";
minecraft = "itzg/minecraft-server";
};
}

View file

@ -1,89 +0,0 @@
{ lib, ... }: {
options.lab = {
networking = {
public = {
ipv4 = {
router = lib.mkOption {
type = lib.types.str;
description = ''
Public IPv4 address of the router.
'';
};
};
ipv6 = {
router = lib.mkOption {
type = lib.types.str;
description = ''
Publicly routable IPv6 address of the router.
'';
};
};
};
dmz = {
ipv4 = {
prefixLength = lib.mkOption {
type = lib.types.str;
description = ''
IPv4 prefix length of DMZ network.
'';
};
dockerSwarm = lib.mkOption {
type = lib.types.str;
description = ''
IPv4 address of the Docker Swarm in the DMZ.
'';
};
router = lib.mkOption {
type = lib.types.str;
description = ''
The router's IPv4 address on the DMZ network.
'';
};
services = lib.mkOption {
type = lib.types.str;
description = ''
The IPv4 address of the interface serving DHCP and DNS on the DMZ network.
'';
};
};
ipv6 = {
prefixLength = lib.mkOption {
type = lib.types.str;
description = ''
IPv6 prefix length of DMZ network.
'';
};
dockerSwarm = lib.mkOption {
type = lib.types.str;
description = ''
Globally routable IPv6 address of the Docker Swarm.
'';
};
router = lib.mkOption {
type = lib.types.str;
description = ''
The router's IPv6 address on the DMZ network.
'';
};
services = lib.mkOption {
type = lib.types.str;
description = ''
The IPv6 address of the interface serving DHCP and DNS on the DMZ network.
'';
};
};
};
};
};
}