[Nix-dev] nixos-install source enhancement proposals
Marc Weber
marco-oweber at gmx.de
Wed Jul 9 02:06:29 CEST 2008
What do you think about:
a renaming $mountPoint to $NIXOS_INSTALL_TO because $mountPoint can be
everything, replacing default /mnt target by $NIXOS_INSTALL_TO as well
(so that you can install to different directories simultaniously for
testing if you so desire)
b changing
if ! test -e "$NIXOS"; then
echo "NixOS source directory $NIXOS doesn't exist"
exit 1
fi
to
[ -e "$NIXOS" ] || fail"NixOS source directory $NIXOS doesn't exist"
because I feel it's more readable? (This pattern is used 4 times)
(half the lines of duplication can be thrown away)
c Why mount the root from host on $NIXOS_INSTALL_TO/mnt at all?
It is mounted to to install the basic system
chroot $mountPoint @nix@/bin/nix-env \
-p /nix/var/nix/profiles/system \
-f "/mnt$NIXOS/system/system.nix" \
--arg configuration "import $NIXOS_CONFIG" \
--set -A system
After that the $NIXOS_INSTALL_TO/etc/nixos/ source code is backed up
and replaced by $NIXOS(_SRC). So the installation step could be done
at this point and mounting the root from host is no longer necessary
e Do we really want to have this backup stuff?
It has bitten me because I've edited the code and there was no change
(because it was backed up..)
I'd like to replace it by some kind of generic "get-nixos-source"
function similar to how build phases can be defined (?)
So ideally you could do something like
NIXOS_SRC=take_from_host (which means cd / dvd when installing from cd / dvd )
NIXOS_SRC=svn # default nix svn repo everyone is using (maybe copy
over from host and only do some update?)
NIXOS_SRC=git; NIXOS_SRC_GIT_URI=git://myserver/path/ # so that you could use your own modifications
path should contain nixpks, nixos, system etc
f document NIXOS(_SRC) at the top of file
g make NIXOS_INSTALL_GRUB optional and document it at the top as well ?
More information about the nix-dev
mailing list