* Make the location of Nixpkgs a function argument (defaulting

to ../../nixpkgs).  This makes the "pkgs" symlink under the 
  nixos checkout unnecessary.

svn path=/nixos/trunk/; revision=11989
This commit is contained in:
Eelco Dolstra 2008-06-05 15:33:17 +00:00
parent e7494da962
commit ebb43a3f67
6 changed files with 34 additions and 38 deletions

View file

@ -4,14 +4,12 @@
then builtins.readFile ../relname
else "nixos-${builtins.readFile ../VERSION}"
, compressImage ? false
, nixpkgsPath ? ../../nixpkgs
}:
rec {
nixpkgsRel = "nixpkgs-0.12pre11791-xl06i469";
configuration = {
boot = {
@ -101,9 +99,7 @@ rec {
mkdir -p /etc/nixos/nixos
tar xjf /install/nixos.tar.bz2 -C /etc/nixos/nixos
tar xjf /install/nixpkgs.tar.bz2 -C /etc/nixos
mv /etc/nixos/nixpkgs-* /etc/nixos/nixpkgs
ln -sfn ../nixpkgs/pkgs /etc/nixos/nixos/pkgs
tar xjf /install/nixpkgs.tar.bz2 -C /etc/nixos/nixpkgs
chown -R root.root /etc/nixos
end script
";
@ -165,7 +161,7 @@ rec {
};
installer = {
nixpkgsURL = http://nixos.org/releases/nixpkgs/ + nixpkgsRel;
nixpkgsURL = http://nixos.org/releases/nixpkgs/unstable;
};
security = {
@ -189,7 +185,7 @@ rec {
system = import ../system/system.nix {
inherit configuration platform;
inherit configuration platform nixpkgsPath;
stage2Init = "/init";
};
@ -201,7 +197,7 @@ rec {
# 0.11 (you won't get the manual).
manual =
if builtins ? unsafeDiscardStringContext
then "${import ../doc/manual}/manual.html"
then "${import ../doc/manual {inherit nixpkgsPath;}}/manual.html"
else pkgs.writeText "dummy-manual" "Manual not included in this build!";
@ -218,19 +214,16 @@ rec {
# Put the current directory in a tarball (making sure to filter
# out crap like the .svn directories).
nixosTarball =
let filter = name: type:
let base = baseNameOf (toString name);
in base != ".svn" && base != "result";
in
makeTarball "nixos.tar.bz2" (builtins.filterSource filter ./..);
nixosTarball =makeTarball "nixos.tar.bz2" (builtins.filterSource svnFilter ./..);
svnFilter = name: type:
let base = baseNameOf (toString name);
in base != ".svn" && base != "result";
# Get a recent copy of Nixpkgs.
nixpkgsTarball = pkgs.fetchurl {
url = configuration.installer.nixpkgsURL + "/nixexprs.tar.bz2";
sha256 = "267c45134eee9a8a93812589e5bd45333c5061a8047b41f3bf27ed76a1461750";
};
# Put Nixpkgs in a tarball
nixpkgsTarball = makeTarball "nixpkgs.tar.bz2"
(builtins.filterSource svnFilter nixpkgsPath);
# The configuration file for Grub.
@ -255,6 +248,7 @@ rec {
# Create an ISO image containing the Grub boot loader, the kernel,
# the initrd produced above, and the closure of the stage 2 init.
rescueCD = import ../helpers/make-iso9660-image.nix {
inherit nixpkgsPath;
inherit (pkgs) stdenv perl cdrkit;
isoName = "${relName}-${platform}.iso";
@ -281,7 +275,7 @@ rec {
{ source = nixosTarball + "/" + nixosTarball.tarName;
target = "/install/" + nixosTarball.tarName;
}
{ source = nixpkgsTarball;
{ source = nixpkgsTarball + "/nixpkgs.tar.bz2";
target = "/install/nixpkgs.tar.bz2";
}
{ source = pkgs.writeText "label" "";

View file

@ -1,6 +1,8 @@
{nixpkgsPath ? ../../../nixpkgs}:
let
pkgs = import ../../pkgs/top-level/all-packages.nix {};
pkgs = import "${nixpkgsPath}/pkgs/top-level/all-packages.nix" {};
options = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext
(builtins.toXML (pkgs.lib.optionAttrSetToDocList ""

View file

@ -1,4 +1,4 @@
{ stdenv, perl, cdrkit
{ stdenv, perl, cdrkit, nixpkgsPath
# The file name of the resulting ISO image.
, isoName ? "cd.iso"
@ -51,5 +51,5 @@ stdenv.mkDerivation {
map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents;
exportBuildReferencesGraph =
map (x: [("closure-build-" + baseNameOf x.object) x.object]) buildStoreContents;
pathsFromGraph = ../pkgs/build-support/kernel/paths-from-graph.pl;
pathsFromGraph = "${nixpkgsPath}/pkgs/build-support/kernel/paths-from-graph.pl";
}

View file

@ -1,4 +1,4 @@
{pkgs, config, nix}:
{pkgs, config, nix, nixpkgsPath}:
let
@ -19,7 +19,7 @@ in
inherit nix;
nixpkgsURL = config.installer.nixpkgsURL;
pathsFromGraph = ../pkgs/build-support/kernel/paths-from-graph.pl;
pathsFromGraph = "${nixpkgsPath}/pkgs/build-support/kernel/paths-from-graph.pl";
nixClosure = pkgs.runCommand "closure"
{exportReferencesGraph = ["refs" nix];}

View file

@ -24,14 +24,14 @@ fi
cd /etc/nixos
if test -n "$NIXOS" && test "$NIXOS_BRANCH" = 1 && test -z "$CHECKOUT_BRANCH" && ! test "$NIXOS" = "/etc/nixos/nixos"; then
CHECKOUT_BRANCH=${NIXOS##*/}
CHECKOUT_BRANCH=${CHECKOUT_BRANCH#nixos-}
CHECKOUT_BRANCH=branches/${CHECKOUT_BRANCH}
CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/}
CHECKOUT_BRANCH=${NIXOS##*/}
CHECKOUT_BRANCH=${CHECKOUT_BRANCH#nixos-}
CHECKOUT_BRANCH=branches/${CHECKOUT_BRANCH}
CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/}
fi
if test -n "${CHECKOUT_BRANCH}" && test -z "${CHECKOUT_SUFFIX}" ; then
CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/}
CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/}
fi;
# Move any old nixos or nixpkgs directories out of the way.
@ -56,7 +56,6 @@ svn co https://svn.nixos.org/repos/nix/services/trunk services
# Add a few required symlink.
ln -sfn ../services nixos${CHECKOUT_SUFFIX}/services
ln -sfn ../nixpkgs${CHECKOUT_SUFFIX}/pkgs nixos${CHECKOUT_SUFFIX}/pkgs
REVISION=$(svn info nixpkgs${CHECKOUT_SUFFIX} | egrep '^Revision: ');
REVISION=${REVISION#Revision: };

View file

@ -1,6 +1,7 @@
{ platform ? __currentSystem
, stage2Init ? ""
, configuration
, nixpkgsPath ? ../../nixpkgs
}:
rec {
@ -12,21 +13,21 @@ rec {
optionDeclarations = import ./options.nix {inherit pkgs; inherit (pkgs.lib) mkOption;};
pkgs = import ../pkgs/top-level/all-packages.nix {system = platform;};
pkgs = import "${nixpkgsPath}/pkgs/top-level/all-packages.nix" {system = platform;};
pkgsDiet = import ../pkgs/top-level/all-packages.nix {
pkgsDiet = import "${nixpkgsPath}/pkgs/top-level/all-packages.nix" {
system = platform;
bootStdenv = pkgs.useDietLibC pkgs.stdenv;
};
pkgsStatic = import ../pkgs/top-level/all-packages.nix {
pkgsStatic = import "${nixpkgsPath}/pkgs/top-level/all-packages.nix" {
system = platform;
bootStdenv = pkgs.makeStaticBinaries pkgs.stdenv;
};
stdenvLinuxStuff = import ../pkgs/stdenv/linux {
stdenvLinuxStuff = import "${nixpkgsPath}/pkgs/stdenv/linux" {
system = pkgs.stdenv.system;
allPackages = import ../pkgs/top-level/all-packages.nix;
allPackages = import "${nixpkgsPath}/pkgs/top-level/all-packages.nix";
};
manifests = config.installer.manifests; # exported here because nixos-rebuild uses it
@ -141,7 +142,7 @@ rec {
# NixOS installation/updating tools.
nixosTools = import ../installer {
inherit pkgs config nix;
inherit pkgs config nix nixpkgsPath;
};