rizin: add module

This adds a basic module for rizin which supports creating a basic
rizinrc for configuration.
This commit is contained in:
rsahwe 2026-02-19 10:04:56 +01:00 committed by Austin Horstman
parent 1dcebb44c6
commit 168fbe8891
5 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,44 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.rizin;
in
{
meta.maintainers = [
lib.hm.maintainers.rsahwe
];
options = {
programs.rizin = {
enable = lib.mkEnableOption "Rizin";
package = lib.mkPackageOption pkgs "rizin" { nullable = true; };
extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
example = ''
e asm.bytes=true
e asm.bytes.space=true
'';
description = ''
Run configuration written to {file}`rizinrc`.
See <https://book.rizin.re/src/configuration/initial_scripts.html>
for more information.
'';
};
};
};
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."rizin/rizinrc" = lib.mkIf (cfg.extraConfig != "") {
text = cfg.extraConfig;
};
};
}