Skip to content

Commit fb18457

Browse files
committed
Use explicitly-generated cabal2nix file
For some reason, relying on `callCabal2nix` in the all-compilers overlay wasn't working when I tried to depend on our modified `scrypt` package for our own use - something about the resulting derivation was making Nix unhappy. However, this manually-generated Nix derivation *does* work, and is functionally identical, so let's use it. The only annoyance will be remembering to re-generate the file when we change the `.cabal` file. This also avoids a use of IFD, which flakes don't tend to like.
1 parent ef5fbc3 commit fb18457

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Diff for: cabal2nix-scrypt.nix

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{ mkDerivation, base, base64-bytestring, bytestring, c2hs, entropy
2+
, HUnit, lib, QuickCheck, scrypt-kdf, test-framework
3+
, test-framework-hunit, test-framework-quickcheck2
4+
}:
5+
mkDerivation {
6+
pname = "scrypt";
7+
version = "0.5.0";
8+
src = ./.;
9+
libraryHaskellDepends = [
10+
base base64-bytestring bytestring entropy
11+
];
12+
librarySystemDepends = [ scrypt-kdf ];
13+
libraryToolDepends = [ c2hs ];
14+
testHaskellDepends = [
15+
base bytestring HUnit QuickCheck test-framework
16+
test-framework-hunit test-framework-quickcheck2
17+
];
18+
homepage = "http://github.com/informatikr/scrypt";
19+
description = "Stronger password hashing via sequential memory-hard functions";
20+
license = lib.licenses.bsd3;
21+
}

Diff for: flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
haskell = prev.haskell // {
1616
packageOverrides = final.lib.composeExtensions (prev.haskell.packageOverrides or (_: _: {}))
1717
(hsFinal: hsPrev: {
18-
scrypt = hsFinal.callCabal2nix "scrypt" ./.
18+
scrypt = hsFinal.callPackage (import ./cabal2nix-scrypt.nix)
1919
{ scrypt-kdf = prev.scrypt.dev; };
2020
});
2121
};

0 commit comments

Comments
 (0)