feat(users/Profpatsch): init initial aerc config
aerc is a mail client. It needs some ini files to work. This is an initial attempt at generating them. Change-Id: I087955f19d2c4527275500a1e13eeb071c98a7b9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5526 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
This commit is contained in:
parent
f0e52f31cd
commit
2a6928fb4c
3 changed files with 335 additions and 0 deletions
70
users/Profpatsch/aerc.nix
Normal file
70
users/Profpatsch/aerc.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{ depot, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
aerc-patched = pkgs.aerc.overrideAttrs (old: {
|
||||
patches = old.patches or [ ] ++ [
|
||||
./aerc-no-config-perms.patch
|
||||
];
|
||||
});
|
||||
|
||||
bins = depot.nix.getBins aerc-patched [ "aerc" ];
|
||||
|
||||
config =
|
||||
depot.users.Profpatsch.importDhall.importDhall
|
||||
{
|
||||
root = ./.;
|
||||
files = [
|
||||
"aerc.dhall"
|
||||
];
|
||||
main = "aerc.dhall";
|
||||
deps = [ ];
|
||||
}
|
||||
{
|
||||
concatNewline = lib.concatStringsSep "\n";
|
||||
aercFilter = name: "${aerc-patched}/share/aerc/filters/${name}";
|
||||
toIni = getSections:
|
||||
lib.generators.toINIWithGlobalSection { }
|
||||
(getSections { } toIniDhall);
|
||||
};
|
||||
|
||||
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";
|
||||
path = pkgs.writeText "accounts.conf" config.accounts;
|
||||
}
|
||||
{
|
||||
name = "aerc/aerc.conf";
|
||||
path = pkgs.writeText "aerc.conf" config.aerc;
|
||||
}
|
||||
{
|
||||
name = "aerc/binds.conf";
|
||||
path = binds-file "binds.conf" config.binds;
|
||||
}
|
||||
];
|
||||
|
||||
aerc = depot.nix.writeExecline "aerc" { } [
|
||||
"export"
|
||||
"XDG_CONFIG_HOME"
|
||||
aerc-config
|
||||
bins.aerc
|
||||
"$@"
|
||||
];
|
||||
|
||||
in
|
||||
aerc
|
||||
Loading…
Add table
Add a link
Reference in a new issue