VSCode-Anywhere
  • Introduction
  • Installation
    • Requirements
      • Windows requirements
      • Linux requirements
      • MacOS requirements
    • Quickstart
    • Advanced
      • Windows installation
      • Linux installation
      • MacOS installation
  • Modules
    • Module installation
    • Module update
    • Module settings
      • Global settings
        • brew settings
        • chocolatey settings
        • env settings
        • msys2 settings
        • nix settings
        • scoop settings
        • vscode settings
        • zeal settings
    • Modules list
      • Ansible
      • Bash
      • C / C++
      • C#
      • Custom
      • Deepcode
      • Docker
      • Fonts
      • Git
      • Go
      • HTML
      • Java
      • JavaScript / TypeScript
      • Markdown
      • Perl
      • PHP
      • Platformio
      • PowerShell
      • Puppet
      • Python2
      • Python3
      • Remote
      • Rest
      • ReStructuredText
      • Ruby
      • Saltstack
      • VSCode
    • Custom modules
  • Structure
    • apps
    • conf
      • saltstack
        • conf-offline
        • conf
        • pillar
        • states
    • tools
      • env
      • install
      • link
      • update
      • vscode
      • vscode-anywhere
  • Tutorials
    • Youtube tutorials
  • Release notes
    • V2
      • V2.0.0
    • V1
  • FAQ
Powered by GitBook
On this page
  • pkgs
  • enabled
  • attr
  • opts

Was this helpful?

  1. Modules
  2. Module settings
  3. Global settings

nix settings

Previousmsys2 settingsNextscoop settings

Last updated 4 years ago

Was this helpful?

Allow managing .

nix is only available for Linux and MacOS.

pkgs

pkgs allow to install some (see ).

You need to specify the name of the packages to install.

2 ways to install nix packages:

  • by name, equivalent to:

nix-env -i python3
vscode-anywhere:
    python3:
        enabled: True
        nix:
          pkgs:
            python3:
              enabled: True
  • by attribute (recommended), equivalent to:

nix-env -iA nixpkgs.python3
vscode-anywhere:
    python3:
        enabled: True
        nix:
          pkgs:
            python3:
              enabled: True
              attr: nixpkgs.python3Full

python3 (line 6) is the real name of the package once installed. To retrieve the package name:

nix-instantiate --eval -E '(import <nixpkgs> {}).python3Full.pname'
"python3"

Sometimes pname doesn't exist. In this case, you can use name and remove the version:

nix-instantiate --eval -E '(import <nixpkgs> {}).dotnetPackages.NUnitConsole.pname'
error: attribute 'pname' missing, at (string):1:1
nix-instantiate --eval -E '(import <nixpkgs> {}).dotnetPackages.NUnitConsole.name'
"NUnit.Console-3.0.1"

enabled

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.

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.gz

Global packages settings

  • nix:pkgs:opts:global: allow passing arguments to all nix packages when installing, updating, or uninstalling a package

Specific packages settings

  • nix:pkgs:<mypkg>:opts:global: allow passing arguments to <mypkg> nix package when installing, updating, or uninstalling the package

Extra args can be arguments described in the or can be .

is not an official Saltstack states but a custom states written for VSCode-Anywhere.

nix:pkgs:opts:install: allow passing arguments to all nix packages when installing a package (cf function)

nix:pkgs:opts:update: allow passing arguments to all nix packages when updating a package (cf function)

nix:pkgs:opts:uninstall: allow passing arguments to all nix packages when uninstalling a package (cf function)

nix:pkgs:<mypkg>:opts:install: allow passing arguments to <mypkg> nix packages when installing the package (cf function)

nix:pkgs:<mypkg>:opts:update: allow passing arguments to <mypkg> nix packages when updating the package (cf function)

nix:pkgs:<mypkg>:opts:uninstall: allow passing arguments to <mypkg> nix packages when uninstalling the package (cf function)

nix
nix packages
website
Saltstack nix states
global Saltstack arguments
nix
pkg_installed
pkg_latest
pkg_removed
pkg_installed
pkg_latest
pkg_removed