mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46: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:
parent
022e7e3f95
commit
c9d758b500
2 changed files with 36 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
delta-basic = ./delta-basic.nix;
|
||||
delta-final-package = ./delta-final-package.nix;
|
||||
delta-with-git-integration = ./delta-with-git-integration.nix;
|
||||
delta-migration = ./delta-migration.nix;
|
||||
}
|
||||
|
|
|
|||
35
tests/modules/programs/delta/delta-final-package.nix
Normal file
35
tests/modules/programs/delta/delta-final-package.nix
Normal 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'
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue