Nix configuration for my personal devices.
- Home Manager for Macbook.
- NixOS + Home Manager for home server.
On macbook, make changes to local checkout in /Users/aostow/dev/home. Then switch Home Manager
with:
$ nix-switch
On server, just run nix-switch to rebuild system and user Home Manager directly from the Github
flake on main.
nix-switch is zsh alias that is different depending on the host.
After cloning this repo, install pre-commit hooks to automatically format Nix files:
nix run .#install-hooks- Make sure
agenixCLI is installed viaterminal.nixHome module. - Register which public keys can decrypt secret in
./secrets/secrets.nix - Create the encrypted secret interactively.
$ cd ./secrets
$ agenix -e foo.age- Use the secret by setting,
config.age.secrets.foo.file = ../../../secrets/foo.age- Reference the decrepyted path with,
config.age.secrets.foo.pathMac
- From my LAN, download root CA cert from http://ca.home/ca.cer.
- Open it with Keychain and add it to the system trust store.
- Open Keychain Access > System > Home Root CA > (expand Trust) > When using this certificate > Always Trust.
iphone
- From my LAN, visit from http://ca.home/ca.cer.
- You'll see a prompt "This website is trying to download a configuration profile"
- Tap Allow
- Install the profile:
- Go to Settings > Profile Downloaded (appears at the top)
- Hit install
- Trust the certificate:
- Go to Settings > General > About > Certificate Trust Settings
- Toggle ON your CA certificate under "Enable Full Trust for Root Certificates"
- Login with admin user in master realm
https://idp.home. - Switch to
homerealm via Manage realms. - Users > Add user
- Set Update Password as the only required user action
- Set a temporary password: Users > $USER > Set password (temporary ON)
Choose an IP for the new client on the 10.0.0.0/8 subnet. See used IPs in
wireguard.nix.
On Ultan, run this to generate a wireguard config. It'll print the config which you need to paste into a file to send to the user.
sudo generate-wireguard-client foo 10.0.0.6
It'll also give you instructions for updating wireguard.nix to add the newly generated public key.