1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-18 14:28:15 +00:00
home-manager/modules/programs/rio.nix
Austin Horstman d2c014e1c7
treewide: null package support (#6582)
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
2025-03-07 18:17:52 -06:00

41 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;
})
]);
}