mirror of
https://github.com/adrlau/nix-dotfiles.git
synced 2025-12-24 10:50:21 +01:00
main
NixOS Configuration Repository
Work-in-progress setup
Repository Structure
This repository contains my NixOS configuration files organized into several directories:
home/: Home managermachines/: Machine-specific configurationspackages/: Custom package definitions and configs.profiles/: System profiles (desktop, development, etc.)services/: Service configurations (nginx, mysql, etc.)secrets/: Encrypted secrets
Quick Start
Build Configuration
nix --extra-experimental-features "nix-command flakes" build ".#nixosConfigurations.galadriel.config.system.build.toplevel"
Rebuild and Switch
The primary rebuild command is:
sudo nixos-rebuild switch --flake .# --no-write-lock-file -L --impure
This command:
- Uses the current flake
- Disables lock file writing
- Enables debug logging (-L)
- Allows impure derivations
Alternative Rebuild Methods
- Remote Flake:
sudo nixos-rebuild switch \
--update-input nixpkgs \
--update-input unstable \
--no-write-lock-file \
--refresh \
--flake git+https://github.com/adrlau/nix-dotfiles.git \
--upgrade
- Standard Local Rebuild:
sudo nixos-rebuild switch --flake .#
Dependency Inspection
Check package relationships using:
nix why-depends /run/current-system /nix/store/...
nix why-depends .#nixosConfigurations.galadriel nixpkgs#python312Packages.botorch
nix why-depends .#nixosConfigurations.eowyn.config.system.build.toplevel pkgs.python3.12-libarcus-4.12.0 --impure
show flake attrs
nix flake show .#
Troubleshooting
Fix Broken Store
After aborted rebuilds:
nix-store --query --referrers-closure \
$(find /nix/store -maxdepth 1 -type f -name '*.drv' -size 0) |
xargs sudo nix-store --delete --ignore-liveness
sudo nix store gc
sudo nix store verify --repair --all
Viewing Logs
Check home-manager logs:
journalctl -eu home-manager-gunalx
Maintenance
Clean old generations:
sudo nix-collect-garbage --delete-older-than 4d
Notes
- This configuration is constantly evolving
- Refer to specific machine configurations in
machines/for details - Service configurations are located in
services/ - Custom packages are defined in
packages/
Description
Languages
Nix
98.9%
Shell
1.1%