Files
home-manager/modules/programs/abaddon.nix
Austin Horstman 166bb6e8e0 abaddon: warn that settings are world-readable
The settings example set a Discord login token, and the generated
abaddon.ini is a world-readable Nix store path. Drop the token from the
example and say so in the description. Abaddon also rewrites
abaddon.ini when it exits, replacing the file Home Manager links, and a
token set from its Discord menu is saved there, so suggest leaving the
option empty when logging in from Abaddon.
2026-09-25 13:01:17 -05:00

60 lines
1.5 KiB
Nix

{
lib,
pkgs,
config,
...
}:
let
inherit (lib)
mkIf
mkEnableOption
mkPackageOption
mkOption
;
cfg = config.programs.abaddon;
iniFormat = pkgs.formats.ini { };
in
{
options.programs.abaddon = {
enable = mkEnableOption "abaddon";
package = mkPackageOption pkgs "abaddon" { nullable = true; };
settings = mkOption {
inherit (iniFormat) type;
default = { };
example = {
windows.hideconsole = true;
notifications.enabled = false;
discord = {
autoconnect = true;
};
gui = {
stock_emojis = false;
animations = false;
alt_menu = true;
hide_to_tray = true;
};
};
description = ''
Configuration settings for abaddon. All the available options can be found here:
<https://github.com/uowuo/abaddon?tab=readme-ov-file#settings>
These settings are written to the world-readable Nix store, so avoid
putting a Discord login token in `discord.token`. Abaddon rewrites
{file}`abaddon.ini` when it exits, which replaces the file Home
Manager manages, so if you log in from Abaddon's Discord menu,
consider leaving this option empty and letting Abaddon manage
{file}`abaddon.ini`.
'';
};
};
config = mkIf cfg.enable {
home.packages = mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."abaddon/abaddon.ini" = mkIf (cfg.settings != { }) {
source = iniFormat.generate "abaddon.ini" cfg.settings;
};
};
}