Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at flake-libs 79 lines 1.7 kB view raw
1{ 2 buildah-unwrapped, 3 runCommand, 4 makeWrapper, 5 symlinkJoin, 6 lib, 7 stdenv, 8 extraPackages ? [ ], 9 runc, # Default container runtime 10 crun, # Container runtime (default with cgroups v2 for podman/buildah) 11 conmon, # Container runtime monitor 12 slirp4netns, # User-mode networking for unprivileged namespaces 13 fuse-overlayfs, # CoW for images, much faster than default vfs 14 util-linux, # nsenter 15 iptables, 16 aardvark-dns, 17 netavark, 18 passt, 19}: 20 21let 22 binPath = lib.makeBinPath ( 23 [ 24 ] 25 ++ lib.optionals stdenv.hostPlatform.isLinux [ 26 runc 27 crun 28 conmon 29 slirp4netns 30 fuse-overlayfs 31 util-linux 32 iptables 33 ] 34 ++ extraPackages 35 ); 36 37 helpersBin = symlinkJoin { 38 name = "${buildah-unwrapped.pname}-helper-binary-wrapper-${buildah-unwrapped.version}"; 39 40 # this only works for some binaries, others may need to be added to `binPath` or in the modules 41 paths = 42 [ 43 ] 44 ++ lib.optionals stdenv.hostPlatform.isLinux [ 45 aardvark-dns 46 netavark 47 passt 48 ]; 49 }; 50 51in 52runCommand buildah-unwrapped.name 53 { 54 name = "${buildah-unwrapped.pname}-wrapper-${buildah-unwrapped.version}"; 55 inherit (buildah-unwrapped) pname version passthru; 56 57 preferLocalBuild = true; 58 59 meta = builtins.removeAttrs buildah-unwrapped.meta [ "outputsToInstall" ]; 60 61 outputs = [ 62 "out" 63 "man" 64 ]; 65 66 nativeBuildInputs = [ 67 makeWrapper 68 ]; 69 70 } 71 '' 72 ln -s ${buildah-unwrapped.man} $man 73 74 mkdir -p $out/bin 75 ln -s ${buildah-unwrapped}/share $out/share 76 makeWrapper ${buildah-unwrapped}/bin/buildah $out/bin/buildah \ 77 --set CONTAINERS_HELPER_BINARY_DIR ${helpersBin}/bin \ 78 --prefix PATH : ${binPath} 79 ''