nix-config/NOTES

35 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-09-19 17:05:08 +00:00
* Yubikeys are great, if you use them correctly
https://www.procustodibus.com/blog/2023/04/how-to-set-up-a-yubikey/
* generate age public key from host's existing SSH keypair
nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'
* trigger first encryption of a secrets file
EDITOR=vi sops --config .sops.yaml --encrypt --in-place hosts/common/secrets.yaml
* edit secrets in that file later
2023-09-19 19:40:04 +00:00
* When SOPS complains about your ~/.gnupg/secring.pgp file not being there try:
export GPG_TTY=$(tty)
gpgconf --reload gpg-agent
2023-09-20 12:29:42 +00:00
* SOPS
https://dev.to/stack-labs/manage-your-secrets-in-git-with-sops-common-operations-118g
2023-09-20 15:47:08 +00:00
INSTALL:
export NIX_CONFIG="experimental-features = nix-command flakes"
2023-09-20 20:14:48 +00:00
nix-env -iA nixos.pinentry nixos.git
2023-09-20 17:32:13 +00:00
echo pinentry-program $(which pinentry) >> ~/.gnupg/gpg-agent.conf
2023-09-20 15:47:08 +00:00
git clone https://github.com/gburd/nix-config.git
cd nix-config
nix develop
2023-09-20 20:14:48 +00:00
echo test | gpg --clearsign
gpg --list-keys
EDITOR=vi sops --config .sops.yaml hosts/common/secrets.yaml
2023-09-20 17:32:13 +00:00
sudo nixos-install --flake .#hostname
2023-09-20 15:47:08 +00:00
reboot
home-manager switch --flake .#username@hostname
2023-09-19 17:05:08 +00:00
2023-09-20 15:47:08 +00:00
export GPG_TTY=$(tty)
2023-09-19 17:05:08 +00:00
sudo nixos-rebuild switch --flake .#my-hostname
2023-09-19 18:38:19 +00:00
clear; sudo nixos-rebuild dry-activate --flake .#loki
2023-09-19 17:05:08 +00:00
-------
services.pcscd.enable = true;