aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/home-manager/tests/modules/targets-linux/generic-linux.nix
blob: 530137cfbe75e573b21a8b01ac57dd9b3e26a63f (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
29
30
{ config, lib, pkgs, ... }:

with lib;

{
  config = {
    targets.genericLinux = {
      enable = true;
      extraXdgDataDirs = [ "/foo" ];
    };

    nmt.script = ''
      assertFileExists home-path/etc/profile.d/hm-session-vars.sh

      assertFileContains \
        home-path/etc/profile.d/hm-session-vars.sh \
        'export XDG_DATA_DIRS="''${NIX_STATE_DIR:-/nix/var/nix}/profiles/default/share:/home/hm-user/.nix-profile/share:/foo''${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS"'
      assertFileContains \
        home-path/etc/profile.d/hm-session-vars.sh \
        '. "${pkgs.nix}/etc/profile.d/nix.sh"'

      assertFileContains \
        home-path/etc/profile.d/hm-session-vars.sh \
        'export TERMINFO_DIRS="/home/hm-user/.nix-profile/share/terminfo:$TERMINFO_DIRS''${TERMINFO_DIRS:+:}/etc/terminfo:/lib/terminfo:/usr/share/terminfo"'
      assertFileContains \
        home-path/etc/profile.d/hm-session-vars.sh \
        'export TERM="$TERM"'
    '';
  };
}