-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: programs.aerc.extraConfig.filters attrs are order-sensitive #6059
Comments
Hi, thanks for reporting the issue and for the additional resources, I had not seen this yet. At this point I have only rough ideas of how one could fix this, but as an escape hatch {
programs.aerc = {
extraConfig = let
iniFormat = pkgs.formats.iniWithGlobalSection {};
cfgText = iniFormat.generate "aerc.conf" {
globalSection = {
unsafe-accounts-conf = true;
};
sections = {
/* your config without filters */
};
};
in
''
${builtins.readFile cfgText}
[filter]
# your filters
'';
};
} You will get a warning about |
Thanks! This is a decent workaround for the time being. Something like: home.file.".notmuch-config".source = ./.notmuch-config;
home.file.".mbsyncrc".source = ./.mbsyncrc;
xdg.configFile."aerc/aerc.conf".source = ./.config/aerc/aerc.conf;
xdg.configFile."aerc/accounts.conf".source = ./.config/aerc/accounts.conf;
xdg.configFile."aerc/binds.conf".source = ./.config/aerc/binds.conf;
xdg.configFile."aerc/notmuch-map.conf".source = ./.config/aerc/notmuch-map.conf;
xdg.configFile."aerc/stylesets/gruvbox".source = ./.config/aerc/stylesets/gruvbox;
xdg.configFile."aerc/stylesets/gruvbox_material_dark_hard".source = ./.config/aerc/stylesets/gruvbox_material_dark_hard;
xdg.configFile."aerc/stylesets/gruvbox_material_dark_medium".source = ./.config/aerc/stylesets/gruvbox_material_dark_medium;
xdg.configFile."aerc/stylesets/gruvbox_material_dark_soft".source = ./.config/aerc/stylesets/gruvbox_material_dark_soft;
xdg.configFile."aerc/templates/quoted_thanks".source = ./.config/aerc/templates/quoted_thanks;
xdg.configFile."aerc/templates/thanks".source = ./.config/aerc/templates/thanks; I was having permissions(?) problems with |
Ended up with https://github.com/happy-dude/dotfiles/blob/work/aerc/default.nix, which is probably not the most idiomatic nix (letting nix / home-manager generate and render the files), but it's still largely compatible with gnu stow and whatnot 😳 |
To my knowledge, using `xdg.configFile` and friends is perfectly fine and relatively common, to augment a stow based setup.
I personally would stick with the symlink, as using the readFile approach produces another copy of the file in the nix-store. The quickfix only makes sense if you would have used attrsets for the module options.
Regarding the permission problems, you have to set `unsafe-accounts-conf = true` [1] in your config and not put plain passwords in there, as nix store path are readable by any user.
[1]: https://man.archlinux.org/man/aerc-config.5.en#GENERAL_OPTIONS
|
Are you following the right branch?
Is there an existing issue for this?
Issue description
This issue is similar to #2519 and NixOS/nixpkgs#258083.
aerc's config (
aerc.conf
) allow various filters to customize how different mimetypes are viewed and paged.For instance, the following is a valid setting:
Note that there are two
text/html
filters (which home-manager attrs only allow 1 key-value mapping), and thetext/*
filter at the end to match all general text content.Unfortunately when I try to configure this for home-manager in a nix file, the order is not preserved (and does not allow duplicate keys for
text/html
):Is there any way to improve this setting and perhaps have it take a literal block of text?
Thanks a ton! Please let me know how I can help facilitate further.
Maintainer CC
@lukasngl
System information
The text was updated successfully, but these errors were encountered: