feat: add ruby

This commit is contained in:
Peritia 2025-09-17 07:51:11 +02:00
parent de645665fc
commit 947cbe3ac5
2 changed files with 47 additions and 0 deletions

View file

@ -7,5 +7,6 @@
./lua.nix
./python.nix
./rust.nix
./ruby.nix
];
}

View 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;
};
}