- Usecase: Full-stack development, browsing, light gaming
- OS: NixOS Unstable
- Install everything using
home-manager, nevernix-env.- Ensures that everything I install is saved in my dotfiles
- Don't use two tools for the same purpose
- Try to keep tools in home-manager to essentials and use
nix-shell -pfor everything else- can try out new software instantly with no need to remember to remove
- saves disk space
- avoids bloating base dotfiles install
- Use
home-managerstandalone rather than as a module- can update system and user independently
- Shell: zsh
- no framework, plugins are managed by nix
- nerdfont complete powerlevel10k theme
- lots of custom aliases and functions
- Terminal: alacritty
- Editors:
- VS Codium (open source, telemetry free VS Code) with vscode-vim extension
- vanilla vim with no config
home-manager/- Modules in
modules/*.nixMachines in*.nix:- Each machine can enable/disable modules based on situation, whether it is GUI, etc.
- Modules are for a specific tool that needs configuring or a set of similar tools
- if it fits in 1 line or package doesn't need to be configured it doesn't need it's own module, it can be put in the machine config
- Modules are sometimes interdependent, e.g. i3 terminal is set to alacritty if that module is enabled
- Modules in
sudo ln -s /path/to/dotfiles/flake.nix /etc/nixos/flake.nix
nixos-rebuild switch --use-remote-sudoThe NixOS config sets up NIX_PATH to use the nixpkgs version pinned in this flake, so
you should sudo nix-channel --remove all your system channels now (list them with
sudo nix-channel --list)
Install the nix package manager.
- Choose or add a
homeConfigurationflake output with the correct username - Refer to the home-manager manual. The flake URI is simply the path to this git repo.
Note: I use flakes rather than this method on all my systems now.
- Install home-manager using the standalone installation: instructions in the home-manager manual.
- At the top of
~/.config/nixpkgs/home.nix, import your desired machine config from this repo using an absolute path. For example, to use theredboxprofile after cloning the repository to/home/scoder12/github/dotfiles, write:
{ config, pkgs, ... }:
{
imports = [
/home/scoder12/github/dotfiles/home-manager/redbox.nix
];
# --snip--- Rebuild home-manager config:
home-manager switch. Repeat this step after any change to this repository.
Note: On non-NixOS, nix's libGL doesn't play nicely with system graphics drivers, so
install alacritty's dependencies
using the system package manager then cargo install alacritty, rather than installing
it with nix.
- Don't forget to
sudo nix-collect-garbage -doften. - Keep your system up to date:
nix flake update --commit-lock-file - Make sure to set
max-jobsandcoreswhen building (manual). I use--max-jobs 1 --cores 2withhome-manager switchandnixos-rebuild switchto avoid overselling my 6-core 12-thread machine - The Firefox User-Agent in
home-manager/modules/firefox.nixis spoofed to look like Win10. Be sure to check the list from time to time to makek sure it isn't being generated incorrectly and standing out