1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/modules/programs/rio.nix
Austin Horstman 86402a17b6 treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce
conflicts with other PRs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-23 16:20:26 -05:00

47 lines
1.2 KiB
Nix

{
lib,
pkgs,
config,
...
}:
let
cfg = config.programs.rio;
settingsFormat = pkgs.formats.toml { };
in
{
options.programs.rio = {
enable = lib.mkEnableOption null // {
description = ''
Enable Rio, a terminal built to run everywhere, as a native desktop applications by
Rust/WebGPU or even in the browsers powered by WebAssembly/WebGPU.
'';
};
package = lib.mkPackageOption pkgs "rio" { nullable = true; };
settings = lib.mkOption {
type = settingsFormat.type;
default = { };
description = ''
Configuration written to {file}`$XDG_CONFIG_HOME/rio/config.toml`. See
<https://raphamorim.io/rio/docs/#configuration-file> for options.
'';
};
};
meta.maintainers = [ lib.maintainers.otavio ];
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
}
# Only manage configuration if not empty
(lib.mkIf (cfg.settings != { }) {
xdg.configFile."rio/config.toml".source =
if lib.isPath cfg.settings then cfg.settings else settingsFormat.generate "rio.toml" cfg.settings;
})
]
);
}