summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorstuebinm2024-02-14 23:37:08 +0100
committerstuebinm2024-02-14 23:37:08 +0100
commit9f230e2b7a2fb077b3405e320b56a205ce3e085e (patch)
treeb4903385b27294506f25d75d0720c04323367128 /modules
parent4b3096a7022f2785b58eddfe5f1d98eed0495165 (diff)
modules/bookwyrm: whoops, that's not how the module system works
Diffstat (limited to '')
-rw-r--r--modules/bookwyrm.nix39
1 files changed, 25 insertions, 14 deletions
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 = {};
};