forked from lep/jassdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
60 lines (52 loc) · 1.41 KB
/
flake.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
{
inputs = {
# nixpkgs.url = "github:NixOs/nixpkgs";
systems.url = "github:nix-systems/default";
};
outputs = { self, nixpkgs, systems }:
let eachSystem = nixpkgs.lib.genAttrs (import systems);
in {
packages = eachSystem (system:
let
pkgs = import nixpkgs { inherit system; };
ghc = pkgs.haskellPackages.ghcWithPackages (ps: [
ps.megaparsec
ps.optparse-applicative
ps.bytestring
ps.aeson
]);
mkdocs = pkgs.stdenv.mkDerivation {
name = "mkdocs";
src = self;
buildPhase = ''
${ghc}/bin/ghc mkdocs
'';
installPhase = ''
install -Dt $out/bin mkdocs
'';
};
jassdoc = pkgs.stdenv.mkDerivation {
name = "jassdoc";
src = self;
buildInputs = [
pkgs.gnumake
pkgs.perl
pkgs.perlPackages.DBI
pkgs.perlPackages.DBDSQLite
pkgs.sqlite
pkgs.cabal-install
];
buildPhase = ''
MKDOCS=${mkdocs}/bin/mkdocs make jass.db
'';
installPhase = ''
install -Dt $out jass.db
'';
};
in {
default = jassdoc;
jassdoc = jassdoc;
mkdocs = mkdocs;
});
};
}