mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-08 01:51:04 +01:00
zsh: move deprecated options to separate file
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
80a07bc6f7
commit
26b987cf88
2 changed files with 81 additions and 62 deletions
|
|
@ -28,19 +28,12 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./deprecated.nix
|
||||||
./history.nix
|
./history.nix
|
||||||
./oh-my-zsh.nix
|
./oh-my-zsh.nix
|
||||||
./prezto.nix
|
./prezto.nix
|
||||||
./zprof.nix
|
./zprof.nix
|
||||||
./zsh-abbr.nix
|
./zsh-abbr.nix
|
||||||
(lib.mkRenamedOptionModule
|
|
||||||
[ "programs" "zsh" "enableAutosuggestions" ]
|
|
||||||
[ "programs" "zsh" "autosuggestion" "enable" ]
|
|
||||||
)
|
|
||||||
(lib.mkRenamedOptionModule
|
|
||||||
[ "programs" "zsh" "enableSyntaxHighlighting" ]
|
|
||||||
[ "programs" "zsh" "syntaxHighlighting" "enable" ]
|
|
||||||
)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
options =
|
options =
|
||||||
|
|
@ -319,54 +312,6 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
initExtraBeforeCompInit = mkOption {
|
|
||||||
default = "";
|
|
||||||
type = types.lines;
|
|
||||||
apply =
|
|
||||||
x:
|
|
||||||
lib.warnIfNot (x == "") ''
|
|
||||||
`programs.zsh.initExtraBeforeCompInit` is deprecated, use `programs.zsh.initContent` with `lib.mkOrder 550` instead.
|
|
||||||
|
|
||||||
Example: programs.zsh.initContent = lib.mkOrder 550 "your content here";
|
|
||||||
'' x;
|
|
||||||
visible = false;
|
|
||||||
description = ''
|
|
||||||
Extra commands that should be added to {file}`.zshrc` before compinit.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
initExtra = mkOption {
|
|
||||||
default = "";
|
|
||||||
type = types.lines;
|
|
||||||
visible = false;
|
|
||||||
apply =
|
|
||||||
x:
|
|
||||||
lib.warnIfNot (x == "") ''
|
|
||||||
`programs.zsh.initExtra` is deprecated, use `programs.zsh.initContent` instead.
|
|
||||||
|
|
||||||
Example: programs.zsh.initContent = "your content here";
|
|
||||||
'' x;
|
|
||||||
description = ''
|
|
||||||
Extra commands that should be added to {file}`.zshrc`.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
initExtraFirst = mkOption {
|
|
||||||
default = "";
|
|
||||||
type = types.lines;
|
|
||||||
visible = false;
|
|
||||||
apply =
|
|
||||||
x:
|
|
||||||
lib.warnIfNot (x == "") ''
|
|
||||||
`programs.zsh.initExtraFirst` is deprecated, use `programs.zsh.initContent` with `lib.mkBefore` instead.
|
|
||||||
|
|
||||||
Example: programs.zsh.initContent = lib.mkBefore "your content here";
|
|
||||||
'' x;
|
|
||||||
description = ''
|
|
||||||
Commands that should be added to top of {file}`.zshrc`.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
envExtra = mkOption {
|
envExtra = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
|
|
@ -517,8 +462,6 @@ in
|
||||||
home.packages = [ cfg.package ] ++ lib.optional cfg.enableCompletion pkgs.nix-zsh-completions;
|
home.packages = [ cfg.package ] ++ lib.optional cfg.enableCompletion pkgs.nix-zsh-completions;
|
||||||
|
|
||||||
programs.zsh.initContent = lib.mkMerge [
|
programs.zsh.initContent = lib.mkMerge [
|
||||||
(lib.mkIf (cfg.initExtraFirst != "") (lib.mkBefore cfg.initExtraFirst))
|
|
||||||
|
|
||||||
(mkOrder 510 "typeset -U path cdpath fpath manpath")
|
(mkOrder 510 "typeset -U path cdpath fpath manpath")
|
||||||
|
|
||||||
(lib.mkIf (cfg.cdpath != [ ]) (
|
(lib.mkIf (cfg.cdpath != [ ]) (
|
||||||
|
|
@ -544,8 +487,6 @@ in
|
||||||
|
|
||||||
(lib.mkIf (localVarsStr != "") (mkOrder 540 localVarsStr))
|
(lib.mkIf (localVarsStr != "") (mkOrder 540 localVarsStr))
|
||||||
|
|
||||||
(lib.mkIf (cfg.initExtraBeforeCompInit != "") (mkOrder 550 cfg.initExtraBeforeCompInit))
|
|
||||||
|
|
||||||
(lib.mkIf (cfg.plugins != [ ]) (
|
(lib.mkIf (cfg.plugins != [ ]) (
|
||||||
mkOrder 560 (
|
mkOrder 560 (
|
||||||
lib.concatStrings (
|
lib.concatStrings (
|
||||||
|
|
@ -604,8 +545,6 @@ in
|
||||||
''
|
''
|
||||||
))
|
))
|
||||||
|
|
||||||
(lib.mkIf (cfg.initExtra != "") cfg.initExtra)
|
|
||||||
|
|
||||||
(lib.mkIf (aliasesStr != "" || cfg.shellGlobalAliases != { }) (
|
(lib.mkIf (aliasesStr != "" || cfg.shellGlobalAliases != { }) (
|
||||||
mkOrder 1100 (
|
mkOrder 1100 (
|
||||||
(optionalString (aliasesStr != "") aliasesStr)
|
(optionalString (aliasesStr != "") aliasesStr)
|
||||||
|
|
|
||||||
80
modules/programs/zsh/deprecated.nix
Normal file
80
modules/programs/zsh/deprecated.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) mkOption types;
|
||||||
|
|
||||||
|
cfg = config.programs.zsh;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(lib.mkRenamedOptionModule
|
||||||
|
[ "programs" "zsh" "enableAutosuggestions" ]
|
||||||
|
[ "programs" "zsh" "autosuggestion" "enable" ]
|
||||||
|
)
|
||||||
|
(lib.mkRenamedOptionModule
|
||||||
|
[ "programs" "zsh" "enableSyntaxHighlighting" ]
|
||||||
|
[ "programs" "zsh" "syntaxHighlighting" "enable" ]
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
programs.zsh = {
|
||||||
|
initExtraBeforeCompInit = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.lines;
|
||||||
|
apply =
|
||||||
|
x:
|
||||||
|
lib.warnIfNot (x == "") ''
|
||||||
|
`programs.zsh.initExtraBeforeCompInit` is deprecated, use `programs.zsh.initContent` with `lib.mkOrder 550` instead.
|
||||||
|
|
||||||
|
Example: programs.zsh.initContent = lib.mkOrder 550 "your content here";
|
||||||
|
'' x;
|
||||||
|
visible = false;
|
||||||
|
description = ''
|
||||||
|
Extra commands that should be added to {file}`.zshrc` before compinit.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
initExtra = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.lines;
|
||||||
|
visible = false;
|
||||||
|
apply =
|
||||||
|
x:
|
||||||
|
lib.warnIfNot (x == "") ''
|
||||||
|
`programs.zsh.initExtra` is deprecated, use `programs.zsh.initContent` instead.
|
||||||
|
|
||||||
|
Example: programs.zsh.initContent = "your content here";
|
||||||
|
'' x;
|
||||||
|
description = ''
|
||||||
|
Extra commands that should be added to {file}`.zshrc`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
initExtraFirst = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.lines;
|
||||||
|
visible = false;
|
||||||
|
apply =
|
||||||
|
x:
|
||||||
|
lib.warnIfNot (x == "") ''
|
||||||
|
`programs.zsh.initExtraFirst` is deprecated, use `programs.zsh.initContent` with `lib.mkBefore` instead.
|
||||||
|
|
||||||
|
Example: programs.zsh.initContent = lib.mkBefore "your content here";
|
||||||
|
'' x;
|
||||||
|
description = ''
|
||||||
|
Commands that should be added to top of {file}`.zshrc`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
programs.zsh.initContent = lib.mkMerge [
|
||||||
|
(lib.mkIf (cfg.initExtraFirst != "") (lib.mkBefore cfg.initExtraFirst))
|
||||||
|
|
||||||
|
(lib.mkIf (cfg.initExtraBeforeCompInit != "") (lib.mkOrder 550 cfg.initExtraBeforeCompInit))
|
||||||
|
|
||||||
|
(lib.mkIf (cfg.initExtra != "") cfg.initExtra)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue