summary refs log tree commit diff
path: root/modules/programs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2010-09-13 15:41:38 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2010-09-13 15:41:38 +0000
commitf729f12e4e8f03540e33aaf07292934747417787 (patch)
tree7673aece3848666da3f7787282af11dbe3819280 /modules/programs
parentf99e42cfbc860c37185ca0c4ff7d9578ffec3d9a (diff)
downloadnixpkgs-f729f12e4e8f03540e33aaf07292934747417787.tar
nixpkgs-f729f12e4e8f03540e33aaf07292934747417787.tar.gz
nixpkgs-f729f12e4e8f03540e33aaf07292934747417787.tar.bz2
nixpkgs-f729f12e4e8f03540e33aaf07292934747417787.tar.lz
nixpkgs-f729f12e4e8f03540e33aaf07292934747417787.tar.xz
nixpkgs-f729f12e4e8f03540e33aaf07292934747417787.tar.zst
nixpkgs-f729f12e4e8f03540e33aaf07292934747417787.zip
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
Diffstat (limited to 'modules/programs')
-rw-r--r--modules/programs/bash/bash.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/modules/programs/bash/bash.nix b/modules/programs/bash/bash.nix
index 1e2730b04b9..f99d04e6335 100644
--- a/modules/programs/bash/bash.nix
+++ b/modules/programs/bash/bash.nix
@@ -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
+    '';
+  
 }