feat: add ruby
This commit is contained in:
parent
de645665fc
commit
947cbe3ac5
2 changed files with 47 additions and 0 deletions
|
|
@ -7,5 +7,6 @@
|
|||
./lua.nix
|
||||
./python.nix
|
||||
./rust.nix
|
||||
./ruby.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
46
Modules/System/Programming-Tools/ruby.nix
Normal file
46
Modules/System/Programming-Tools/ruby.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# Ruby (System Module)
|
||||
#
|
||||
# Provides:
|
||||
# - Ruby (standard interpreter)
|
||||
# - JRuby (Ruby on the JVM)
|
||||
# - Bundler (Ruby package manager, optional)
|
||||
#
|
||||
# Options:
|
||||
# - enable → Enable Ruby system module (default: false)
|
||||
# - bundler → Install Bundler alongside Ruby (default: follows `enable`)
|
||||
#
|
||||
# Examples:
|
||||
# nyx-module.system.ruby.enable = true;
|
||||
# nyx-module.system.ruby.bundler = false; # disable Bundler explicitly
|
||||
#
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.nyx-module.system.ruby;
|
||||
in
|
||||
{
|
||||
options.nyx-module.system.ruby = {
|
||||
enable = lib.mkEnableOption "Enable Ruby (system module)";
|
||||
|
||||
bundler = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = cfg.enable; # follows Ruby enable by default
|
||||
description = ''
|
||||
Install Bundler with Ruby.
|
||||
Defaults to the same value as `enable`.
|
||||
'';
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages =
|
||||
with pkgs;
|
||||
[
|
||||
ruby
|
||||
jruby
|
||||
]
|
||||
++ lib.optional cfg.bundler bundler;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue