-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathflake.nix
More file actions
75 lines (67 loc) · 1.78 KB
/
flake.nix
File metadata and controls
75 lines (67 loc) · 1.78 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
utils,
}:
utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
# Package definition for external consumption
packages.default = pkgs.stdenv.mkDerivation {
pname = "giggle";
version = "unstable";
src = ./.;
# Build tools
nativeBuildInputs = with pkgs; [
gcc
gnumake
autoconf
automake
libtool
];
# Libraries
buildInputs = with pkgs; [
zlib
bzip2
xz
curl
openssl
htslib
];
# Set the environment variables expected by the Makefile
preBuild = ''
export HTS_INC=${pkgs.htslib}/include
export HTS_LIB=${pkgs.htslib}/lib
'';
# Standard install phase to output the binary
installPhase = ''
mkdir -p $out/bin
cp bin/giggle $out/bin/
'';
};
# Development shell for contributors
devShells.default = pkgs.mkShell {
# Automatically inherit all the build dependencies from the package above
inputsFrom = [ self.packages.${system}.default ];
packages = with pkgs; [
# Testing/utilities not needed for the build itself, but useful for dev
bedtools
];
shellHook = ''
export GIGGLE_ROOT=$PWD
export HTS_INC=${pkgs.htslib}/include
export HTS_LIB=${pkgs.htslib}/lib
'';
};
}
);
}