diff --git a/hosts/hl-fwdesk.nix b/hosts/hl-fwdesk.nix index a193c26..d211987 100644 --- a/hosts/hl-fwdesk.nix +++ b/hosts/hl-fwdesk.nix @@ -225,10 +225,8 @@ in PUID = "1000"; PGID = "100"; }; - extraConfig = { - shm_size = "1g"; - extra_hosts = [ "host.docker.internal:host-gateway" ]; - }; + shm_size = "1g"; + extra_hosts = [ "host.docker.internal:host-gateway" ]; }; }; # Signal CLI diff --git a/hosts/hl-minipc1.nix b/hosts/hl-minipc1.nix index cc164bd..3c2564f 100644 --- a/hosts/hl-minipc1.nix +++ b/hosts/hl-minipc1.nix @@ -1,9 +1,12 @@ -{ ... }: +{ config, ... }: let ports = { audiobookshelf = 8000; nixServe = 5000; dockerRegistry = 5001; + postgres = 5432; + ssh = 22; + iu = 1947; }; gitea = { user = "gitea"; @@ -18,7 +21,9 @@ let ports.audiobookshelf gitea.sshPort gitea.httpPort - 22 + ports.postgres + ports.ssh + ports.iu ]; in { @@ -88,6 +93,35 @@ in }; }; + skyg.nixos.common.container-services.iu = { + services = { + db = { + image = "postgres:18"; + ports = [ + "${toString ports.postgres}:5432" + ]; + volumes = [ + "/var/lib/iu:/opt/data" + ]; + environmentFiles = [ config.age.secrets.iu-project.path ]; + networks = [ "main" ]; + }; + iu = { + image = "minipc1.lab.internal:5001/iu:2026.07.12-ac2c604"; + ports = [ + "${toString ports.iu}:1947" + ]; + volumes = [ + ]; + environmentFiles = [ + ]; + networks = [ + "main" + ]; + }; + }; + }; + # Certbot TLS service skyg.server.dns.certbot = { enable = false; diff --git a/hosts/hl-minipc2.nix b/hosts/hl-minipc2.nix index 2b22162..ecfe85a 100644 --- a/hosts/hl-minipc2.nix +++ b/hosts/hl-minipc2.nix @@ -67,10 +67,7 @@ "scrypted-nvr:/nvr" ]; environment.SCRYPTED_NVR_VOLUME = "/nvr"; - extraConfig = { - network_mode = "host"; - networks = [ ]; - }; + network_mode = "host"; }; volumes = { scrypted-nvr = { diff --git a/modules/nixos/common/containers/container-services/compose.nix b/modules/nixos/common/containers/container-services/compose.nix index 2ce78d2..0d7448b 100644 --- a/modules/nixos/common/containers/container-services/compose.nix +++ b/modules/nixos/common/containers/container-services/compose.nix @@ -39,6 +39,15 @@ rec { // lib.optionalAttrs (svcCfg.deploy != { }) { deploy = svcCfg.deploy; } + // lib.optionalAttrs (svcCfg.extra_hosts != [ ]) { + extra_hosts = svcCfg.extra_hosts; + } + // lib.optionalAttrs (svcCfg.shm_size != null) { + shm_size = svcCfg.shm_size; + } + // lib.optionalAttrs (svcCfg.network_mode != null) { + network_mode = svcCfg.network_mode; + } // svcCfg.extraConfig; # Build the full compose document attrset for a group. diff --git a/modules/nixos/common/containers/container-services/options.nix b/modules/nixos/common/containers/container-services/options.nix index 846aa95..cf033e1 100644 --- a/modules/nixos/common/containers/container-services/options.nix +++ b/modules/nixos/common/containers/container-services/options.nix @@ -129,6 +129,31 @@ ''; }; + extra_hosts = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + description = '' + Additional host entries to add to the container's /etc/hosts file. + ''; + }; + + shm_size = lib.mkOption { + type = lib.types.optional lib.types.str; + default = null; + description = '' + Size of the shared memory segment to allocate. + ''; + }; + + network_mode = lib.mkOption { + type = lib.types.optional lib.types.str; + default = null; + description = '' + Network mode to use for the container. + Set to "host" to use the host's network stack. + ''; + }; + files = lib.mkOption { type = lib.types.attrsOf lib.types.str; default = { }; @@ -146,8 +171,7 @@ default = { }; description = '' Free-form attrset merged directly into the compose service - block. Use this for keys not modelled above: - shm_size, cap_add, ulimits, etc. + block. Use this for keys not modelled above. ''; }; diff --git a/secrets/iu-project.age b/secrets/iu-project.age new file mode 100644 index 0000000..db834dd --- /dev/null +++ b/secrets/iu-project.age @@ -0,0 +1,8 @@ +age-encryption.org/v1 +-> ssh-ed25519 CIR0mA RyS/sxPxXWdb6q5asrgqNlF6Bsc4vUsXlgvuowHcDUk +egUa2BN2Beqj0wo/tTWV61BmWqesX4W8IGiIUWvRcwY +-> ssh-ed25519 LuJNQA MPx6UOrVyrJjbuxYARFGp0OFXD5iMFypCsDtjXTJYUc +UCXdNZU2YqjkROdmHdiAhja0eo3DEorhgWjsumxgbww +--- FHjBtaqTnM8QZmyOuxMLzFc2P0WpePbyhmrXTxXcdgo +g Ç`Ú¶E«ôm´Î#cô5¤+BÞüÝwi›îcšŽd5Œ´®- {®:•¤sÈ`æN–xý‚É•×Ìšvteöa¨ +ÇX!ºn2kA™ÿϨ6·Ükxü©¿"FýØHxÛœÉpâÒâãªÐ�¤Û£&ô¨Ò±8ƒ{ Ðú‹Ç� \ No newline at end of file