diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2021-07-22 14:58:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-22 14:58:20 +0200 |
commit | 15dab3835f49067532a70aa4c6f85d6d2656a326 (patch) | |
tree | fe9c7778b1e78f2a7fe5d1e45bebcdae8b1059b0 /nixos | |
parent | f102bcee7d1f3f607ad502dfe346f4d4066e534a (diff) | |
parent | 6dbf8c04097c8961bb1cb9cb319fee42eb19ab7a (diff) | |
download | nixpkgs-15dab3835f49067532a70aa4c6f85d6d2656a326.tar nixpkgs-15dab3835f49067532a70aa4c6f85d6d2656a326.tar.gz nixpkgs-15dab3835f49067532a70aa4c6f85d6d2656a326.tar.bz2 nixpkgs-15dab3835f49067532a70aa4c6f85d6d2656a326.tar.lz nixpkgs-15dab3835f49067532a70aa4c6f85d6d2656a326.tar.xz nixpkgs-15dab3835f49067532a70aa4c6f85d6d2656a326.tar.zst nixpkgs-15dab3835f49067532a70aa4c6f85d6d2656a326.zip |
Merge pull request #128649 from nrdxp/fix-unstable-nix-zsh-completions
zsh: fix nixUnstable completions
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/programs/zsh/zsh.nix | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix index 48638fda28d..6c824a692b7 100644 --- a/nixos/modules/programs/zsh/zsh.nix +++ b/nixos/modules/programs/zsh/zsh.nix @@ -53,7 +53,7 @@ in }; shellAliases = mkOption { - default = {}; + default = { }; description = '' Set of aliases for zsh shell, which overrides <option>environment.shellAliases</option>. See <option>environment.shellAliases</option> for an option format description. @@ -118,7 +118,9 @@ in setOptions = mkOption { type = types.listOf types.str; default = [ - "HIST_IGNORE_DUPS" "SHARE_HISTORY" "HIST_FCNTL_LOCK" + "HIST_IGNORE_DUPS" + "SHARE_HISTORY" + "HIST_FCNTL_LOCK" ]; example = [ "EXTENDED_HISTORY" "RM_STAR_WAIT" ]; description = '' @@ -278,15 +280,29 @@ in environment.etc.zinputrc.source = ./zinputrc; - environment.systemPackages = [ pkgs.zsh ] - ++ optional cfg.enableCompletion pkgs.nix-zsh-completions; + environment.systemPackages = + let + completions = + if lib.versionAtLeast (lib.getVersion config.nix.package) "2.4pre" + then + pkgs.nix-zsh-completions.overrideAttrs + (_: { + postInstall = '' + rm $out/share/zsh/site-functions/_nix + ''; + }) + else pkgs.nix-zsh-completions; + in + [ pkgs.zsh ] + ++ optional cfg.enableCompletion completions; environment.pathsToLink = optional cfg.enableCompletion "/share/zsh"; #users.defaultUserShell = mkDefault "/run/current-system/sw/bin/zsh"; environment.shells = - [ "/run/current-system/sw/bin/zsh" + [ + "/run/current-system/sw/bin/zsh" "${pkgs.zsh}/bin/zsh" ]; |