about summary refs log tree commit diff
path: root/static.nix
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2023-02-21 06:59:08 +0900
committerNguyễn Gia Phong <mcsinyx@disroot.org>2023-02-21 07:01:00 +0900
commit2ce14f17f2700f3188e3467d35fa218c018e9c73 (patch)
treef3956e3f6ad2428ab9d5e3fd55e684ce3a3050b5 /static.nix
parentbfa417e9a2790cd506393559207a751201d2159d (diff)
downloadnixos-conf-2ce14f17f2700f3188e3467d35fa218c018e9c73.tar.gz
Clean up
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
   ];
 }