* 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:
parent
e7494da962
commit
ebb43a3f67
@ -4,14 +4,12 @@
|
|||||||
then builtins.readFile ../relname
|
then builtins.readFile ../relname
|
||||||
else "nixos-${builtins.readFile ../VERSION}"
|
else "nixos-${builtins.readFile ../VERSION}"
|
||||||
, compressImage ? false
|
, compressImage ? false
|
||||||
|
, nixpkgsPath ? ../../nixpkgs
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
|
|
||||||
nixpkgsRel = "nixpkgs-0.12pre11791-xl06i469";
|
|
||||||
|
|
||||||
|
|
||||||
configuration = {
|
configuration = {
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
@ -101,9 +99,7 @@ rec {
|
|||||||
|
|
||||||
mkdir -p /etc/nixos/nixos
|
mkdir -p /etc/nixos/nixos
|
||||||
tar xjf /install/nixos.tar.bz2 -C /etc/nixos/nixos
|
tar xjf /install/nixos.tar.bz2 -C /etc/nixos/nixos
|
||||||
tar xjf /install/nixpkgs.tar.bz2 -C /etc/nixos
|
tar xjf /install/nixpkgs.tar.bz2 -C /etc/nixos/nixpkgs
|
||||||
mv /etc/nixos/nixpkgs-* /etc/nixos/nixpkgs
|
|
||||||
ln -sfn ../nixpkgs/pkgs /etc/nixos/nixos/pkgs
|
|
||||||
chown -R root.root /etc/nixos
|
chown -R root.root /etc/nixos
|
||||||
end script
|
end script
|
||||||
";
|
";
|
||||||
@ -165,7 +161,7 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
installer = {
|
installer = {
|
||||||
nixpkgsURL = http://nixos.org/releases/nixpkgs/ + nixpkgsRel;
|
nixpkgsURL = http://nixos.org/releases/nixpkgs/unstable;
|
||||||
};
|
};
|
||||||
|
|
||||||
security = {
|
security = {
|
||||||
@ -189,7 +185,7 @@ rec {
|
|||||||
|
|
||||||
|
|
||||||
system = import ../system/system.nix {
|
system = import ../system/system.nix {
|
||||||
inherit configuration platform;
|
inherit configuration platform nixpkgsPath;
|
||||||
stage2Init = "/init";
|
stage2Init = "/init";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -201,7 +197,7 @@ rec {
|
|||||||
# 0.11 (you won't get the manual).
|
# 0.11 (you won't get the manual).
|
||||||
manual =
|
manual =
|
||||||
if builtins ? unsafeDiscardStringContext
|
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!";
|
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
|
# Put the current directory in a tarball (making sure to filter
|
||||||
# out crap like the .svn directories).
|
# out crap like the .svn directories).
|
||||||
nixosTarball =
|
nixosTarball =makeTarball "nixos.tar.bz2" (builtins.filterSource svnFilter ./..);
|
||||||
let filter = name: type:
|
|
||||||
let base = baseNameOf (toString name);
|
svnFilter = name: type:
|
||||||
in base != ".svn" && base != "result";
|
let base = baseNameOf (toString name);
|
||||||
in
|
in base != ".svn" && base != "result";
|
||||||
makeTarball "nixos.tar.bz2" (builtins.filterSource filter ./..);
|
|
||||||
|
|
||||||
|
|
||||||
# Get a recent copy of Nixpkgs.
|
# Put Nixpkgs in a tarball
|
||||||
nixpkgsTarball = pkgs.fetchurl {
|
nixpkgsTarball = makeTarball "nixpkgs.tar.bz2"
|
||||||
url = configuration.installer.nixpkgsURL + "/nixexprs.tar.bz2";
|
(builtins.filterSource svnFilter nixpkgsPath);
|
||||||
sha256 = "267c45134eee9a8a93812589e5bd45333c5061a8047b41f3bf27ed76a1461750";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# The configuration file for Grub.
|
# The configuration file for Grub.
|
||||||
@ -255,6 +248,7 @@ rec {
|
|||||||
# Create an ISO image containing the Grub boot loader, the kernel,
|
# Create an ISO image containing the Grub boot loader, the kernel,
|
||||||
# the initrd produced above, and the closure of the stage 2 init.
|
# the initrd produced above, and the closure of the stage 2 init.
|
||||||
rescueCD = import ../helpers/make-iso9660-image.nix {
|
rescueCD = import ../helpers/make-iso9660-image.nix {
|
||||||
|
inherit nixpkgsPath;
|
||||||
inherit (pkgs) stdenv perl cdrkit;
|
inherit (pkgs) stdenv perl cdrkit;
|
||||||
isoName = "${relName}-${platform}.iso";
|
isoName = "${relName}-${platform}.iso";
|
||||||
|
|
||||||
@ -281,7 +275,7 @@ rec {
|
|||||||
{ source = nixosTarball + "/" + nixosTarball.tarName;
|
{ source = nixosTarball + "/" + nixosTarball.tarName;
|
||||||
target = "/install/" + nixosTarball.tarName;
|
target = "/install/" + nixosTarball.tarName;
|
||||||
}
|
}
|
||||||
{ source = nixpkgsTarball;
|
{ source = nixpkgsTarball + "/nixpkgs.tar.bz2";
|
||||||
target = "/install/nixpkgs.tar.bz2";
|
target = "/install/nixpkgs.tar.bz2";
|
||||||
}
|
}
|
||||||
{ source = pkgs.writeText "label" "";
|
{ source = pkgs.writeText "label" "";
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
{nixpkgsPath ? ../../../nixpkgs}:
|
||||||
|
|
||||||
let
|
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
|
options = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext
|
||||||
(builtins.toXML (pkgs.lib.optionAttrSetToDocList ""
|
(builtins.toXML (pkgs.lib.optionAttrSetToDocList ""
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, perl, cdrkit
|
{ stdenv, perl, cdrkit, nixpkgsPath
|
||||||
|
|
||||||
# The file name of the resulting ISO image.
|
# The file name of the resulting ISO image.
|
||||||
, isoName ? "cd.iso"
|
, isoName ? "cd.iso"
|
||||||
@ -51,5 +51,5 @@ stdenv.mkDerivation {
|
|||||||
map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents;
|
map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents;
|
||||||
exportBuildReferencesGraph =
|
exportBuildReferencesGraph =
|
||||||
map (x: [("closure-build-" + baseNameOf x.object) x.object]) buildStoreContents;
|
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";
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{pkgs, config, nix}:
|
{pkgs, config, nix, nixpkgsPath}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ in
|
|||||||
inherit nix;
|
inherit nix;
|
||||||
nixpkgsURL = config.installer.nixpkgsURL;
|
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"
|
nixClosure = pkgs.runCommand "closure"
|
||||||
{exportReferencesGraph = ["refs" nix];}
|
{exportReferencesGraph = ["refs" nix];}
|
||||||
|
@ -24,14 +24,14 @@ fi
|
|||||||
cd /etc/nixos
|
cd /etc/nixos
|
||||||
|
|
||||||
if test -n "$NIXOS" && test "$NIXOS_BRANCH" = 1 && test -z "$CHECKOUT_BRANCH" && ! test "$NIXOS" = "/etc/nixos/nixos"; then
|
if test -n "$NIXOS" && test "$NIXOS_BRANCH" = 1 && test -z "$CHECKOUT_BRANCH" && ! test "$NIXOS" = "/etc/nixos/nixos"; then
|
||||||
CHECKOUT_BRANCH=${NIXOS##*/}
|
CHECKOUT_BRANCH=${NIXOS##*/}
|
||||||
CHECKOUT_BRANCH=${CHECKOUT_BRANCH#nixos-}
|
CHECKOUT_BRANCH=${CHECKOUT_BRANCH#nixos-}
|
||||||
CHECKOUT_BRANCH=branches/${CHECKOUT_BRANCH}
|
CHECKOUT_BRANCH=branches/${CHECKOUT_BRANCH}
|
||||||
CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/}
|
CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "${CHECKOUT_BRANCH}" && test -z "${CHECKOUT_SUFFIX}" ; then
|
if test -n "${CHECKOUT_BRANCH}" && test -z "${CHECKOUT_SUFFIX}" ; then
|
||||||
CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/}
|
CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/}
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
# Move any old nixos or nixpkgs directories out of the way.
|
# 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.
|
# Add a few required symlink.
|
||||||
ln -sfn ../services nixos${CHECKOUT_SUFFIX}/services
|
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=$(svn info nixpkgs${CHECKOUT_SUFFIX} | egrep '^Revision: ');
|
||||||
REVISION=${REVISION#Revision: };
|
REVISION=${REVISION#Revision: };
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{ platform ? __currentSystem
|
{ platform ? __currentSystem
|
||||||
, stage2Init ? ""
|
, stage2Init ? ""
|
||||||
, configuration
|
, configuration
|
||||||
|
, nixpkgsPath ? ../../nixpkgs
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
@ -12,21 +13,21 @@ rec {
|
|||||||
optionDeclarations = import ./options.nix {inherit pkgs; inherit (pkgs.lib) mkOption;};
|
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;
|
system = platform;
|
||||||
bootStdenv = pkgs.useDietLibC pkgs.stdenv;
|
bootStdenv = pkgs.useDietLibC pkgs.stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
pkgsStatic = import ../pkgs/top-level/all-packages.nix {
|
pkgsStatic = import "${nixpkgsPath}/pkgs/top-level/all-packages.nix" {
|
||||||
system = platform;
|
system = platform;
|
||||||
bootStdenv = pkgs.makeStaticBinaries pkgs.stdenv;
|
bootStdenv = pkgs.makeStaticBinaries pkgs.stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
stdenvLinuxStuff = import ../pkgs/stdenv/linux {
|
stdenvLinuxStuff = import "${nixpkgsPath}/pkgs/stdenv/linux" {
|
||||||
system = pkgs.stdenv.system;
|
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
|
manifests = config.installer.manifests; # exported here because nixos-rebuild uses it
|
||||||
@ -141,7 +142,7 @@ rec {
|
|||||||
|
|
||||||
# NixOS installation/updating tools.
|
# NixOS installation/updating tools.
|
||||||
nixosTools = import ../installer {
|
nixosTools = import ../installer {
|
||||||
inherit pkgs config nix;
|
inherit pkgs config nix nixpkgsPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user