My home-manager nix config.
./switch.sh
To derive a config from this config (like for work or something), start with
docs/derived-flake-template.nix
.
- improvements from this blog
- Add zsh-forgit
- Switch tmux to zellij?
- Switch vim to nixvim?
Depending on the system, some other manual setup is required.
Open nix shell with tools
nix-shell -p vim git
Generate SSH key
ssh-keygen -t ed25519 -C "[email protected]"
cat ~/.ssh/id_ed25519.pub
Add SSH key to github: https://github.com/settings/ssh/new
Clone and run setup
ssh-add
git clone [email protected]:krscott/nixcfg.git
cd nixcfg
./nixos-setup.sh
Edit new configuration:
- Setup videoDrivers
- Add home-manager module
Some terminals have trouble with modfiers. See:
- https://stackoverflow.com/questions/16359878/how-to-map-shift-enter
- microsoft/terminal#530 (comment)
tldr for windows, add this to terminal settings json:
{ "command": {"action": "sendInput", "input": "\u001b[13;2u" }, "keys": "shift+enter" },
{ "command": {"action": "sendInput", "input": "\u001b[13;5u" }, "keys": "ctrl+enter" },
{ "command": {"action": "sendInput", "input": "\u001b[13;6u" }, "keys": "ctrl+shift+enter" },
{ "command": {"action": "sendInput", "input": "\u001b[32;2u" }, "keys": "shift+space" },
{ "command": {"action": "sendInput", "input": "\u001b[32;5u" }, "keys": "ctrl+space" },
{ "command": {"action": "sendInput", "input": "\u001b[32;6u" }, "keys": "ctrl+shift+space" },
First time setup:
mkdir -p ~/.config/sops/age
# Generate new key
nix shell nixpkgs#age -c age-keygen -o ~/.config/sops/age/keys.txt
# Print public key (Copy into .sops.yaml keys)
nix shell nixpkgs#age -c age-keygen -y ~/.config/sops/age/keys.txt
# Edit secrets
sops secrets/secrets.yaml
Existing keys
mkdir -p ~/.config/sops/age
# Copy keys.txt to ~/.config/sops/age
Run init scripts
krs_rclone_init
Bypass Win11 setup sign-in: https://www.tomshardware.com/how-to/install-windows-11-without-microsoft-account