summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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 = {};
};