aboutsummaryrefslogtreecommitdiff
path: root/home-manager/tests/modules/programs/bash/session-variables.nix
blob: ea789a1d061ba285898ef04a39d71a3b1c3fe4f3 (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
{ config, lib, pkgs, ... }:

with lib;

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

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

    home.homeDirectory = "/home/testuser";

    nmt.script = ''
      assertFileExists home-files/.profile
      assertFileContent \
        home-files/.profile \
        ${./session-variables-expected.txt}
    '';
  };
}