1
Fork 0
satellite/modules/home-manager/discord.nix

35 lines
908 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2023-05-24 03:17:09 +02:00
let cfg = config.programs.discord;
in
{
options.programs.discord = {
2023-05-24 03:17:09 +02:00
enable = lib.mkEnableOption "Discord";
enableOpenASAR = lib.mkEnableOption "openASAR";
disableUpdateCheck = lib.mkEnableOption "update skipping";
enableDevtools = lib.mkEnableOption "devtools";
2023-05-24 03:17:09 +02:00
package = lib.mkOption {
type = lib.types.package;
default = pkgs.discord;
description = "The discord package to install";
};
};
config = lib.mkIf cfg.enable {
2023-05-24 03:17:09 +02:00
home.packages =
[
(if cfg.enableOpenASAR
then cfg.package.override { withOpenASAR = true; }
else cfg.package)
];
xdg.configFile."discord/settings.json".text =
builtins.toJSON
{
SKIP_HOST_UPDATE = cfg.disableUpdateCheck;
2023-03-12 05:24:25 +01:00
DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING = cfg.enableDevtools;
};
};
}
2023-03-12 05:24:25 +01:00