summaryrefslogtreecommitdiffstats
path: root/nixos/tests/npmrc.nix
blob: d4209d0f85cd27977a9a3f96e05c024bb3c84916 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ ... }:
let
  machineName = "machine";
  settingName = "prefix";
  settingValue = "/some/path";
in
{
  name = "npmrc";

  nodes."${machineName}".programs.npm = {
    enable = true;
    npmrc = ''
      ${settingName} = ${settingValue}
    '';
  };

  testScript = ''
    ${machineName}.start()

    assert ${machineName}.succeed("npm config get ${settingName}") == "${settingValue}\n"
  '';
}