From 2cb2e0fa71d86ca8a621d023b7ed139d34826e8c Mon Sep 17 00:00:00 2001 From: Nydragon Date: Wed, 2 Oct 2024 19:05:33 +0200 Subject: [PATCH] feat: update kitchenowl to use the beta all in one docker compose file --- hosts/shan/configuration.nix | 1 + modules/programs/sway.nix | 1 - options/container/kitchenowl/default.nix | 46 +++++------------------- 3 files changed, 10 insertions(+), 38 deletions(-) diff --git a/hosts/shan/configuration.nix b/hosts/shan/configuration.nix index 60946a3..ecf2aff 100644 --- a/hosts/shan/configuration.nix +++ b/hosts/shan/configuration.nix @@ -23,6 +23,7 @@ container.kitchenowl = { enable = true; openFirewall = true; + version = "v0.5.2"; }; server = { diff --git a/modules/programs/sway.nix b/modules/programs/sway.nix index cd50ec6..599309c 100644 --- a/modules/programs/sway.nix +++ b/modules/programs/sway.nix @@ -12,7 +12,6 @@ lib.mkIf config.programs.sway.enable { grim slurp wl-clipboard - swaynotificationcenter swaybg swaylock swayidle diff --git a/options/container/kitchenowl/default.nix b/options/container/kitchenowl/default.nix index afcc04b..34a6f96 100644 --- a/options/container/kitchenowl/default.nix +++ b/options/container/kitchenowl/default.nix @@ -6,7 +6,7 @@ }: let inherit (lib) mkIf mkOption mkEnableOption; - inherit (lib.types) port bool; + inherit (lib.types) port bool string; cfg = config.modules.container.kitchenowl; in { @@ -20,6 +20,10 @@ in type = bool; default = false; }; + version = mkOption { + type = string; + default = "latest"; + }; }; config = mkIf cfg.enable { @@ -27,37 +31,23 @@ in networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ]; - # Containers virtualisation.oci-containers.containers."kitchenowl-back" = { - image = "tombursch/kitchenowl:latest"; + image = "tombursch/kitchenowl:${toString cfg.version}"; environment = { "JWT_SECRET_KEY" = "PLEASE_CHANGE_ME"; }; volumes = [ "kitchenowl_kitchenowl_data:/data:rw" ]; + ports = [ + "${toString cfg.port}:8080/tcp" + ]; log-driver = "journald"; extraOptions = [ "--network-alias=back" "--network=kitchenowl_default" ]; }; - virtualisation.oci-containers.containers."kitchenowl-front" = { - image = "tombursch/kitchenowl-web:latest"; - ports = [ - "${toString cfg.port}:80/tcp" - ]; - dependsOn = [ - "kitchenowl-back" - ]; - log-driver = "journald"; - extraOptions = [ - "--hostname=kitchenowl" - "--network-alias=front" - "--network=kitchenowl_default" - ]; - }; - systemd.services."podman-kitchenowl-back" = { serviceConfig = { Restart = lib.mkOverride 500 "always"; @@ -78,24 +68,6 @@ in ]; }; - systemd.services."podman-kitchenowl-front" = { - serviceConfig = { - Restart = lib.mkOverride 500 "always"; - }; - after = [ - "podman-network-kitchenowl_default.service" - ]; - requires = [ - "podman-network-kitchenowl_default.service" - ]; - partOf = [ - "podman-compose-kitchenowl-root.target" - ]; - wantedBy = [ - "podman-compose-kitchenowl-root.target" - ]; - }; - # Networks systemd.services."podman-network-kitchenowl_default" = { path = [ pkgs.podman ];