fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMerge PR #421575790441

master
991 B44 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.abook;
8
9in {
10  options.programs.abook = {
11    enable = mkEnableOption "Abook";
12
13    extraConfig = mkOption {
14      type = types.lines;
15      default = "";
16      example = ''
17        field pager = Pager
18        view CONTACT = name, email
19        set autosave=true
20      '';
21      description = ''
22        Extra lines added to {file}`$HOME/.config/abook/abookrc`.
23        Available configuration options are described in the abook repository:
24        <https://sourceforge.net/p/abook/git/ci/master/tree/sample.abookrc>.
25      '';
26    };
27  };
28
29  config = mkIf cfg.enable {
30    assertions =
31      [ (hm.assertions.assertPlatform "programs.abook" pkgs platforms.linux) ];
32
33    home.packages = [ pkgs.abook ];
34
35    xdg.configFile."abook/abookrc" = mkIf (cfg.extraConfig != "") {
36      text = ''
37        # Generated by Home Manager.
38        # See http://abook.sourceforge.net/
39
40        ${cfg.extraConfig}
41      '';
42    };
43  };
44}