1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

tests/dircolors: add nushell integration tests

This commit is contained in:
jaredmontoya 2025-05-09 23:18:50 +02:00 committed by Austin Horstman
parent 38fbd8909e
commit 6c5025e2bb
2 changed files with 43 additions and 17 deletions

View file

@ -1,7 +1,8 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
{
config = {
programs.zsh.enable = true;
programs.nushell.enable = true;
programs.dircolors = {
enable = true;
@ -17,7 +18,15 @@
'';
};
nmt.script = ''
nmt.script =
let
nushellConfigDir =
if pkgs.stdenv.isDarwin && !config.xdg.enable then
"home-files/Library/Application Support/nushell"
else
"home-files/.config/nushell";
in
''
assertFileContent \
home-files/.dir_colors \
${./settings-expected.conf}
@ -26,6 +35,10 @@
assertFileRegex \
home-files/.zshrc \
"eval \$(${pkgs.coreutils}/bin/dircolors -b ~/.dir_colors)"
assertFileExists "${nushellConfigDir}/env.nu"
assertFileRegex "${nushellConfigDir}/env.nu" \
"source /nix/store/[^/]*-dircolors.nu"
'';
};
}

View file

@ -4,6 +4,7 @@
home.preferXdgDirectories = true;
programs.zsh.enable = true;
programs.nushell.enable = true;
programs.dircolors = {
enable = true;
@ -19,7 +20,15 @@
'';
};
nmt.script = ''
nmt.script =
let
nushellConfigDir =
if pkgs.stdenv.isDarwin && !config.xdg.enable then
"home-files/Library/Application Support/nushell"
else
"home-files/.config/nushell";
in
''
assertFileContent \
home-files/.config/dir_colors \
${./settings-expected.conf}
@ -27,6 +36,10 @@
assertFileRegex \
home-files/.zshrc \
"eval \$(${pkgs.coreutils}/bin/dircolors -b ${config.xdg.configHome}/dir_colors)"
assertFileExists "${nushellConfigDir}/env.nu"
assertFileRegex "${nushellConfigDir}/env.nu" \
"source /nix/store/[^/]*-dircolors.nu"
'';
};
}