From 0d749e58f7f2c6d5190920906cd8b5b5f4a8f9f4 Mon Sep 17 00:00:00 2001 From: Bernard Fortz Date: Tue, 25 Sep 2018 16:18:42 +0200 Subject: [PATCH] autojump: creates links required by oh-my-zsh for autojump. The autojump plugin in oh-my-zsh assumes autojump.zsh resides in /run/current-system/sw/share/autojump/ but these links are not created by default. The new programs.autojump.enable option forces the creation of these links. --- nixos/modules/module-list.nix | 1 + nixos/modules/programs/autojump.nix | 33 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 nixos/modules/programs/autojump.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 1a8f522a969..0b15a49d9f1 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -78,6 +78,7 @@ ./misc/version.nix ./programs/adb.nix ./programs/atop.nix + ./programs/autojump.nix ./programs/bash/bash.nix ./programs/bcc.nix ./programs/blcr.nix diff --git a/nixos/modules/programs/autojump.nix b/nixos/modules/programs/autojump.nix new file mode 100644 index 00000000000..229ac212e40 --- /dev/null +++ b/nixos/modules/programs/autojump.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.autojump; + +in + +{ + + ###### interface + + options = { + programs.autojump = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable autojump. + ''; + }; + }; + }; + + ###### implementation + + config = mkIf cfg.enable { + environment.pathsToLink = [ "/share/autojump" ]; + }; +}