grace/dots
dotfiles/nix configs
git clone https://git.gae.moe/grace/dots
c1be8e3
main
1{ 2principals ? ( import ../hosts.nix ). sshPrincipals or [ ], 3extraKeys ? [ ], 4} : 5 6{ 7lib , 8... 9} : 10 11let 12host = import ../hosts.nix ; 13authorizedKeys = lib . concatStringsSep "\n" ( 14import ../ssh-keys.nix { 15inherit host principals extraKeys ; 16} 17); 18in 19{ 20home . activation . authorizedKeys = lib . hm . dag . entryAfter [ "writeBoundary" ] '' 21run mkdir -p "$HOME/.ssh" 22run chmod 700 "$HOME/.ssh" 23 24if [[ -z "''${DRY_RUN:-}" ]]; then 25cat > "$HOME/.ssh/authorized_keys" <<'EOF' 26${ authorizedKeys } 27EOF 28 29chmod 600 "$HOME/.ssh/authorized_keys" 30fi 31'' ; 32}