1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

delta: add test where git integration is disabled

This commit is contained in:
PerchunPak 2025-10-21 17:09:06 +02:00 committed by Austin Horstman
parent 84e1adb0cd
commit aa559a682b
3 changed files with 26 additions and 0 deletions

View file

@ -2,5 +2,6 @@
delta-basic = ./delta-basic.nix;
delta-final-package = ./delta-final-package.nix;
delta-with-git-integration = ./delta-with-git-integration.nix;
delta-without-git-integration = ./delta-without-git-integration.nix;
delta-migration = ./delta-migration.nix;
}

View file

@ -28,5 +28,8 @@
assertFileContains home-files/.config/git/config 'commit-decoration-style = "bold yellow box ul"'
assertFileContains home-files/.config/git/config 'file-decoration-style = "none"'
assertFileContains home-files/.config/git/config 'file-style = "bold yellow ul"'
# the wrapper should be created only if git integration is disabled
assertPathNotExists home-path/bin/.delta-wrapped
'';
}

View file

@ -0,0 +1,22 @@
{ config, ... }:
{
programs.delta = {
enable = true;
enableGitIntegration = false;
package = config.lib.test.mkStubPackage {
name = "delta";
buildScript = /* sh */ ''
mkdir -p $out/bin
echo "#!/bin/sh" > $out/bin/delta
chmod +x $out/bin/delta
'';
};
options.features = "line-numbers decorations";
};
nmt.script = ''
assertPathNotExists home-files/.config/git/config
# the wrapper should be created only if git integration is disabled
assertFileExists home-path/bin/.delta-wrapped
'';
}