Skip to content

Commit

Permalink
lang.go: add GOPATH option
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfangAukang committed Feb 22, 2024
1 parent 83cb93d commit 32dbdd3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions extra/language/go.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,22 @@ with lib;
example = literalExpression "pkgs.go";
description = "Which go package to use";
};

GOPATH = mkOption {
type = types.nullOr types.path;
default = null;
example = literalExpression "/home/user/go";
description = "Path to your go directory";
};
};

config = {
env = [{
name = "GO111MODULE";
value = cfg.GO111MODULE;
}] ++ optionals (cfg.GOPATH != null) [{
name = "GOPATH";
value = cfg.GOPATH;
}];

devshell.packages = [ cfg.package ];
Expand Down

0 comments on commit 32dbdd3

Please sign in to comment.