fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Ytnushell: deprecation of let-env (#4292)8c731978

master
1.0 KiB52 linesraw
1{ pkgs, ... }:
2
3{
4  programs.nushell = {
5    enable = true;
6
7    configFile.text = ''
8      let $config = {
9        filesize_metric: false
10        table_mode: rounded
11        use_ls_colors: true
12      }
13    '';
14
15    envFile.text = ''
16      $env.FOO = 'BAR'
17    '';
18
19    loginFile.text = ''
20      # Prints "Hello, World" upon logging into tty1
21      if (tty) == "/dev/tty1" {
22        echo "Hello, World"
23      }
24    '';
25
26    shellAliases = {
27      "lsname" = "(ls | get name)";
28      "ll" = "ls -a";
29    };
30
31    environmentVariables = { BAR = "$'(echo BAZ)'"; };
32  };
33
34  test.stubs.nushell = { };
35
36  nmt.script = let
37    configDir = if pkgs.stdenv.isDarwin then
38      "home-files/Library/Application Support/nushell"
39    else
40      "home-files/.config/nushell";
41  in ''
42    assertFileContent \
43      "${configDir}/config.nu" \
44      ${./config-expected.nu}
45    assertFileContent \
46      "${configDir}/env.nu" \
47      ${./env-expected.nu}
48    assertFileContent \
49      "${configDir}/login.nu" \
50      ${./login-expected.nu}
51  '';
52}