git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #47334 from bfortz/autojump

autojump: new program.autojump.enable flag to automatically load autojump

commitae3a807a2199583cc4ba25ded9ad3e40d802929e authorDomen Kožar <domen@enlambda.com> dateWed 20 Feb 2019, 15:12 (8 years ago) parent2407f4ccd8ffef
2 files changed+34
nixos/modules/module-list.nix+1 nixos/modules/programs/autojump.nix+33
nixos/modules/module-list.nix+1
@@ -82,6 +82,7 @@
8282 ./misc/version.nix
8383 ./programs/adb.nix
8484 ./programs/atop.nix
85+ ./programs/autojump.nix
8586 ./programs/bash/bash.nix
8687 ./programs/bcc.nix
8788 ./programs/blcr.nix
nixos/modules/programs/autojump.nixnew file+33
@@ -0,0 +1,33 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+ cfg = config.programs.autojump;
7+ prg = config.programs;
8+in
9+{
10+ options = {
11+ programs.autojump = {
12+
13+ enable = mkOption {
14+ type = types.bool;
15+ default = false;
16+ description = ''
17+ Whether to enable autojump.
18+ '';
19+ };
20+ };
21+ };
22+
23+ ###### implementation
24+
25+ config = mkIf cfg.enable {
26+ environment.pathsToLink = [ "/share/autojump" ];
27+ environment.systemPackages = [ pkgs.autojump ];
28+
29+ programs.bash.interactiveShellInit = "source ${pkgs.autojump}/share/autojump/autojump.bash";
30+ programs.zsh.interactiveShellInit = mkIf prg.zsh.enable "source ${pkgs.autojump}/share/autojump/autojump.zsh";
31+ programs.fish.interactiveShellInit = mkIf prg.fish.enable "source ${pkgs.autojump}/share/autojump/autojump.fish";
32+ };
33+}