2022-02-02 08:55:08 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.pubs;
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ hm.maintainers.loicreynier ];
|
|
|
|
|
|
|
|
options.programs.pubs = {
|
2023-07-01 23:45:18 +00:00
|
|
|
enable = mkEnableOption "pubs";
|
2022-02-02 08:55:08 +00:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.pubs;
|
|
|
|
defaultText = literalExpression "pkgs.pubs";
|
2023-07-01 23:45:18 +00:00
|
|
|
description = "The package to use for the pubs script.";
|
2022-02-02 08:55:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
|
|
|
example = literalExpression ''
|
|
|
|
'''
|
|
|
|
[main]
|
|
|
|
pubsdir = ''${config.home.homeDirectory}/.pubs
|
|
|
|
docsdir = ''${config.home.homeDirectory}/.pubs/doc
|
|
|
|
doc_add = link
|
|
|
|
open_cmd = xdg-open
|
|
|
|
|
|
|
|
[plugins]
|
|
|
|
active = git,alias
|
|
|
|
|
|
|
|
[[alias]]
|
|
|
|
|
|
|
|
[[[la]]]
|
|
|
|
command = list -a
|
|
|
|
description = lists papers in lexicographic order
|
|
|
|
|
|
|
|
[[git]]
|
|
|
|
quiet = True
|
|
|
|
manual = False
|
|
|
|
force_color = False
|
|
|
|
''''';
|
2023-07-01 23:45:18 +00:00
|
|
|
description = ''
|
2022-02-02 08:55:08 +00:00
|
|
|
Configuration using syntax written to
|
2023-06-30 23:30:13 +00:00
|
|
|
{file}`$HOME/.pubsrc`.
|
2022-02-02 08:55:08 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
home.file.".pubsrc" =
|
|
|
|
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
|
|
|
|
};
|
|
|
|
}
|