summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/virtualization
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-12-27 21:25:46 +0100
committerGitHub <noreply@github.com>2022-12-27 21:25:46 +0100
commitbfc35e168b848acaf22c484e1bfa465dd02453e2 (patch)
tree113afb6de8aa7a1896709fb1592036c43a7a98f6 /pkgs/applications/virtualization
parent375851e5cfa17bf21a4f28285c62af8e52468f19 (diff)
parentd8c8e9abb733b57d8534c6765d308b37eae39c39 (diff)
Merge pull request #203904 from urandom2/toolbox
Fixes https://github.com/NixOS/nixpkgs/issues/96115 Closes https://github.com/NixOS/nixpkgs/pull/110473
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r--pkgs/applications/virtualization/toolbox/default.nix51
-rw-r--r--pkgs/applications/virtualization/toolbox/glibc.patch12
2 files changed, 63 insertions, 0 deletions
diff --git a/pkgs/applications/virtualization/toolbox/default.nix b/pkgs/applications/virtualization/toolbox/default.nix
new file mode 100644
index 000000000000..94928ff35733
--- /dev/null
+++ b/pkgs/applications/virtualization/toolbox/default.nix
@@ -0,0 +1,51 @@
+{ lib, buildGoModule, fetchFromGitHub, glibc, go-md2man, installShellFiles }:
+
+buildGoModule rec {
+ pname = "toolbox";
+ version = "0.0.99.3";
+
+ src = fetchFromGitHub {
+ owner = "containers";
+ repo = pname;
+ rev = version;
+ hash = "sha256-9HiWgEtaMypLOwXJ6Xg3grLSZOQ4NInZtcvLPV51YO8=";
+ };
+
+ patches = [ ./glibc.patch ];
+
+ vendorHash = "sha256-k79TcC9voQROpJnyZ0RsqxJnBT83W5Z+D+D3HnuQGsI=";
+
+ postPatch = ''
+ substituteInPlace src/cmd/create.go --subst-var-by glibc ${glibc}
+ '';
+
+ modRoot = "src";
+
+ nativeBuildInputs = [ go-md2man installShellFiles ];
+
+ ldflags = [
+ "-s"
+ "-w"
+ "-X github.com/containers/toolbox/pkg/version.currentVersion=${version}"
+ ];
+
+ preCheck = "export PATH=$GOPATH/bin:$PATH";
+
+ postInstall = ''
+ cd ..
+ for d in doc/*.md; do
+ go-md2man -in $d -out ''${d%.md}
+ done
+ installManPage doc/*.[1-9]
+ installShellCompletion --bash completion/bash/toolbox
+ install profile.d/toolbox.sh -Dt $out/share/profile.d
+ '';
+
+ meta = with lib; {
+ homepage = "https://containertoolbx.org";
+ changelog = "https://github.com/containers/toolbox/releases/tag/${version}";
+ description = "Tool for containerized command line environments on Linux";
+ license = licenses.asl20;
+ maintainers = with maintainers; [ urandom ];
+ };
+}
diff --git a/pkgs/applications/virtualization/toolbox/glibc.patch b/pkgs/applications/virtualization/toolbox/glibc.patch
new file mode 100644
index 000000000000..1055dc965a0b
--- /dev/null
+++ b/pkgs/applications/virtualization/toolbox/glibc.patch
@@ -0,0 +1,12 @@
+diff --git a/src/cmd/create.go b/src/cmd/create.go
+index 74e90b1..113ef80 100644
+--- a/src/cmd/create.go
++++ b/src/cmd/create.go
+@@ -423,6 +425,7 @@ func createContainer(container, image, release string, showCommandToEnter bool)
+ "--volume", toolboxPathMountArg,
+ "--volume", usrMountArg,
+ "--volume", runtimeDirectoryMountArg,
++ "--volume", "@glibc@:@glibc@:ro",
+ }...)
+
+ createArgs = append(createArgs, avahiSocketMount...)