1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/tests/modules/programs/delta/delta-basic.nix
Austin Horstman 2c8b962091 tests/delta: add tests
Create a new set of tests to verify the new module's behavior.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-10-19 10:24:15 -05:00

35 lines
1,000 B
Nix

{ config, ... }:
{
programs.delta = {
enable = true;
package = config.lib.test.mkStubPackage {
name = "delta";
buildScript = ''
mkdir -p $out/bin
touch $out/bin/delta
chmod 755 $out/bin/delta
'';
};
options = {
features = "line-numbers decorations";
syntax-theme = "Dracula";
decorations = {
commit-decoration-style = "bold yellow box ul";
file-style = "bold yellow ul";
file-decoration-style = "none";
};
};
};
programs.git.enable = true;
nmt.script = ''
# Git config should NOT contain delta configuration since enableGitIntegration is false by default
assertFileNotRegex home-files/.config/git/config 'pager = .*/bin/delta'
assertFileNotRegex home-files/.config/git/config 'diffFilter = .*/bin/delta'
# Verify the wrapper passes the config flag
# The wrapper script should contain --config flag
assertFileRegex home-path/bin/delta '\-\-config'
'';
}