mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
* Sync with the trunk.
svn path=/nixos/branches/boot-order/; revision=22349
This commit is contained in:
parent
061ea1674f
commit
d43d321e86
@ -30,7 +30,7 @@ esac
|
||||
# the GRUB config file must be relative to the root of the /boot
|
||||
# filesystem. `$bootRoot' is the path to be prepended to paths under
|
||||
# /boot.
|
||||
if [ "$(stat -f -c '%i' /)" = "$(stat -f -c '%i' /boot)" ]; then
|
||||
if [ "$(stat -c '%D' /.)" = "$(stat -c '%D' /boot/.)" ]; then
|
||||
bootRoot=/boot
|
||||
copyKernels="@copyKernels@" # user can override in the NixOS config
|
||||
else
|
||||
|
@ -287,7 +287,15 @@ in
|
||||
|
||||
daemonType = "none";
|
||||
|
||||
respawn = false;
|
||||
respawn = true;
|
||||
|
||||
script = ''
|
||||
while ${pkgs.procps}/bin/ps `${pkgs.coreutils}/bin/cat /var/postfix/queue/pid/master.pid` |
|
||||
grep -q postfix
|
||||
do
|
||||
${pkgs.coreutils}/bin/sleep 1m
|
||||
done
|
||||
'';
|
||||
|
||||
preStart =
|
||||
''
|
||||
|
@ -162,6 +162,10 @@ in
|
||||
internal = true;
|
||||
default = "";
|
||||
merge = mergeStringOption;
|
||||
example = ''
|
||||
export NIX_TARGET_LOAD=$(( 3 * $(${pkgs.coreutils}/bin/nproc) / 2 ))
|
||||
export NIX_MAX_PARALLELIZATION=$NIX_TARGET_LOAD
|
||||
'';
|
||||
description = "
|
||||
Environment variables used by Nix.
|
||||
";
|
||||
|
@ -106,6 +106,11 @@ in
|
||||
|
||||
services.dbus.packages = [cups];
|
||||
|
||||
# cups uses libusb to talk to printers, and does not use the
|
||||
# linux kernel driver. If the driver is not in a black list, it
|
||||
# gets loaded, and then cups cannot access the printers.
|
||||
boot.blacklistedKernelModules = [ "usblp" ];
|
||||
|
||||
environment.etc =
|
||||
[ # CUPS expects the following files in its ServerRoot.
|
||||
{ source = "${cups}/etc/cups/mime.convs";
|
||||
@ -122,15 +127,17 @@ in
|
||||
startOn = "started network-interfaces";
|
||||
stopOn = "stopping network-interfaces";
|
||||
|
||||
environment = {
|
||||
# Cups scripts for printing (psto...) require awk, sed, grep, ...
|
||||
PATH = "${config.system.path}/bin";
|
||||
};
|
||||
|
||||
preStart =
|
||||
''
|
||||
mkdir -m 0755 -p ${logDir}
|
||||
mkdir -m 0700 -p /var/cache/cups
|
||||
mkdir -m 0700 -p /var/spool/cups
|
||||
mkdir -m 0755 -p ${cfg.tempDir}
|
||||
|
||||
# Make USB printers show up.
|
||||
${modprobe}/sbin/modprobe usblp || true
|
||||
'';
|
||||
|
||||
exec = "${cups}/sbin/cupsd -c ${pkgs.writeText "cupsd.conf" cfg.cupsdConf} -F";
|
||||
|
@ -131,9 +131,15 @@ echo "running activation script..."
|
||||
@activateConfiguration@ "$systemConfig"
|
||||
|
||||
|
||||
# Record the boot configuration. !!! Should this be a GC root?
|
||||
# Record the boot configuration.
|
||||
if test -n "$systemConfig"; then
|
||||
ln -sfn "$systemConfig" /var/run/booted-system
|
||||
|
||||
# Prevent the booted system form being garbage-collected
|
||||
# If it weren't a gcroot, if we were running a different kernel,
|
||||
# switched system, and garbage collected all, we could not load
|
||||
# kernel modules anymore.
|
||||
ln -sfn /var/run/booted-system /nix/var/nix/gcroots/booted-system
|
||||
fi
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@ let
|
||||
makeJob = job:
|
||||
|
||||
let
|
||||
hasMain = job.script != "" || job.exec != "";
|
||||
|
||||
jobText =
|
||||
let log = "/var/log/upstart/${job.name}"; in
|
||||
@ -77,12 +78,14 @@ let
|
||||
${optionalString job.task "task"}
|
||||
${optionalString (!job.task && job.respawn) "respawn"}
|
||||
|
||||
${optionalString (job.preStop != "") ''
|
||||
${ # preStop is run only if there is exec or script.
|
||||
# (upstart 0.6.5, job.c:562)
|
||||
optionalString (job.preStop != "") (assert hasMain; ''
|
||||
pre-stop script
|
||||
exec >> ${log} 2>&1
|
||||
${job.preStop}
|
||||
end script
|
||||
''}
|
||||
'')}
|
||||
|
||||
${optionalString (job.postStop != "") ''
|
||||
post-stop script
|
||||
|
@ -19,7 +19,7 @@ let
|
||||
|
||||
# To build the kernel with coverage instrumentation, we need a
|
||||
# special patch to make coverage data available under /proc.
|
||||
kernel = pkgs.kernel.override (orig: {
|
||||
linux = pkgs.linux.override (orig: {
|
||||
stdenv = cleanupBuildTree (keepBuildTree orig.stdenv);
|
||||
extraConfig =
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user