Nix home-manager
- Nix 100%
|
All checks were successful
Signed-off-by: Lorenzo Setale <lorenzo.setale@LEGO.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| modules | ||
| .gitignore | ||
| .sops.yaml | ||
| flake.lock | ||
| flake.nix | ||
| home.nix | ||
| README.md | ||
Home Manager
First setup
mkdir -p ~/.config
cd ~/.config
git clone https://git.elates.it/koalalorenzo/home-manager.git
# Install Nix
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# OR Install Lix
curl -sSf -L https://install.lix.systems/lix | sh -s -- install
Start a development shell with dev tools to bootstrap tools/cli
# Create a temporary shell with the dependencies
nix develop
Setup Yubikey with GPG too (required for sops later)
## Install GPG Key, get it from setale.me
curl https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x73880ecaf69ec2ed44ce5889502bfb12d0b5295f | gpg --import
## Check if the Yubikey works:
gpg --card-status
Prepare now sops-nix to decrypt the secrets and update the keys:
## Generate a valid SSH key
ssh-keygen -t ed25519 -a 128
## Extract the age key from ssh
cat ~/.ssh/id_ed25519.pub | ssh-to-age
## Add the key to sops:
hx .sops.yaml
## Rotate all the keys (requires Yubikey)
find . -type f -name "*.sops.*" -exec sops updatekeys {} \;
Install:
nix run home-manager -- init
nix run home-manager -- switch --flake ~/.config/home-manager#personal
Then you can restart your shell!
Post-Install
Homebrew Install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install from the bundle (requires reload/restart)
brew bundle install --global
Atuin Login
atuin login -u koalalorenzo
atuin import auto
atuin sync
NixOS Config
# macOS group is @admin
trusted-users = @admin
Uninstall
To uninstall home manager and Nix use these commands:
hm uninstall
sudo /nix/nix-installer uninstall