Skip to content

Commit

Permalink
packaging: Expose libs
Browse files Browse the repository at this point in the history
This exposes the libraries in a way that is easily replicated in
Nixpkgs, without having to create a package set within a package
set.
  • Loading branch information
roberth committed Aug 23, 2024
1 parent 0bcc83d commit 2a14a20
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion packaging/everything.nix
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@
] ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
nix-perl-bindings
];
}).overrideAttrs (_: {
}).overrideAttrs (finalAttrs: prevAttrs: {
doCheck = true;
doInstallCheck = true;

@@ -90,4 +90,37 @@
installCheckInputs = [
nix-functional-tests
];
passthru = prevAttrs.passthru // {
/**
These are the libraries that are part of the Nix project. They are used
by the Nix CLI and other tools.
If you need to use these libraries in your project, we recommend to use
the `-c` C API libraries exclusively, if possible.
We also recommend that you build the complete package to ensure that the unit tests pass.
You could do this in CI, or by passing it in an unused environment variable. e.g in a `mkDerivation` call:
```nix
buildInputs = [ nix.libs.nix-util-c nix.libs.nix-store-c ];
# Make sure the nix libs we use are ok
unusedInputsForTests = [ nix ];
disallowedReferences = nix.all;
```
*/
libs = {
inherit
nix-util
nix-util-c
nix-store
nix-store-c
nix-fetchers
nix-expr
nix-expr-c
nix-flake
nix-main
nix-main-c
;
};
};
})

0 comments on commit 2a14a20

Please sign in to comment.