mirror of
https://github.com/nix-community/home-manager
synced 2024-12-27 12:19:48 +01:00
f33d5086d3
This is an error as of https://github.com/NixOS/nixpkgs/pull/303841 It seems to have been missed in https://github.com/nix-community/home-manager/pull/4215
41 lines
1.1 KiB
Nix
41 lines
1.1 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" { };
|
|
|
|
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 = [ 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;
|
|
})
|
|
]);
|
|
}
|