about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--irc.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/irc.nix b/irc.nix
index 2d03c5c..671b872 100644
--- a/irc.nix
+++ b/irc.nix
@@ -23,8 +23,10 @@ let
 in {
   environment.systemPackages = [ (pkgs.writeTextFile rec {
     name = "sojupw";
-    text = ''
+    text = let htpasswd = "${pkgs.apacheHttpd}/bin/htpasswd";
+    in ''
       #!/bin/sh
+      set -e
       printf 'soju password: '
       read -rs password
       printf '\nretype soju password: '
@@ -32,8 +34,8 @@ in {
 
       file=$(mktemp)
       trap 'rm $file' EXIT
-      htpasswd -bBC 10 $file "" $password 2> /dev/null
-      if htpasswd -bv $file "" $confirmation 2> /dev/null
+      ${htpasswd} -bBC 10 $file "" $password 2> /dev/null
+      if ${htpasswd} -bv $file "" $confirmation 2> /dev/null
       then
         printf '\nbcrypt: '
         cat $file | tr -d ':\n'