Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ drowse.instantiate (finalAttrs: {
version = "${finalAttrs.version}";
}
'';
env.NIX_PATH = "nixpkgs=${path}";
env.NIX_PATH = "nixpkgs=${nixpkgs}";
dontUnpack = true;
})
```
Expand All @@ -147,7 +147,7 @@ drowse.mkDynamicDerivation {
version = "0.3.3";

nativeBuildInputs = [ nix ];
env.NIX_PATH = "nixpkgs=${path}";
env.NIX_PATH = "nixpkgs=${nixpkgs}";

buildCommand = ''
drv=$(nix-instantiate --expr "(import <nixpkgs> { }).nix-init")
Expand Down
15 changes: 15 additions & 0 deletions src/__pathToString.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# avoid copying stuff to the store when possible

{ lib }:

path:

if !lib.isDerivation path && lib.isStorePath path then
let
str = toString path;
in
builtins.appendContext str {
${str}.path = true;
}
else
"${path}"
2 changes: 1 addition & 1 deletion src/callPackage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ lib.extendMkDerivation {
'';

env = {
NIX_PATH = "nixpkgs=${path}";
NIX_PATH = "nixpkgs=${super.pathToString path}";
}
// env;

Expand Down
2 changes: 1 addition & 1 deletion src/crate2nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ lib.extendMkDerivation {
'';

env = {
NIX_PATH = "nixpkgs=${path}";
NIX_PATH = "nixpkgs=${super.pathToString path}";
}
// env;

Expand Down