My unified nix flake for all configuration management.
Find a file
2023-09-18 09:03:17 -05:00
fish Cleaning up feels so good 2023-09-15 11:16:38 -05:00
home Cleaning up feels so good 2023-09-15 11:16:38 -05:00
modules Merge remote-tracking branch 'origin/main' into dev 2023-09-14 13:12:58 -05:00
nixos Firewall 2023-09-18 09:02:00 -05:00
old Cleanup and some modularization 2023-09-05 22:39:17 -05:00
scripts Cleaning up feels so good 2023-09-15 11:16:38 -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 Fix being unable to boot laptop 2023-09-14 21:00:11 -05:00
flake.lock Firewall 2023-09-18 09:02:00 -05:00
flake.nix Firewall 2023-09-18 09:02:00 -05:00
home.nix Formatting 2023-09-14 21:20:27 -05:00
nixos.nix Formatting 2023-09-14 21:20:27 -05:00
readme.md Merge remote-tracking branch 'origin/main' 2023-09-18 09:03:17 -05:00

Nix

My grand, declarative, and unified application, service, environment, and machine configuration, secret, and package management in a single flake. ❤️ ❄️

NOTE: Everything in here is highly specific to my personal preference. I can't recommend you actually use this in any way, but hopefully some stuff in here is useful inspiration.

Quick Start

You don't have even have to clone this crap yourself. How cool is that!

NixOS

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

Not NixOS

$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
$ nix profile install github:nix-community/home-manager
$ home-manager switch --flake git+https://git.lyte.dev/lytedev/nix

Advanced Usage

Push NixOS Config

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

Provisioning New NixOS Hosts

# establish network access
# plug in ethernet or do the wpa_cli song and dance for wifi
wpa_cli scan
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 disks
nix-shell --packages git --run "sudo nix run \
  --extra-experimental-features nix-command \
  --extra-experimental-features flakes \
  github:nix-community/disko -- \
    --flake 'git+https://git.lyte.dev/lytedev/nix#${PARTITION_SCHEME}' \
    --mode disko \
    --arg disks '[ \"/dev/${DISK}\" ]'"

# install
nix-shell --packages git \
  --run "sudo nixos-install \
    --flake 'git+https://git.lyte.dev/lytedev/nix#${FLAKE_ATTR}' \
    --option substituters 'https://nix.h.lyte.dev' \
    --option trusted-public-keys 'h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0='"

To Do

  • Port configuration (lytedev/dotfiles) to home manager where applicable?
    • Sway, Kitty, and Helix, come to mind
  • Installation from a live ISO does not fully work yet
  • I don't understand Nix well enough to know why stuff is being compiled even when I have a binary cache
    • Maybe it detects different CPUs and will recompile certain packages for per-CPU optimizations?
      • How does this factor in with "pureness"?
  • Custom pre-configured live ISO
  • Unify standalone home manager module with NixOS home manager module
  • Pre-commit checks with stuff like nix flake check and formatting checkers