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

tests/delta: add 'delta-final-package'

This tests the usage of the wrapper program when `programs.git` is
disabled, and therefore home-manager is _not_ generating its
configuration.
This commit is contained in:
Bruno BELANYI 2025-10-20 13:29:17 +00:00 committed by Austin Horstman
parent 022e7e3f95
commit c9d758b500
2 changed files with 36 additions and 0 deletions

View file

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

View file

@ -0,0 +1,35 @@
{ 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";
};
};
enableGitIntegration = true;
};
programs.git.enable = false;
nmt.script = ''
# Git config should NOT exist since `git.enable` is false
assertPathNotExists home-files/.config/git/config
# Verify the wrapper passes the config flag
# The wrapper script should contain --config flag
assertFileRegex home-path/bin/delta '\-\-config'
'';
}