mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Make wrapper derivation
This ensures just `nix build`-ing the flake doesn't forget to run all tests. One can still specifiy specific attributes to just build one thing. Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
parent
6f3045c2a2
commit
b41cc1a755
7 changed files with 142 additions and 39 deletions
|
@ -15,7 +15,7 @@
|
|||
|
||||
, nix-store
|
||||
, nix-expr
|
||||
, nix-ng
|
||||
, nix-cli
|
||||
|
||||
, rapidcheck
|
||||
, gtest
|
||||
|
@ -67,7 +67,7 @@ mkMesonDerivation (finalAttrs: {
|
|||
];
|
||||
|
||||
nativeBuildInputs = finalAttrs.passthru.baseNativeBuildInputs ++ [
|
||||
nix-ng
|
||||
nix-cli
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
|
@ -105,7 +105,7 @@ mkMesonDerivation (finalAttrs: {
|
|||
doCheck = true;
|
||||
|
||||
installPhase = ''
|
||||
touch $out
|
||||
mkdir $out
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
|
|
@ -27,13 +27,13 @@ in
|
|||
};
|
||||
|
||||
config = {
|
||||
passthru.quickBuild =
|
||||
passthru.quickBuild =
|
||||
let withQuickBuild = extendModules { modules = [{ quickBuild = true; }]; };
|
||||
in withQuickBuild.config.test;
|
||||
|
||||
defaults = { pkgs, ... }: {
|
||||
config = lib.mkIf test.config.quickBuild {
|
||||
nix.package = pkgs.nix_noTests;
|
||||
nix.package = pkgs.nixComponents.nix-cli;
|
||||
|
||||
system.forbiddenDependenciesRegexes = [
|
||||
# This would indicate that the quickBuild feature is broken.
|
||||
|
@ -44,4 +44,4 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue