2024-08-12 19:20:24 +07:00
|
|
|
{ config, lib, pkgs, ... }:
|
2024-06-12 18:09:56 +07:00
|
|
|
let
|
|
|
|
cfg = config.profile.go;
|
2024-08-12 21:18:22 +07:00
|
|
|
impl = pkgs.buildGoModule rec {
|
|
|
|
pname = "impl";
|
|
|
|
version = "1.4.0";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "josharian";
|
|
|
|
repo = "impl";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-0TSyg7YEPur+h0tkDxI3twr2PzT7tmo3shKgmSSJ6qk=";
|
|
|
|
};
|
|
|
|
vendorHash = "sha256-vTqDoM/LK5SHkayLKYig+tCrXLelOoILmQGCxlTWHog=";
|
|
|
|
};
|
2024-06-12 18:09:56 +07:00
|
|
|
in
|
|
|
|
{
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
programs.go = {
|
|
|
|
enable = true;
|
|
|
|
goPrivate = [
|
|
|
|
"gitlab.bareksa.com"
|
|
|
|
];
|
|
|
|
};
|
2024-08-12 19:20:24 +07:00
|
|
|
home.packages = with pkgs; [
|
|
|
|
gotools
|
|
|
|
|
|
|
|
###### Golang development tools ######
|
|
|
|
gomodifytags
|
|
|
|
gotests
|
|
|
|
iferr
|
2024-08-12 21:18:22 +07:00
|
|
|
gopls
|
|
|
|
gofumpt
|
|
|
|
impl
|
2024-08-12 19:20:24 +07:00
|
|
|
];
|
2024-08-12 21:18:22 +07:00
|
|
|
|
|
|
|
# Some toolings will lookup for $GOROOT env.
|
|
|
|
home.sessionVariables = {
|
|
|
|
GOROOT = "${pkgs.go}/share/go";
|
|
|
|
GOPATH = "${config.home.homeDirectory}/go";
|
|
|
|
};
|
2024-06-12 18:09:56 +07:00
|
|
|
};
|
|
|
|
}
|