{lima,colima}: use pkill from nixpkgs on non-darwin (#458941)

This commit is contained in:
Fabián Heredia Montiel
2025-11-13 01:39:22 +00:00
committed by GitHub
2 changed files with 15 additions and 0 deletions
+9
View File
@@ -7,6 +7,7 @@
installShellFiles,
lima,
makeWrapper,
procps,
qemu,
testers,
colima,
@@ -43,6 +44,14 @@ buildGoModule rec {
env.CGO_ENABLED = 1;
postPatch = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
substituteInPlace cmd/daemon/daemon.go \
--replace-fail '/usr/bin/pkill' '${lib.getExe' procps "pkill"}'
substituteInPlace daemon/process/vmnet/vmnet.go \
--replace-fail '/usr/bin/pkill' '${lib.getExe' procps "pkill"}'
'';
preConfigure = ''
ldflags="-s -w -X github.com/abiosoft/colima/config.appVersion=${version} \
-X github.com/abiosoft/colima/config.revision=$(cat .git-revision)"
+6
View File
@@ -4,6 +4,7 @@
buildGoModule,
callPackage,
installShellFiles,
procps,
qemu,
darwin,
makeWrapper,
@@ -40,6 +41,11 @@ buildGoModule (finalAttrs: {
substituteInPlace Makefile \
--replace-fail 'codesign -f -v --entitlements vz.entitlements -s -' 'codesign -f --entitlements vz.entitlements -s -' \
--replace-fail 'rm -rf _output vendor' 'rm -rf _output'
''
# fixed upstream, remove when version >=2.0.0
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
substituteInPlace pkg/networks/usernet/recoincile.go \
--replace-fail '/usr/bin/pkill' '${lib.getExe' procps "pkill"}'
'';
# It attaches entitlements with codesign and strip removes those,