28 pname = "incus${lib.optionalString lts "-lts"}";
44 src = fetchFromGitHub {
47 rev = "refs/tags/v${version}";
52 # statically compile these
56 # oidc test requires network
78 tags = [ "libsqlite3" ];
80 # required for go-cowsql.
81 CGO_LDFLAGS_ALLOW = "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)";
84 make incus-agent incus-migrate
87 # Disable tests requiring local operations
92 "TestConvertNetworkConfig"
93 "TestConvertStorageConfig"
95 "TestContainerTestSuite"
98 [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
101 installShellCompletion --cmd incus \
102 --bash <($out/bin/incus completion bash) \
103 --fish <($out/bin/incus completion fish) \
104 --zsh <($out/bin/incus completion zsh)
106 mkdir -p $agent_loader/bin $agent_loader/etc/systemd/system $agent_loader/lib/udev/rules.d
107 cp internal/server/instance/drivers/agent-loader/incus-agent-setup $agent_loader/bin/
108 chmod +x $agent_loader/bin/incus-agent-setup
109 patchShebangs $agent_loader/bin/incus-agent-setup
110 cp internal/server/instance/drivers/agent-loader/systemd/incus-agent.service $agent_loader/etc/systemd/system/
111 cp internal/server/instance/drivers/agent-loader/systemd/incus-agent.rules $agent_loader/lib/udev/rules.d/99-incus-agent.rules
112 substituteInPlace $agent_loader/etc/systemd/system/incus-agent.service --replace-fail 'TARGET/systemd' "$agent_loader/bin"
116 client = callPackage ./client.nix {
127 tests = if lts then nixosTests.incus-lts else nixosTests.incus;
129 ui = callPackage ./ui.nix { };
131 updateScript = writeScript "ovs-update.py" ''
132 ${./update.py} ${updateScriptArgs}
137 description = "Powerful system container and virtual machine manager";
138 homepage = "https://linuxcontainers.org/incus";
139 changelog = "https://github.com/lxc/incus/releases/tag/v${version}";
140 license = lib.licenses.asl20;
141 maintainers = lib.teams.lxc.members;
142 platforms = lib.platforms.linux;
143 mainProgram = "incus";