mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
tests/dircolors: add nushell integration tests
This commit is contained in:
committed by
Austin Horstman
parent
38fbd8909e
commit
6c5025e2bb
@@ -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"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user