Default.nix
files are built to importnix
files in the directory- Top level
nix
files or bundles will set enable options for imported modules - Bundles are just groups of packages for a purpose
- This approach sacrifices terseness for flexibilty
- Relies on config options to enable software
- Importing a directory imports the
directory/default.nix
- macOS is the darwin kernel with the aqua desktop
a work in progress
NIX_FLAKE_PATH
is optional but helpful.- Tip: NIX_CONFIG is used by NIX for other purposes, so don't use it
search
input is regex. Example search for Firefox or Chromium: "firefox|chromium"
export NIX_FLAKE_PATH="/path/to/flake"
alias clean="echo 'garbage collecting: this might take a while' && nix store gc"
alias generations="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system"
alias optimise="echo 'optimising: this might take a while' && nix store optimise"
alias rebuild="nixos-rebuild build --impure --flake \$NIX_FLAKE_PATH"
alias search="nix search nixpkgs"
alias switch="nixos-rebuild switch --impure --flake \$NIX_FLAKE_PATH"
alias upgrade="nixos-rebuild switch --upgrade --impure --flake \$NIX_FLAKE_PATH"
These files set reasonable defaults for using nix, such as allowing "un-free" software and enableingthe use of flakes
# nix-command: enables the new nix subcommands
# flakes: enables the use of flakes
# pipe-operators: Add |> and <| operators to the Nix language.
experimental-features = nix-command flakes pipe-operators
{
allowUnfree = true; # all unfree packages allowed
# == allowUnfree alternative ==
# allowUnfreePredicate = pkg: {
# some logic to filter which packages can be unfree or not
# returns a bool
# };
}
I use these aliases to support my use of nix on a mac, for example using NIX_FLAKE_PATH to point to you config repo instead of base config
NIX_FLAKE_PATH
is optional but helpful.- Tip: NIX_CONFIG is used by NIX for other purposes, so don't use it
search
input is regex. Example search for Firefox or Chromium: "firefox|chromium"
export NIX_FLAKE_PATH="/path/to/flake"
alias clean="echo 'garbage collecting: this might take a while' && nix store gc"
alias generations="darwin-rebuild --list-generations"
alias optimise="echo 'optimising: this might take a while' && nix store optimise"
alias rebuild="darwin-rebuild build --impure --flake \$NIX_FLAKE_PATH"
alias search="nix search nixpkgs"
alias switch="darwin-rebuild switch --impure --flake \$NIX_FLAKE_PATH"
alias update="nix flake update --flake \$NIX_FLAKE_PATH"