diff --git a/modules/modules.nix b/modules/modules.nix index aad4b86e8..9c8114b3c 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -131,6 +131,7 @@ let ./programs/i3blocks.nix ./programs/i3status-rust.nix ./programs/i3status.nix + ./programs/iamb.nix ./programs/imv.nix ./programs/info.nix ./programs/ion.nix diff --git a/modules/programs/iamb.nix b/modules/programs/iamb.nix new file mode 100644 index 000000000..bc783ba14 --- /dev/null +++ b/modules/programs/iamb.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.programs.iamb; + tomlFormat = pkgs.formats.toml { }; +in { + options.programs.iamb = { + enable = lib.mkEnableOption "iamb"; + + package = lib.mkOption { + type = lib.types.package; + default = pkgs.iamb; + defaultText = lib.literalExpression "pkgs.iamb"; + description = "The package to use for the iamb binary."; + }; + + settings = lib.mkOption { + type = tomlFormat.type; + default = { }; + example = lib.literalExpression '' + { + 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 for the full list + of options. + ''; + }; + + }; + + config = lib.mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile."iamb/config.toml" = lib.mkIf (cfg.settings != { }) { + source = tomlFormat.generate "iamb-config" cfg.settings; + }; + }; +}