From 35900046a12bcea5e95da335b05f199d8afe9c4b Mon Sep 17 00:00:00 2001 From: Muhammed Hussein Karimi Date: Thu, 12 Dec 2024 14:10:44 +0330 Subject: [PATCH] :sparkles: Isolating tmpdir and gopath in nix-shell Signed-off-by: Muhammed Hussein Karimi --- nix/.gitignore | 2 ++ shell.nix | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 nix/.gitignore diff --git a/nix/.gitignore b/nix/.gitignore new file mode 100644 index 00000000..5a89bf48 --- /dev/null +++ b/nix/.gitignore @@ -0,0 +1,2 @@ +.go/ +.tmp/ diff --git a/shell.nix b/shell.nix index 9a0fd589..696d261b 100644 --- a/shell.nix +++ b/shell.nix @@ -11,11 +11,17 @@ pkgs.mkShell { go_1_19 golint kubectl - kubernetes-controller-tools kubernetes-helm gnumake minikube semver-tool yq-go ]; + shellHook = '' + export GOPATH=$(pwd)/nix/.go + export TMPDIR=$(pwd)/nix/.tmp + export PATH=$GOPATH/bin:$PATH + go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.0 + mkdir -p "$TMPDIR" + ''; }