nushell: allow arbitrary environment variables
This commit is contained in:
parent
edf15f1549
commit
628b15d275
3 changed files with 47 additions and 9 deletions
|
|
@ -1,4 +1,17 @@
|
|||
$env.FOO = 'BAR'
|
||||
|
||||
|
||||
$env.BAR = $'(echo BAZ)'
|
||||
load-env {
|
||||
"ENV_CONVERSIONS": {
|
||||
"PATH": {
|
||||
"from_string": ({|s| $s | split row (char esep) })
|
||||
"to_string": ({|v| $v | str join (char esep) })
|
||||
}
|
||||
}
|
||||
"FOO": "BAR"
|
||||
"LIST_VALUE": [
|
||||
"foo"
|
||||
"bar"
|
||||
]
|
||||
"PROMPT_COMMAND": ({|| "> "})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, ... }:
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
programs.nushell = {
|
||||
|
|
@ -28,7 +28,17 @@
|
|||
"ll" = "ls -a";
|
||||
};
|
||||
|
||||
environmentVariables = { BAR = "$'(echo BAZ)'"; };
|
||||
environmentVariables = {
|
||||
FOO = "BAR";
|
||||
LIST_VALUE = [ "foo" "bar" ];
|
||||
PROMPT_COMMAND = lib.hm.nushell.mkNushellInline ''{|| "> "}'';
|
||||
ENV_CONVERSIONS.PATH = {
|
||||
from_string =
|
||||
lib.hm.nushell.mkNushellInline "{|s| $s | split row (char esep) }";
|
||||
to_string =
|
||||
lib.hm.nushell.mkNushellInline "{|v| $v | str join (char esep) }";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.nushell = { };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue