Skip to content

Instantly share code, notes, and snippets.

@samueldr
Created March 3, 2021 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueldr/56971b019bf23f235bee27da9a5d85c3 to your computer and use it in GitHub Desktop.
Save samueldr/56971b019bf23f235bee27da9a5d85c3 to your computer and use it in GitHub Desktop.
let
test-dependency = { stdenv }:
stdenv.mkDerivation {
name = "test-dependency";
# This will be overriden using `.overrideAttrs`
buildInputs = [ (throw "Should not throw") ];
installPhase = ''
echo ok > $out
'';
unpackPhase = ":";
}
;
test-dependency-too = { runCommandNoCC }:
runCommandNoCC "test-dependency-too" {
# This will be overriden using `.overrideAttrs`
buildInputs = [ (throw "Should not throw") ];
} ''
echo ok > $out
''
;
pkgs = import ./. {
overlays = [
(self: super: {
test-dependency = self.callPackage test-dependency {};
test-dependency-too = self.callPackage test-dependency-too {};
})
];
};
in
{
# a_ = pkgs.test-dependency
# .overrideAttrs(_: { /* verify it fails as expected */ })
# ;
aa = pkgs.test-dependency
.overrideAttrs(_: { buildInputs = []; })
;
ab = pkgs.pkgsCross.aarch64-multiplatform.test-dependency
.overrideAttrs(_: { buildInputs = []; })
;
/*
# Why is this failing?
ac = pkgs.pkgsStatic.test-dependency
.overrideAttrs(_: { buildInputs = []; })
;
/* */
# b_ = pkgs.test-dependency-too
# .overrideAttrs(_: { /* verify it fails as expected */ })
# ;
ba = pkgs.test-dependency-too
.overrideAttrs(_: { buildInputs = []; })
;
bb = pkgs.pkgsCross.aarch64-multiplatform.test-dependency-too
.overrideAttrs(_: { buildInputs = []; })
;
# And why is this one not failing?
bc = pkgs.pkgsStatic.test-dependency-too
.overrideAttrs(_: { buildInputs = []; })
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment