diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2016-12-12 23:01:07 +0100 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2016-12-12 23:01:07 +0100 |
| commit | 2af32bbcfe1ac7dcecf40dfb7d7f8ca747308755 (patch) | |
| tree | 229ac1a018dd9680645032fb732b1ef958b78c82 /modules/examples | |
| parent | 58f246595ac7d9c8ddeb13fcef1f64eddc7d9908 (diff) | |
add shell options for zsh
Diffstat (limited to 'modules/examples')
| -rw-r--r-- | modules/examples/lnl.nix | 77 |
1 files changed, 22 insertions, 55 deletions
diff --git a/modules/examples/lnl.nix b/modules/examples/lnl.nix index 1ebfae0..c8552ed 100644 --- a/modules/examples/lnl.nix +++ b/modules/examples/lnl.nix @@ -40,26 +40,17 @@ 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.GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; - environment.variables.SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; - - environment.shellAliases.l = "ls -lh"; - environment.shellAliases.ls = "ls -G"; - environment.shellAliases.g = "git log --oneline --max-count 42"; - environment.shellAliases.gl = "git log --graph --oneline"; - environment.shellAliases.gd = "git diff --minimal --patch"; - - environment.etc."zprofile".text = '' - # /etc/zprofile: DO NOT EDIT -- this file has been generated automatically. - # This file is read for login shells. + programs.zsh.shellInit = '' + export NIX_PATH=nixpkgs=$HOME/.nix-defexpr/nixpkgs:darwin=$HOME/.nix-defexpr/darwin:darwin-config=$HOME/.nixpkgs/darwin-config.nix:$HOME/.nix-defexpr/channels_root - # Only execute this file once per shell. - if [ -n "$__ETC_ZPROFILE_SOURCED" ]; then return; fi - __ETC_ZPROFILE_SOURCED=1 + # Set up secure multi-user builds: non-root users build through the + # Nix daemon. + if [ "$USER" != root -a ! -w /nix/var/nix/db ]; then + export NIX_REMOTE=daemon + fi + ''; + programs.zsh.loginShellInit = '' autoload -U promptinit && promptinit PROMPT='%B%(?..%? )%b⇒ ' RPROMPT='%F{green}%~%f' @@ -100,38 +91,7 @@ fi ''; - environment.etc."zshenv".text = '' - # /etc/zshenv: DO NOT EDIT -- this file has been generated automatically. - # This file is read for all shells. - - # Only execute this file once per shell. - # But don't clobber the environment of interactive non-login children! - - if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi - export __ETC_ZSHENV_SOURCED=1 - - export NIX_PATH=nixpkgs=$HOME/.nix-defexpr/nixpkgs:darwin=$HOME/.nix-defexpr/darwin:darwin-config=$HOME/.nixpkgs/darwin-config.nix:$HOME/.nix-defexpr/channels_root - - # Set up secure multi-user builds: non-root users build through the - # Nix daemon. - if [ "$USER" != root -a ! -w /nix/var/nix/db ]; then - export NIX_REMOTE=daemon - fi - - # Read system-wide modifications. - if test -f /etc/zshenv.local; then - . /etc/zshenv.local - fi - ''; - - environment.etc."zshrc".text = '' - # /etc/zshrc: DO NOT EDIT -- this file has been generated automatically. - # This file is read for interactive shells. - - # Only execute this file once per shell. - if [ -n "$__ETC_ZSHRC_SOURCED" -o -n "$NOSYSZSHRC" ]; then return; fi - __ETC_ZSHRC_SOURCED=1 - + programs.zsh.interactiveShellInit = '' # history defaults SAVEHIST=2000 HISTSIZE=2000 @@ -144,13 +104,20 @@ ${config.system.build.setEnvironment} ${config.system.build.setAliases} - - # Read system-wide modifications. - if test -f /etc/zshrc.local; then - . /etc/zshrc.local - fi ''; + environment.variables.EDITOR = "vim"; + environment.variables.HOMEBREW_CASK_OPTS = "--appdir=/Applications/cask"; + + 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"; + + environment.shellAliases.l = "ls -lh"; + environment.shellAliases.ls = "ls -G"; + environment.shellAliases.g = "git log --oneline --max-count 42"; + environment.shellAliases.gl = "git log --graph --oneline"; + environment.shellAliases.gd = "git diff --minimal --patch"; + nixpkgs.config.allowUnfree = true; nixpkgs.config.packageOverrides = self: { |
