Closed mputz86 closed 5 years ago
Why does nix copy files? Can it copy with cp --dereference
?
Can you build your project with stack or cabal-install and then copy executables only?
Why does nix copy files? Can it copy with
cp --dereference
?
With my knowledge of nix, I dont know if there is a solution like this. I guess expressing the situation more correctly is, that nix assumes self-contained "projects" which can be built with cabal.
Can you build your project with stack or cabal-install and then copy executables only?
Hm, no, guess not. This is not the idea of nix. But I may be wrong.
Maybe we need somebody who is expert in nix to help us/me out.
For reference: here is the base of how the ron-git is used within my nix file:
https://gist.github.com/mputz86/3a48c964594966560da8ef4a172bf715
In essence it is:
specifying the source
ron-src = pkgs.fetchFromGitHub {
owner = "ff-notes";
repo = "ron";
rev = "refs/heads/master";
sha256 = "1drq383zjh789xrihpz2zlq49yd4j89x589xj0qwm99dhs33bzyd";
};
and then overriding the package like this:
ron-storage = self.callCabal2nix "ron-storage" (ron-src + "/ron-storage") {};
ron-schema = self.callCabal2nix "ron-schema" (ron-src + "/ron-schema") {};
ron-rdt = self.callCabal2nix "ron-rdt" (ron-src + "/ron-rdt") {};
ron = dontCheck (self.callCabal2nix "ron" (ron-src + "/ron") {});
The problem is the subdir reference.
Well, the source code wasn't intended to be used as a cabal package directly, only to be a source for cabal package. But I don't see a problem with such use. Let's make them proper packages.
When ron sub-packages are used with nix build, the sub dirs are copied and therefore the link to the LICENSE file in the parent can not be found.
This change is