From ea3eeea82635bb01eeeba34a0684b11a7721f495 Mon Sep 17 00:00:00 2001 From: Evan Quiney Date: Fri, 15 Aug 2025 15:24:58 +0100 Subject: [PATCH] improved go caching with nix Co-authored-by: Gelu Vrabie --- .flake-modules/go-forwarder.nix | 7 ++----- .gitignore | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.flake-modules/go-forwarder.nix b/.flake-modules/go-forwarder.nix index 6d711645..647e54ee 100644 --- a/.flake-modules/go-forwarder.nix +++ b/.flake-modules/go-forwarder.nix @@ -62,11 +62,8 @@ make-shells.default = { # Go 1.24 compiler – align with go.mod packages = [ pkgs.go_1_24 ]; - - # TODO: change this into exported env via nix directly??? - shellHook = '' - export GOPATH=$(mktemp -d) - ''; + shellHook = "export GOPATH=$FLAKE_ROOT/.go_cache"; }; }; } + diff --git a/.gitignore b/.gitignore index 762f2302..3e73b059 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ __pycache__ hosts_*.json +# go cache is project local but not tracked +.go_cache + # hide direnv stuff .direnv/ # TODO figure out how to properly solve the issue with these target directories showing up @@ -21,4 +24,3 @@ rust/Cargo.lock # Says this symlink should be git-ignored https://github.com/juspay/just-flake just-flake.just -.DS_Store