aboutsummaryrefslogtreecommitdiff
path: root/home-manager/tests/modules/programs/bash/session-variables.nix
blob: a7a69a2a1f8efb571ab28bf334d9c252239b7c13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ config, lib, pkgs, ... }:

with lib;

{
  config = {
    programs.bash = {
      enable = true;

      sessionVariables = {
        V1 = "v1";
        V2 = "v2-${config.programs.bash.sessionVariables.V1}";
      };
    };

    nmt.script = ''
      assertFileExists home-files/.profile
      assertFileContent \
        home-files/.profile \
        ${
          pkgs.substituteAll {
            src = ./session-variables-expected.txt;
            inherit (config.home) homeDirectory;
          }
        }
    '';
  };
}