about summary refs log tree commit diff
path: root/nixos/modules/services/web-apps/lemmy.nix
diff options
context:
space:
mode:
authorBrian Leung <leungbk@posteo.net>2022-09-19 00:09:38 -0700
committerYt <happysalada@proton.me>2022-09-19 11:34:08 -0400
commit2c8e67bf6b88d8cffc67cdbfbc018061388f2b64 (patch)
tree40999352232b4540c2e6dfe16410e61f49b0633e /nixos/modules/services/web-apps/lemmy.nix
parentd15db11db14e85bc7654ed95409d6ae3df4466ae (diff)
downloadnixlib-2c8e67bf6b88d8cffc67cdbfbc018061388f2b64.tar
nixlib-2c8e67bf6b88d8cffc67cdbfbc018061388f2b64.tar.gz
nixlib-2c8e67bf6b88d8cffc67cdbfbc018061388f2b64.tar.bz2
nixlib-2c8e67bf6b88d8cffc67cdbfbc018061388f2b64.tar.lz
nixlib-2c8e67bf6b88d8cffc67cdbfbc018061388f2b64.tar.xz
nixlib-2c8e67bf6b88d8cffc67cdbfbc018061388f2b64.tar.zst
nixlib-2c8e67bf6b88d8cffc67cdbfbc018061388f2b64.zip
nixos/lemmy: settings.database.createLocally -> database.createLocally
Co-authored-by: Shahar Dawn Or <mightyiampresence@gmail.com>
Co-authored-by: Ctem <c@ctem.me>
Co-authored-by: a-kenji <aks.kenji@protonmail.com>
Diffstat (limited to 'nixos/modules/services/web-apps/lemmy.nix')
-rw-r--r--nixos/modules/services/web-apps/lemmy.nix13
1 files changed, 6 insertions, 7 deletions
diff --git a/nixos/modules/services/web-apps/lemmy.nix b/nixos/modules/services/web-apps/lemmy.nix
index 7f619489893e..925156e7c4ab 100644
--- a/nixos/modules/services/web-apps/lemmy.nix
+++ b/nixos/modules/services/web-apps/lemmy.nix
@@ -28,6 +28,8 @@ in
 
     caddy.enable = mkEnableOption (lib.mdDoc "exposing lemmy with the caddy reverse proxy");
 
+    database.createLocally = mkEnableOption (lib.mdDoc "creation of database on the instance");
+
     settings = mkOption {
       default = { };
       description = lib.mdDoc "Lemmy configuration";
@@ -63,9 +65,6 @@ in
             description = lib.mdDoc "The difficultly of the captcha to solve.";
           };
         };
-
-        options.database.createLocally = mkEnableOption (lib.mdDoc "creation of database on the instance");
-
       };
     };
 
@@ -142,7 +141,7 @@ in
       };
 
       assertions = [{
-        assertion = cfg.settings.database.createLocally -> localPostgres;
+        assertion = cfg.database.createLocally -> localPostgres;
         message = "if you want to create the database locally, you need to use a local database";
       }];
 
@@ -163,9 +162,9 @@ in
 
         wantedBy = [ "multi-user.target" ];
 
-        after = [ "pict-rs.service" ] ++ lib.optionals cfg.settings.database.createLocally [ "lemmy-postgresql.service" ];
+        after = [ "pict-rs.service" ] ++ lib.optionals cfg.database.createLocally [ "lemmy-postgresql.service" ];
 
-        requires = lib.optionals cfg.settings.database.createLocally [ "lemmy-postgresql.service" ];
+        requires = lib.optionals cfg.database.createLocally [ "lemmy-postgresql.service" ];
 
         serviceConfig = {
           DynamicUser = true;
@@ -203,7 +202,7 @@ in
         };
       };
 
-      systemd.services.lemmy-postgresql = mkIf cfg.settings.database.createLocally {
+      systemd.services.lemmy-postgresql = mkIf cfg.database.createLocally {
         description = "Lemmy postgresql db";
         after = [ "postgresql.service" ];
         partOf = [ "lemmy.service" ];