nixpkgs/pkgs/applications/virtualization/colima/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.8 KiB
Nix
Raw Normal View History

{ lib
, stdenv
2023-03-06 08:13:58 +00:00
, darwin
colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k <dev@j-k.io> * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k <dev@j-k.io> * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k <dev@j-k.io> * colima: update meta.description Co-authored-by: j-k <dev@j-k.io> * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu <Atemu@users.noreply.github.com> * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k <dev@j-k.io> * colima: cleanup meta Co-authored-by: Sandro <sandro.jaeckel@gmail.com> * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Atemu <Atemu@users.noreply.github.com> * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k <dev@j-k.io> Co-authored-by: Atemu <Atemu@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-04 11:28:02 +00:00
, buildGoModule
, fetchFromGitHub
, installShellFiles
, lima
, lima-bin
, makeWrapper
colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k <dev@j-k.io> * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k <dev@j-k.io> * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k <dev@j-k.io> * colima: update meta.description Co-authored-by: j-k <dev@j-k.io> * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu <Atemu@users.noreply.github.com> * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k <dev@j-k.io> * colima: cleanup meta Co-authored-by: Sandro <sandro.jaeckel@gmail.com> * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Atemu <Atemu@users.noreply.github.com> * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k <dev@j-k.io> Co-authored-by: Atemu <Atemu@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-04 11:28:02 +00:00
, qemu
, testers
, colima
# use lima-bin on darwin to support native macOS virtualization
# https://github.com/NixOS/nixpkgs/pull/209171
, lima-drv ? if stdenv.isDarwin then lima-bin else lima
}:
colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k <dev@j-k.io> * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k <dev@j-k.io> * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k <dev@j-k.io> * colima: update meta.description Co-authored-by: j-k <dev@j-k.io> * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu <Atemu@users.noreply.github.com> * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k <dev@j-k.io> * colima: cleanup meta Co-authored-by: Sandro <sandro.jaeckel@gmail.com> * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Atemu <Atemu@users.noreply.github.com> * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k <dev@j-k.io> Co-authored-by: Atemu <Atemu@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-04 11:28:02 +00:00
buildGoModule rec {
pname = "colima";
2023-03-11 10:32:13 +00:00
version = "0.5.4";
src = fetchFromGitHub {
owner = "abiosoft";
repo = pname;
rev = "v${version}";
2023-03-11 10:32:13 +00:00
sha256 = "sha256-oCYHQFajtZXVAVeJ8zvJABlmwmOUgisvVg9eLT7wd0M=";
# We need the git revision
leaveDotGit = true;
postFetch = ''
colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k <dev@j-k.io> * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k <dev@j-k.io> * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k <dev@j-k.io> * colima: update meta.description Co-authored-by: j-k <dev@j-k.io> * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu <Atemu@users.noreply.github.com> * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k <dev@j-k.io> * colima: cleanup meta Co-authored-by: Sandro <sandro.jaeckel@gmail.com> * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Atemu <Atemu@users.noreply.github.com> * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k <dev@j-k.io> Co-authored-by: Atemu <Atemu@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-04 11:28:02 +00:00
git -C $out rev-parse --short HEAD > $out/.git-revision
rm -rf $out/.git
'';
};
nativeBuildInputs = [ installShellFiles makeWrapper ]
++ lib.optionals stdenv.isDarwin [ darwin.DarwinTools ];
2023-03-07 09:06:11 +00:00
vendorHash = "sha256-bEgC7j8WvCgrJ2Ahye4mfWVEmo6Y/OO64mDIJXvtaiE=";
# disable flaky Test_extractZones
# https://hydra.nixos.org/build/212378003/log
excludedPackages = "gvproxy";
colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k <dev@j-k.io> * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k <dev@j-k.io> * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k <dev@j-k.io> * colima: update meta.description Co-authored-by: j-k <dev@j-k.io> * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu <Atemu@users.noreply.github.com> * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k <dev@j-k.io> * colima: cleanup meta Co-authored-by: Sandro <sandro.jaeckel@gmail.com> * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Atemu <Atemu@users.noreply.github.com> * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k <dev@j-k.io> Co-authored-by: Atemu <Atemu@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-04 11:28:02 +00:00
CGO_ENABLED = 1;
preConfigure = ''
colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k <dev@j-k.io> * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k <dev@j-k.io> * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k <dev@j-k.io> * colima: update meta.description Co-authored-by: j-k <dev@j-k.io> * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu <Atemu@users.noreply.github.com> * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k <dev@j-k.io> * colima: cleanup meta Co-authored-by: Sandro <sandro.jaeckel@gmail.com> * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Atemu <Atemu@users.noreply.github.com> * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k <dev@j-k.io> Co-authored-by: Atemu <Atemu@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-04 11:28:02 +00:00
ldflags="-s -w -X github.com/abiosoft/colima/config.appVersion=${version} \
-X github.com/abiosoft/colima/config.revision=$(cat .git-revision)"
'';
postInstall = ''
wrapProgram $out/bin/colima \
--prefix PATH : ${lib.makeBinPath [ lima-drv qemu ]}
installShellCompletion --cmd colima \
--bash <($out/bin/colima completion bash) \
--fish <($out/bin/colima completion fish) \
--zsh <($out/bin/colima completion zsh)
'';
colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k <dev@j-k.io> * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k <dev@j-k.io> * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k <dev@j-k.io> * colima: update meta.description Co-authored-by: j-k <dev@j-k.io> * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu <Atemu@users.noreply.github.com> * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k <dev@j-k.io> * colima: cleanup meta Co-authored-by: Sandro <sandro.jaeckel@gmail.com> * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Atemu <Atemu@users.noreply.github.com> * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k <dev@j-k.io> Co-authored-by: Atemu <Atemu@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-04 11:28:02 +00:00
passthru.tests.version = testers.testVersion {
package = colima;
command = "HOME=$(mktemp -d) colima version";
};
meta = with lib; {
colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k <dev@j-k.io> * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k <dev@j-k.io> * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k <dev@j-k.io> * colima: update meta.description Co-authored-by: j-k <dev@j-k.io> * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu <Atemu@users.noreply.github.com> * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k <dev@j-k.io> * colima: cleanup meta Co-authored-by: Sandro <sandro.jaeckel@gmail.com> * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Atemu <Atemu@users.noreply.github.com> * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k <dev@j-k.io> Co-authored-by: Atemu <Atemu@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-04 11:28:02 +00:00
description = "Container runtimes with minimal setup";
homepage = "https://github.com/abiosoft/colima";
license = licenses.mit;
colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k <dev@j-k.io> * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k <dev@j-k.io> * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k <dev@j-k.io> * colima: update meta.description Co-authored-by: j-k <dev@j-k.io> * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu <Atemu@users.noreply.github.com> * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k <dev@j-k.io> * colima: cleanup meta Co-authored-by: Sandro <sandro.jaeckel@gmail.com> * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: Atemu <Atemu@users.noreply.github.com> * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k <dev@j-k.io> Co-authored-by: Atemu <Atemu@users.noreply.github.com> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-04 11:28:02 +00:00
maintainers = with maintainers; [ aaschmid tricktron ];
};
}