Skip to content

Commit 0541c96

Browse files
feat: update nix flake
1 parent e42ddba commit 0541c96

File tree

2 files changed

+55
-7
lines changed

2 files changed

+55
-7
lines changed

flake.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
55
inputs.flake-utils.url = "github:numtide/flake-utils";
66
inputs.CHaP = {
7-
url = "github:input-output-hk/cardano-haskell-packages?ref=repo";
7+
url = "github:IntersectMBO/cardano-haskell-packages?ref=repo";
88
flake = false;
99
};
1010
outputs = { self, nixpkgs, flake-utils, haskellNix, CHaP }:
@@ -26,6 +26,41 @@
2626
};
2727

2828
overlays = [ haskellNix.overlay
29+
(final: prev: {
30+
webkitgtk = final.webkitgtk_4_0;
31+
libsodium = with final; stdenv.mkDerivation rec {
32+
pname = "libsodium";
33+
34+
src = fetchGit {
35+
url = "https://github.com/IntersectMBO/libsodium";
36+
rev = version;
37+
};
38+
version = "dbb48cce5429cb6585c9034f002568964f1ce567";
39+
40+
nativeBuildInputs = [ autoreconfHook ];
41+
42+
configureFlags = [ "--enable-static" ]
43+
# Fixes a compilation failure: "undefined reference to `__memcpy_chk'". Note
44+
# that the more natural approach of adding "stackprotector" to
45+
# `hardeningDisable` does not resolve the issue.
46+
++ lib.optional stdenv.hostPlatform.isMinGW "CFLAGS=-fno-stack-protector";
47+
48+
outputs = [ "out" "dev" ];
49+
separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
50+
51+
enableParallelBuilding = true;
52+
53+
doCheck = true;
54+
55+
meta = with lib; {
56+
description = "A modern and easy-to-use crypto library - VRF fork";
57+
homepage = "http://doc.libsodium.org/";
58+
license = licenses.isc;
59+
maintainers = [ "tdammers" "nclarke" ];
60+
platforms = platforms.all;
61+
};
62+
};
63+
})
2964
(final: prev: {
3065
hixProject =
3166
final.haskell-nix.project' {
@@ -34,15 +69,17 @@
3469
# This is used by `nix develop .` to open a shell for use with
3570
# `cabal`, `hlint` and `haskell-language-server`
3671
shell.tools = {
37-
cabal = {} ;
72+
cabal = {};
3873
hlint = {};
3974
haskell-language-server = {};
4075
fourmolu = {};
4176
};
4277
# Non-Haskell shell tools go here
43-
shell.buildInputs = with pkgs; [
78+
shell.buildInputs = with final; [
4479
nixpkgs-fmt
4580
];
81+
# ???: Fix for `nix flake show --allow-import-from-derivation`
82+
evalSystem = "x86_64-linux";
4683
inputMap = { "https://chap.intersectmbo.org/" = CHaP; };
4784
};
4885
})
@@ -52,5 +89,16 @@
5289
flake = pkgs.hixProject.flake {};
5390
in flake // {
5491
legacyPackages = pkgs;
92+
# Built by `nix build .`
93+
packages.default = flake.packages."atlas-cardano:lib:atlas-cardano";
5594
});
95+
# --- Flake Local Nix Configuration ----------------------------
96+
nixConfig = {
97+
# This sets the flake to use the IOG nix cache.
98+
# Nix should ask for permission before using it,
99+
# but remove it here if you do not want it to.
100+
extra-substituters = ["https://cache.iog.io"];
101+
extra-trusted-public-keys = ["hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="];
102+
allow-import-from-derivation = "true";
103+
};
56104
}

0 commit comments

Comments
 (0)