2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, pkgconfig, lxc, buildGoPackage, fetchurl
|
2018-06-28 19:59:07 +01:00
|
|
|
, makeWrapper, acl, rsync, gnutar, xz, btrfs-progs, gzip, dnsmasq
|
2018-10-13 10:44:54 +01:00
|
|
|
, squashfsTools, iproute, iptables, ebtables, libcap, dqlite
|
|
|
|
, sqlite-replication
|
2018-11-20 06:36:56 +00:00
|
|
|
, writeShellScriptBin, apparmor-profiles, apparmor-parser
|
2018-03-16 09:58:54 +00:00
|
|
|
}:
|
2016-06-03 14:55:03 +01:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2018-10-13 10:44:54 +01:00
|
|
|
name = "lxd-3.0.2";
|
2016-06-03 14:55:03 +01:00
|
|
|
|
|
|
|
goPackagePath = "github.com/lxc/lxd";
|
|
|
|
|
2018-03-16 09:58:54 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/lxc/lxd/releases/download/${name}/${name}.tar.gz";
|
2018-10-13 10:44:54 +01:00
|
|
|
sha256 = "1ha8ijzblf15p0kcpgwshswz6s2rdd2b4qnzjw3l72ww620hr84j";
|
2016-06-03 14:55:03 +01:00
|
|
|
};
|
|
|
|
|
2018-03-16 09:58:54 +00:00
|
|
|
preBuild = ''
|
|
|
|
# unpack vendor
|
|
|
|
pushd go/src/github.com/lxc/lxd
|
|
|
|
rm dist/src/github.com/lxc/lxd
|
|
|
|
cp -r dist/src/* ../../..
|
|
|
|
rm -r dist
|
|
|
|
popd
|
|
|
|
'';
|
2016-06-03 14:55:03 +01:00
|
|
|
|
2018-10-13 10:44:54 +01:00
|
|
|
buildFlags = [ "-tags libsqlite3" ];
|
|
|
|
|
2018-03-16 09:58:54 +00:00
|
|
|
postInstall = ''
|
|
|
|
# binaries from test/
|
|
|
|
rm $bin/bin/{deps,macaroon-identity}
|
|
|
|
|
|
|
|
wrapProgram $bin/bin/lxd --prefix PATH ":" ${stdenv.lib.makeBinPath [
|
2018-06-28 19:59:07 +01:00
|
|
|
acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables ebtables
|
2018-11-20 06:36:56 +00:00
|
|
|
(writeShellScriptBin "apparmor_parser" ''
|
|
|
|
exec '${apparmor-parser}/bin/apparmor_parser' -I '${apparmor-profiles}/etc/apparmor.d' "$@"
|
|
|
|
'')
|
2018-03-16 09:58:54 +00:00
|
|
|
]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper ];
|
2018-10-13 10:44:54 +01:00
|
|
|
buildInputs = [ lxc acl libcap dqlite sqlite-replication ];
|
2016-06-03 14:55:03 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Daemon based on liblxc offering a REST API to manage containers";
|
2017-06-20 01:02:54 +01:00
|
|
|
homepage = https://linuxcontainers.org/lxd/;
|
2016-06-03 14:55:03 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ globin fpletz ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|