Skip to content

Nix

Basics

Terminal window
# Find packages at search.nixos.org
# Create a new shell with these packages
nix-shell -p cowsay lolcat
# Run a package once
nix-shell -p cowsay --run "cowsay meow"
# install a package
nix-env -iA git
# add unstable USER CHANNEL
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
nix-channel --add https://nixos.org/channels/nixos-unstable nixos
nix-channel --update
# add root channel
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
# rebuild system
sudo nixos-rebuild switch
# reboots with the new configuration, idk when to use it
sudo nixos-rebuild boot

WSL Setup

https://nix-community.github.io/NixOS-WSL/install.html

Terminal window
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
sudo nix-channel --update
sudo nixos-rebuild swtitch
nix-shell -p git neovim