-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
64 lines (56 loc) · 1.87 KB
/
flake.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
53
54
55
56
57
58
59
60
61
62
63
64
{
description = "hasec";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
github = owner: repo: rev: sha256:
builtins.fetchTarball { inherit sha256; url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; };
sources = { };
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.unmarkBroken pkg));
haskellPackages = pkgs.haskell.packages.ghc925.override
{
overrides = hself: hsuper: {
# text = haskellPackages.text_2_0_2;
# parsec = haskellPackages.parsec_3_1_16_1;
};
};
in
rec
{
packages.hasec-core =
haskellPackages.callCabal2nix "hasec-core" ./hasec-core rec {
# Dependency overrides go here
};
defaultPackage = packages.hasec-core;
devShell =
let
scripts = pkgs.symlinkJoin {
name = "scripts";
paths = pkgs.lib.mapAttrsToList pkgs.writeShellScriptBin {
ormolu-ide = ''
${pkgs.ormolu}/bin/ormolu -o -XNoImportQualifiedPost -o -XOverloadedRecordDot $@
'';
};
};
in
pkgs.mkShell {
buildInputs = with haskellPackages; [
haskell-language-server
ghcid
cabal-install
scripts
ormolu
];
inputsFrom = [
self.defaultPackage.${system}.env
];
};
});
}