-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathflake.nix
More file actions
105 lines (97 loc) · 3.94 KB
/
flake.nix
File metadata and controls
105 lines (97 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{
description = "atlas-cardano";
inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.CHaP = {
url = "github:IntersectMBO/cardano-haskell-packages?ref=repo";
flake = false;
};
outputs = { self, nixpkgs, flake-utils, haskellNix, CHaP }:
let
supportedSystems = [
"x86_64-linux"
];
in
flake-utils.lib.eachSystem supportedSystems (system:
let
overlay = final: prev: {
haskell-nix = prev.haskell-nix // {
extraPkgconfigMappings = prev.haskell-nix.extraPkgconfigMappings // {
# String pkgconfig-depends names are mapped to lists of Nixpkgs
# package names
"libblst" = [ "blst" ];
};
};
};
overlays = [ haskellNix.overlay
(final: prev: {
webkitgtk = final.webkitgtk_4_0;
libsodium = with final; stdenv.mkDerivation rec {
pname = "libsodium";
src = fetchGit {
url = "https://github.com/IntersectMBO/libsodium";
rev = version;
};
version = "dbb48cce5429cb6585c9034f002568964f1ce567";
nativeBuildInputs = [ autoreconfHook ];
configureFlags = [ "--enable-static" ]
# Fixes a compilation failure: "undefined reference to `__memcpy_chk'". Note
# that the more natural approach of adding "stackprotector" to
# `hardeningDisable` does not resolve the issue.
++ lib.optional stdenv.hostPlatform.isMinGW "CFLAGS=-fno-stack-protector";
outputs = [ "out" "dev" ];
separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
enableParallelBuilding = true;
doCheck = true;
meta = with lib; {
description = "A modern and easy-to-use crypto library - VRF fork";
homepage = "http://doc.libsodium.org/";
license = licenses.isc;
maintainers = [ "tdammers" "nclarke" ];
platforms = platforms.all;
};
};
})
(final: prev: {
hixProject =
final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc966";
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
shell.tools = {
cabal = {};
hlint = {};
haskell-language-server = {};
# ghc-lib-parser doesnt compile with anything newer
fourmolu = "0.17.0.0";
};
# Non-Haskell shell tools go here
shell.buildInputs = with final; [
nixpkgs-fmt
];
# ???: Fix for `nix flake show --allow-import-from-derivation`
evalSystem = "x86_64-linux";
inputMap = { "https://chap.intersectmbo.org/" = CHaP; };
};
})
overlay
];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
flake = pkgs.hixProject.flake {};
in flake // {
legacyPackages = pkgs;
# Built by `nix build .`
packages.default = flake.packages."atlas-cardano:lib:atlas-cardano";
});
# --- Flake Local Nix Configuration ----------------------------
nixConfig = {
# This sets the flake to use the IOG nix cache.
# Nix should ask for permission before using it,
# but remove it here if you do not want it to.
extra-substituters = ["https://cache.iog.io"];
extra-trusted-public-keys = ["hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="];
allow-import-from-derivation = "true";
};
}