Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bd129c2b3e03
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8189811d3f7c
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jul 6, 2017

  1. Make zshrc more predictable

    Originially, `programs.zsh` sets default values for some
    initialisation scripts.
    Nix resolves the case of multiple values by concatenating them all.
    It is however impossible to predict where the default script will be
    inserted; but we never want the default value to override the
    user-specified ones.
    Now, it doesn't set default values; almost everything is hardcoded at
    the begining of the file.
    yacinehmito committed Jul 6, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    1f70f38 View commit details

Commits on Jul 9, 2017

  1. Merge pull request #25648 from yacinehmito/custom

    Make zshrc more predictable
    LnL7 authored Jul 9, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    8189811 View commit details
Showing with 36 additions and 39 deletions.
  1. +4 −0 nixos/modules/programs/zsh/oh-my-zsh.nix
  2. +32 −39 nixos/modules/programs/zsh/zsh.nix
4 changes: 4 additions & 0 deletions nixos/modules/programs/zsh/oh-my-zsh.nix
Original file line number Diff line number Diff line change
@@ -42,6 +42,10 @@ in
};

config = mkIf cfg.enable {

# Prevent zsh from overwriting oh-my-zsh's prompt
programs.zsh.promptInit = mkDefault "";

environment.systemPackages = with pkgs; [ oh-my-zsh ];

programs.zsh.interactiveShellInit = with pkgs; with builtins; ''
71 changes: 32 additions & 39 deletions nixos/modules/programs/zsh/zsh.nix
Original file line number Diff line number Diff line change
@@ -97,45 +97,6 @@ in

config = mkIf cfg.enable {

programs.zsh = {

shellInit = ''
. ${config.system.build.setEnvironment}
${cfge.shellInit}
'';

loginShellInit = cfge.loginShellInit;

interactiveShellInit = ''
# history defaults
SAVEHIST=2000
HISTSIZE=2000
HISTFILE=$HOME/.zsh_history
setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK
# Tell zsh how to find installed completions
for p in ''${(z)NIX_PROFILES}; do
fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions)
done
${if cfg.enableCompletion then "autoload -U compinit && compinit" else ""}
${optionalString (cfg.enableAutosuggestions)
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
}
${zshAliases}
${cfg.promptInit}
${cfge.interactiveShellInit}
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
'';

};

environment.etc."zshenv".text =
''
# /etc/zshenv: DO NOT EDIT -- this file has been generated automatically.
@@ -146,6 +107,10 @@ in
if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi
export __ETC_ZSHENV_SOURCED=1
. ${config.system.build.setEnvironment}
${cfge.shellInit}
${cfg.shellInit}
# Read system-wide modifications.
@@ -163,6 +128,8 @@ in
if [ -n "$__ETC_ZPROFILE_SOURCED" ]; then return; fi
__ETC_ZPROFILE_SOURCED=1
${cfge.loginShellInit}
${cfg.loginShellInit}
# Read system-wide modifications.
@@ -182,8 +149,34 @@ in
. /etc/zinputrc
# history defaults
SAVEHIST=2000
HISTSIZE=2000
HISTFILE=$HOME/.zsh_history
setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
${optionalString cfg.enableCompletion "autoload -U compinit && compinit"}
${optionalString (cfg.enableAutosuggestions)
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
}
${zshAliases}
${cfge.interactiveShellInit}
${cfg.interactiveShellInit}
${cfg.promptInit}
# Tell zsh how to find installed completions
for p in ''${(z)NIX_PROFILES}; do
fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions)
done
# Read system-wide modifications.
if test -f /etc/zshrc.local; then
. /etc/zshrc.local