mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 06:54:35 +00:00
Add iamb (tui matrix client)
This commit is contained in:
parent
56154c0758
commit
1c5581679f
|
@ -14,5 +14,6 @@ _: {
|
|||
./bottom.nix
|
||||
./bat.nix
|
||||
./nix-index.nix
|
||||
./iamb.nix
|
||||
];
|
||||
}
|
||||
|
|
48
home/programs/terminal/tools/iamb.nix
Normal file
48
home/programs/terminal/tools/iamb.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = osConfig.myOptions.home-manager.programs.applications.iamb;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [ iamb ];
|
||||
|
||||
xdg.configFile."iamb/config.json".text = builtins.toJSON {
|
||||
settings = {
|
||||
log_level = "warn";
|
||||
reaction_display = true;
|
||||
reaction_shortcode_display = false;
|
||||
read_receipt_send = false;
|
||||
read_receipt_display = true;
|
||||
request_timeout = 15000;
|
||||
typing_notice_send = true;
|
||||
typing_notice_display = true;
|
||||
|
||||
image_preview = {
|
||||
protocol.type = "kitty";
|
||||
size = {
|
||||
width = 80;
|
||||
height = 24;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
default_profile = cfg.defaultProfile;
|
||||
profiles = lib.mapAttrs (name: profile: {
|
||||
user_id = profile.userId;
|
||||
url = profile.homeServer;
|
||||
}) cfg.profiles;
|
||||
|
||||
dirs = {
|
||||
cache = "${config.xdg.cacheHome}/iamb/";
|
||||
logs = "${config.xdg.dataHome}/iamb/logs/";
|
||||
downloads = "${config.xdg.userDirs.download}/";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -186,6 +186,13 @@
|
|||
qimgv.enable = true;
|
||||
qbittorrent.enable = true;
|
||||
obs.enable = true;
|
||||
iamb = {
|
||||
enable = true;
|
||||
profiles.default = {
|
||||
userId = "@itsdrike:envs.net";
|
||||
homeServer = "https://matrix.envs.net";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
inherit (lib) mkEnableOption mkOption types;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./iamb.nix
|
||||
];
|
||||
|
||||
options.myOptions.home-manager.programs = {
|
||||
launchers = {
|
||||
wofi.enable = mkEnableOption "Wofi launcher";
|
||||
|
|
51
options/home/programs/iamb.nix
Normal file
51
options/home/programs/iamb.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types mkIf;
|
||||
|
||||
cfg = config.myOptions.home-manager.programs.applications.iamb;
|
||||
in
|
||||
{
|
||||
options.myOptions.home-manager.programs.applications.iamb = {
|
||||
enable = mkEnableOption "iamb (vim-inspired terminal Matrix client)";
|
||||
defaultProfile = mkOption {
|
||||
type = types.str;
|
||||
default = "default";
|
||||
description = "Default profile to be used when the app starts";
|
||||
};
|
||||
profiles = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
userId = mkOption {
|
||||
type = types.str;
|
||||
example = "@itsdrike:envs.net";
|
||||
description = "Your Matrix user ID";
|
||||
};
|
||||
homeServer = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
example = "https://matrix.envs.net";
|
||||
default = null;
|
||||
description = ''
|
||||
If your homeserver is located on a different domain than the server part
|
||||
of the `userId`, then you can explicitly specify a homeserver URL to use.
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
description = "Profiles for the iamb client, keyed by profile name";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = builtins.elem cfg.defaultProfile (lib.attrNames cfg.profiles);
|
||||
message = "Default profile must be present in profiles configuration";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in a new issue