diff --git a/docs/setup.sh b/docs/setup.sh index 418bd0b1..8ff87bb0 100755 --- a/docs/setup.sh +++ b/docs/setup.sh @@ -1,6 +1,24 @@ #!/usr/bin/env bash pushd /etc/nixos/git +# Home-Manager Setup +echo ">>> Setting up Home Manager..... " +sudo mkdir /nix/var/nix/profiles/per-user/albert +home-manager switch -b backup --flake /etc/nixos/git +source ~/.bashrc + +# Import and trust the GPG key +echo ">>> Setting up user GPG key..... " +drive=$(lsblk -o serial,name | grep 012345679518 | awk {'print $2'}) +sudo mkdir /tmp/drive +sudo cryptsetup luksOpen /dev/${drive}3 usb-luks +sudo mount /dev/mapper/usb-luks /tmp/drive +gpg --import /tmp/drive/gpg/albert@sysctl.io/privkey.asc +sudo umount /tmp/drive +sudo rmdir /tmp/drive +sudo cryptsetup luksClose /dev/mapper/usb-luks +echo -e "5\ny\n" | gpg --command-fd 0 --expert --edit-key albert@sysctl.io trust + # Setup SOPS echo "Setting up SOPS keys..... " echo ">>> !!!!!"