A minimal, terminal-focused, Nix Home Manager setup.
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --no-daemon
. /home/shade/.nix-profile/etc/profile.d/nix.shnix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --updatenix-shell '<home-manager>' -A install
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"git clone https://github.com/0xshade/HomeManager.git
cd HomeManager
# Update username and home directory in home.nix first!
# Edit lines 11-12 to match your system:
# home.username = "yourusername";
# home.homeDirectory = "/home/yourusername";
# Update Git username and email in ./modules/git.nix
home-manager --extra-experimental-features "nix-command flakes" switch -b backup --flake . -
Packages: Add/remove packages in
home.nix. Package configurations are inmodules/package.nix. -
Alacritty: Modify colors, fonts, and shortcuts in
modules/alacritty.nix. -
Zellij: Change theme in
modules/zellij.nix. Note: tmux shortcut changed toCtrl + Space(instead of defaultCtrl + B). -
Shell: Configure shortcuts and bashrc in
modules/shell.nix.
This setup already includes NixGL wrapping around Applications requiring OpenGL (like Alacritty) are wrapped with:
(config.lib.nixGL.wrap pkgs.alacritty)with NiXGL support added in flake.nix:
nixGL.packages = nixgl;
nixGL.defaultWrapper = "mesa";
nixGL.offloadWrapper = "nvidiaPrime";
nixGL.installScripts = [ "mesa" "nvidiaPrime" ];If you encounter display errors like:
Error: Error { raw_code: None, raw_os_message: None, kind: NotSupported("provided display handle is not supported") }
Then make sure to 1) identify the package causing the issue and 2) wrap NixGL around it like alacritty above.
For one-off runs of OpenGL applications without Home Manager (to verify):
nix --extra-experimental-features "nix-command flakes" run --impure github:nix-community/nixGL -- alacritty