fork/home-manager

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

Kidfish: remove `promptInit` in favor of `interactiveShellInit` (#2231)9282dbc1

master
1.2 KiB56 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.autojump;
8  package = pkgs.autojump;
9
10in {
11  meta.maintainers = [ maintainers.evanjs ];
12
13  options.programs.autojump = {
14    enable = mkEnableOption "autojump";
15
16    enableBashIntegration = mkOption {
17      default = true;
18      type = types.bool;
19      description = ''
20        Whether to enable Bash integration.
21      '';
22    };
23
24    enableZshIntegration = mkOption {
25      default = true;
26      type = types.bool;
27      description = ''
28        Whether to enable Zsh integration.
29      '';
30    };
31
32    enableFishIntegration = mkOption {
33      default = true;
34      type = types.bool;
35      description = ''
36        Whether to enable Fish integration.
37      '';
38    };
39  };
40
41  config = mkIf cfg.enable {
42    home.packages = [ package ];
43
44    programs.bash.initExtra = mkIf cfg.enableBashIntegration (mkBefore ''
45      . ${package}/share/autojump/autojump.bash
46    '');
47
48    programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
49      . ${package}/share/autojump/autojump.zsh
50    '';
51
52    programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
53      . ${package}/share/autojump/autojump.fish
54    '';
55  };
56}