about summary refs log tree commit diff
path: root/static.nix
diff options
context:
space:
mode:
Diffstat (limited to 'static.nix')
-rw-r--r--static.nix14
1 files changed, 7 insertions, 7 deletions
diff --git a/static.nix b/static.nix
index 603b3c0..bdfd73b 100644
--- a/static.nix
+++ b/static.nix
@@ -16,10 +16,9 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with loang configuration.  If not, see <https://www.gnu.org/licenses/>.
 
-{ config, lib, pkgs, ... }:
+{ config, lib, ... }:
 let
-  certs = config.security.acme.certs.${domain};
-  domain = config.networking.domain;
+  inherit (config.networking) domain;
   bindUserDirs = sources: target: lib.mapAttrs' (user: dir: {
     name = target + user;
     value = {
@@ -45,12 +44,13 @@ in {
   };
 
   services = {
-    molly-brown = {
-      certPath = "${certs.directory}/cert.pem";
+    molly-brown = let certDir = config.security.acme.certs.${domain}.directory;
+    in {
+      certPath = "${certDir}/cert.pem";
       docBase = "/var/lib/gemini/${domain}";
       enable = true;
       hostName = domain;
-      keyPath = "${certs.directory}/key.pem";
+      keyPath = "${certDir}/key.pem";
     };
 
     nginx = {
@@ -114,6 +114,6 @@ in {
   };
 
   systemd.services.molly-brown.serviceConfig.SupplementaryGroups = [
-    certs.group
+    config.security.acme.certs.${domain}.group
   ];
 }