Skip to content

Instantly share code, notes, and snippets.

@jakkn
Last active June 6, 2019 19:45
Show Gist options
  • Save jakkn/97a35d22af9ca81e3cc6733a8236b180 to your computer and use it in GitHub Desktop.
Save jakkn/97a35d22af9ca81e3cc6733a8236b180 to your computer and use it in GitHub Desktop.
Getting started with nix
##############################################
# Useful resources:
#
# https://nixos.org/nixos/options.html
# https://nixos.wiki/wiki/NixOS:extend_NixOS
# https://nixos.wiki/wiki/Cheatsheet
#
##############################################
#### NixOS ####
# Create VM with config
NIXOS_CONFIG=`pwd`/client.txt nixos-rebuild build-vm
# List installed packages
nixos-option environment.systemPackages # installed from /etc/nixos/configuration.nix
#### Nix Package Manager ####
# Search
nix search <package> # replaces nix-env -qa
# Install
nix-env -i <package>
# Remove
nix-env -e <package>
# Install package with unfree license
# edit ~/.config/nixpkgs/config.nix
# { allowUnfree = true; }
# Remember to reverse after
# List installed packages (https://functor.tokyo/blog/2018-02-20-show-packages-installed-on-nixos)
nix-env --query # everything installed with package manager (active user profile)
sudo nix-env --query # everything installed with package manager (root)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment