mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
nixos/shells: do not override user-defined shell aliases
This commit is contained in:
parent
60ae563293
commit
e4e160cc39
2 changed files with 7 additions and 8 deletions
|
@ -108,14 +108,13 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.shellAliases = mkOption {
|
environment.shellAliases = mkOption {
|
||||||
default = {};
|
|
||||||
example = { ll = "ls -l"; };
|
example = { ll = "ls -l"; };
|
||||||
description = ''
|
description = ''
|
||||||
An attribute set that maps aliases (the top level attribute names in
|
An attribute set that maps aliases (the top level attribute names in
|
||||||
this option) to command strings or directly to build outputs. The
|
this option) to command strings or directly to build outputs. The
|
||||||
aliases are added to all users' shells.
|
aliases are added to all users' shells.
|
||||||
'';
|
'';
|
||||||
type = types.attrs; # types.attrsOf types.stringOrPath;
|
type = with types; attrsOf (either str path);
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.binsh = mkOption {
|
environment.binsh = mkOption {
|
||||||
|
@ -157,6 +156,12 @@ in
|
||||||
# terminal instead of logging out of X11).
|
# terminal instead of logging out of X11).
|
||||||
environment.variables = config.environment.sessionVariables;
|
environment.variables = config.environment.sessionVariables;
|
||||||
|
|
||||||
|
environment.shellAliases = mapAttrs (name: mkDefault) {
|
||||||
|
ls = "ls --color=tty";
|
||||||
|
ll = "ls -l";
|
||||||
|
l = "ls -alh";
|
||||||
|
};
|
||||||
|
|
||||||
environment.etc."shells".text =
|
environment.etc."shells".text =
|
||||||
''
|
''
|
||||||
${concatStringsSep "\n" (map utils.toShellPath cfg.shells)}
|
${concatStringsSep "\n" (map utils.toShellPath cfg.shells)}
|
||||||
|
|
|
@ -8,12 +8,6 @@ with lib;
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
environment.shellAliases =
|
|
||||||
{ ls = "ls --color=tty";
|
|
||||||
ll = "ls -l";
|
|
||||||
l = "ls -alh";
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.shellInit =
|
environment.shellInit =
|
||||||
''
|
''
|
||||||
# Set up the per-user profile.
|
# Set up the per-user profile.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue