From e49b33fe446ca5a47f9eb04b5163609835db3dad Mon Sep 17 00:00:00 2001 From: tdback Date: Thu, 9 Jan 2025 20:31:34 -0500 Subject: fix: cleanup container configs --- modules/containers/freshrss/default.nix | 8 +++----- modules/containers/jellyfin/default.nix | 8 +++----- modules/containers/lubelogger/default.nix | 6 +++--- modules/containers/pinchflat/default.nix | 20 ++++++++------------ modules/containers/vaultwarden/default.nix | 14 +++++--------- 5 files changed, 22 insertions(+), 34 deletions(-) diff --git a/modules/containers/freshrss/default.nix b/modules/containers/freshrss/default.nix index 3854a8e..5f352a7 100644 --- a/modules/containers/freshrss/default.nix +++ b/modules/containers/freshrss/default.nix @@ -1,18 +1,16 @@ { lib, ... }: let + inherit (lib.lists) singleton; directory = "/opt/freshrss"; port = "8888"; in { - systemd.tmpfiles.rules = - map (x: "d ${x} 0755 share share - -") (lib.lists.singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); virtualisation.oci-containers.containers.freshrss = { image = "freshrss/freshrss:latest"; autoStart = true; - ports = [ - "${port}:80" - ]; + ports = singleton "${port}:80"; volumes = [ "${directory}/data:/var/www/FreshRSS/data" "${directory}/extensions:/var/www/FreshRSS/extensions" diff --git a/modules/containers/jellyfin/default.nix b/modules/containers/jellyfin/default.nix index d9c26cb..d4923ae 100644 --- a/modules/containers/jellyfin/default.nix +++ b/modules/containers/jellyfin/default.nix @@ -1,18 +1,16 @@ { lib, ... }: let + inherit (lib.lists) singleton; directory = "/opt/jellyfin"; in { - systemd.tmpfiles.rules = - map (x: "d ${x} 0755 share share - -") (lib.lists.singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); virtualisation.oci-containers.containers.jellyfin = { image = "jellyfin/jellyfin:latest"; autoStart = true; user = "994:994"; - ports = [ - "8096:8096/tcp" - ]; + ports = singleton "8096:8096/tcp"; volumes = [ "${directory}/config:/config" "${directory}/cache:/cache" diff --git a/modules/containers/lubelogger/default.nix b/modules/containers/lubelogger/default.nix index eb3f58f..37155dc 100644 --- a/modules/containers/lubelogger/default.nix +++ b/modules/containers/lubelogger/default.nix @@ -1,16 +1,16 @@ { lib, ... }: let + inherit (lib.lists) singleton; directory = "/opt/lubelogger"; port = "8889"; in { - systemd.tmpfiles.rules = - builtins.map (x: "d ${x} 0755 share share - -") (lib.lists.singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); virtualisation.oci-containers.containers.lubelogger = { image = "ghcr.io/hargata/lubelogger:latest"; autoStart = true; - ports = [ "${port}:8080" ]; + ports = singleton "${port}:8080"; volumes = [ "${directory}/config:/App/config" "${directory}/data:/App/data" diff --git a/modules/containers/pinchflat/default.nix b/modules/containers/pinchflat/default.nix index 8ee831f..996476d 100644 --- a/modules/containers/pinchflat/default.nix +++ b/modules/containers/pinchflat/default.nix @@ -1,23 +1,19 @@ -{ ... }: +{ lib, ... }: let - directories = [ - "/opt/pinchflat" - ]; + inherit (lib.lists) singleton; + directory = "/opt/pinchflat"; in { - systemd.tmpfiles.rules = map (x: "d ${x} 0755 share share - -") directories; + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); + virtualisation.oci-containers.containers.pinchflat = { image = "keglin/pinchflat:latest"; autoStart = true; - ports = [ - "8945:8945" - ]; + ports = singleton "8945:8945"; volumes = [ - "/opt/pinchflat:/config" + "${directory}:/config" "/tank/media/yt:/downloads" ]; - environment = { - TZ = "America/Detroit"; - }; + environment.TZ = "America/Detroit"; }; } diff --git a/modules/containers/vaultwarden/default.nix b/modules/containers/vaultwarden/default.nix index cc6b86f..185fde1 100644 --- a/modules/containers/vaultwarden/default.nix +++ b/modules/containers/vaultwarden/default.nix @@ -1,22 +1,18 @@ { lib, ... }: let - directory = "/opt/vaultwarden"; + inherit (lib.lists) singleton; + directory = singleton "/opt/vaultwarden"; domain = "steel-mountain.brownbread.net"; port = "11001"; in { - systemd.tmpfiles.rules = - map (x: "d ${x} 0755 share share - -") (lib.lists.singleton directory); + systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory); virtualisation.oci-containers.containers.vaultwarden = { image = "vaultwarden/server:latest"; autoStart = true; - ports = [ - "${port}:80" - ]; - volumes = [ - "${directory}/data:/data" - ]; + ports = singleton "${port}:80"; + volumes = singleton "${directory}/data:/data"; environment = { DOMAIN = domain; WEBSOCKET_ENABLED = "true"; -- cgit v1.2.3