2023-12-21 19:55:08 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fuse3,
|
|
|
|
help2man,
|
|
|
|
makeWrapper,
|
|
|
|
meson,
|
|
|
|
ninja,
|
2024-03-30 02:29:52 +00:00
|
|
|
nix-update-script,
|
2023-12-21 19:55:08 +00:00
|
|
|
nixosTests,
|
|
|
|
pkg-config,
|
|
|
|
python3,
|
|
|
|
util-linux,
|
2024-07-15 03:33:07 +00:00
|
|
|
coreutils,
|
2023-12-21 19:55:08 +00:00
|
|
|
}:
|
2016-11-21 13:11:40 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-08-14 20:09:18 +00:00
|
|
|
pname = "lxcfs";
|
2024-09-19 13:59:53 +00:00
|
|
|
version = "6.0.2";
|
2016-11-21 13:11:40 +00:00
|
|
|
|
2017-03-01 22:02:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lxc";
|
|
|
|
repo = "lxcfs";
|
2024-03-30 02:29:52 +00:00
|
|
|
rev = "v${version}";
|
2024-09-19 13:59:53 +00:00
|
|
|
hash = "sha256-5r1X/yUXTMC/2dNhpI+BVYeClIydefg2lurCGt7iA8Y=";
|
2016-11-21 13:11:40 +00:00
|
|
|
};
|
|
|
|
|
2023-12-21 19:55:08 +00:00
|
|
|
patches = [
|
|
|
|
# skip RPM spec generation
|
|
|
|
./no-spec.patch
|
2022-10-09 09:04:02 +00:00
|
|
|
|
2023-12-21 19:55:08 +00:00
|
|
|
# skip installing systemd files
|
|
|
|
./skip-init.patch
|
|
|
|
|
|
|
|
# fix pidfd checks and include
|
|
|
|
./pidfd.patch
|
|
|
|
];
|
2016-11-21 13:11:40 +00:00
|
|
|
|
2023-12-21 19:55:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
help2man
|
|
|
|
makeWrapper
|
|
|
|
ninja
|
|
|
|
(python3.withPackages (p: [ p.jinja2 ]))
|
|
|
|
pkg-config
|
2016-11-21 13:11:40 +00:00
|
|
|
];
|
2023-12-21 19:55:08 +00:00
|
|
|
buildInputs = [ fuse3 ];
|
2016-11-21 13:11:40 +00:00
|
|
|
|
2023-12-21 19:55:08 +00:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs tools/
|
|
|
|
'';
|
2016-11-21 13:11:40 +00:00
|
|
|
|
2020-06-05 12:37:14 +00:00
|
|
|
postInstall = ''
|
2024-07-15 03:33:07 +00:00
|
|
|
# `mount` hook requires access to the `mount` command from `util-linux` and `readlink` from `coreutils`:
|
|
|
|
wrapProgram "$out/share/lxcfs/lxc.mount.hook" --prefix PATH : ${lib.makeBinPath [ coreutils util-linux ]}
|
2020-06-05 12:37:14 +00:00
|
|
|
'';
|
|
|
|
|
2016-11-21 13:11:40 +00:00
|
|
|
postFixup = ''
|
|
|
|
# liblxcfs.so is reloaded with dlopen()
|
|
|
|
patchelf --set-rpath "$(patchelf --print-rpath "$out/bin/lxcfs"):$out/lib" "$out/bin/lxcfs"
|
|
|
|
'';
|
|
|
|
|
2024-03-30 02:27:22 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
incus-container-legacy-init = nixosTests.incus.container-legacy-init;
|
|
|
|
incus-container-systemd-init = nixosTests.incus.container-systemd-init;
|
|
|
|
};
|
2024-03-30 02:29:52 +00:00
|
|
|
|
|
|
|
updateScript = nix-update-script { };
|
2023-12-21 19:55:08 +00:00
|
|
|
};
|
|
|
|
|
2016-11-21 13:11:40 +00:00
|
|
|
meta = {
|
|
|
|
description = "FUSE filesystem for LXC";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "lxcfs";
|
2020-08-14 20:09:18 +00:00
|
|
|
homepage = "https://linuxcontainers.org/lxcfs";
|
|
|
|
changelog = "https://linuxcontainers.org/lxcfs/news/";
|
2023-12-02 14:41:13 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
platforms = lib.platforms.linux;
|
2023-12-02 14:38:44 +00:00
|
|
|
maintainers = lib.teams.lxc.members;
|
2016-11-21 13:11:40 +00:00
|
|
|
};
|
|
|
|
}
|