Some cleanups in the activation script:

* Moved some scriptlets to the appropriate modules.
* Put the scriptlet that sets the default path at the start, since it
  never makes sense not to have it there.  It no longer needs to be
  declared as a dependency.
* If a scriptlet has no dependencies, it can be denoted as a plain
  string (i.e., `noDepEntry' is not needed anymore).

svn path=/nixos/trunk/; revision=23762
This commit is contained in:
Eelco Dolstra
2010-09-13 15:41:38 +00:00
parent f99e42cfbc
commit f729f12e4e
15 changed files with 346 additions and 359 deletions

View File

@@ -1,19 +1,21 @@
# This module defines global configuration for the Bash shell, in
# particular /etc/bashrc and /etc/profile.
{config, pkgs, ...}:
{ config, pkgs, ... }:
with pkgs.lib;
let
options = {
environment.shellInit = pkgs.lib.mkOption {
environment.shellInit = mkOption {
default = "";
example = ''export PATH=/godi/bin/:$PATH'';
description = "
Script used to initialized user shell environments.
";
merge = pkgs.lib.mergeStringOption;
merge = mergeStringOption;
};
};
@@ -57,4 +59,13 @@ in
];
system.build.binsh = pkgs.bashInteractive;
system.activationScripts.binsh = stringAfter [ "stdio" ]
''
# Create the required /bin/sh symlink; otherwise lots of things
# (notably the system() function) won't work.
mkdir -m 0755 -p /bin
ln -sfn ${config.system.build.binsh}/bin/sh /bin/sh
'';
}