From 47b7eb8fd946cd4b8a62fc518147491479b5b925 Mon Sep 17 00:00:00 2001 From: Leona Maroni Date: Mon, 19 Feb 2024 23:27:56 +0100 Subject: [PATCH] nixos/vikunja: remove setupNginx option The required nginx configuration is now really simple, and e.g. SSL/ACME already required the user to interact with `services.nginx.virtualHosts`. Therefore, and to reduce complexity, we now leave the web server configuration to the user. --- .../manual/release-notes/rl-2405.section.md | 2 ++ nixos/modules/services/web-apps/vikunja.nix | 30 +++---------------- nixos/tests/vikunja.nix | 14 +++++++-- 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 38ac9e00318d..746259b19ea0 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -132,6 +132,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - The `services.vikunja` systemd service now uses `vikunja` as dynamic user instead of `vikunja-api`. Database users might need to be changed. +- The `services.vikunja.setupNginx` setting has been removed. Users now need to setup the webserver configuration on their own with a proxy pass to the vikunja service. + - The `woodpecker-*` packages have been updated to v2 which includes [breaking changes](https://woodpecker-ci.org/docs/next/migrations#200). - `services.nginx` will no longer advertise HTTP/3 availability automatically. This must now be manually added, preferably to each location block. diff --git a/nixos/modules/services/web-apps/vikunja.nix b/nixos/modules/services/web-apps/vikunja.nix index 1bba08421601..efa9c676d9a5 100644 --- a/nixos/modules/services/web-apps/vikunja.nix +++ b/nixos/modules/services/web-apps/vikunja.nix @@ -9,6 +9,10 @@ let useMysql = cfg.database.type == "mysql"; usePostgresql = cfg.database.type == "postgres"; in { + imports = [ + (mkRemovedOptionModule [ "services" "vikunja" "setupNginx" ] "services.vikunja no longer supports the automatic set up of a nginx virtual host. Set up your own webserver config with a proxy pass to the vikunja service.") + ]; + options.services.vikunja = with lib; { enable = mkEnableOption (lib.mdDoc "vikunja service"); package = mkPackageOption pkgs "vikunja" { }; @@ -20,25 +24,10 @@ in { For example passwords should be set in one of these files. ''; }; - setupNginx = mkOption { - type = types.bool; - default = config.services.nginx.enable; - defaultText = literalExpression "config.services.nginx.enable"; - description = lib.mdDoc '' - Whether to setup NGINX. - Further nginx configuration can be done by changing - {option}`services.nginx.virtualHosts.`. - This does not enable TLS or ACME by default. To enable this, set the - {option}`services.nginx.virtualHosts..enableACME` to - `true` and if appropriate do the same for - {option}`services.nginx.virtualHosts..forceSSL`. - ''; - }; frontendScheme = mkOption { type = types.enum [ "http" "https" ]; description = lib.mdDoc '' Whether the site is available via http or https. - This does not configure https or ACME in nginx! ''; }; frontendHostname = mkOption { @@ -120,17 +109,6 @@ in { }; }; - services.nginx.virtualHosts."${cfg.frontendHostname}" = mkIf cfg.setupNginx { - locations = { - "/" = { - proxyPass = "http://localhost:${toString cfg.port}"; - extraConfig = '' - client_max_body_size 20M; - ''; - }; - }; - }; - environment.etc."vikunja/config.yaml".source = configFile; environment.systemPackages = [ diff --git a/nixos/tests/vikunja.nix b/nixos/tests/vikunja.nix index 07d67f225a76..4e2bf166a7b6 100644 --- a/nixos/tests/vikunja.nix +++ b/nixos/tests/vikunja.nix @@ -13,7 +13,12 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { frontendScheme = "http"; frontendHostname = "localhost"; }; - services.nginx.enable = true; + services.nginx = { + enable = true; + virtualHosts."http://localhost" = { + locations."/".proxyPass = "http://localhost:3456"; + }; + }; }; vikunjaPostgresql = { pkgs, ... }: { services.vikunja = { @@ -37,7 +42,12 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { } ]; }; - services.nginx.enable = true; + services.nginx = { + enable = true; + virtualHosts."http://localhost" = { + locations."/".proxyPass = "http://localhost:9090"; + }; + }; }; };