From 9f37caad9100c927c9179d387c4436bedde90813 Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 21 May 2022 19:41:43 +0200 Subject: [PATCH] flake: add 'upcache' command easy way to push dev env to cachix --- flake.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flake.nix b/flake.nix index 696d9c1..215e78d 100644 --- a/flake.nix +++ b/flake.nix @@ -127,6 +127,15 @@ cd $(git rev-parse --show-toplevel) go test ./... ''; + upcache = pkgs.writeShellScriptBin "upcache" '' + ## refs: + ## https://fzakaria.com/2020/08/11/caching-your-nix-shell.html + ## https://nixos.wiki/wiki/Caching_nix_shell_build_inputs + nix-store --query --references $(nix-instantiate shell.nix) | \ + xargs nix-store --realise | \ + xargs nix-store --query --requisites | \ + cachix push go-xkcdreader + ''; in { default = with pkgs; mkShell @@ -163,6 +172,7 @@ ## ad-hoc cmds gob gota + upcache gopls gofumpt