* nixos-rebuild: do a nix-pull on the Nixpkgs channel manifest. I.e., you

don't need to be subscribed to the Nixpkgs channel to get binary downloads.
  This is possible because nix-pull is now pretty fast.

svn path=/nixos/trunk/; revision=9133
This commit is contained in:
Eelco Dolstra 2007-08-15 12:01:20 +00:00
parent cc4d0d118a
commit ad22e587ab
4 changed files with 30 additions and 0 deletions

View File

@ -28,6 +28,19 @@ if test -z "$NIXOS"; then NIXOS=/etc/nixos/nixos; fi
if test -z "$NIXOS_CONFIG"; then NIXOS_CONFIG=/etc/nixos/configuration.nix; fi
# Pull the manifests defined in the configuration (the "manifests"
# attribute). Wonderfully hacky.
manifests=$(nix-instantiate --eval-only --xml --strict \
$NIXOS/system/system.nix \
--arg configuration "import $NIXOS_CONFIG" \
-A manifests \
| grep '<string' | sed 's^.*"\(.*\)".*^\1^g')
for i in $manifests; do
NIX_DOWNLOAD_CACHE=/nix/var/nix/channel-cache nix-pull $i || true
done
# Either upgrade the configuration in the system profile (for "switch"
# or "boot"), or just build it and create a symlink "result" in the
# current directory (for "build" and "test").

View File

@ -909,6 +909,20 @@
}
{
name = ["installer" "manifests"];
default = [http://nix.cs.uu.nl/dist/nix/channels-v3/nixpkgs-unstable/MANIFEST];
example =
[ http://nix.cs.uu.nl/dist/nix/channels-v3/nixpkgs-unstable/MANIFEST
http://nix.cs.uu.nl/dist/nix/channels-v3/nixpkgs-stable/MANIFEST
];
description = "
URLs of manifests to be downloaded when you run
<command>nixos-rebuild</command> to speed up builds.
";
}
{
name = ["nix" "maxJobs"];
default = 1;

View File

@ -27,6 +27,8 @@ rec {
allPackages = import ../pkgs/top-level/all-packages.nix;
};
manifests = config.get ["installer" "manifests"]; # exported here because nixos-rebuild uses it
nix = pkgs.nixUnstable; # we need the exportReferencesGraph feature
useKernel = (config.get ["boot" "useKernel"]) pkgs;

View File

@ -10,6 +10,7 @@ let
plugScript = writeScript "ifplugd.action" "#! ${bash}/bin/sh
if test \"$2\" = up; then
initctl stop dhclient
sleep 1
initctl start dhclient
fi
";