From 2ce14f17f2700f3188e3467d35fa218c018e9c73 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Tue, 21 Feb 2023 06:59:08 +0900 Subject: Clean up --- static.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'static.nix') 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 . -{ 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 ]; } -- cgit 1.4.1