From 35868fe4cd2aa15070cfbf8d33f7035314ebcbb5 Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Tue, 13 Aug 2024 13:49:28 +0200 Subject: [PATCH] add simple override test Signed-off-by: Markus Theil --- test.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test.nix b/test.nix index 20ffe63..53c8d0d 100644 --- a/test.nix +++ b/test.nix @@ -22,7 +22,8 @@ let ''; inherit (pkgs) lib; - # Generate a git repository hat can be served via HTTP. + + # Generate a git repository that can be served via HTTP. # # By default the repository will contain an empty `test.txt` # file. For all defined tags the name of the tag is written to that @@ -423,4 +424,17 @@ in ''; }; }; + + gitDependencyOverride = mkGitTest rec { + name = "git-dependency-override"; + repositories."foo" = gitRepo; + commands = '' + npins init --bare + npins add git http://localhost:8000/foo -b test-branch + npins show + + OUTPATH=$(NPINS_OVERRIDE_foo=/foo nix-instantiate --eval npins -A foo.outPath --impure) + eq "$OUTPATH" "/foo" + ''; + }; }