-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathoverlay.nix
96 lines (95 loc) · 2.87 KB
/
overlay.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
final: prev:
let
b9cOsRuntimeDeps = with final;
[
libvirt
systemd
rsync
docker
podman
];
b9cRuntimeDeps = with final;
[
cdrkit
openssh
qemu
e2fsprogs
xorriso
bash
curl
coreutils
dosfstools
mtools
];
b9-flake = final.b9-haskell-project.flake { };
b9c-unwrapped = b9-flake.packages."b9:exe:b9c";
b9-haskell-project =
final.haskell-nix.cabalProject' {
name = "b9-haskell-project";
src = ./.;
compiler-nix-name = "ghc8107";
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
shell = {
tools = {
cabal = { };
hlint = { };
haskell-language-server = { };
};
exactDeps = true;
NIX_SHELL_TAG = "b9";
shellHook = ''
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
echo
echo "___________________________________________________"
echo " "
echo " B9 Development Environment "
echo "___________________________________________________"
echo " "
echo " * use 'cabal' to build this software "
echo " "
echo "==================================================="
echo
'';
};
modules = [
{
packages.b9.components.tests.spec.build-tools = [
b9-haskell-project.hsPkgs.hspec-discover
];
}
];
index-state = "2021-09-03T00:00:00Z";
checkMaterialization = false;
materialized = ./nix/materialization/b9;
};
in {
inherit b9-haskell-project b9c-unwrapped b9cOsRuntimeDeps b9cRuntimeDeps;
b9c =
prev.stdenvNoCC.mkDerivation {
name = "b9c";
buildInputs = [ prev.makeWrapper ];
depsHostHost = b9cRuntimeDeps ++ b9cOsRuntimeDeps;
phases = [ "buildPhase" "installPhase" ];
buildPhase = ''
mkdir -p $out/bin
cp ${b9c-unwrapped}/bin/b9c $out/bin
'';
installPhase = ''
wrapProgram \
$out/bin/b9c \
--prefix PATH : "${prev.lib.makeBinPath b9cRuntimeDeps}:" \
--suffix PATH : "${prev.lib.makeBinPath b9cOsRuntimeDeps}:" \
--suffix PATH : "${prev.libvirt}/libexec" \
--set-default B9_LIBVIRT_LXC "${prev.libvirt}/libexec/libvirt_lxc"
'';
meta = {
homepage = final.b9c-unwrapped.meta.homepage;
description = final.b9c-unwrapped.meta.description + " CLI-only version";
license = final.b9c-unwrapped.meta.license;
platforms = final.b9c-unwrapped.meta.platforms;
};
};
}