forked from channable/hoff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhoff.nix
61 lines (50 loc) · 1.78 KB
/
hoff.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
{ lib, haskellPackages, nix-gitignore, git, coreutils, openssh, glibcLocales, makeWrapper }:
let
haskellLibs = import ./nix/haskell-dependencies.nix haskellPackages;
in
haskellPackages.mkDerivation {
pname = "hoff";
version = "0.27.4"; # please keep consistent with hoff.cabal
src =
let
# We do not want to include all files, because that leads to a lot of things that nix
# has to copy to the temporary build directory that we don't want to have in there
# (e.g. the `.stack-work` directory, the `.git` directory, etc.)
prefixWhitelist = builtins.map builtins.toString [
./app
./package
./src
./static
./tests
./hoff.cabal
./stack.yaml
./license
];
# Compute source based on whitelist
whitelistFilter = path: _type: lib.any (prefix: lib.hasPrefix prefix path) prefixWhitelist;
gitignore = builtins.readFile ./.gitignore;
gitignoreFilter = nix-gitignore.gitignoreFilterPure whitelistFilter gitignore ./.;
whitelistedSrc = lib.cleanSourceWith {
src = lib.cleanSource ./.;
filter = gitignoreFilter;
};
in
whitelistedSrc;
buildTools = [ makeWrapper ];
postInstall = ''
# Set LOCALE_ARCHIVE so that glibc can find the locales it needs when running on Ubuntu
# machines.
wrapProgram $out/bin/hoff --set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive
'';
isLibrary = false;
isExecutable = true;
executableToolDepends = [
git coreutils openssh
];
testDepends = [
git coreutils openssh
];
libraryHaskellDepends = haskellLibs;
homepage = "https://github.com/channable/hoff";
license = lib.licenses.asl20;
}