nixpkgs/modules/installer/generations-dir/generations-dir.nix
Lluís Batlle i Rossell 420639a4b1 Making generations-dir consider the pkgs.platform.
stdenv-updates stuff. Still to be reviewed, but at least an implementation to have
some different armv5tel-linux platforms: qemu versatile and the sheevaplug.


svn path=/nixos/trunk/; revision=18290
2009-11-08 17:38:35 +00:00

67 lines
1.5 KiB
Nix

{pkgs, config, ...}:
###### interface
let
inherit (pkgs.lib) mkOption mkIf;
options = {
boot = {
loader = {
generationsDir = {
enable = mkOption {
default = false;
description = ''
Whether to enable the simple preparation of symlinks to the system
generations in /boot.
'';
};
copyKernels = mkOption {
default = false;
description = "
Whether copy the necessary boot files into /boot, so
/nix/store is not needed by the boot loadear.
";
};
};
};
};
};
in
###### implementation
let
generationsDirBuilder = pkgs.substituteAll {
src = ./generations-dir-builder.sh;
isExecutable = true;
inherit (pkgs) bash;
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
inherit (config.boot.loader.generationsDir) copyKernels;
};
# Temporary check, for nixos to cope both with nixpkgs stdenv-updates and trunk
platform = (if pkgs ? platform then pkgs.platform else
{ name = "pc"; uboot = null; });
in
{
require = [
options
# config.system.build
# ../system/system-options.nix
];
system = mkIf config.boot.loader.generationsDir.enable {
build = {
menuBuilder = generationsDirBuilder;
};
boot.loader.id = "generationsDir";
boot.loader.kernelFile = (
if (platform.name == "sheevaplug") then "uImage"
else if (platform.name == "versatileARM") then "zImage"
else "vmlinuz");
};
}