From 6468c493b43f28e2e4d6a803509c054014079dda Mon Sep 17 00:00:00 2001 From: Brian Lee Date: Sat, 22 Feb 2025 17:54:04 -0800 Subject: [PATCH] litten: add mealie --- litten.brenise.dev/configuration.nix | 103 +++++++++------------------ 1 file changed, 32 insertions(+), 71 deletions(-) diff --git a/litten.brenise.dev/configuration.nix b/litten.brenise.dev/configuration.nix index 0ec996a..d1f50d5 100644 --- a/litten.brenise.dev/configuration.nix +++ b/litten.brenise.dev/configuration.nix @@ -44,13 +44,15 @@ in }; nixpkgs.overlays = [ (self: super: { + n8n = unstable.n8n; + ansible = super.ansible.overrideAttrs (oldAttrs: { propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [ super.python312Packages.jmespath ]; }); # Add jmespath to ansible build inputs - }) -# (self: super: { + + # https://blaukraut.info/ # charlatan3 = super.callPackage ./overlays/clap/charlatan3.nix { }; -# }) # https://blaukraut.info/ + }) ]; imports = [ @@ -113,8 +115,6 @@ in users = { groups = { glance = {}; - n8n = {}; - mealie = {}; }; users = { @@ -134,11 +134,8 @@ in "adbusers" "docker" "glance" - "n8n" - "mealie" ]; packages = with pkgs; [ - # unstable.n8n # unstable.goose-cli gh solaar @@ -213,28 +210,6 @@ in # shell = pkgs.bash; }; - n8n = { - isSystemUser = true; - group = "n8n"; - home = "/var/lib/n8n"; - createHome = true; - description = "System account for n8n"; - shell = pkgs.bashInteractive; - packages = with pkgs; [ - unstable.n8n - ]; - }; - - mealie = { - isSystemUser = true; - group = "mealie"; - description = "Mealie service user"; - home = "/var/lib/mealie"; - createHome = true; - packages = with pkgs; [ - unstable.mealie - ]; - }; }; }; # home-manager.users.blee = { imports = [ ./home.nix ]; }; @@ -470,6 +445,11 @@ in reverse_proxy http://127.0.0.1:8034 } + ${host_fqdn}:4435 { # mealie + ${tlsConfig} + reverse_proxy http://127.0.0.1:8035 + } + :9999 { respond "success" } @@ -487,7 +467,6 @@ in tandoor-recipes = { enable = true; - # address = "127.0.0.1"; port = 8034; extraConfig = { # https://github.com/TandoorRecipes/recipes/raw/refs/heads/develop/docs/system/configuration.md @@ -495,52 +474,28 @@ in ALLOWED_HOSTS = "${host_fqdn}"; TANDOOR_PORT = "8034"; }; + package = unstable.tandoor-recipes; + }; + + mealie = { + enable = true; + port = 8035; + listenAddress = "127.0.0.1"; + package = unstable.mealie; + }; + + n8n = { + enable = true; + settings = { + port = 8033; + }; + }; }; systemd = { - services.mealie = { - enable = true; - description = "Mealie"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - User = "mealie"; - Group = "mealie"; - WorkingDirectory = "/var/lib/mealie"; - ExecStart = "${pkgs.mealie}/bin/mealie"; - Restart = "on-failure"; - RestartSec = "1m"; - Environment = [ - "MEALIE_PORT=8035" - ]; - }; - }; - - services.n8n = { - enable = true; - description = "n8n"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - User = "n8n"; - Group = "n8n"; - ExecStart = "${unstable.n8n}/bin/n8n"; - Restart = "on-failure"; - RestartSec = "1m"; - Environment = [ - "N8N_PORT=8033" - "N8N_EDITOR_BASE_URL=https://${host_fqdn}:4433" - "N8N_HIRING_BANNER_ENABLED=false" - "N8N_METRICS=true" - ]; - }; - }; - services.glance = { wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; @@ -565,6 +520,12 @@ in script = "${pkgs.nix}/bin/nix-shell"; }; + services.n8n.environment = { + N8N_EDITOR_BASE_URL = "https://${config.networking.hostName}:4433"; + N8N_HIRING_BANNER_ENABLED = "false"; + N8N_METRICS = "true"; + }; + }; virtualisation.docker = {