2020-04-05 16:46:55 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2021-05-11 02:14:42 +02:00
|
|
|
let
|
|
|
|
expectedXdgDataDirs = concatStringsSep ":" [
|
|
|
|
"\${NIX_STATE_DIR:-/nix/var/nix}/profiles/default/share"
|
|
|
|
"/home/hm-user/.nix-profile/share"
|
|
|
|
"/usr/share/ubuntu"
|
|
|
|
"/usr/local/share"
|
|
|
|
"/usr/share"
|
|
|
|
"/var/lib/snapd/desktop"
|
|
|
|
"/foo"
|
|
|
|
];
|
|
|
|
|
|
|
|
in {
|
2020-04-05 16:46:55 +02:00
|
|
|
config = {
|
2021-05-11 02:14:42 +02:00
|
|
|
targets.genericLinux.enable = true;
|
|
|
|
|
|
|
|
xdg.systemDirs.data = [ "/foo" ];
|
2020-04-05 16:46:55 +02:00
|
|
|
|
|
|
|
nmt.script = ''
|
2021-05-11 02:14:42 +02:00
|
|
|
envFile=home-files/.config/environment.d/10-home-manager.conf
|
|
|
|
assertFileExists $envFile
|
|
|
|
assertFileContains $envFile \
|
|
|
|
'XDG_DATA_DIRS=${expectedXdgDataDirs}''${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}'
|
|
|
|
assertFileContains $envFile \
|
|
|
|
'TERMINFO_DIRS=/home/hm-user/.nix-profile/share/terminfo:$TERMINFO_DIRS''${TERMINFO_DIRS:+:}/etc/terminfo:/lib/terminfo:/usr/share/terminfo'
|
2021-03-08 21:41:23 +01:00
|
|
|
|
2021-05-11 02:14:42 +02:00
|
|
|
sessionVarsFile=home-path/etc/profile.d/hm-session-vars.sh
|
|
|
|
assertFileExists $sessionVarsFile
|
|
|
|
assertFileContains $sessionVarsFile \
|
2020-04-24 21:41:22 +02:00
|
|
|
'. "${pkgs.nix}/etc/profile.d/nix.sh"'
|
2021-03-08 21:41:23 +01:00
|
|
|
|
|
|
|
assertFileContains \
|
|
|
|
home-path/etc/profile.d/hm-session-vars.sh \
|
|
|
|
'export TERM="$TERM"'
|
2020-04-05 16:46:55 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|