From 9f230e2b7a2fb077b3405e320b56a205ce3e085e Mon Sep 17 00:00:00 2001 From: stuebinm Date: Wed, 14 Feb 2024 23:37:08 +0100 Subject: modules/bookwyrm: whoops, that's not how the module system works --- modules/bookwyrm.nix | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'modules') diff --git a/modules/bookwyrm.nix b/modules/bookwyrm.nix index 4fcc323..a55d115 100644 --- a/modules/bookwyrm.nix +++ b/modules/bookwyrm.nix @@ -88,15 +88,19 @@ in bookwyrm = { enable = true; wantedBy = [ "multi-user.target" ]; - serviceConfig = { - BindPaths = [ - cfg.package.passthru.gunicorn - cfg.package.passthru.celery - cfg.stateDir - ]; - } // mkIf (cfg.bindAddress != "0.0.0.0" || cfg.port != 8000 || cfg.threads != 8) { - ExecStart = "${lib.getExe cfg.package.passthru.gunicorn} bookwyrm.wsgi:application --threads=${toString cfg.threads} --bind ${cfg.bindAddress}:${toString cfg.port}"; - }; + serviceConfig = mkMerge [ + { + BindPaths = [ + cfg.package.passthru.gunicorn + cfg.package.passthru.celery + cfg.stateDir + ]; + } + (mkIf (cfg.bindAddress != "0.0.0.0" || cfg.port != 8000 || cfg.threads != 8) { + ExecStart = "${lib.getExe cfg.package.passthru.gunicorn} bookwyrm.wsgi:application --threads=${toString cfg.threads} --bind ${cfg.bindAddress}:${toString cfg.port}"; + + }) + ]; environment.PYTHONPATH = cfg.package.passthru.pythonPath; }; @@ -129,11 +133,18 @@ in }; }; - users.users.bookwyrm = { - isSystemUser = true; - group = "bookwyrm"; - }; - users.users.nginx.extraGroups = [ "bookwyrm" ]; + users.users = mkMerge [ + { + bookwyrm = { + isSystemUser = true; + group = "bookwyrm"; + }; + } + (mkIf cfg.setupNginx { + nginx.extraGroups = [ "bookwyrm" ]; + }) + ]; + users.groups.bookwyrm = {}; }; -- cgit v1.2.3