2021-07-02 22:36:30 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.programs.scmpuff;
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ maintainers.cpcloud ];
|
|
|
|
|
|
|
|
options.programs.scmpuff = {
|
|
|
|
enable = mkEnableOption ''
|
|
|
|
scmpuff, a command line tool that allows you to work quicker with Git by
|
|
|
|
substituting numeric shortcuts for files'';
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.scmpuff;
|
2021-11-04 16:42:44 +00:00
|
|
|
defaultText = literalExpression "pkgs.scmpuff";
|
2023-08-08 10:19:01 +00:00
|
|
|
description = "Package providing the {command}`scmpuff` tool.";
|
2021-07-02 22:36:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enableBashIntegration = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
|
|
|
Whether to enable Bash integration.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
enableZshIntegration = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
|
|
|
Whether to enable Zsh integration.
|
|
|
|
'';
|
|
|
|
};
|
2023-01-10 09:35:00 +00:00
|
|
|
|
|
|
|
enableFishIntegration = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
|
|
|
Whether to enable fish integration.
|
|
|
|
'';
|
|
|
|
};
|
2021-07-02 22:36:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
|
|
|
eval "$(${cfg.package}/bin/scmpuff init -s)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
|
|
|
eval "$(${cfg.package}/bin/scmpuff init -s)"
|
|
|
|
'';
|
2023-01-10 09:35:00 +00:00
|
|
|
|
|
|
|
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration
|
|
|
|
(mkAfter ''
|
|
|
|
${cfg.package}/bin/scmpuff init -s --shell=fish | source
|
|
|
|
'');
|
2021-07-02 22:36:30 +00:00
|
|
|
};
|
|
|
|
}
|