20 stdenv.mkDerivation (finalAttrs: {
24 src = fetchFromGitHub {
27 rev = "refs/tags/v${finalAttrs.version}";
28 hash = "sha256-qc60oSs2KahQJpSmhrctXpV2Zumv7EvlnGFaOCSCX/E=";
49 # fix docbook2man version detection
52 # Fix hardcoded path of lxc-user-nic
53 # This is needed to use unprivileged containers
58 "-Dinstall-init-files=true"
59 "-Dinstall-state-dirs=false"
61 "-Dtools-multicall=true"
63 "-Dusernet-config-path=/etc/lxc/lxc-usernet"
64 "-Ddistrosysconfdir=${placeholder "out"}/etc/lxc"
65 "-Dsystemd-unitdir=${placeholder "out"}/lib/systemd/system"
68 # /run/current-system/sw/share
70 substituteInPlace $out/etc/lxc/lxc --replace-fail "$out/etc/lxc" "/etc/lxc"
71 substituteInPlace $out/libexec/lxc/lxc-net --replace-fail "$out/etc/lxc" "/etc/lxc"
73 substituteInPlace $out/share/lxc/templates/lxc-download --replace-fail "$out/share" "/run/current-system/sw/share"
74 substituteInPlace $out/share/lxc/templates/lxc-local --replace-fail "$out/share" "/run/current-system/sw/share"
75 substituteInPlace $out/share/lxc/templates/lxc-oci --replace-fail "$out/share" "/run/current-system/sw/share"
77 substituteInPlace $out/share/lxc/config/common.conf --replace-fail "$out/share" "/run/current-system/sw/share"
78 substituteInPlace $out/share/lxc/config/userns.conf --replace-fail "$out/share" "/run/current-system/sw/share"
79 substituteInPlace $out/share/lxc/config/oci.common.conf --replace-fail "$out/share" "/run/current-system/sw/share"
82 enableParallelBuilding = true;
88 incus-legacy-init = nixosTests.incus.container-legacy-init;
89 incus-systemd-init = nixosTests.incus.container-systemd-init;
91 lxd = nixosTests.lxd.container;
94 updateScript = nix-update-script {
103 homepage = "https://linuxcontainers.org/";
104 description = "Userspace tools for Linux Containers, a lightweight virtualization system";
105 license = lib.licenses.gpl2;
108 LXC containers are often considered as something in the middle between a chroot and a
109 full fledged virtual machine. The goal of LXC is to create an environment as close as
110 possible to a standard Linux installation but without the need for a separate kernel.
113 platforms = lib.platforms.linux;
114 maintainers = lib.teams.lxc.members;