chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / lx / lxc / package.nix
blob3f00ccb82b523b47b783c4f007ad0a67106a3dfa
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   dbus,
6   docbook2x,
7   libapparmor,
8   libcap,
9   libseccomp,
10   libselinux,
11   meson,
12   ninja,
13   nixosTests,
14   openssl,
15   pkg-config,
16   systemd,
17   nix-update-script,
20 stdenv.mkDerivation (finalAttrs: {
21   pname = "lxc";
22   version = "6.0.2";
24   src = fetchFromGitHub {
25     owner = "lxc";
26     repo = "lxc";
27     rev = "refs/tags/v${finalAttrs.version}";
28     hash = "sha256-qc60oSs2KahQJpSmhrctXpV2Zumv7EvlnGFaOCSCX/E=";
29   };
31   nativeBuildInputs = [
32     docbook2x
33     meson
34     ninja
35     pkg-config
36   ];
38   buildInputs = [
39     dbus
40     libapparmor
41     libcap
42     libseccomp
43     libselinux
44     openssl
45     systemd
46   ];
48   patches = [
49     # fix docbook2man version detection
50     ./docbook-hack.patch
52     # Fix hardcoded path of lxc-user-nic
53     # This is needed to use unprivileged containers
54     ./user-nic.diff
55   ];
57   mesonFlags = [
58     "-Dinstall-init-files=true"
59     "-Dinstall-state-dirs=false"
60     "-Dspecfile=false"
61     "-Dtools-multicall=true"
62     "-Dtools=false"
63     "-Dusernet-config-path=/etc/lxc/lxc-usernet"
64     "-Ddistrosysconfdir=${placeholder "out"}/etc/lxc"
65     "-Dsystemd-unitdir=${placeholder "out"}/lib/systemd/system"
66   ];
68   # /run/current-system/sw/share
69   postInstall = ''
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"
80   '';
82   enableParallelBuilding = true;
84   doCheck = true;
86   passthru = {
87     tests = {
88       incus-legacy-init = nixosTests.incus.container-legacy-init;
89       incus-systemd-init = nixosTests.incus.container-systemd-init;
90       lxc = nixosTests.lxc;
91       lxd = nixosTests.lxd.container;
92     };
94     updateScript = nix-update-script {
95       extraArgs = [
96         "--version-regex"
97         "v(6.0.*)"
98       ];
99     };
100   };
102   meta = {
103     homepage = "https://linuxcontainers.org/";
104     description = "Userspace tools for Linux Containers, a lightweight virtualization system";
105     license = lib.licenses.gpl2;
107     longDescription = ''
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.
111     '';
113     platforms = lib.platforms.linux;
114     maintainers = lib.teams.lxc.members;
115   };