* Use runCommand.
svn path=/nixos/trunk/; revision=7300
This commit is contained in:
parent
acf656125c
commit
c063ea2bfa
@ -44,21 +44,19 @@ rec {
|
|||||||
# Some additional utilities needed in stage 1, notably mount. We
|
# Some additional utilities needed in stage 1, notably mount. We
|
||||||
# don't want to bring in all of util-linux, so we just copy what we
|
# don't want to bring in all of util-linux, so we just copy what we
|
||||||
# need.
|
# need.
|
||||||
extraUtils = pkgs.stdenv.mkDerivation {
|
extraUtils = pkgs.runCommand "extra-utils"
|
||||||
name = "extra-utils";
|
{ buildInputs = [pkgs.nukeReferences];
|
||||||
builder = builtins.toFile "builder.sh" "
|
inherit (pkgsStatic) utillinux;
|
||||||
source $stdenv/setup
|
inherit (pkgs) splashutils;
|
||||||
|
e2fsprogs = pkgs.e2fsprogsDiet;
|
||||||
|
}
|
||||||
|
"
|
||||||
ensureDir $out/bin
|
ensureDir $out/bin
|
||||||
cp $utillinux/bin/mount $utillinux/bin/umount $utillinux/sbin/pivot_root $out/bin
|
cp $utillinux/bin/mount $utillinux/bin/umount $utillinux/sbin/pivot_root $out/bin
|
||||||
cp -p $e2fsprogs/sbin/fsck* $e2fsprogs/sbin/e2fsck $out/bin
|
cp -p $e2fsprogs/sbin/fsck* $e2fsprogs/sbin/e2fsck $out/bin
|
||||||
cp $splashutils/bin/splash_helper $out/bin
|
cp $splashutils/bin/splash_helper $out/bin
|
||||||
nuke-refs $out/bin/*
|
nuke-refs $out/bin/*
|
||||||
";
|
";
|
||||||
buildInputs = [pkgs.nukeReferences];
|
|
||||||
inherit (pkgsStatic) utillinux;
|
|
||||||
inherit (pkgs) splashutils;
|
|
||||||
e2fsprogs = pkgs.e2fsprogsDiet;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# The init script of boot stage 1 (loading kernel modules for
|
# The init script of boot stage 1 (loading kernel modules for
|
||||||
@ -99,14 +97,14 @@ rec {
|
|||||||
|
|
||||||
# The installer.
|
# The installer.
|
||||||
nixosInstaller = import ../installer/nixos-installer.nix {
|
nixosInstaller = import ../installer/nixos-installer.nix {
|
||||||
inherit (pkgs) stdenv substituteAll;
|
inherit (pkgs) stdenv runCommand substituteAll;
|
||||||
inherit nix;
|
inherit nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# The services (Upstart) configuration for the system.
|
# The services (Upstart) configuration for the system.
|
||||||
upstartJobs = import ../upstart-jobs/gather.nix {
|
upstartJobs = import ../upstart-jobs/gather.nix {
|
||||||
inherit (pkgs) stdenv;
|
inherit (pkgs) runCommand;
|
||||||
|
|
||||||
jobs = map makeJob [
|
jobs = map makeJob [
|
||||||
# Syslogd.
|
# Syslogd.
|
||||||
@ -241,7 +239,7 @@ rec {
|
|||||||
|
|
||||||
|
|
||||||
makeJob = import ../upstart-jobs/make-job.nix {
|
makeJob = import ../upstart-jobs/make-job.nix {
|
||||||
inherit (pkgs) stdenv;
|
inherit (pkgs) runCommand;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{stdenv, substituteAll, nix}:
|
{stdenv, runCommand, substituteAll, nix}:
|
||||||
|
|
||||||
substituteAll {
|
substituteAll {
|
||||||
src = ./nixos-installer.sh;
|
src = ./nixos-installer.sh;
|
||||||
@ -8,9 +8,7 @@ substituteAll {
|
|||||||
|
|
||||||
pathsFromGraph = ../helpers/paths-from-graph.sh;
|
pathsFromGraph = ../helpers/paths-from-graph.sh;
|
||||||
|
|
||||||
nixClosure = stdenv.mkDerivation {
|
nixClosure = runCommand "closure"
|
||||||
name = "closure";
|
{exportReferencesGraph = ["refs" nix];}
|
||||||
exportReferencesGraph = ["refs" nix];
|
"cp refs $out";
|
||||||
builder = builtins.toFile "builder.sh" "source $stdenv/setup; cp refs $out";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -20,32 +20,23 @@ rec {
|
|||||||
|
|
||||||
|
|
||||||
# Since the CD is read-only, the mount points must be on disk.
|
# Since the CD is read-only, the mount points must be on disk.
|
||||||
cdMountPoints = pkgs.stdenv.mkDerivation {
|
cdMountPoints = pkgs.runCommand "mount-points" {} "
|
||||||
name = "mount-points";
|
|
||||||
builder = builtins.toFile "builder.sh" "
|
|
||||||
source $stdenv/setup
|
|
||||||
ensureDir $out
|
ensureDir $out
|
||||||
cd $out
|
cd $out
|
||||||
mkdir proc sys tmp etc dev var mnt nix nix/var
|
mkdir proc sys tmp etc dev var mnt nix nix/var
|
||||||
touch $out/${cdromLabel}
|
touch $out/${cdromLabel}
|
||||||
";
|
";
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# We need a copy of the Nix expressions for Nixpkgs and NixOS on the
|
# We need a copy of the Nix expressions for Nixpkgs and NixOS on the
|
||||||
# CD. We put them in a tarball because accessing that many small
|
# CD. We put them in a tarball because accessing that many small
|
||||||
# files from a slow device like a CD-ROM takes too long.
|
# files from a slow device like a CD-ROM takes too long.
|
||||||
makeTarball = tarName: input: pkgs.stdenv.mkDerivation {
|
makeTarball = tarName: input: pkgs.runCommand "tarball" "
|
||||||
name = "tarball";
|
|
||||||
inherit tarName input;
|
|
||||||
builder = builtins.toFile "builder.sh" "
|
|
||||||
source $stdenv/setup
|
|
||||||
ensureDir $out
|
ensureDir $out
|
||||||
(cd $input && tar cvfj $out/$tarName . \\
|
(cd ${input} && tar cvfj $out/${tarName} . \\
|
||||||
--exclude '*~' --exclude '.svn' \\
|
--exclude '*~' --exclude '.svn' \\
|
||||||
--exclude 'pkgs' --exclude 'result')
|
--exclude 'pkgs' --exclude 'result')
|
||||||
";
|
";
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# Put the current directory in the tarball. !!! This gives us a lot
|
# Put the current directory in the tarball. !!! This gives us a lot
|
||||||
|
@ -1,19 +1,13 @@
|
|||||||
# Create an etc/event.d directory containing symlinks to the
|
# Create an etc/event.d directory containing symlinks to the
|
||||||
# specified list of Upstart job files.
|
# specified list of Upstart job files.
|
||||||
{stdenv, jobs}:
|
{runCommand, jobs}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
runCommand "upstart-jobs" {inherit jobs;}
|
||||||
name = "upstart-jobs";
|
"
|
||||||
|
|
||||||
inherit jobs;
|
|
||||||
|
|
||||||
builder = builtins.toFile "builder.sh" "
|
|
||||||
source $stdenv/setup
|
|
||||||
ensureDir $out/etc/event.d
|
ensureDir $out/etc/event.d
|
||||||
for i in $jobs; do
|
for i in $jobs; do
|
||||||
if test -d $i; then
|
if test -d $i; then
|
||||||
ln -s $i/etc/event.d/* $out/etc/event.d/
|
ln -s $i/etc/event.d/* $out/etc/event.d/
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
";
|
"
|
||||||
}
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
{stdenv}: job:
|
{runCommand}: job:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
runCommand job.name {inherit (job) job;}
|
||||||
inherit (job) name job;
|
"ensureDir $out/etc/event.d; echo \"$job\" > $out/etc/event.d/$name"
|
||||||
builder = builtins.toFile "builder.sh"
|
|
||||||
"source $stdenv/setup; ensureDir $out/etc/event.d; echo \"$job\" > $out/etc/event.d/$name";
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user