From 750f2b53ce464a071c54847bbc1042eeee0c6b94 Mon Sep 17 00:00:00 2001 From: Colton Donnelly Date: Thu, 31 Aug 2023 16:31:26 +0000 Subject: [PATCH] go --- pkgs/modules/default.nix | 8 +++++++- pkgs/modules/go/default.nix | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/modules/default.nix b/pkgs/modules/default.nix index a20833bd..9d614319 100644 --- a/pkgs/modules/default.nix +++ b/pkgs/modules/default.nix @@ -67,6 +67,13 @@ let }); })) + (mkModule (import ./go { + inherit (pkgs) go; + })) + (mkModule (import ./go { + go = pkgs.go_1_17; + })) + (mkModule ./apl) (mkModule ./bash) (mkModule ./basic) @@ -82,7 +89,6 @@ let (mkLegacyModule ./erlang) (mkLegacyModule ./forth) (mkModule ./gcloud) - (mkModule ./go) (mkModule ./haskell) (mkModule ./java) (mkModule ./lua) diff --git a/pkgs/modules/go/default.nix b/pkgs/modules/go/default.nix index efc178d8..a14e8385 100644 --- a/pkgs/modules/go/default.nix +++ b/pkgs/modules/go/default.nix @@ -1,21 +1,21 @@ +{ go }: { pkgs, lib, ... }: let - goversion = lib.versions.majorMinor pkgs.go.version; + goversion = lib.versions.majorMinor go.version; in { id = "go-${goversion}"; name = "Go Tools"; - packages = with pkgs; [ + packages = [ go - gopls ]; replit.runners.go-run = { name = "go run"; language = "go"; - start = "${pkgs.go}/bin/go run $file"; + start = "${go}/bin/go run $file"; fileParam = true; }; @@ -23,7 +23,7 @@ in name = "go fmt"; language = "go"; - start = "${pkgs.go}/bin/go fmt"; + start = "${go}/bin/go fmt"; stdin = false; };