nixpkgs/pkgs/tools/admin/lxd/default.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, pkgconfig, lxc, buildGoPackage, fetchurl
2018-06-28 20:59:07 +02:00
, makeWrapper, acl, rsync, gnutar, xz, btrfs-progs, gzip, dnsmasq
, squashfsTools, iproute, iptables, ebtables
2018-03-16 10:58:54 +01:00
}:
2016-06-03 15:55:03 +02:00
buildGoPackage rec {
2018-03-16 10:58:54 +01:00
name = "lxd-3.0.0";
2016-06-03 15:55:03 +02:00
goPackagePath = "github.com/lxc/lxd";
2018-03-16 10:58:54 +01:00
src = fetchurl {
url = "https://github.com/lxc/lxd/releases/download/${name}/${name}.tar.gz";
sha256 = "0m5prdf9sk8k5bws1zva4n9ycggmy76wnjr6wb423066pszz24ww";
2016-06-03 15:55:03 +02:00
};
2018-03-16 10:58:54 +01: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 15:55:03 +02:00
2018-03-16 10:58:54 +01:00
postInstall = ''
# binaries from test/
rm $bin/bin/{deps,macaroon-identity}
wrapProgram $bin/bin/lxd --prefix PATH ":" ${stdenv.lib.makeBinPath [
2018-06-28 20:59:07 +02:00
acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables ebtables
2018-03-16 10:58:54 +01:00
]}
'';
nativeBuildInputs = [ pkgconfig makeWrapper ];
buildInputs = [ lxc acl ];
2016-06-03 15:55:03 +02:00
meta = with stdenv.lib; {
description = "Daemon based on liblxc offering a REST API to manage containers";
2017-06-20 02:02:54 +02:00
homepage = https://linuxcontainers.org/lxd/;
2016-06-03 15:55:03 +02:00
license = licenses.asl20;
maintainers = with maintainers; [ globin fpletz ];
platforms = platforms.linux;
};
}