diff --git a/tests/darwinScrublist.nix b/tests/darwinScrublist.nix index 637418454..23683127b 100644 --- a/tests/darwinScrublist.nix +++ b/tests/darwinScrublist.nix @@ -35,6 +35,7 @@ let "earthly" "emacs" "espanso" + "eza" "fastfetch" "feh" "fzf" diff --git a/tests/default.nix b/tests/default.nix index b1cd577a7..82e3e1909 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -196,6 +196,7 @@ import nmtSrc { ./modules/programs/direnv ./modules/programs/earthly ./modules/programs/emacs + ./modules/programs/eza ./modules/programs/fastfetch ./modules/programs/feh ./modules/programs/fish diff --git a/tests/modules/programs/eza/bash.nix b/tests/modules/programs/eza/bash.nix new file mode 100644 index 000000000..16688b2f1 --- /dev/null +++ b/tests/modules/programs/eza/bash.nix @@ -0,0 +1,38 @@ +{ + programs = { + bash.enable = true; + + eza = { + enable = true; + enableBashIntegration = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + icons = "auto"; + git = true; + }; + }; + + nmt.script = '' + assertFileExists home-files/.bashrc + assertFileContains \ + home-files/.bashrc \ + "alias eza='eza --icons auto --git --group-directories-first --header'" + assertFileContains \ + home-files/.bashrc \ + "alias ls=eza" + assertFileContains \ + home-files/.bashrc \ + "alias ll='eza -l'" + assertFileContains \ + home-files/.bashrc \ + "alias la='eza -a'" + assertFileContains \ + home-files/.bashrc \ + "alias lt='eza --tree'" + assertFileContains \ + home-files/.bashrc \ + "alias lla='eza -la'" + ''; +} diff --git a/tests/modules/programs/eza/default.nix b/tests/modules/programs/eza/default.nix new file mode 100644 index 000000000..c990cc723 --- /dev/null +++ b/tests/modules/programs/eza/default.nix @@ -0,0 +1,8 @@ +{ + eza-bash = ./bash.nix; + eza-fish = ./fish.nix; + eza-ion = ./ion.nix; + eza-nushell = ./nushell.nix; + eza-theme = ./theme.nix; + eza-zsh = ./zsh.nix; +} diff --git a/tests/modules/programs/eza/fish.nix b/tests/modules/programs/eza/fish.nix new file mode 100644 index 000000000..4c84ad10c --- /dev/null +++ b/tests/modules/programs/eza/fish.nix @@ -0,0 +1,38 @@ +{ + programs = { + fish.enable = true; + + eza = { + enable = true; + enableFishIntegration = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + icons = "auto"; + git = true; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/fish/config.fish + assertFileContains \ + home-files/.config/fish/config.fish \ + "alias eza 'eza --icons auto --git --group-directories-first --header'" + assertFileContains \ + home-files/.config/fish/config.fish \ + "alias ls eza" + assertFileContains \ + home-files/.config/fish/config.fish \ + "alias ll 'eza -l'" + assertFileContains \ + home-files/.config/fish/config.fish \ + "alias la 'eza -a'" + assertFileContains \ + home-files/.config/fish/config.fish \ + "alias lt 'eza --tree'" + assertFileContains \ + home-files/.config/fish/config.fish \ + "alias lla 'eza -la'" + ''; +} diff --git a/tests/modules/programs/eza/ion.nix b/tests/modules/programs/eza/ion.nix new file mode 100644 index 000000000..09fb22889 --- /dev/null +++ b/tests/modules/programs/eza/ion.nix @@ -0,0 +1,38 @@ +{ + programs = { + ion.enable = true; + + eza = { + enable = true; + enableIonIntegration = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + icons = "auto"; + git = true; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/ion/initrc + assertFileContains \ + home-files/.config/ion/initrc \ + "alias eza = 'eza --icons auto --git --group-directories-first --header'" + assertFileContains \ + home-files/.config/ion/initrc \ + "alias ls = eza" + assertFileContains \ + home-files/.config/ion/initrc \ + "alias ll = 'eza -l'" + assertFileContains \ + home-files/.config/ion/initrc \ + "alias la = 'eza -a'" + assertFileContains \ + home-files/.config/ion/initrc \ + "alias lt = 'eza --tree'" + assertFileContains \ + home-files/.config/ion/initrc \ + "alias lla = 'eza -la'" + ''; +} diff --git a/tests/modules/programs/eza/nushell.nix b/tests/modules/programs/eza/nushell.nix new file mode 100644 index 000000000..9016c8990 --- /dev/null +++ b/tests/modules/programs/eza/nushell.nix @@ -0,0 +1,38 @@ +{ + programs = { + nushell.enable = true; + + eza = { + enable = true; + enableNushellIntegration = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + icons = "auto"; + git = true; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/nushell/config.nu + assertFileContains \ + home-files/.config/nushell/config.nu \ + 'alias "eza" = eza --icons auto --git --group-directories-first --header' + assertFileContains \ + home-files/.config/nushell/config.nu \ + 'alias "ls" = eza' + assertFileContains \ + home-files/.config/nushell/config.nu \ + 'alias "ll" = eza -l' + assertFileContains \ + home-files/.config/nushell/config.nu \ + 'alias "la" = eza -a' + assertFileContains \ + home-files/.config/nushell/config.nu \ + 'alias "lt" = eza --tree' + assertFileContains \ + home-files/.config/nushell/config.nu \ + 'alias "lla" = eza -la' + ''; +} diff --git a/tests/modules/programs/eza/theme.nix b/tests/modules/programs/eza/theme.nix new file mode 100644 index 000000000..c6caf4f2f --- /dev/null +++ b/tests/modules/programs/eza/theme.nix @@ -0,0 +1,20 @@ +{ + programs.eza = { + enable = true; + theme = { + colors = { + background = "254"; + foreground = "237"; + }; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/eza/theme.yml + assertFileContent home-files/.config/eza/theme.yml ${builtins.toFile "eza-theme-expected.yml" '' + colors: + background: '254' + foreground: '237' + ''} + ''; +} diff --git a/tests/modules/programs/eza/zsh.nix b/tests/modules/programs/eza/zsh.nix new file mode 100644 index 000000000..02ad89e94 --- /dev/null +++ b/tests/modules/programs/eza/zsh.nix @@ -0,0 +1,38 @@ +{ + programs = { + zsh.enable = true; + + eza = { + enable = true; + enableZshIntegration = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + icons = "auto"; + git = true; + }; + }; + + nmt.script = '' + assertFileExists home-files/.zshrc + assertFileContains \ + home-files/.zshrc \ + "alias -- eza='eza --icons auto --git --group-directories-first --header'" + assertFileContains \ + home-files/.zshrc \ + "alias -- ls=eza" + assertFileContains \ + home-files/.zshrc \ + "alias -- ll='eza -l'" + assertFileContains \ + home-files/.zshrc \ + "alias -- la='eza -a'" + assertFileContains \ + home-files/.zshrc \ + "alias -- lt='eza --tree'" + assertFileContains \ + home-files/.zshrc \ + "alias -- lla='eza -la'" + ''; +}