discord experimentatioj
This commit is contained in:
parent
4a7d8858e5
commit
d472a99976
1 changed files with 27 additions and 26 deletions
|
@ -5,7 +5,6 @@ let
|
|||
cfg = config.modules.software.distractions.discord;
|
||||
flags = [
|
||||
"--flag-switches-begin"
|
||||
"--flag-switches-end"
|
||||
"--disable-gpu-memory-buffer-video-frames"
|
||||
"--enable-accelerated-mjpeg-decode"
|
||||
"--enable-accelerated-video"
|
||||
|
@ -13,36 +12,38 @@ let
|
|||
"--enable-native-gpu-memory-buffers"
|
||||
"--enable-zero-copy"
|
||||
"--ignore-gpu-blocklist"
|
||||
"--disable-features=UseOzonePlatform"
|
||||
"--enable-features=UseOzonePlatform"
|
||||
"--enable-features=VaapiVideoDecoder"
|
||||
"--enable-features=VaapiVideoEncoder"
|
||||
"--enable-features=WebRTCPipeWireCapturer"
|
||||
"--flag-switches-end"
|
||||
];
|
||||
vanillaDiscordPackage = pkgs.discord-canary.override {
|
||||
withOpenASAR = true;
|
||||
withVencord = true;
|
||||
};
|
||||
package = if cfg.armcord then pkgs.armcord else (if cfg.vesktop then pkgs.vesktop else vanillaDiscordPackage);
|
||||
in {
|
||||
options.modules.software.distractions.discord = {
|
||||
enable = mkEnableOption "Enable discord, a social messaging app";
|
||||
vesktop = mkEnableOption "Use vesktop, an alternative discord client.";
|
||||
armcord = mkEnableOption "Use Armcord, an alternative Electron client";
|
||||
vesktop = mkEnableOption "Use Vesktop, an alternative Electron client with vencord preinstalled";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf (!cfg.vesktop) {
|
||||
user.packages = let
|
||||
discord = (pkgs.discord-canary.override {
|
||||
withOpenASAR = true;
|
||||
withVencord = true;
|
||||
}).overrideAttrs (old: {
|
||||
preInstall = ''
|
||||
gappsWrapperArgs=+("--add-flags" "${concatStringsSep " " flags}")
|
||||
'';
|
||||
});
|
||||
in [ discord ];
|
||||
})
|
||||
(mkIf cfg.vesktop {
|
||||
user.packages = [
|
||||
(pkgs.vesktop.overrideAttrs (old: {
|
||||
preInstall = ''
|
||||
gappsWrapperArgs+=("--add-flags" "${concatStringsSep " " flags}")
|
||||
'';
|
||||
}))
|
||||
];
|
||||
})
|
||||
]);
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = !(cfg.armcord && cfg.vesktop);
|
||||
message = "You must either enable Armcord or Vesktop, not both";
|
||||
}
|
||||
];
|
||||
|
||||
user.packages = [
|
||||
(package.overrideAttrs (old: {
|
||||
preInstall = ''
|
||||
gappsWrapperArgs+=("--add-flags" "${concatStringsSep " " flags}")
|
||||
'';
|
||||
}))
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue