* Provide a convience option for commands that must be executed both

when the system boots and when it resumes from suspend.

svn path=/nixos/branches/upstart-0.6/; revision=18354
This commit is contained in:
Eelco Dolstra 2009-11-15 12:56:40 +00:00
parent 1affc9168e
commit 9174b4ab42
2 changed files with 18 additions and 2 deletions

View File

@ -11,7 +11,8 @@ let
#! ${pkgs.stdenv.shell}
action="$1"
if [ "$action" = "resume" ]; then
${cfg.resumeCommands}
${cfg.resumeCommands}
${cfg.powerUpCommands}
fi
'';
@ -39,6 +40,17 @@ in
description = "Commands executed after the system resumes from suspend-to-RAM.";
};
powerUpCommands = mkOption {
default = "";
example = "${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda";
description =
''
Commands executed when the machine powers up. That is,
they're executed both when the system first boots and when
it resumes from suspend or hibernation.
'';
};
};
};

View File

@ -29,7 +29,11 @@ let
utillinux
udev
];
postBootCommands = writeText "local-cmds" config.boot.postBootCommands;
postBootCommands = writeText "local-cmds"
''
${config.boot.postBootCommands}
${config.powerManagement.powerUpCommands}
'';
};
in