diff --git a/modules/home-environment.nix b/modules/home-environment.nix index b3e904e5b..bc7be92ea 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -233,6 +233,26 @@ in ''; }; + home.shellAliases = mkOption { + type = with types; attrsOf str; + default = { }; + example = literalExample '' + { + g = "git"; + "..." = "cd ../.."; + } + ''; + description = '' + An attribute set that maps aliases (the top level attribute names + in this option) to command strings or directly to build outputs. + + This option should only be used to manage simple aliases that are + compatible across all shells. If you need to use a shell specific + feature then make sure to use a shell specific option, for example + for Bash. + ''; + }; + home.sessionVariables = mkOption { default = {}; type = types.attrs; @@ -482,6 +502,10 @@ in && config.submoduleSupport.externalPackageInstall then "/etc/profiles/per-user/${cfg.username}" else cfg.homeDirectory + "/.nix-profile"; + + programs.bash.shellAliases = cfg.shellAliases; + programs.zsh.shellAliases = cfg.shellAliases; + programs.fish.shellAliases = cfg.shellAliases; home.sessionVariables = let