Comments (2)
The reason for this behaviour is that when you give cabal2nix
a file path as an argument, it still tries to fetch from hackage (because that's what it did before) and also generates expressions that fetch from hackage. To build a nix expression for a local project, you need to supply cabal2nix a directory:
$ cabal2nix /data/apps/cabal2nix
# This file was auto-generated by cabal2nix. Please do NOT edit manually!
{ cabal, Cabal, doctest, filepath, hackageDb, mtl, regexPosix
, transformers
}:
cabal.mkDerivation (self: {
pname = "cabal2nix";
version = "1.69";
src = ./.;
isLibrary = false;
isExecutable = true;
buildDepends = [
Cabal filepath hackageDb mtl regexPosix transformers
];
testDepends = [ doctest ];
doCheck = self.stdenv.lib.versionOlder "7.6" self.ghc.version;
meta = {
homepage = "http://github.com/NixOS/cabal2nix";
description = "Convert Cabal files into Nix build instructions";
license = self.stdenv.lib.licenses.bsd3;
platforms = self.ghc.meta.platforms;
};
})
The logic behind this is that cabal2nix always generates derivations for building from hackage if you supply a cabal file. If you want to build directly from some source, you need to supply the path to that source, not to the cabal file.
$ cabal2nix /data/libs/fsnotify/fsnotify.cabal
* trying fetcher: url
# This file was auto-generated by cabal2nix. Please do NOT edit manually!
{ cabal, async, hinotify, systemFileio, systemFilepath, tasty
, tastyHunit, text, time
}:
cabal.mkDerivation (self: {
pname = "fsnotify";
version = "0.0.11";
sha256 = "03m911pncyzgfdx4aj38azbbmj25fdm3s9l1w27zv0l730fy8ywq";
buildDepends = [
async hinotify systemFileio systemFilepath text time
];
testDepends = [
async systemFileio systemFilepath tasty tastyHunit
];
meta = {
description = "Cross platform library for file change notification";
license = self.stdenv.lib.licenses.bsd3;
platforms = self.ghc.meta.platforms;
};
})
There still remains the bug the specifying the sha256
manually didn't work, though. The error message / documentation could probably also be improved to mention this.
from cabal2nix.
OK, using directory works but as you say, the bug where we manually specify sha256 remains.
from cabal2nix.
Related Issues (20)
- cabal2nix tries to fetch hackage revisions even if already present in the source HOT 2
- hackage2nix: Correctly flag broken Haskell packages HOT 12
- Regression tests for fetcher-based derivations
- docs: Sidebar on left doesn't scroll HOT 1
- Enable hlint on CI
- Map `extra-libraries: FLAC` to pkgs.flac HOT 4
- latest library doesn't pull in other latest library
- do not encourage use of `nix-env` HOT 1
- hackage-db: `signatures` field in `MetaData` has the wrong type
- hackage-db: .cabal file extraction HOT 1
- Confusing output when using --subpath in conjunction with a source that needs to be unpacked
- Improve tooling for making a new release
- Add --disable-library-profiling option HOT 2
- `posix_spawnp: illegal operation` HOT 1
- Support for GitHub/GitLab PR URLs HOT 1
- Add warning redirecting to nixpkgs manual at the top of every readthedocs page
- Get pkg-config dependencies from `pkg-configPackages` HOT 5
- Don't set mainProgram when it matches pname HOT 1
- Component-based build support for `cabal2nix` HOT 5
- Removing `configureCabalFlags` completely HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cabal2nix.