Nix: reference - Oliver-Mustoe/Oliver-Mustoe-Tech-Journal GitHub Wiki

Info

Following is specifications/syntax for various Nix things I think to be important in a fast and readable way.

configuration.nix

LOCATION:

  • /etc/nixos/configuration.nix

COMMON CONFIGURATION FUNCTIONS:

  • enviroment.systemPackages - specifies an array of packages to install onto the system

COMMON CONFIGURATION SYNTAX:

  • with <KEY>; [<VALUES>] - specifies an array of values that would start in a KEY.VALUE format in a way as to not have to put KEY before each one. IT SHOULD BE NOTED I DO NOT CURRENTLY KNOW WHAT THE CORRECT NAME WOULD BE FOR THE KEY AND VALUE IN NIX SYNTAX!!!

nix-shell

SYNTAX:

  • nix-shell <FLAGS>

FLAGS:

  • -p <PACKAGES> - specifies what packages you want in the shell
  • --run '<COMMANDS>' - specifies what commands you what to run in the enviro

nixos-rebuild

SYNTAX:

  • sudo nixos-rebuild <OPTION>

FLAGS/OPTIONS:

  • switch - apply the current configuration.nix file AND make it boot default
  • test - apply the current configuration.nix file AND DON'T make it boot default
⚠️ **GitHub.com Fallback** ⚠️