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.
This commit is contained in:
Leona Maroni 2024-02-19 23:27:56 +01:00
parent 8817f080cc
commit 47b7eb8fd9
No known key found for this signature in database
GPG Key ID: D5B08ADFC75E3605
3 changed files with 18 additions and 28 deletions

View File

@ -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.

View File

@ -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.<frontendHostname>`.
This does not enable TLS or ACME by default. To enable this, set the
{option}`services.nginx.virtualHosts.<frontendHostname>.enableACME` to
`true` and if appropriate do the same for
{option}`services.nginx.virtualHosts.<frontendHostname>.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 = [

View File

@ -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";
};
};
};
};