Files
nixpkgs/pkgs/by-name/im/img/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

58 lines
1.3 KiB
Nix

{
buildGoModule,
fetchFromGitHub,
lib,
makeWrapper,
runc,
wrapperDir ? "/run/wrappers/bin", # Default for NixOS, other systems might need customization.
}:
buildGoModule rec {
pname = "img";
version = "0.5.11";
src = fetchFromGitHub {
owner = "genuinetools";
repo = "img";
rev = "v${version}";
sha256 = "0r5hihzp2679ki9hr3p0f085rafy2hc8kpkdhnd4m5k4iibqib08";
};
vendorHash = null;
postPatch = ''
V={newgidmap,newgidmap} \
substituteInPlace ./internal/unshare/unshare.c \
--replace "/usr/bin/$V" "${wrapperDir}/$V"
'';
nativeBuildInputs = [
makeWrapper
];
tags = [
"seccomp"
"noembed" # disables embedded `runc`
];
ldflags = [
"-X github.com/genuinetools/img/version.VERSION=v${version}"
"-s -w"
];
postInstall = ''
wrapProgram "$out/bin/img" --prefix PATH : ${lib.makeBinPath [ runc ]}
'';
# Tests fail as: internal/binutils/install.go:57:15: undefined: Asset
doCheck = false;
meta = with lib; {
description = "Standalone, daemon-less, unprivileged Dockerfile and OCI compatible container image builder";
mainProgram = "img";
license = licenses.mit;
homepage = "https://github.com/genuinetools/img";
maintainers = with maintainers; [ bryanasdev000 ];
};
}