forked from ruuda/hoff
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhoff.nix
108 lines (97 loc) · 2.71 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
# `pkgs` is needed for git. Specifying `git` here would use the `git` library
# from Hackage instead
pkgs, mkDerivation
# Core packages
, coreutils, glibcLocales, lib, makeWrapper, nix-gitignore, openssh
# Haskell packages
, QuickCheck, aeson, aeson-pretty, blaze-html, blaze-markup, bytestring
, containers, cryptonite, directory, effectful, extra, file-embed, filepath
, generic-arbitrary, github, hspec, hspec-core, http-client, http-conduit
, http-types, megaparsec, memory, monad-logger, optparse-applicative, process
, process-extras, prometheus, prometheus-metrics-ghc, quickcheck-instances
, scotty, stm, text, text-format, time, uuid, vector, wai
, wai-middleware-prometheus, warp, warp-tls }:
mkDerivation {
pname = "hoff";
version = "0.36.0"; # 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 `.dist-newstyle` directory, the `.git`
# directory, etc.)
prefixWhitelist = builtins.map builtins.toString [
./app
./package
./src
./static
./tests
./hoff.cabal
./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 = [ pkgs.git coreutils openssh ];
testDepends = [ pkgs.git coreutils openssh ];
libraryHaskellDepends = [
QuickCheck
aeson
aeson-pretty
blaze-html
blaze-markup
bytestring
containers
cryptonite
directory
effectful
extra
file-embed
filepath
generic-arbitrary
github
hspec
hspec-core
http-client
http-conduit
http-types
megaparsec
memory
monad-logger
optparse-applicative
process
process-extras
prometheus
prometheus-metrics-ghc
quickcheck-instances
scotty
stm
text
text-format
time
uuid
vector
wai
wai-middleware-prometheus
warp
warp-tls
];
homepage = "https://github.com/channable/hoff";
license = lib.licenses.asl20;
}