fork/home-manager

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

Robert HelgessonMerge PR #421575790441

master
1.2 KiB60 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.pubs;
8
9in {
10  meta.maintainers = [ hm.maintainers.loicreynier ];
11
12  options.programs.pubs = {
13    enable = mkEnableOption "pubs";
14
15    package = mkOption {
16      type = types.package;
17      default = pkgs.pubs;
18      defaultText = literalExpression "pkgs.pubs";
19      description = "The package to use for the pubs script.";
20    };
21
22    extraConfig = mkOption {
23      type = types.lines;
24      default = "";
25      example = literalExpression ''
26        '''
27        [main]
28        pubsdir = ''${config.home.homeDirectory}/.pubs
29        docsdir = ''${config.home.homeDirectory}/.pubs/doc
30        doc_add = link
31        open_cmd = xdg-open
32
33        [plugins]
34        active = git,alias
35
36        [[alias]]
37
38        [[[la]]]
39        command = list -a
40        description = lists papers in lexicographic order
41
42        [[git]]
43        quiet = True
44        manual = False
45        force_color = False
46        ''''';
47      description = ''
48        Configuration using syntax written to
49        {file}`$HOME/.pubsrc`.
50      '';
51    };
52  };
53
54  config = mkIf cfg.enable {
55    home.packages = [ cfg.package ];
56
57    home.file.".pubsrc" =
58      mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
59  };
60}