Home

dotnix @main - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
tree log patch
add go update Signed-off-by: jolheiser <git@jolheiser.com>
Signature
-----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgBTEvCQk6VqUAdN2RuH6bj1dNkY oOpbPWj+jw4ua1B1cAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5 AAAAQIVPdkAQoC1xZMSPdsYjZPDU8L9R8DbraVQ+6N/IiANO0y2TyfwvqQWrRQKe8w4vBu k9Av2pvCrmZSdp0RO3Og8= -----END SSH SIGNATURE-----
jolheiser <git@jolheiser.com>
1 week ago
2 changed files, 11 additions(+), 10 deletions(-)
home/nogui/go.nixhome/nogui/nushell/autoload/go-update.nu
M home/nogui/go.nix -> home/nogui/go.nix
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
diff --git a/home/nogui/go.nix b/home/nogui/go.nix
index 527efff0355c41759d59929a897a15178ac4d330..3f5326ce50017a69c454127b6799699c4dada684 100644
--- a/home/nogui/go.nix
+++ b/home/nogui/go.nix
@@ -1,12 +1,3 @@
-let
-  GOPATH = ".local/share/go";
-in
 {
-  programs.go = {
-    enable = true;
-    env = {
-      inherit GOPATH;
-      GOBIN = "${GOPATH}/bin";
-    };
-  };
+  programs.go.enable = true;
 }
I home/nogui/nushell/autoload/go-update.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
diff --git a/home/nogui/nushell/autoload/go-update.nu b/home/nogui/nushell/autoload/go-update.nu
new file mode 100644
index 0000000000000000000000000000000000000000..783e9a3d40c51fdf56c0d7076c0fb09cf211c585
--- /dev/null
+++ b/home/nogui/nushell/autoload/go-update.nu
@@ -0,0 +1,10 @@
+module go-update {
+  # Update to the latest go toolchain
+  export def --env "go update" [] {
+    let ver = http get https://go.dev/dl/?mode=json | where stable == true | first | get version
+    print $"Old: (^go version)"
+    ^go env -w GOTOOLCHAIN=$"($ver)+auto"
+    print $"New: (^go version)"
+  }
+}
+use go-update *