-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.nix
52 lines (49 loc) · 2.03 KB
/
default.nix
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
{ compiler-nix-name ? "ghc984" }:
let
# Read in the Niv sources
sources = import ./nix/sources.nix {};
# If ./nix/sources.nix file is not found run:
# niv init
# niv add input-output-hk/haskell.nix -n haskellNix
# Fetch the haskell.nix commit we have pinned with Niv
haskellNix = import sources.haskellNix { };
# If haskellNix is not found run:
# niv add input-output-hk/haskell.nix -n haskellNix
# Import nixpkgs and pass the haskell.nix provided nixpkgsArgs
overlays = haskellNix.overlays ++ [
(self: super: {
postgresql = super.postgresql.overrideAttrs (_: { doCheck = false;});
})
];
# Import nixpkgs and pass the haskell.nix provided nixpkgsArgs
pkgs = import
# haskell.nix provides access to the nixpkgs pins which are used by our CI,
# hence you will be more likely to get cache hits when using these.
# But you can also just use your own, e.g. '<nixpkgs>'.
haskellNix.sources.nixpkgs-unstable
# These arguments passed to nixpkgs, include some patches and also
# the haskell.nix functionality itself as an overlay.
(haskellNix.nixpkgsArgs // { inherit overlays; });
in pkgs.haskell-nix.cabalProject {
# 'cleanGit' cleans a source directory based on the files known by git
src = pkgs.haskell-nix.haskellLib.cleanGit {
src = ./.;
name = "haskell-periodic";
};
index-state = "2025-01-16T00:00:00Z";
index-sha256 = "09b1b10b246208b5afbb4349ba3f706f6a50915282f2ad863702550225e49cc3";
sha256map = import ./nix/sha256map.nix;
# Specify the GHC version to use.
compiler-nix-name = compiler-nix-name;
modules = [(
{pkgs, ...}: {
packages.periodic-server.configureFlags = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isMusl [
"--ghc-option=-optl=-lssl"
"--ghc-option=-optl=-lcrypto"
"--ghc-option=-optl=-lpgport"
"--ghc-option=-optl=-lpgcommon"
"--ghc-option=-optl=-L${pkgs.postgresql.lib.out}/lib"
"--ghc-option=-optl=-L${pkgs.openssl.out}/lib"
];
})];
}