mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 10:53:52 +00:00
* 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:
parent
1affc9168e
commit
9174b4ab42
@ -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.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user