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:
parent
38fbd8909e
commit
6c5025e2bb
2 changed files with 43 additions and 17 deletions
|
|
@ -1,7 +1,8 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
config = {
|
||||
programs.zsh.enable = true;
|
||||
programs.nushell.enable = true;
|
||||
|
||||
programs.dircolors = {
|
||||
enable = true;
|
||||
|
|
@ -17,15 +18,27 @@
|
|||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.dir_colors \
|
||||
${./settings-expected.conf}
|
||||
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}
|
||||
|
||||
|
||||
assertFileRegex \
|
||||
home-files/.zshrc \
|
||||
"eval \$(${pkgs.coreutils}/bin/dircolors -b ~/.dir_colors)"
|
||||
'';
|
||||
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"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
home.preferXdgDirectories = true;
|
||||
|
||||
programs.zsh.enable = true;
|
||||
programs.nushell.enable = true;
|
||||
|
||||
programs.dircolors = {
|
||||
enable = true;
|
||||
|
|
@ -19,14 +20,26 @@
|
|||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/dir_colors \
|
||||
${./settings-expected.conf}
|
||||
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}
|
||||
|
||||
assertFileRegex \
|
||||
home-files/.zshrc \
|
||||
"eval \$(${pkgs.coreutils}/bin/dircolors -b ${config.xdg.configHome}/dir_colors)"
|
||||
'';
|
||||
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"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue