about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--irc.nix12
-rw-r--r--mail.nix16
2 files changed, 10 insertions, 18 deletions
diff --git a/irc.nix b/irc.nix
index 9f69ec3..04239bc 100644
--- a/irc.nix
+++ b/irc.nix
@@ -21,11 +21,9 @@ let
   inherit (config.networking) domain;
   cert = config.security.acme.certs.${domain};
 in {
-  environment.systemPackages = [ (pkgs.writeTextFile rec {
-    name = "sojupw";
-    text = let htpasswd = "${pkgs.apacheHttpd}/bin/htpasswd";
-    in ''
-      #!/bin/sh
+  environment.systemPackages = let
+    htpasswd = "${pkgs.apacheHttpd}/bin/htpasswd";
+    sojupw = pkgs.writeShellScriptBin "sojupw" ''
       set -e
       printf 'soju password: '
       read -rs password
@@ -46,9 +44,7 @@ in {
         exit 1
       fi
     '';
-    executable = true;
-    destination = "/bin/${name}";
-  }) ];
+  in [ sojupw ];
 
   networking.firewall.allowedTCPPorts = [ 6697 ];
 
diff --git a/mail.nix b/mail.nix
index 1fd2d01..61b80c1 100644
--- a/mail.nix
+++ b/mail.nix
@@ -76,16 +76,12 @@ in {
       "mta-sts.${domain}" = {
         enableACME = true;
         forceSSL = true;
-        locations."/".root = pkgs.writeTextFile {
-          name = "mta-sts.txt";
-          text = ''
-            version: STSv1
-            mode: enforce
-            max_age: 604800
-            mx: ${hostname}
-          '';
-          destination = "/.well-known/mta-sts.txt";
-        };
+        locations."/".root = pkgs.writeTextDir ".well-known/mta-sts.txt" ''
+          version: STSv1
+          mode: enforce
+          max_age: 604800
+          mx: ${hostname}
+        '';
       };
 
       ${domain}.locations."^~ /.well-known/openpgpkey" = {