-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
100 lines (80 loc) · 2.55 KB
/
Copy pathflake.nix
File metadata and controls
100 lines (80 loc) · 2.55 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
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
{
description = "StarIntel v0.9.0 document specification for Nim";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
mkPackage = pkgs:
pkgs.stdenvNoCC.mkDerivation {
pname = "starintel-doc-nim";
version = "0.9.0";
src = self;
nativeBuildInputs = [ pkgs.nim ]
++ pkgs.lib.optional (pkgs ? nimble) pkgs.nimble;
dontConfigure = true;
dontBuild = true;
doCheck = true;
checkPhase = ''
runHook preCheck
export HOME="$TMPDIR"
export NIMBLE_DIR="$TMPDIR/nimble"
mkdir -p "$HOME" "$NIMBLE_DIR"
command -v nimble >/dev/null
nimble dump >/dev/null
runHook postCheck
'';
installPhase = ''
runHook preInstall
root="$out/share/nimble/starintel_doc-0.9.0"
mkdir -p "$root"
for path in src starintel_doc.nimble README.md LICENSE changelog.org; do
if [ -e "$path" ]; then
cp -R "$path" "$root/"
fi
done
ln -s "starintel_doc-0.9.0" "$out/share/nimble/starintel_doc"
runHook postInstall
'';
passthru = {
nimblePath = "share/nimble/starintel_doc";
sourcePath = "share/nimble/starintel_doc/src";
};
meta = {
description = "StarIntel v0.9.0 parser, validator, serializer, and conformance adapter for Nim";
homepage = "https://github.com/lost-rob0t/starintel-doc.nim";
};
};
in
{
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
package = mkPackage pkgs;
in
{
default = package;
starintel-doc-nim = package;
});
checks = forAllSystems (system: {
default = self.packages.${system}.starintel-doc-nim;
});
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
packages = [ pkgs.nim ]
++ pkgs.lib.optional (pkgs ? nimble) pkgs.nimble
++ pkgs.lib.optional (pkgs ? nim_lk) pkgs.nim_lk;
};
});
overlays.default = final: _prev: {
starintel-doc-nim = mkPackage final;
};
};
}