Andrew McMahon's NixOS dotfiles
NixOS/home-manager config files. Requires Nix flakes.
Shamelessly inspired/ripped-off from misterio77 and archer-65
flake.nix: Entrypoint for hosts and home configurations. Also exposes devshells for boostrapping (nix developornix-shell).hosts: NixOS Configurationscommon: Shared configurations consumed by the machine-specific ones.common: Configurations that are applied to all machines.optional: Opt-in configurations any machines can use.
rocinante: AMD 9950X3D / RTX 4090 Workstation
home: Home-manager configurationmodules: Modules (with options).overlays: Patches and version overrides for some packages. Accessible vianix build.pkgs: Custom packages. Also accessible vianix build.
This repo includes a justfile with common maintenance tasks:
Run these from inside nix develop (which provides just).
just fmt: Run formatting viatreefmt.just check: Runnix flake check.just switch-home: Apply Home Manager config foramcmahon@rocinante.just rebuild-host: Apply NixOS config forrocinante.just update: Update flake inputs, then format and check.just clean: Run Nix garbage collection.
Using rocinante as an example:
-
Add following to
/etc/nixos/configuration.nix:networking.hostName = "rocinante"; nix.settings.experimental-features = [ "nix-command" "flakes" ]; environment.systemPackages = with pkgs; [ vim wget git ]; services.openssh.enable = true;
-
Run
sudo nixos-rebuild switch -
Then:
mkdir -p Sources cd Sources git clone git@github.com:McDamon/dotfiles.git cd dotfiles nix develop
-
Clone the generated hardware configuration (we will modify this later):
cp /etc/nixos/hardware-configuration.nix ~/Sources/dotfiles/hosts/rocinante/ -
Add the following lines to
hardware-configuration.nix:# Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true;
-
Rebuild:
sudo nixos-rebuild switch --flake .#rocinante home-manager switch --flake .#amcmahon@rocinante
-
Reboot, then enable Secure Boot in BIOS.
-
Enable secure boot using directions from nix-community/lanzaboote, merging in
lanzabootefrom the existing githardware-configuration.nix. -
Enable TPM boot:
sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7 /dev/nvme1n1p2
-
Rebuild and reboot.