This is the personal configuration for Thomas Christensen.
Feel free to borrow parts and/or make your own based on this.
A configuration setup based on Nix flakes for:
As such it can be used to configure:
- my home directory (shell and utils, dev setup) on a UNIX system (using Nix the package manager with Home Manager)
- my macOS user (defaults, apps and the above) (using Nix the package manager with nix-darwin)
- a full machine running NixOS (apps, services, hardware and kernel config)
A motivation/overview of Nix flakes for configuring machines: NIX FLAKES, PART 3: MANAGING NIXOS SYSTEMS.
- Nix
- Experimental
nix flake
support until released
./apply.sh home
will apply the homeManagerConfigurations
defined as $HOST
.$USER
in machines.nix
hint: to apply and reload: ./apply.sh home && reload_zshrc
to preview changes without applying:
./build.sh home
The nix-darwin (Nix on macOS) can be configured to use Yabai + SKHD (tiling window manager with a hotkey daemon). For more information on this type of setup, see this video.
Use The Determinate Nix Installer to install nix with flakes on your macOS machine.
./apply.sh darwin
will apply the darwinConfigurations
defined as $HOST
in machines.nix
To preview changes without applying: ./build.sh darwin
. The built configuration will be placed in ./result
.
./apply.sh nixos
will apply the nixos configuration defined for $HOST
in machines.nix
.
To preview changes without applying: ./build.sh nixos
Use ./update.sh
to write a new lock file (updating all the inputs)
To preview what has changed, try ./lock-to-github.sh
which can show github links to the different inputs including differences to the currently locked.
nix-store --query --referrers /nix/store/8mlz1pppq90x4j959932jzhm982rb2rc-gtk4-4.6.5
As with apply.sh
and build.sh
, this command will invoke nix-tree
with the current (or specified) configuration.
# home manager
nix why-depends .#homeManagerConfigurations.aeris.thomas.activationPackage nixpkgs#ghc-8.10.4
# darwin (with allow unfree)
NIXPKGS_ALLOW_UNFREE=1 nix why-depends --impure .#darwinConfigurations.aeris.system nixpkgs#nodePackages.vscode-langservers-extracted
Running ./clean-old-generations.sh
(as with sudo
for nixos/nix-darwin) will clean any profiles older than 30 days.
-
Excellent introduction to nix (sans flakes it seems): Chris Titus Tech