mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
mkPackages: automagically wrapping with hello as a test package
This commit is contained in:
parent
cbbf862d6b
commit
98c4d12843
4 changed files with 94 additions and 18 deletions
7
packages/hello/call.nix
Normal file
7
packages/hello/call.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ callPackage }:
|
||||
{
|
||||
callPackage = f: x: callPackage f ({ bar = "foo"; } // x);
|
||||
args = {
|
||||
foo = "bar";
|
||||
};
|
||||
}
|
||||
19
packages/hello/package.nix
Normal file
19
packages/hello/package.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
stdenv,
|
||||
fetchurl,
|
||||
foo,
|
||||
bar,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hello";
|
||||
version = "2.12.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/hello/hello-${finalAttrs.version}.tar.gz";
|
||||
hash = "sha256-jZkUKv2SV28wsM18tCqNxoCZmLxdYH2Idh9RLibH2yA=";
|
||||
};
|
||||
passthru = {
|
||||
inherit foo bar;
|
||||
};
|
||||
})
|
||||
17
packages/hello/wrapper.nix
Normal file
17
packages/hello/wrapper.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
symlinkJoin,
|
||||
foo,
|
||||
bar,
|
||||
hello-unwrapped,
|
||||
}:
|
||||
symlinkJoin {
|
||||
name = "hello-wrapped";
|
||||
paths = [ hello-unwrapped ];
|
||||
postBuild = ''
|
||||
ln -s $out/bin/hello $out/bin/hello-wrapped
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit foo bar;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue