added go, zig, and ruby, as well as environment
This commit is contained in:
45
modules/dev/go.nix
Normal file
45
modules/dev/go.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
go # Go compiler and core toolchain
|
||||
gocode-gomod # Code completion for Go (modern fork of gocode)
|
||||
gotools # Contains godoc, gorename, goimports, etc.
|
||||
gore # Go REPL
|
||||
gotests # Generate Go tests from function signatures
|
||||
gomodifytags # Struct tag manipulation
|
||||
golangci-lint # Linter aggregation
|
||||
;
|
||||
};
|
||||
GOPATH = "\${XDG_DATA_HOME}/go";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
my.dev.go.enable = lib.mkEnableOption "Install Go tooling globally";
|
||||
devShells.go = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.mkShell {
|
||||
inherit packages GOPATH;
|
||||
name = "go-dev-shell";
|
||||
shellHook = ''
|
||||
echo "🐹 Go dev environment"
|
||||
'';
|
||||
};
|
||||
description = "Go development shell with Emacs tooling, REPL, formatter, and linter";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
environment.variables = { inherit GOPATH; };
|
||||
}
|
||||
(lib.mkIf config.my.dev.go.enable {
|
||||
users.users.jawz = { inherit packages; };
|
||||
})
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user