about summary refs log tree commit diff
path: root/users/Profpatsch/aerc.nix
blob: 407f224e588a055199d6b22a3cdabc419c6e3527 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ 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"
          "dhall/lib.dhall"
          "ini/ini.dhall"
        ];
        main = "aerc.dhall";
        deps = [
        ];
      }
      {
        aercFilter = name: "${aerc-patched}/share/aerc/filters/${name}";
        "Ini/externs" = depot.users.Profpatsch.ini.externs;
      };

  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 = pkgs.writeText "binds.conf" config.binds;
    }
  ];

  aerc = depot.nix.writeExecline "aerc" { } [
    "export"
    "XDG_CONFIG_HOME"
    aerc-config
    bins.aerc
    "$@"
  ];

in
aerc