From 58f246595ac7d9c8ddeb13fcef1f64eddc7d9908 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 12 Dec 2016 22:00:48 +0100 Subject: [PATCH] add programs.zsh module --- default.nix | 1 + modules/examples/lnl.nix | 5 +++-- modules/programs/zsh.nix | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 modules/programs/zsh.nix diff --git a/default.nix b/default.nix index c5376a1..ab92be2 100644 --- a/default.nix +++ b/default.nix @@ -18,6 +18,7 @@ let ./modules/services/activate-system.nix ./modules/services/nix-daemon.nix ./modules/programs/tmux.nix + ./modules/programs/zsh.nix ]; }; diff --git a/modules/examples/lnl.nix b/modules/examples/lnl.nix index 692cd84..1ebfae0 100644 --- a/modules/examples/lnl.nix +++ b/modules/examples/lnl.nix @@ -37,11 +37,12 @@ set -g status-fg white ''; + programs.zsh.enable = true; + programs.zsh.shell = "${pkgs.lnl.zsh}/bin/zsh"; + environment.variables.EDITOR = "vim"; environment.variables.HOMEBREW_CASK_OPTS = "--appdir=/Applications/cask"; - environment.variables.SHELL = "${pkgs.lnl.zsh}/bin/zsh"; - environment.variables.GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; environment.variables.SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix new file mode 100644 index 0000000..ff39d4b --- /dev/null +++ b/modules/programs/zsh.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.zsh; + +in + +{ + options = { + + programs.zsh.enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to configure zsh as an interactive shell. + ''; + }; + + programs.zsh.shell = mkOption { + type = types.path; + default = "${pkgs.zsh}/bin/zsh"; + description = '' + Zsh shell to use. + ''; + }; + + }; + + config = mkIf cfg.enable { + + environment.variables.SHELL = "${cfg.shell}"; + + }; +}