2023-01-10 16:05:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2023-05-24 03:17:09 +02:00
|
|
|
let cfg = config.programs.discord;
|
2023-01-10 16:05:48 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.programs.discord = {
|
2023-05-24 03:17:09 +02:00
|
|
|
enable = lib.mkEnableOption "Discord";
|
|
|
|
disableUpdateCheck = lib.mkEnableOption "update skipping";
|
|
|
|
enableDevtools = lib.mkEnableOption "devtools";
|
2023-01-10 16:05:48 +01:00
|
|
|
|
2023-05-24 03:17:09 +02:00
|
|
|
package = lib.mkOption {
|
|
|
|
type = lib.types.package;
|
|
|
|
default = pkgs.discord;
|
|
|
|
description = "The discord package to install";
|
2023-01-10 16:05:48 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2024-05-21 01:37:39 +02:00
|
|
|
home.packages = [ cfg.package ];
|
2023-01-10 16:05:48 +01:00
|
|
|
|
|
|
|
xdg.configFile."discord/settings.json".text =
|
2024-05-21 01:37:39 +02:00
|
|
|
builtins.toJSON {
|
|
|
|
SKIP_HOST_UPDATE = cfg.disableUpdateCheck;
|
|
|
|
DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING = cfg.enableDevtools;
|
|
|
|
};
|
2023-01-10 16:05:48 +01:00
|
|
|
};
|
|
|
|
}
|
2023-03-12 05:24:25 +01:00
|
|
|
|