2009-05-28 14:06:54 +02:00
|
|
|
# This module defines global configuration for the Bash shell, in
|
|
|
|
# particular /etc/bashrc and /etc/profile.
|
|
|
|
|
|
|
|
{config, pkgs, ...}:
|
|
|
|
|
2009-05-28 15:17:56 +02:00
|
|
|
let
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
environment.shellInit = pkgs.lib.mkOption {
|
|
|
|
default = "";
|
|
|
|
example = ''export PATH=/godi/bin/:$PATH'';
|
|
|
|
description = "
|
|
|
|
Script used to initialized user shell environments.
|
|
|
|
";
|
|
|
|
merge = pkgs.lib.mergeStringOption;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2009-05-28 14:06:54 +02:00
|
|
|
{
|
2009-05-28 15:17:56 +02:00
|
|
|
require = [options];
|
|
|
|
|
2009-05-28 14:06:54 +02:00
|
|
|
environment.etc =
|
|
|
|
[ { # /etc/bashrc: script executed when the shell starts as a
|
|
|
|
# non-login shell. /etc/profile also sources this file, so
|
|
|
|
# most global configuration (such as environment variables)
|
|
|
|
# should go into this script.
|
|
|
|
source = pkgs.substituteAll {
|
|
|
|
src = ./bashrc.sh;
|
|
|
|
systemPath = config.system.path;
|
|
|
|
wrapperDir = config.security.wrapperDir;
|
|
|
|
modulesTree = config.system.modulesTree;
|
|
|
|
shellInit = config.environment.shellInit;
|
|
|
|
};
|
|
|
|
target = "bashrc";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # Script executed when the shell starts as a login shell.
|
|
|
|
source = ./profile.sh;
|
|
|
|
target = "profile";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # Template for ~/.bashrc: script executed when the shell
|
|
|
|
# starts as a non-login shell.
|
|
|
|
source = ./bashrc-user.sh;
|
|
|
|
target = "skel/.bashrc";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # Configuration for readline in bash.
|
|
|
|
source = ./inputrc;
|
|
|
|
target = "inputrc";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
system.build.binsh = pkgs.bashInteractive;
|
|
|
|
}
|