For more information about Nix and NixOS check out my list of RESOURCES.md
sudo nixos-install --flake https://github.com/fabian-gubler/.dotfiles
Important Note: hardware-configuration.nix
file must be customized to your system's hardware.
The following commands for a fresh system build:
# Clone the repository
nix-env -iA nixpkgs.git
git clone https://github.com/fabian-gubler/.dotfiles ~/.dotfiles
# Generate hardware-configuration and replace it
sudo nixos-generate config
cd ~/.dotfiles/
cp -f host/hardware-configuration /etc/nixos/hardware-configuration.nix
# Install NixOS system
sudo nixos-install --flake .#<host>
Currently I am considering adding...
- git-credential-oauth using home-manager
programs.git-credential-oauth
- toggle-theme to switch up aesthetics
nix-shell -p steam-run --run "steam-run ./the-binary"
Check out many possible methods: Link
host
everything that is system based (e.g. hardware, system packages, window manager)shared
home-manager and .dotfiles for my favorite programsscripts
collection of personal or modified scriptstemplates
reproducible development environmentspkgs
custom written packagesoverlays
extend or change packages
- Wayland: Porting my setup from
dwm
todwl
- Identify conflicting packages (e.g. xinit, dmenu etc.)
- Porting dwm configuration & patches
The following are some personal non-functional benefits of using a nix-based system.
- Declared configuration for the entire system.
- Has to be written once, easily bootstrap anytime
- Reproducible Builds using Lock files
- Easily go back to previous states of entire systems (like timeshift)
- Biggest Offering of Packages (bigger than AUR)
- Fairly well maintained and up to date (otherwise create overlay to make changes)
- Quickly enable / try out packages in an isolated environment
- Reuse on all platforms: Linux, WSL, Darwin based systems
- Create alternative versions of configuration (e.g. server, desktop, laptop)
- Distro-agnostic
- Nix is straight-forward for building & maintaining personal packages
- Useful for reproducible development environments (with shell.nix)
- Replaces and extends virtual environments (e.g. conda)
- Use for Declarative containers (e.g. docker images)