We have a repo with a subdirectory acting as the Cabal project. In this subdirectory lies the README.md
but as a symlink targeting the one in repo root (i.e., ../README.md
). I tried the following to forcefully copy over the target (so that it remains available to cabal builds).
+ 36 projectDrv0 = haskellPackages.override {
+ 37 overrides = self: super: with pkgs.haskell.lib; {
+ 38 summoner = overrideCabal (self.callCabal2nix "summoner" ./summoner-cli {}) (drv: {
+ 39 postUnpack = "cp --remove-destination ${./README.md} $src/README.md";
+ 40
+ 41 });
+ 43 };
+ 44 };
But this does’t work:
cp: cannot remove '/nix/store/drzs7mzc03cjgs4q95maz0g1wcn8sv2d-summoner-cli/README.md': Permission denied
Is there no way to modify a source path in Nix?