-
Notifications
You must be signed in to change notification settings - Fork 34
/
default.nix
108 lines (90 loc) · 2.27 KB
/
default.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
let
fetchTarballFromGitHub =
{ owner, repo, rev, sha256, ... }:
builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/tarball/${rev}";
inherit sha256;
};
fromJSONFile = f: builtins.fromJSON (builtins.readFile f);
genMeta = { ghc, stdenv, ...}: with stdenv.lib; {
description = "Software Foundations in Idris";
homepage = https://idris-hackers.github.io/software-foundations;
license = licenses.mit;
maintainers = with maintainers; [ yurrriq ];
inherit (ghc.meta) platforms;
};
in
{ nixpkgs ? fetchTarballFromGitHub (fromJSONFile ./nixpkgs-src.json) }:
with import nixpkgs {
overlays = [
(self: super: {
idrisPackages = super.idrisPackages // {
software_foundations = with super.idrisPackages; build-idris-package {
name = "software_foundations";
version = builtins.readFile ./VERSION;
src = ./.;
idrisDeps = [ pruviloj ];
meta = genMeta super;
};
};
})
(self: super: {
idris = with super.idrisPackages; with-packages [
base
prelude
pruviloj
software_foundations
];
pandoc = super.haskellPackages.ghcWithPackages (ps: with ps; [
pandoc
]);
inherit (super.pythonPackages) pygments;
xelatex = super.texlive.combine {
inherit (super.texlive) scheme-small
amsmath
datatool
dirtytalk
ebproof
fontspec
framed
fvextra
glossaries
ifplatform
latexmk
lm-math
mfirstuc
minted
newunicodechar
substr
todonotes
xetex
xfor
xindy
xstring;
};
})
];
};
stdenv.mkDerivation rec {
name = "sf-idris-${version}";
version = builtins.readFile ./VERSION;
src = ./.;
FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ iosevka ]; };
patchPhase = lib.optionalString (! lib.inNixShell) ''
patchShebangs src/pandoc-minted.hs
'';
nativeBuildInputs = [
pandoc
pygments
xelatex
which
];
buildInputs = [
idris
];
makeFlags = [ "PREFIX=$(out)" ];
dontInstall = true;
meta = (genMeta pkgs) // {
platforms = lib.platforms.linux;
};
}