Files
NixOS/modules/dev/ruby.nix
Danilo Reyes 495f6e2e25 Refactor user management functions to use inputs
Removed the `lib.nix` file and refactored various modules to utilize `inputs.self.lib` for user package and attribute management. This change enhances consistency and maintainability across the configuration files.
2026-01-16 10:55:15 -06:00

42 lines
1020 B
Nix

{
config,
inputs,
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 = inputs.self.lib.mkUserAttrs lib config.my.toggleUsers.dev { 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";
};
}
];
}