nix settings
Allow managing nix.
nix is only available for Linux and MacOS.
pkgs
pkgs allow to install some nix packages (see website).
You need to specify the name of the packages to install.
2 ways to install nix packages:
by name, equivalent to:
nix-env -i python3vscode-anywhere:
python3:
enabled: True
nix:
pkgs:
python3:
enabled: Trueby attribute (recommended), equivalent to:
nix-env -iA nixpkgs.python3vscode-anywhere:
python3:
enabled: True
nix:
pkgs:
python3:
enabled: True
attr: nixpkgs.python3Fullenabled
True to enable, False to skip (default to False).
attr
attr is not mandatory but allow to specify specific attribute like python3Full.
opts
opts is not mandatory but allows to pass extra args.
Extra args can be arguments described in the Saltstack nix states or can be global Saltstack arguments.
channel
It uses the -I option of nix-env (man nix-env):
-I path
Add a path to the Nix expression search path. This option may be given multiple times. See the NIX_PATH environment variable for information on the semantics of the Nix
search path. Paths added through -I take precedence over NIX_PATH.Example:
vscode-anywhere:
python3:
enabled: True
nix:
pkgs:
opts:
install: {}
update: {}
uninstall: {}
python3:
enabled: True
attr: nixpkgs.python3Full
install:
channel: nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz
update:
channel: nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz
uninstall: {}This is equivalent to:
nix-env -iA python3Full -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gzGlobal packages settings
nix:pkgs:opts:global: allow passing arguments to all nix packages when installing, updating, or uninstalling a packagenix:pkgs:opts:install: allow passing arguments to all nix packages when installing a package (cf pkg_installed function)nix:pkgs:opts:update: allow passing arguments to all nix packages when updating a package (cf pkg_latest function)nix:pkgs:opts:uninstall: allow passing arguments to all nix packages when uninstalling a package (cf pkg_removed function)
Specific packages settings
nix:pkgs:<mypkg>:opts:global: allow passing arguments to<mypkg>nix package when installing, updating, or uninstalling the packagenix:pkgs:<mypkg>:opts:install: allow passing arguments to<mypkg>nix packages when installing the package (cf pkg_installed function)nix:pkgs:<mypkg>:opts:update: allow passing arguments to<mypkg>nix packages when updating the package (cf pkg_latest function)nix:pkgs:<mypkg>:opts:uninstall: allow passing arguments to<mypkg>nix packages when uninstalling the package (cf pkg_removed function)
Last updated
Was this helpful?