added go, zig, and ruby, as well as environment
This commit is contained in:
40
modules/dev/ruby.nix
Normal file
40
modules/dev/ruby.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs) ruby; # Ruby interpreter
|
||||
inherit (pkgs.rubyPackages) solargraph; # LSP for Ruby
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
my.dev.ruby.enable = lib.mkEnableOption "Install Ruby tooling globally";
|
||||
devShells.ruby = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.mkShell {
|
||||
inherit packages;
|
||||
name = "ruby-dev-shell";
|
||||
shellHook = ''
|
||||
echo "💎 Ruby dev environment"
|
||||
'';
|
||||
};
|
||||
description = "Ruby development shell with interpreter and Solargraph LSP";
|
||||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.my.dev.ruby.enable {
|
||||
users.users.jawz = { inherit packages; };
|
||||
})
|
||||
{
|
||||
environment.variables = {
|
||||
GEM_HOME = "\${XDG_DATA_HOME}/ruby/gems";
|
||||
GEM_PATH = "\${XDG_DATA_HOME}/ruby/gems";
|
||||
GEM_SPEC_CACHE = "\${XDG_DATA_HOME}/ruby/specs";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user