grace/dots

dotfiles/nix configs

git clone https://git.gae.moe/grace/dots

Grace Yoderhamano againa4b6f88

wafrn-testing
811 B31 linesraw
1{
2  principals,
3  extraKeys ? [ ],
4}:
5
6{
7  lib,
8  ...
9}:
10
11let
12  authorizedKeys = ''
13    cert-authority,principals="t:rebuild,${lib.concatStringsSep "," principals}" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuc4HCdyEMu4uiYhlokSXmu+68hkm7j6CqVwjDkCeSj grace.pink
14    sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIA6Eq2yVsZrCH8so7f3ygH0UWp6WkOxbhLNFC9QewKwoAAAABHNzaDo= grace.pink
15    ${lib.concatStringsSep "\n" extraKeys}
16  '';
17in
18{
19  home.activation.authorizedKeys = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
20          run mkdir -p "$HOME/.ssh"
21          run chmod 700 "$HOME/.ssh"
22
23          if [[ -z "''${DRY_RUN:-}" ]]; then
24            cat > "$HOME/.ssh/authorized_keys" <<'EOF'
25    ${authorizedKeys}
26    EOF
27
28            chmod 600 "$HOME/.ssh/authorized_keys"
29          fi
30  '';
31}