2023-01-10 09:35:00 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.pubs;
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ hm.maintainers.loicreynier ];
|
|
|
|
|
|
|
|
options.programs.pubs = {
|
|
|
|
enable = mkEnableOption "pubs";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.pubs;
|
|
|
|
defaultText = literalExpression "pkgs.pubs";
|
|
|
|
description = "The package to use for the pubs script.";
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
''''';
|
|
|
|
description = ''
|
|
|
|
Configuration using syntax written to
|
2023-08-08 10:19:01 +00:00
|
|
|
{file}`$HOME/.pubsrc`.
|
2023-01-10 09:35:00 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
home.file.".pubsrc" =
|
|
|
|
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
|
|
|
|
};
|
|
|
|
}
|