My unified nix flake for all configuration management.
Find a file
2023-09-14 17:12:39 -05:00
fish Fully modularized the thinker config 2023-09-05 23:11:14 -05:00
home Merge remote-tracking branch 'origin/dev' into dev 2023-09-14 16:44:40 -05:00
modules Merge remote-tracking branch 'origin/main' into dev 2023-09-14 13:12:58 -05:00
nixos Finally working 2023-09-14 17:12:13 -05:00
old Cleanup and some modularization 2023-09-05 22:39:17 -05:00
scripts Merge remote-tracking branch 'origin/dev' into dev 2023-09-14 16:44:40 -05:00
secrets Initial commit 2023-09-04 11:40:30 -05:00
.sops.yaml Initial commit 2023-09-04 11:40:30 -05:00
disko.nix Merge remote-tracking branch 'origin/main' 2023-09-05 15:49:05 -05:00
flake.lock Lock 2023-09-06 00:58:27 -05:00
flake.nix WIP 2023-09-11 10:29:12 -05:00
home.nix Merge remote-tracking branch 'origin/main' into dev 2023-09-14 13:12:58 -05:00
nixos.nix Formatting 2023-09-14 17:12:39 -05:00
readme.md Note on next steps for me 2023-09-06 01:23:08 -05:00

Nix

The grand unification of configuration.

Not on NixOS?

Install Nix using Determinate Systems's installer:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

And install Home Manager in standalone mode:

NixOS

nixos-rebuild --flake git+https://git.lyte.dev/lytedev/nix switch

Remotely

nixos-rebuild --flake git+https://git.lyte.dev/lytedev/nix#host \
  --target-host root@host --build-host root@host \
  switch

Home Manager

This can be used on non-NixOS hosts:

home-manager switch --flake .#daniel

Remotely

ssh daniel@host 'home-manager switch --flake git+https://git.lyte.dev/lytedev/nix#daniel'

Provisioning New NixOS Hosts

Documented below is my process for standing up a new NixOS node configured and managed by this flake from scratch.

Network Access

Boot a NixOS ISO and establish network access:

# plug in ethernet or do the wpa_cli song and dance for wifi access
wpa_cli scan # if you need to
wpa_cli scan_results

wpa_cli add_network 0
wpa_cli set_network 0 ssid "MY_SSID"
wpa_cli set_network 0 psk "MY_WIFI_PASSWORD"
wpa_cli enable_network 0
wpa_cli save_config

Partition disk(s) and mount up however you like. Preferably, though, use a disko configuration from this flake like so:

# TODO: I'm relatively certain this can be simplified to a single `nix run` command
sudo nix-shell --packages git --run "nix run \
  --extra-experimental-features nix-command \
  --extra-experimental-features flakes \
  github:nix-community/disko -- \
    --flake 'git+https://git.lyte.dev/lytedev/nix#standard' \
    --mode disko \
    --arg disks '[ \"/dev/your_disk\" ]'"

And finally install NixOS as specified by this flake:

nix-shell --packages git \
  --run "sudo nixos-install \
    --flake 'git+https://git.lyte.dev/lytedev/nix#yourNixosConfig'"

NOTE: This takes a while, mostly due to building Helix myself on each box. I really need to figure out a good local caching setup.

NOTE: since the disko setup should be included in the nixosConfiguration, I would like to know how to do this all in one go -- maybe even building my own live media?

Other To Dos

  • Port configuration (lytedev/dotfiles) to home manager where applicable?
    • Sway, Kitty, and Helix, come to mind
  • Pre-commit checks with nix flake check?