-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathflake.nix
More file actions
61 lines (58 loc) · 1.72 KB
/
flake.nix
File metadata and controls
61 lines (58 loc) · 1.72 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
{
description = "hell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachSystem [ "aarch64-linux" "x86_64-linux" ] (system:
let
pkgs = import nixpkgs { inherit system; };
pkgsStaticArm64 = import nixpkgs {
localSystem = system;
crossSystem = {
config = "aarch64-unknown-linux-musl";
isStatic = true;
};
};
pkgsStaticAmd64 = import nixpkgs {
localSystem = system;
crossSystem = {
config = "x86_64-unknown-linux-musl";
isStatic = true;
};
};
mkStaticApp = hp: hp.haskellPackages.callCabal2nix "hell" ./. {};
app = pkgs.haskellPackages.callCabal2nix "hell" ./. {};
in {
devShells.default = pkgs.haskellPackages.shellFor {
name = "hell-dev";
packages = _: [ app ];
withHoogle = true;
buildInputs = with pkgs.haskellPackages; [
cabal-install
haskell-language-server
fourmolu
hlint
hpack
pkgs.pandoc
pkgs.zlib
];
};
checks = {
run-script-check = pkgs.runCommand "test-hell-script" {
buildInputs = [ app ];
} ''
hell ${./scripts/check.hell} --dir ${./examples} --dir ${./scripts}
touch $out
'';
build = app;
};
packages = {
default = app;
static-arm64 = mkStaticApp pkgsStaticArm64;
static-amd64 = mkStaticApp pkgsStaticAmd64;
};
}
);
}