20b364f4de
After the change from revision 30103, nixos-rebuild suddenly consumed freaky amounts of memory. I had to abort the process after it had allocated well in excess of 30GB(!) of RAM. I'm not sure what is causing this behavior, but undoing that assignment fixes the problem. The other two commits needed to be revoked, too, because they depend on 30103. svn path=/nixos/trunk/; revision=30127
53 lines
1 KiB
Nix
53 lines
1 KiB
Nix
# Produce a script to generate /etc.
|
|
{ config, pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
|
|
|
###### interface
|
|
let
|
|
|
|
option = {
|
|
environment.etc = mkOption {
|
|
default = [];
|
|
example = [
|
|
{ source = "/nix/store/.../etc/dir/file.conf.example";
|
|
target = "dir/file.conf";
|
|
mode = "0440";
|
|
}
|
|
];
|
|
description = ''
|
|
List of files that have to be linked in /etc.
|
|
'';
|
|
};
|
|
};
|
|
in
|
|
|
|
###### implementation
|
|
let
|
|
|
|
etc = pkgs.stdenv.mkDerivation {
|
|
name = "etc";
|
|
|
|
builder = ./make-etc.sh;
|
|
|
|
/* !!! Use toXML. */
|
|
sources = map (x: x.source) config.environment.etc;
|
|
targets = map (x: x.target) config.environment.etc;
|
|
modes = map (x: if x ? mode then x.mode else "symlink") config.environment.etc;
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
require = [option];
|
|
|
|
system.build.etc = etc;
|
|
|
|
system.activationScripts.etc = stringAfter [ "stdio" ]
|
|
''
|
|
# Set up the statically computed bits of /etc.
|
|
echo "setting up /etc..."
|
|
${pkgs.perl}/bin/perl ${./setup-etc.pl} ${etc}/etc
|
|
'';
|
|
|
|
}
|