2023-11-19 02:37:51 +00:00
# discord gtk3 client
2023-11-21 03:32:59 +00:00
{ config , lib , pkgs , . . . }:
let
cfg = config . sane . programs . abaddon ;
in
2023-11-19 02:37:51 +00:00
{
sane . programs . abaddon = {
2023-11-21 03:32:59 +00:00
configOption = with lib ; mkOption {
default = { } ;
type = types . submodule {
options . autostart = mkOption {
type = types . bool ;
2023-12-09 16:45:40 +00:00
default = false ;
2023-11-21 03:32:59 +00:00
} ;
} ;
} ;
2024-01-20 11:11:12 +00:00
packageUnwrapped = pkgs . abaddon . overrideAttrs ( upstream : {
2023-11-21 03:06:58 +00:00
patches = ( upstream . patches or [ ] ) ++ [
( pkgs . fetchpatch {
url = " h t t p s : / / g i t . u n i n s a n e . o r g / c o l i n / a b a d d o n / c o m m i t / e b 5 5 1 f 1 8 8 d 3 4 6 7 9 f 7 5 a d c b c 8 3 c b 8 d 5 b e b 4 d 1 9 f d 6 . p a t c h " ;
name = '' " v i e w m e m b e r s " d e f a u l t t o f a l s e '' ;
hash = " s h a 2 5 6 - 9 B X 8 i O 8 6 C U 1 l N r K S 1 G 2 B j D R + 3 I l V 9 b m h R N T s L r x C h w Q = " ;
} )
] ;
} ) ;
2023-11-21 06:05:52 +00:00
suggestedPrograms = [ " g n o m e - k e y r i n g " ] ;
2023-11-21 00:36:43 +00:00
fs . " . c o n f i g / a b a d d o n / a b a d d o n . i n i " . symlink . text = ''
# see abaddon README.md for options.
# at time of writing:
# | Setting | Type | Default | Description |
# |[discord]------|---------|---------|--------------------------------------------------------------------------------------------------|
# | `gateway` | string | | override url for Discord gateway. must be json format and use zlib stream compression |
# | `api_base` | string | | override base url for Discord API |
# | `memory_db` | boolean | false | if true, Discord data will be kept in memory as opposed to on disk |
# | `token` | string | | Discord token used to login, this can be set from the menu |
# | `prefetch` | boolean | false | if true, new messages will cause the avatar and image attachments to be automatically downloaded |
# | `autoconnect` | boolean | false | autoconnect to discord |
# |[http]--------|--------|---------|---------------------------------------------------------------------------------------------|
# | `user_agent` | string | | sets the user-agent to use in HTTP requests to the Discord API (not including media/images) |
# | `concurrent` | int | 20 | how many images can be concurrently retrieved |
# |[gui}------------------------|---------|---------|----------------------------------------------------------------------------------------------------------------------------|
# | `member_list_discriminator` | boolean | true | show user discriminators in the member list |
# | `stock_emojis` | boolean | true | allow abaddon to substitute unicode emojis with images from emojis.bin, must be false to allow GTK to render emojis itself |
# | `custom_emojis` | boolean | true | download and use custom Discord emojis |
# | `css` | string | | path to the main CSS file |
# | `animations` | boolean | true | use animated images where available (e.g. server icons, emojis, avatars). false means static images will be used |
# | `animated_guild_hover_only` | boolean | true | only animate guild icons when the guild is being hovered over |
# | `owner_crown` | boolean | true | show a crown next to the owner |
# | `unreads` | boolean | true | show unread indicators and mention badges |
# | `save_state` | boolean | true | save the state of the gui (active channels, tabs, expanded channels) |
# | `alt_menu` | boolean | false | keep the menu hidden unless revealed with alt key |
# | `hide_to_tray` | boolean | false | hide abaddon to the system tray on window close |
# | `show_deleted_indicator` | boolean | true | show \[deleted\] indicator next to deleted messages instead of actually deleting the message |
# | `font_scale` | double | | scale font rendering. 1 is unchanged |
# |[style]------------------|--------|-----------------------------------------------------|
# | `linkcolor` | string | color to use for links in messages |
# | `expandercolor` | string | color to use for the expander in the channel list |
# | `nsfwchannelcolor` | string | color to use for NSFW channels in the channel list |
# | `channelcolor` | string | color to use for SFW channels in the channel list |
# | `mentionbadgecolor` | string | background color for mention badges |
# | `mentionbadgetextcolor` | string | color to use for number displayed on mention badges |
# | `unreadcolor` | string | color to use for the unread indicator |
# |[notifications]|---------|--------------------------|-------------------------------------------------------------------------------|
# | `enabled` | boolean | true (if not on Windows) | Enable desktop notifications |
# | `playsound` | boolean | true | Enable notification sounds. Requires ENABLE_NOTIFICATION_SOUNDS=TRUE in CMake |
# |[voice]--|--------|------------------------------------|------------------------------------------------------------|
# | `vad` | string | rnnoise if enabled, gate otherwise | Method used for voice activity detection. Changeable in UI |
# |[windows]|---------|---------|-------------------------|
# | `hideconsole` | boolean | true | Hide console on startup |
# N.B.: abaddon writes this file itself (and even when i don't change anything internally).
# it prefers no spaces around the equal sign.
[ discord ]
autoconnect = true
[ notifications ]
# playsound: i manage sounds via swaync
playsound = false
'' ;
2023-11-19 02:37:51 +00:00
persist . byStore . private = [
" . c a c h e / a b a d d o n "
] ;
2023-11-21 03:32:59 +00:00
services . abaddon = {
description = " u n o f f i c i a l D i s c o r d c h a t c l i e n t " ;
2024-03-21 16:02:06 +00:00
partOf = lib . mkIf cfg . config . autostart [ " g r a p h i c a l - s e s s i o n " ] ;
2024-03-21 15:05:23 +00:00
command = " a b a d d o n " ;
2023-11-21 03:32:59 +00:00
} ;
2023-11-19 02:37:51 +00:00
} ;
}