This repository is structured to support multiple hosts with shared configuration:
flake.nix: Entry point defining system configurations (homepcandmylaptop).nixos/: System-level configurations.common.nix: Shared settings, packages, and users applicable to all hosts.homepc/: Configuration specific to the desktop PC (Nvidia drivers, extra storage).mylaptop/: Configuration specific to the laptop.
users/vd/: User-specific configuration (Home Manager), including dotfiles (config/).
After installing NixOS and rebooting into your new system, follow these steps to apply this configuration.
Install Git (if not already available) and clone this repository:
# Enter a temporary shell with git
nix-shell -p git
# Clone your repository (replace URL with your actual repo)
git clone https://github.com/lvdund/nixos-config /etc/nixos/nixos-config
cd /etc/nixos/nixos-config Crucial: You must generate the hardware configuration specific to your machine to ensure bootloaders and filesystems are correct.
For Laptop:
nixos-generate-config --show-hardware-config > nixos/mylaptop/hardware-configuration.nixFor Home PC:
nixos-generate-config --show-hardware-config > nixos/homepc/hardware-configuration.nixApply the flake configuration for your specific host:
For Laptop:
sudo nixos-rebuild switch --flake .#mylaptopFor Home PC:
sudo nixos-rebuild switch --flake .#homepcUpdate:
nix flake updateSet up your global git identity:
git config --global user.email "lvdund@gmail.com"
git config --global user.name "lvdund"- Install essential Go tools and utilities:
go install golang.org/x/tools/gopls@latest
go install github.com/go-delve/delve/cmd/dlv@latest
go install mvdan.cc/gofumpt@latest
go install mvdan.cc/sh/v3/cmd/shfmt@latest
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/fatih/gomodifytags@latest
go install github.com/jesseduffield/lazygit@latest
go install github.com/jesseduffield/lazydocker@latest
go install github.com/josharian/impl@latest- npm global installations:
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
npm install -g tree-sitter-cli