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.
razorback: Asus TUF A17 2023 Laptoprocinante: 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.
Using razorback as an example:
- Add following to
/etc/nixos/configuration.nix:
networking.hostName = "razorback";
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/razorback/- 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 .#razorback
home-manager switch --flake .#amcmahon@razorback-
Reboot, and enable Secure Boot in BIOS
-
Enable secure boot using direction from
https://github.com/nix-community/lanzaboote, merging inlanzabootefrom the existing githardware-configuration.nix -
Enable TPM boot:
sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7 /dev/nvme1n1p2- Rebuild and Reboot