forked from
lass.pds.lassul.us/superconfig
This repository has no description
643 B
17 lines
1# clan vars generator for one radicale user: a random password plus its
2# bcrypt htpasswd line. Imported by configs/radicale.nix for every user, and
3# by the machines of users whose generator is shared (hermes on coaxmetal):
4# a shared generator must be defined identically on every machine using it.
5pkgs: user: {
6 files."htpasswd-line" = { };
7 files."password" = { };
8 runtimeInputs = with pkgs; [
9 apacheHttpd
10 coreutils
11 ];
12 script = ''
13 password=$(head -c 32 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 24)
14 echo "$password" > "$out/password"
15 htpasswd -nbB ${user} "$password" > "$out/htpasswd-line"
16 '';
17}