diff --git a/tests/modules/programs/starship/default.nix b/tests/modules/programs/starship/default.nix index 024dc821..529ef626 100644 --- a/tests/modules/programs/starship/default.nix +++ b/tests/modules/programs/starship/default.nix @@ -1,5 +1,7 @@ { starship-settings = ./settings.nix; + starship-no-settings = ./no-settings.nix; + starship-presets = ./presets.nix; starship-fish-with-transience = ./fish_with_transience.nix; starship-fish-without-transience = ./fish_without_transience.nix; starship-fish-with-interactive = ./fish_with_interactive.nix; diff --git a/tests/modules/programs/starship/no-settings.nix b/tests/modules/programs/starship/no-settings.nix new file mode 100644 index 00000000..c58db6c3 --- /dev/null +++ b/tests/modules/programs/starship/no-settings.nix @@ -0,0 +1,7 @@ +{ + programs.starship.enable = true; + + nmt.script = '' + assertPathNotExists home-files/.config/starship.toml + ''; +} diff --git a/tests/modules/programs/starship/presets.nix b/tests/modules/programs/starship/presets.nix new file mode 100644 index 00000000..ecab32a2 --- /dev/null +++ b/tests/modules/programs/starship/presets.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: +let + starshipPackage = pkgs.runCommand "starship-test-package" { } '' + mkdir -p "$out/share/starship/presets" + cat > "$out/share/starship/presets/nerd-font-symbols.toml" <<'EOF' + format = "$all" + [directory] + style = "blue" + EOF + ''; +in +{ + programs.starship = { + enable = true; + package = starshipPackage; + presets = [ "nerd-font-symbols" ]; + settings = { + add_newline = false; + scan_timeout = 10; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/starship.toml + assertFileContains home-files/.config/starship.toml 'format = "$all"' + assertFileContains home-files/.config/starship.toml 'style = "blue"' + assertFileContains home-files/.config/starship.toml "add_newline = false" + assertFileContains home-files/.config/starship.toml "scan_timeout = 10" + ''; +}