enable

Whether to enable enable scripts integration.

Type: boolean

Default: true

Example: true

__enabledScripts

enabled scripts

Type: unspecified value (read only)

Default: { }

__exportableScripts

enabled scripts, with some config removed, suitable for importing between scripts

Type: unspecified value (read only)

Default: { }

addToPackages

Whether to enable adds all scripts to packages depending on module type

  • flake: packages.{system}
  • nixos: environment.systemPackages
  • home: home.packages .

Type: boolean

Default: true

Example: true

defaultLibDirs

optional script lib dir set for all nushell scripts

Type: null or path

Default: null

defaultShell

set default shell for all scripts

Type: string

Default: "nu"

pkgs

Nixpkgs used to generate script. Influences shell runtime.

Type: Nixpkgs package set

Default: pkgs

scripts

Generate scripts from different shells from string snippets, files, or nushell modules.

Enabled scripts are added to packages.{system} by name if scripts.addToPackages is set.

Type: attribute set of (submodule)

Default: { }

Example:

{
  my-test-script.text = "ls -l";
  my-test-script-bash-test.shell = "bash";
  my-test-script-bash-test.text = "ls -la";
  my-test-script-env-has.inputs = [pkgs.afetch];
  my-test-script-env-has.text = ''
    def main [ var ] {
      print $"Env ($var) present: (envHas $var)"
      afetch
    }
  '';
}

scripts.<name>.enable

Whether to enable enable script, auto-matically adds script to packages.

Type: boolean

Default: true

Example: true

Declared by:

scripts.<name>.package

package binary for running script

Type: package

Default: ""

Declared by:

scripts.<name>.checkPhase

setting of writeShellApplication, if null runs a default bash one

Type: null or string

Default: ""

Declared by:

scripts.<name>.env

runtime env to provide to script

Type: null or (attribute set of string)

Default: null

Example:

{
  ENV_VAR = "variable";
}

Declared by:

scripts.<name>.extraConfig

extra config to add to `writeShellApplication

Type: attribute set of raw value

Default: { }

Example:

with pkgs; [
  caddy
  gnused
]

Declared by:

scripts.<name>.file

optionally set script file path, recommended for script files which only contain a single main

Type: path

Default: builtins.toFile "‹name›.nu" config.text

Example: ./fill.nu

Declared by:

scripts.<name>.inputs

runtime inputs to add to script

Type: list of package

Default: [ ]

Example:

with pkgs; [
  caddy
  gnused
]

Declared by:

scripts.<name>.name

script name, also used as name of binary

Type: string

Default: "‹name›"

Declared by:

scripts.<name>.nuLegacyModule

optional nu legacy module wrapper

Type: null or path

Default: null

Example: ./my-helpers.nu

Declared by:

scripts.<name>.nuLibDirs

sets NU_LIB_DIRS in nushell scripts

Type: null or path

Default: null

Example: ./nu

Declared by:

scripts.<name>.nuModule

optional nu module wrapper, very basic wrapper that exports a module to be called from cli

Type: null or path

Default: null

Example: ./my-helpers.nu

Declared by:

scripts.<name>.runtimeShell

runtime shell package.

Type: package

Declared by:

scripts.<name>.shell

runtime shell of script

Type: string

Default: "nu"

Example: "bash"

Declared by:

scripts.<name>.text

nushell script

Type: string

Default: ""

Declared by: