blob: 44cbf2d86aaaec8d7447d179e3e1f38cb207464c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/bin/sh
if [ ! -f ~/.config/sops/age/keys.txt ]; then
mkdir -p ~/.config/sops/age
echo "---------------------------------------------------------------------------------------------------"
echo "| WARNING: Sops key not found. Please generate one from your ssh key using the following command: |"
echo "| nix run nixpkgs#ssh-to-age -- -private-key -i ~/.ssh/private > ~/.config/sops/age/keys.txt |"
echo "| cat ~/.config/sops/age/keys.txt | age-keygen -y # Public key |"
echo "| IMPORTANT: Ensure your private key is available at a configured keypath for secret decryption: |"
echo "| sudo cp ~/.ssh/private /root/.ssh # When using an age key generated from your ssh key |"
echo "---------------------------------------------------------------------------------------------------"
fi
nixos-rebuild switch --sudo --flake "$(dirname "$0")/#$(hostname)" $@
|