Nix configurations for my homelab
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

caddy: modify cp-certs save location and file permissions

yemou 181b90ef b8eedc02

+4 -7
+4 -7
modules/services/caddy/cp-certs.nix
··· 1 - { config, pkgs, ... }: 1 + { pkgs, ... }: 2 2 let 3 3 cpCerts = pkgs.writeShellApplication { 4 4 name = "cpCerts"; 5 5 runtimeInputs = with pkgs; [ coreutils ]; 6 6 text = '' 7 7 prog_name=''${0##*/} 8 - certs_dir="/nfs/caddy-certs" 8 + certs_dir="/var/ssl" 9 9 10 10 case $1 in 11 11 "proxy.butwho.org" | "pubsub.butwho.org" | "upload.butwho.org" | "muc.butwho.org" | "butwho.org" ) ··· 15 15 mkdir -p "$certs_dir/$1" 16 16 cp -f "$caddy_path/$2" "$certs_dir/$1" 17 17 cp -f "$caddy_path/$3" "$certs_dir/$1" 18 + chmod 604 "$certs_dir/$1/$1.crt" "$certs_dir/$1/$1.key" 18 19 19 20 printf '%s\n' "$prog_name: Copied certs for '$1'" 20 21 ;; ··· 27 28 { 28 29 environment.persistence."/data/persistent".directories = [ 29 30 { 30 - directory = "/nfs/caddy-certs"; 31 + directory = "/var/ssl"; 31 32 mode = "0755"; 32 33 user = "caddy"; 33 34 group = "caddy"; 34 35 } 35 36 ]; 36 - 37 - services.nfs.server.exports = '' 38 - /nfs/caddy-certs ${config.garden.info.network.lily.netbird-ip}(ro,nohide,insecure,no_subtree_check) 39 - ''; 40 37 41 38 services.caddy.globalConfig = '' 42 39 events {