nixpkgs/make-disk.sh
Armijn Hemel 200251da1a fix tpyos
svn path=/nixu/trunk/; revision=3367
2005-07-19 16:00:34 +00:00

40 lines
1.5 KiB
Bash
Executable file

#! /bin/sh -e
archivesDir=/tmp/arch
manifest=${archivesDir}/MANIFEST
nixpkgs=/nixpkgs2/trunk/pkgs
fill_disk=$archivesDir/scripts/fill-disk.sh
chmod -f -R +w ${archivesDir}/*
rm -rf ${archivesDir}/*
NIX_CMD_PATH=/nix/bin
storeExpr=$(echo '(import ./pkgs.nix).everything' | $NIX_CMD_PATH/nix-instantiate -v -v -)
$NIX_CMD_PATH/nix-push --copy $archivesDir $manifest $(nix-store -r $storeExpr) $(nix-store -r $(echo '(import ./pkgs.nix).kernel' | $NIX_CMD_PATH/nix-instantiate -))
#$NIX_CMD_PATH/nix-push --copy $archivesDir $manifest $storeExpr $(nix-store -r $(echo '(import ./pkgs.nix).kernel' | $NIX_CMD_PATH/nix-instantiate -))
# Location of sysvinit?
sysvinitPath=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).sysvinit' | $NIX_CMD_PATH/nix-instantiate -))
# Location of Nix boot scripts?
bootPath=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).boot' | $NIX_CMD_PATH/nix-instantiate -))
nix=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).nix' | $NIX_CMD_PATH/nix-instantiate -))
#nixDeps=$($NIX_CMD_PATH/nix-store -qR $(echo '(import ./pkgs.nix).nix' | $NIX_CMD_PATH/nix-instantiate -))
nixDeps=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).nix' | $NIX_CMD_PATH/nix-instantiate -)))
echo $nixDeps
cp -fa ${nixpkgs} ${archivesDir}
cp -fa --parents ${nixDeps} ${archivesDir}
mkdir ${archivesDir}/scripts
cp -fa * ${archivesDir}/scripts
sed -e "s^@sysvinitPath\@^$sysvinitPath^g" \
-e "s^@bootPath\@^$bootPath^g" \
-e "s^@NIX_CMD_PATH\@^$nix^g" \
< $fill_disk > $fill_disk.tmp
mv $fill_disk.tmp $fill_disk