Open happy-dude opened 2 weeks ago
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
also accepts text, so you could try the following as a quick fix:
{
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 unsafe-accounts-conf
, which you can simply ignore.
At this point I have only rough ideas of how one could fix this, but as an escape hatch
programs.aerc.extraConfig
also accepts text, so you could try the following as a quick fix:
Thanks! This is a decent workaround for the time being. I was also looking for some perspective here: is creating xdg symlinks to copies of the config files in my dotfiles directory advised against?
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 accounts.conf
when I was doing that, but wouldn't the end result would be similar to the above recommendation and using ${builtins.readFile location/in/repo/file.conf}
?
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 :flushed:
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.
Are you following the right branch?
Is there an existing issue for this?
Issue description
This issue is similar to https://github.com/nix-community/home-manager/issues/2519 and https://github.com/NixOS/nixpkgs/issues/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