summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorAlexey Lebedeff <binarin@gmail.com>2018-02-14 07:31:59 +0100
committerJörg Thalheim <Mic92@users.noreply.github.com>2018-02-14 06:31:59 +0000
commit6d442efe9966661c60f22a43397e7b66f1acde84 (patch)
tree7bcc6646ca8a3ac2461f4d133349cd41a773c957 /nixos
parentc2973f986d4fc5da938aaca158a8497751ef35f0 (diff)
zsh-autoenv: init at 2017-12-16 (#34932)
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/programs/zsh/zsh-autoenv.nix28
2 files changed, 29 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index b271ca0f3557..d8d6749f7965 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -114,6 +114,7 @@
./programs/yabar.nix
./programs/zsh/oh-my-zsh.nix
./programs/zsh/zsh.nix
+ ./programs/zsh/zsh-autoenv.nix
./programs/zsh/zsh-syntax-highlighting.nix
./rename.nix
./security/acme.nix
diff --git a/nixos/modules/programs/zsh/zsh-autoenv.nix b/nixos/modules/programs/zsh/zsh-autoenv.nix
new file mode 100644
index 000000000000..630114bcda9f
--- /dev/null
+++ b/nixos/modules/programs/zsh/zsh-autoenv.nix
@@ -0,0 +1,28 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+ cfg = config.programs.zsh.zsh-autoenv;
+in {
+ options = {
+ programs.zsh.zsh-autoenv = {
+ enable = mkEnableOption "zsh-autoenv";
+ package = mkOption {
+ default = pkgs.zsh-autoenv;
+ defaultText = "pkgs.zsh-autoenv";
+ description = ''
+ Package to install for `zsh-autoenv` usage.
+ '';
+
+ type = types.package;
+ };
+ };
+ };
+
+ config = mkIf cfg.enable {
+ programs.zsh.interactiveShellInit = ''
+ source ${cfg.package}/share/zsh-autoenv/autoenv.zsh
+ '';
+ };
+}