-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
65 lines (65 loc) · 1.79 KB
/
flake.nix
File metadata and controls
65 lines (65 loc) · 1.79 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
appimage.url = "github:ralismark/nix-appimage";
};
outputs =
{
flake-parts,
nixpkgs,
appimage,
...
}@inputs:
let
hs-project =
{
pkgs,
hp ? pkgs.haskellPackages,
isShell ? false,
}:
hp.developPackage {
root = ./.;
returnShellEnv = isShell;
modifier =
drv:
pkgs.haskell.lib.addBuildTools drv (
with pkgs;
[
cabal-install
haskell-language-server
]
);
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.platforms.unix;
perSystem =
{ pkgs, ... }:
{
packages.default = (hs-project { inherit pkgs; }).overrideAttrs {
nativeBuildInputs = [
pkgs.makeWrapper
pkgs.removeReferencesTo
];
postInstall = ''wrapProgram $out/bin/chipi-chapa --set LD_LIBRARY_PATH ${
pkgs.lib.makeLibraryPath [ pkgs.alsa-lib ]
}'';
};
packages.bin = (hs-project { inherit pkgs; }).overrideAttrs {
nativeBuildInputs = [
pkgs.patchelf
pkgs.removeReferencesTo
];
postInstall = ''patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 $out/bin/chipi-chapa'';
};
# packages.appimage = appimage.lib.${pkgs.system}.mkAppImage {
# program = "${hs-project { inherit pkgs; }}/bin/chipi-chapa";
# };
devShells.default = hs-project {
inherit pkgs;
isShell = true;
};
};
};
}