39 "https://linuxcontainers.org/downloads/lxd/lxd-${version}.tar.gz"
40 "https://github.com/lxc/lxd/releases/download/lxd-${version}/lxd-${version}.tar.gz"
42 sha256 = "sha256-TZeF/VPrP4qRAVezJwQWtfypsxBJpnTrST0uDdw3WVI=";
48 substituteInPlace shared/usbid/load.go \
49 --replace "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
52 excludedPackages = [ "test" "lxd/db/generate" ];
54 nativeBuildInputs = [ installShellFiles pkg-config makeWrapper ];
65 ldflags = [ "-s" "-w" ];
66 tags = [ "libsqlite3" ];
69 # required for go-dqlite. See: https://github.com/lxc/lxd/pull/8939
70 export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
76 "TestConvertNetworkConfig"
77 "TestConvertStorageConfig"
79 "TestContainerTestSuite"
82 # Disable tests requiring local operations
83 buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]")
87 wrapProgram $out/bin/lxd --prefix PATH : ${lib.makeBinPath (
89 ++ [ acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute2 bash criu attr ]
90 ++ [ (writeShellScriptBin "apparmor_parser" ''
91 exec '${apparmor-parser}/bin/apparmor_parser' -I '${apparmor-profiles}/etc/apparmor.d' "$@"
96 installShellCompletion --bash --name lxd ./scripts/bash/lxd-client
99 passthru.tests.lxd = nixosTests.lxd;
100 passthru.tests.lxd-nftables = nixosTests.lxd-nftables;
103 description = "Daemon based on liblxc offering a REST API to manage containers";
104 homepage = "https://linuxcontainers.org/lxd/";
105 changelog = "https://github.com/lxc/lxd/releases/tag/lxd-${version}";
106 license = licenses.asl20;
107 maintainers = with maintainers; [ marsam ];
108 platforms = platforms.linux;