mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 07:16:17 +02:00
Add resolvePath, filesetToSource indirections for Nixpkgs
This commit is contained in:
parent
0729f0a113
commit
bea54d116e
5 changed files with 18 additions and 5 deletions
|
@ -14,9 +14,16 @@
|
|||
let
|
||||
inherit (pkgs) lib;
|
||||
|
||||
root = ../.;
|
||||
|
||||
# Nixpkgs implements this by returning a subpath into the fetched Nix sources.
|
||||
resolvePath = p: p;
|
||||
|
||||
# Indirection for Nixpkgs to override when package.nix files are vendored
|
||||
filesetToSource = lib.fileset.toSource;
|
||||
|
||||
localSourceLayer = finalAttrs: prevAttrs:
|
||||
let
|
||||
root = ../.;
|
||||
workDirPath =
|
||||
# Ideally we'd pick finalAttrs.workDir, but for now `mkDerivation` has
|
||||
# the requirement that everything except passthru and meta must be
|
||||
|
@ -104,5 +111,7 @@ scope: {
|
|||
meta.platforms = lib.platforms.all;
|
||||
});
|
||||
|
||||
inherit resolvePath filesetToSource;
|
||||
|
||||
mkMesonDerivation = f: stdenv.mkDerivation (lib.extends localSourceLayer f);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# Configuration Options
|
||||
|
||||
, version
|
||||
, resolvePath
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -84,7 +85,7 @@ mkMesonDerivation (finalAttrs: {
|
|||
run = runCommand "${finalAttrs.pname}-run" {
|
||||
} ''
|
||||
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH"
|
||||
export _NIX_TEST_UNIT_DATA=${./data}
|
||||
export _NIX_TEST_UNIT_DATA=${resolvePath ./data}
|
||||
nix-expr-tests
|
||||
touch $out
|
||||
'';
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
# Configuration Options
|
||||
|
||||
, version
|
||||
, resolvePath
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -82,7 +83,7 @@ mkMesonDerivation (finalAttrs: {
|
|||
run = runCommand "${finalAttrs.pname}-run" {
|
||||
} ''
|
||||
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH"
|
||||
export _NIX_TEST_UNIT_DATA=${./data}
|
||||
export _NIX_TEST_UNIT_DATA=${resolvePath ./data}
|
||||
nix-fetchers-tests
|
||||
touch $out
|
||||
'';
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
# Configuration Options
|
||||
|
||||
, version
|
||||
, resolvePath
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -82,7 +83,7 @@ mkMesonDerivation (finalAttrs: {
|
|||
run = runCommand "${finalAttrs.pname}-run" {
|
||||
} ''
|
||||
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH"
|
||||
export _NIX_TEST_UNIT_DATA=${./data}
|
||||
export _NIX_TEST_UNIT_DATA=${resolvePath ./data}
|
||||
nix-flake-tests
|
||||
touch $out
|
||||
'';
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
# Configuration Options
|
||||
|
||||
, version
|
||||
, filesetToSource
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -86,7 +87,7 @@ mkMesonDerivation (finalAttrs: {
|
|||
run = let
|
||||
# Some data is shared with the functional tests: they create it,
|
||||
# we consume it.
|
||||
data = lib.fileset.toSource {
|
||||
data = filesetToSource {
|
||||
root = ../..;
|
||||
fileset = lib.fileset.unions [
|
||||
./data
|
||||
|
|
Loading…
Reference in a new issue