Files
chiasson-nix/modules/wisdom/apps/discord.nix
T
Olivier 13f35677be refactor(wisdom): decentralize module defaults and update conventions
Move Home Manager module defaults from a centralized `desktop-home-defaults.nix`
file into their respective `wisdom` slices. This change aligns with the
updated documentation regarding module ownership, where defaults live
with the option that owns them rather than in a shared defaults file.

Additionally, update `docs/conventions.md` to reflect this new pattern for
defining `mkEnableOption` defaults and move base git/encryption
configurations into the core `wisdom` module.

- Delete `modules/hosts/desktop-home-defaults.nix`
- Update `modules/wisdom/default.nix` to include shared git and package defaults
- Add `default = ...` to `mkEnableOption` in various `wisdom` modules
- Update `docs/conventions.md` with new HM slice guidelines
2026-07-16 13:51:48 -03:00

52 lines
1.7 KiB
Nix

{ inputs, ... }: {
flake.homeManagerModules.wisdomAppsDiscord =
{ config, lib, pkgs, ... }:
let
root = config.chiasson.home;
cfg = config.chiasson.home.apps.discord;
# nixcord still pulls `discord` on some paths; that package is not built for aarch64-linux.
nixcordSupported = lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.discord;
in
{
imports = [ inputs.nixcord.homeModules.default ];
options.chiasson.home.apps.discord.enable = lib.mkEnableOption ''
Vesktop (nixcord). Needs nixpkgs `discord` — breaks on e.g. aarch64-linux.
'' // {
default = false;
};
config = lib.mkIf root.enable (lib.mkMerge [
{
assertions = lib.mkIf cfg.enable [
{
assertion = nixcordSupported;
message = "chiasson.home.apps.discord uses nixcord, which currently requires nixpkgs `discord` (not available on ${pkgs.stdenv.hostPlatform.system}). Disable `chiasson.home.apps.discord` on this host.";
}
];
}
(lib.mkIf (cfg.enable && nixcordSupported) {
programs.nixcord = {
enable = true;
vesktop.enable = true;
dorion.enable = false;
config = {
useQuickCss = true;
transparent = true;
enabledThemes = lib.optionals (
lib.attrByPath [ "programs" "dank-material-shell" "enable" ] false config
) [ "dank-discord.css" ];
plugins = {
showHiddenChannels = {
enable = true;
showMode = 0;
};
platformIndicators.enable = true;
};
};
};
})
]);
};
}