From 9037d7250fbfd12cd239fd2250739d8b22d09efa Mon Sep 17 00:00:00 2001 From: iFargle Date: Sun, 19 Nov 2023 17:27:41 +0900 Subject: [PATCH] Update setup.sh --- docs/setup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 ">>> !!!!!"