mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
vesktop: created module
Added a home-manager module for vesktop that allows for configuring both vesktop and vencord, and creating a custom theme.
This commit is contained in:
parent
3cecde80a5
commit
a0461b67ff
8 changed files with 213 additions and 0 deletions
|
|
@ -278,7 +278,9 @@ let
|
|||
./programs/translate-shell.nix
|
||||
./programs/urxvt.nix
|
||||
./programs/vdirsyncer.nix
|
||||
./programs/vesktop.nix
|
||||
./programs/vifm.nix
|
||||
./programs/vim.nix
|
||||
./programs/vim-vint.nix
|
||||
./programs/vim.nix
|
||||
./programs/vinegar.nix
|
||||
|
|
|
|||
112
modules/programs/vesktop.nix
Normal file
112
modules/programs/vesktop.nix
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.vesktop;
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [
|
||||
lib.maintainers.Flameopathic
|
||||
lib.hm.maintainers.LilleAila
|
||||
];
|
||||
|
||||
options.programs.vesktop = {
|
||||
enable = lib.mkEnableOption "Vesktop, an alternate client for Discord with Vencord built-in";
|
||||
package = lib.mkPackageOption pkgs "vesktop" { };
|
||||
settings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Vesktop settings written to
|
||||
{file}`$XDG_CONFIG_HOME/vesktop/settings.json`. See
|
||||
<https://github.com/Vencord/Vesktop/blob/main/src/shared/settings.d.ts>
|
||||
for available options.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
appBadge = false;
|
||||
arRPC = true;
|
||||
checkUpdates = false;
|
||||
customTitleBar = false;
|
||||
disableMinSize = true;
|
||||
minimizeToTray = false;
|
||||
tray = false;
|
||||
splashBackground = "#000000";
|
||||
splashColor = "#ffffff";
|
||||
splashTheming = true;
|
||||
staticTitle = true;
|
||||
hardwareAcceleration = true;
|
||||
discordBranch = "stable";
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
vencord = {
|
||||
useSystem = lib.mkEnableOption "Vencord package from Nixpkgs";
|
||||
theme = lib.mkOption {
|
||||
description = "The theme to use for Vencord";
|
||||
default = null;
|
||||
type =
|
||||
with lib.types;
|
||||
nullOr (oneOf [
|
||||
lines
|
||||
path
|
||||
]);
|
||||
};
|
||||
settings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Vencord settings written to
|
||||
{file}`$XDG_CONFIG_HOME/vesktop/settings/settings.json`. See
|
||||
<https://github.com/Vendicated/Vencord/blob/main/src/api/Settings.ts>
|
||||
for available options.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
autoUpdate = false;
|
||||
autoUpdateNotification = false;
|
||||
notifyAboutUpdates = false;
|
||||
useQuickCss = true;
|
||||
disableMinSize = true;
|
||||
plugins = {
|
||||
MessageLogger = {
|
||||
enabled = true;
|
||||
ignoreSelf = true;
|
||||
};
|
||||
FakeNitro.enabled = true;
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
home.packages = [
|
||||
(cfg.package.override { withSystemVencord = cfg.vencord.useSystem; })
|
||||
];
|
||||
xdg.configFile."vesktop/settings.json".source = jsonFormat.generate "vesktop-settings" cfg.settings;
|
||||
xdg.configFile."vesktop/settings/settings.json".source =
|
||||
jsonFormat.generate "vencord-settings" cfg.vencord.settings;
|
||||
}
|
||||
(lib.mkIf (cfg.vencord.theme != null) {
|
||||
programs.vesktop.vencord.settings.enabledThemes = [ "theme.css" ];
|
||||
xdg.configFile."vesktop/themes/theme.css".source =
|
||||
if builtins.isPath cfg.vencord.theme || lib.isStorePath cfg.vencord.theme then
|
||||
cfg.vencord.theme
|
||||
else
|
||||
pkgs.writeText "vesktop/themes/theme.css" cfg.vencord.theme;
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
@ -548,6 +548,7 @@ import nmtSrc {
|
|||
./modules/programs/swayr
|
||||
./modules/programs/terminator
|
||||
./modules/programs/tofi
|
||||
./modules/programs/vesktop
|
||||
./modules/programs/vinegar
|
||||
./modules/programs/waybar
|
||||
./modules/programs/wlogout
|
||||
|
|
|
|||
59
tests/modules/programs/vesktop/basic-configuration.nix
Normal file
59
tests/modules/programs/vesktop/basic-configuration.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.vesktop = {
|
||||
enable = true;
|
||||
settings = {
|
||||
tray = false;
|
||||
minimizeToTray = false;
|
||||
hardwareAcceleration = true;
|
||||
customTitleBar = false;
|
||||
staticTitle = true;
|
||||
discordBranch = "stable";
|
||||
};
|
||||
vencord = {
|
||||
theme = ''
|
||||
.privateChannels_f0963d::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
background: linear-gradient(to bottom, transparent 85%, var(--base00));
|
||||
pointer-events: none;
|
||||
}
|
||||
'';
|
||||
settings = {
|
||||
autoUpdate = false;
|
||||
autoUpdateNotification = false;
|
||||
notifyAboutUpdates = false;
|
||||
useQuickCss = true;
|
||||
disableMinSize = true;
|
||||
plugins = {
|
||||
MessageLogger = {
|
||||
enabled = true;
|
||||
ignoreSelf = true;
|
||||
};
|
||||
FakeNitro.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
configDir=home-files/.config/vesktop
|
||||
assertFileExists $configDir/settings.json
|
||||
assertFileContent $configDir/settings.json \
|
||||
${./basic-settings.json}
|
||||
assertFileExists $configDir/settings/settings.json
|
||||
assertFileContent $configDir/settings/settings.json \
|
||||
${./basic-vencord-settings.json}
|
||||
assertFileExists $configDir/themes/theme.css
|
||||
assertFileContent $configDir/themes/theme.css \
|
||||
${./basic-theme.css}
|
||||
'';
|
||||
};
|
||||
}
|
||||
8
tests/modules/programs/vesktop/basic-settings.json
Normal file
8
tests/modules/programs/vesktop/basic-settings.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"customTitleBar": false,
|
||||
"discordBranch": "stable",
|
||||
"hardwareAcceleration": true,
|
||||
"minimizeToTray": false,
|
||||
"staticTitle": true,
|
||||
"tray": false
|
||||
}
|
||||
11
tests/modules/programs/vesktop/basic-theme.css
Normal file
11
tests/modules/programs/vesktop/basic-theme.css
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.privateChannels_f0963d::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
background: linear-gradient(to bottom, transparent 85%, var(--base00));
|
||||
pointer-events: none;
|
||||
}
|
||||
19
tests/modules/programs/vesktop/basic-vencord-settings.json
Normal file
19
tests/modules/programs/vesktop/basic-vencord-settings.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"autoUpdate": false,
|
||||
"autoUpdateNotification": false,
|
||||
"disableMinSize": true,
|
||||
"enabledThemes": [
|
||||
"theme.css"
|
||||
],
|
||||
"notifyAboutUpdates": false,
|
||||
"plugins": {
|
||||
"FakeNitro": {
|
||||
"enabled": true
|
||||
},
|
||||
"MessageLogger": {
|
||||
"enabled": true,
|
||||
"ignoreSelf": true
|
||||
}
|
||||
},
|
||||
"useQuickCss": true
|
||||
}
|
||||
1
tests/modules/programs/vesktop/default.nix
Normal file
1
tests/modules/programs/vesktop/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ vesktop-basic-configuration = ./basic-configuration.nix; }
|
||||
Loading…
Add table
Add a link
Reference in a new issue