feat(users/Profpatsch/aerc): use toINI

Uses the list-based toINI, which removes a lot of the complications
caused by the INI DSL (it was fun to write but really not necessary).

Change-Id: Ia6c30a726662416c99ed74f9eb33537573543383
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5530
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
This commit is contained in:
Profpatsch 2022-05-06 00:34:50 +02:00
parent 0c51608f6c
commit 54684f6c34
2 changed files with 42 additions and 157 deletions

View file

@ -20,29 +20,10 @@ let
deps = [ ];
}
{
concatNewline = lib.concatStringsSep "\n";
aercFilter = name: "${aerc-patched}/share/aerc/filters/${name}";
toIni = getSections:
lib.generators.toINIWithGlobalSection { }
(getSections { } toIniDhall);
toIni = depot.users.Profpatsch.toINI { };
};
toIniDhall = {
newSection = { };
add = key: val: sect: sect // { ${key} = val; };
addAll = keyVals: sect: sect // builtins.listToAttrs keyVals;
newSectionList = { };
addSection = key: val: sect: sect // { ${key} = val; };
};
ini-file = name: ini: lib.pipe ini [
(lib.generators.toINI { })
(pkgs.writeText name)
];
binds-file = name: binds: pkgs.writeText name binds;
aerc-config = pkgs.linkFarm "alacritty-config" [
{
name = "aerc/accounts.conf";
@ -54,7 +35,7 @@ let
}
{
name = "aerc/binds.conf";
path = binds-file "binds.conf" config.binds;
path = pkgs.writeText "binds.conf" config.binds;
}
];