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