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

55 lines
1.6 KiB
Nix
Raw Normal View History

{ stdenv, pkgconfig, lxc, buildGoPackage, fetchurl
2018-06-28 18:59:07 +00:00
, makeWrapper, acl, rsync, gnutar, xz, btrfs-progs, gzip, dnsmasq
2018-10-13 09:44:54 +00:00
, squashfsTools, iproute, iptables, ebtables, libcap, dqlite
, sqlite-replication
, writeShellScriptBin, apparmor-profiles, apparmor-parser
2019-07-09 16:47:19 +00:00
, criu
, bash
2018-03-16 09:58:54 +00:00
}:
2016-06-03 13:55:03 +00:00
buildGoPackage rec {
pname = "lxd";
version = "3.13";
2016-06-03 13:55:03 +00:00
goPackagePath = "github.com/lxc/lxd";
2018-03-16 09:58:54 +00:00
src = fetchurl {
url = "https://github.com/lxc/lxd/releases/download/${pname}-${version}/${pname}-${version}.tar.gz";
sha256 = "1kasnzd8hw9biyx8avbjmpfax1pdbp9g543g8hs6xpksmk93hl82";
2016-06-03 13:55:03 +00: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 13:55:03 +00:00
2018-10-13 09:44:54 +00:00
buildFlags = [ "-tags libsqlite3" ];
2018-03-16 09:58:54 +00:00
postInstall = ''
2019-02-08 06:54:38 +00:00
# test binaries, code generation
rm $bin/bin/{deps,macaroon-identity,generate}
2018-03-16 09:58:54 +00:00
wrapProgram $bin/bin/lxd --prefix PATH : ${stdenv.lib.makeBinPath [
2019-07-09 16:47:19 +00:00
acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables ebtables bash criu
(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 09:44:54 +00:00
buildInputs = [ lxc acl libcap dqlite sqlite-replication ];
2016-06-03 13:55:03 +00:00
meta = with stdenv.lib; {
description = "Daemon based on liblxc offering a REST API to manage containers";
2017-06-20 00:02:54 +00:00
homepage = https://linuxcontainers.org/lxd/;
2016-06-03 13:55:03 +00:00
license = licenses.asl20;
maintainers = with maintainers; [ globin fpletz ];
platforms = platforms.linux;
};
}