mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 15:41:40 +00:00
Merge pull request #128649 from nrdxp/fix-unstable-nix-zsh-completions
zsh: fix nixUnstable completions
This commit is contained in:
commit
15dab3835f
|
@ -53,7 +53,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
shellAliases = mkOption {
|
shellAliases = mkOption {
|
||||||
default = {};
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Set of aliases for zsh shell, which overrides <option>environment.shellAliases</option>.
|
Set of aliases for zsh shell, which overrides <option>environment.shellAliases</option>.
|
||||||
See <option>environment.shellAliases</option> for an option format description.
|
See <option>environment.shellAliases</option> for an option format description.
|
||||||
|
@ -118,7 +118,9 @@ in
|
||||||
setOptions = mkOption {
|
setOptions = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [
|
default = [
|
||||||
"HIST_IGNORE_DUPS" "SHARE_HISTORY" "HIST_FCNTL_LOCK"
|
"HIST_IGNORE_DUPS"
|
||||||
|
"SHARE_HISTORY"
|
||||||
|
"HIST_FCNTL_LOCK"
|
||||||
];
|
];
|
||||||
example = [ "EXTENDED_HISTORY" "RM_STAR_WAIT" ];
|
example = [ "EXTENDED_HISTORY" "RM_STAR_WAIT" ];
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -278,15 +280,29 @@ in
|
||||||
|
|
||||||
environment.etc.zinputrc.source = ./zinputrc;
|
environment.etc.zinputrc.source = ./zinputrc;
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.zsh ]
|
environment.systemPackages =
|
||||||
++ optional cfg.enableCompletion pkgs.nix-zsh-completions;
|
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";
|
environment.pathsToLink = optional cfg.enableCompletion "/share/zsh";
|
||||||
|
|
||||||
#users.defaultUserShell = mkDefault "/run/current-system/sw/bin/zsh";
|
#users.defaultUserShell = mkDefault "/run/current-system/sw/bin/zsh";
|
||||||
|
|
||||||
environment.shells =
|
environment.shells =
|
||||||
[ "/run/current-system/sw/bin/zsh"
|
[
|
||||||
|
"/run/current-system/sw/bin/zsh"
|
||||||
"${pkgs.zsh}/bin/zsh"
|
"${pkgs.zsh}/bin/zsh"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue