mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
`literalExpression` is intended just to signify code that needs to stay a string that gets represented exactly as-is for docs. It has been misused heavily and people get confused repeatedly on when or not to use it because of the rampant misuse.
57 lines
1.2 KiB
Nix
57 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.programs.iamb;
|
|
tomlFormat = pkgs.formats.toml { };
|
|
configDir =
|
|
if pkgs.stdenv.isDarwin && !config.xdg.enable then
|
|
"Library/Application Support"
|
|
else
|
|
config.xdg.configHome;
|
|
in
|
|
{
|
|
options.programs.iamb = {
|
|
enable = lib.mkEnableOption "iamb";
|
|
|
|
package = lib.mkPackageOption pkgs "iamb" { nullable = true; };
|
|
|
|
settings = lib.mkOption {
|
|
inherit (tomlFormat) type;
|
|
default = { };
|
|
example = {
|
|
default_profile = "personal";
|
|
settings = {
|
|
notifications.enabled = true;
|
|
image_preview.protocol = {
|
|
type = "kitty";
|
|
size = {
|
|
height = 10;
|
|
width = 66;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
description = ''
|
|
Configuration written to
|
|
{file}`$XDG_CONFIG_HOME/iamb/config.toml`.
|
|
|
|
See <https://iamb.chat/configure.html> for the full list
|
|
of options.
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
home.file."${configDir}/iamb/config.toml" = lib.mkIf (cfg.settings != { }) {
|
|
source = tomlFormat.generate "iamb-config" cfg.settings;
|
|
};
|
|
};
|
|
}
|