Tried to do offline install CD, not DVD. Failure, but some parts could be useful.

svn path=/nixos/trunk/; revision=10248
This commit is contained in:
Michael Raskin 2008-01-22 17:55:57 +00:00
parent ca2b1e3b77
commit 7fa31be440
4 changed files with 69 additions and 6 deletions

View File

@ -26,6 +26,8 @@ let
addUsers = arg "addUsers" []; addUsers = arg "addUsers" [];
extraInitrdKernelModules = arg "extraInitrdKernelModules" []; extraInitrdKernelModules = arg "extraInitrdKernelModules" [];
bootKernelModules = arg "bootKernelModules" []; bootKernelModules = arg "bootKernelModules" [];
arbitraryOverrides = arg "arbitraryOverrides" (config:{});
cleanStart = arg "cleanStart" false;
/* Should return list of {configuration, suffix} attrsets. /* Should return list of {configuration, suffix} attrsets.
{configuration=configuration; suffix=""} is always prepended. {configuration=configuration; suffix=""} is always prepended.
@ -99,7 +101,7 @@ rec {
nixpkgsRel = "nixpkgs" + (if networkNixpkgs != "" then "-" + networkNixpkgs else ""); nixpkgsRel = "nixpkgs" + (if networkNixpkgs != "" then "-" + networkNixpkgs else "");
configuration = { configuration = let preConfiguration ={
boot = { boot = {
autoDetectRootDevice = true; autoDetectRootDevice = true;
@ -238,19 +240,20 @@ rec {
}; };
environment = { environment = {
extraPackages = pkgs: [ extraPackages = if cleanStart then pkgs:[] else pkgs: [
pkgs.vim pkgs.vim
pkgs.subversion # for nixos-checkout pkgs.subversion # for nixos-checkout
pkgs.w3m # needed for the manual anyway pkgs.w3m # needed for the manual anyway
] ++ (packages pkgs); ] ++ (packages pkgs);
checkConfigurationOptions = true; checkConfigurationOptions = true;
cleanStart = cleanStart;
}; };
users = { users = {
extraUsers = map userEntry addUsers; extraUsers = map userEntry addUsers;
}; };
}; }; in preConfiguration // (arbitraryOverrides preConfiguration);
configurations = [{ configurations = [{
inherit configuration; inherit configuration;

View File

@ -0,0 +1,36 @@
{platform ? __currentSystem} :
let
isoFun = import ./rescue-cd-configurable.nix;
in
(isoFun {
inherit platform;
lib = (import ../pkgs/lib);
networkNixpkgs = "";
manualEnabled = false;
rogueEnabled = false;
sshdEnabled = false;
fontConfigEnabled = false;
sudoEnable = false;
includeMemtest = false;
includeStdenv = false;
includeBuildDeps = true;
cleanStart = true;
packages = pkgs: with pkgs; [
bashInteractive
bzip2
coreutils
curl
e2fsprogs
gnutar
grub
gzip
less
module_init_tools
nano
su
udev
upstart
utillinux
];
}).rescueCD

View File

@ -1849,6 +1849,18 @@ root ALL=(ALL) SETENV: ALL
"; ";
}; };
cleanStart = mkOption {
default = false;
example = true;
description = "
There are some times when you want really small system for specific
purpose and do not want default package list. Setting
<varname>cleanStart<varname> to <literal>true</literal> allows you
to create a system with empty path - only extraPackages will be
included..
";
};
extraPackages = mkOption { extraPackages = mkOption {
default = pkgs: []; default = pkgs: [];
example = pkgs: [pkgs.firefox pkgs.thunderbird]; example = pkgs: [pkgs.firefox pkgs.thunderbird];

View File

@ -204,7 +204,19 @@ rec {
# The packages you want in the boot environment. # The packages you want in the boot environment.
systemPathList = [ systemPathList = (if config.environment.cleanStart then
[
# Better leave them here - they are small, needed,
# and hard to refer from anywhere outside.
modprobe
nix
nixosInstall
nixosRebuild
nixosCheckout
setuidWrapper
]
else
[
modprobe # must take precedence over module_init_tools modprobe # must take precedence over module_init_tools
pkgs.bashInteractive # bash with ncurses support pkgs.bashInteractive # bash with ncurses support
pkgs.bzip2 pkgs.bzip2
@ -252,9 +264,9 @@ rec {
nixosRebuild nixosRebuild
nixosCheckout nixosCheckout
setuidWrapper setuidWrapper
] ])
++ pkgs.lib.optional (config.security.sudo.enable) pkgs.sudo ++ pkgs.lib.optional (config.security.sudo.enable) pkgs.sudo
++ pkgs.lib.optional (config.networking.defaultMailServer.directDelivery) pkgs.ssmtp ++ pkgs.lib.optional (config.networking.defaultMailServer.directDelivery) pkgs.ssmtp
++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs) ++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs)
++ (config.environment.extraPackages) pkgs ++ (config.environment.extraPackages) pkgs
++ pkgs.lib.optional (config.fonts.enableFontDir) fontDir; ++ pkgs.lib.optional (config.fonts.enableFontDir) fontDir;