diff --git a/modules/config/fonts.nix b/modules/config/fonts.nix index 653400c7e480..3516ed75ab61 100644 --- a/modules/config/fonts.nix +++ b/modules/config/fonts.nix @@ -50,8 +50,8 @@ let "~/.nix-profile/lib/X11/fonts" "~/.nix-profile/share/fonts" # - the default profile - "${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/lib/X11/fonts" - "${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/share/fonts" + "/nix/var/nix/profiles/default/lib/X11/fonts" + "/nix/var/nix/profiles/default/share/fonts" ]; description = " List of primary font paths. diff --git a/modules/config/system-path.nix b/modules/config/system-path.nix index afdc65858a1b..286f7993f77c 100644 --- a/modules/config/system-path.nix +++ b/modules/config/system-path.nix @@ -69,7 +69,7 @@ let automatically updated every time you rebuild the system configuration. (The latter is the main difference with installing them in the default profile, - ${config.nixpkgs.config.nix.stateDir}/nix/profiles/default. + /nix/var/nix/profiles/default. ''; }; diff --git a/modules/installer/cd-dvd/iso-image.nix b/modules/installer/cd-dvd/iso-image.nix index 004cff6eb459..daeebde76cf5 100644 --- a/modules/installer/cd-dvd/iso-image.nix +++ b/modules/installer/cd-dvd/iso-image.nix @@ -143,7 +143,7 @@ in [ { mountPoint = "/"; device = "/dev/root"; } - { mountPoint = "${config.nixpkgs.config.nix.storeDir}"; + { mountPoint = "/nix/store"; fsType = "squashfs"; device = "/nix-store.squashfs"; options = "loop"; @@ -169,7 +169,7 @@ in boot.initrd.kernelModules = [ "loop" ]; # In stage 1, mount a tmpfs on top of / (the ISO image) and - # ${config.nixpkgs.config.nix.storeDir} (the squashfs image) to make this a live CD. + # /nix/store (the squashfs image) to make this a live CD. boot.initrd.postMountCommands = '' mkdir /mnt-root-tmpfs @@ -180,8 +180,8 @@ in mkdir /mnt-store-tmpfs mount -t tmpfs -o "mode=755" none /mnt-store-tmpfs - mkdir -p $targetRoot${config.nixpkgs.config.nix.storeDir} - mount -t aufs -o dirs=/mnt-store-tmpfs=rw:/mnt-root${config.nixpkgs.config.nix.storeDir}=ro none /mnt-root-union${config.nixpkgs.config.nix.storeDir} + mkdir -p $targetRoot/nix/store + mount -t aufs -o dirs=/mnt-store-tmpfs=rw:/mnt-root/nix/store=ro none /mnt-root-union/nix/store ''; # Closures to be copied to the Nix store on the CD, namely the init @@ -223,7 +223,7 @@ in } { # Quick hack: need a mount point for the store. source = pkgs.runCommand "empty" {} "ensureDir $out"; - target = "${config.nixpkgs.config.nix.storeDir}"; + target = "/nix/store"; } ]; @@ -257,11 +257,11 @@ in '' # After booting, register the contents of the Nix store on the # CD in the Nix database in the tmpfs. - ${config.environment.nix}/bin/nix-store --load-db < ${config.nixpkgs.config.nix.storeDir}/nix-path-registration + ${config.environment.nix}/bin/nix-store --load-db < /nix/store/nix-path-registration # nixos-rebuild also requires a "system" profile and an # /etc/NIXOS tag. touch /etc/NIXOS - ${config.environment.nix}/bin/nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set /var/run/current-system + ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /var/run/current-system ''; } diff --git a/modules/installer/cd-dvd/system-tarball.nix b/modules/installer/cd-dvd/system-tarball.nix index f6753494d6e7..daffb94bc532 100644 --- a/modules/installer/cd-dvd/system-tarball.nix +++ b/modules/installer/cd-dvd/system-tarball.nix @@ -87,6 +87,6 @@ in # nixos-rebuild also requires a "system" profile and an # /etc/NIXOS tag. touch /etc/NIXOS - ${config.environment.nix}/bin/nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set /var/run/current-system + ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /var/run/current-system ''; } diff --git a/modules/installer/generations-dir/generations-dir.nix b/modules/installer/generations-dir/generations-dir.nix index 87d1fccedbc7..db9fa32c55a9 100644 --- a/modules/installer/generations-dir/generations-dir.nix +++ b/modules/installer/generations-dir/generations-dir.nix @@ -31,7 +31,7 @@ let default = false; description = " Whether copy the necessary boot files into /boot, so - ${config.nixpkgs.config.nix.storeDir} is not needed by the boot loadear. + /nix/store is not needed by the boot loadear. "; }; }; diff --git a/modules/installer/tools/nixos-deploy-network/deploy.nix b/modules/installer/tools/nixos-deploy-network/deploy.nix index e94060101f5d..7ece202a990c 100644 --- a/modules/installer/tools/nixos-deploy-network/deploy.nix +++ b/modules/installer/tools/nixos-deploy-network/deploy.nix @@ -22,8 +22,8 @@ let '' if [ "$rollback" != "$succeeded" ] then - ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --rollback - ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system/bin/switch-to-configuration switch + ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --rollback + ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} /nix/var/nix/profiles/system/bin/switch-to-configuration switch rollback=$((rollback + 1)) fi @@ -50,12 +50,12 @@ let in '' echo "=== activating system configuration on ${getAttr targetProperty (config.deployment)} ===" - ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set ${config.system.build.toplevel} || - (ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --rollback; rollbackSucceeded) + ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --set ${config.system.build.toplevel} || + (ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --rollback; rollbackSucceeded) - ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system/bin/switch-to-configuration switch || - ( ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --rollback - ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system/bin/switch-to-configuration switch + ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} /nix/var/nix/profiles/system/bin/switch-to-configuration switch || + ( ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --rollback + ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} /nix/var/nix/profiles/system/bin/switch-to-configuration switch rollbackSucceeded ) diff --git a/modules/installer/tools/nixos-install.sh b/modules/installer/tools/nixos-install.sh index e55955db7c46..5b7746b61620 100644 --- a/modules/installer/tools/nixos-install.sh +++ b/modules/installer/tools/nixos-install.sh @@ -6,7 +6,7 @@ # - register validity # - with a chroot to the target device: # * do a nix-pull -# * nix-env -p @stateDir@/nix/profiles/system -i +# * nix-env -p /nix/var/nix/profiles/system -i # * run the activation script of the configuration (also installs Grub) set -e @@ -92,16 +92,16 @@ mkdir -m 0755 -p $mountPoint/var # Create the necessary Nix directories on the target device, if they # don't already exist. mkdir -m 0755 -p \ - $mountPoint@stateDir@/nix/gcroots \ - $mountPoint@stateDir@/nix/temproots \ - $mountPoint@stateDir@/nix/manifests \ - $mountPoint@stateDir@/nix/userpool \ - $mountPoint@stateDir@/nix/profiles \ - $mountPoint@stateDir@/nix/db \ - $mountPoint@stateDir@/log/nix/drvs + $mountPoint/nix/var/nix/gcroots \ + $mountPoint/nix/var/nix/temproots \ + $mountPoint/nix/var/nix/manifests \ + $mountPoint/nix/var/nix/userpool \ + $mountPoint/nix/var/nix/profiles \ + $mountPoint/nix/var/nix/db \ + $mountPoint/nix/var/log/nix/drvs mkdir -m 1777 -p \ - $mountPoint@storeDir@ \ + $mountPoint/nix/store \ # Get the store paths to copy from the references graph. @@ -112,7 +112,7 @@ storePaths=$(@perl@/bin/perl @pathsFromGraph@ @nixClosure@) echo "copying Nix to $mountPoint...." for i in $storePaths; do echo " $i" - rsync -a $i $mountPoint@storeDir@/ + rsync -a $i $mountPoint/nix/store/ done @@ -154,7 +154,7 @@ fi # it into the system configuration profile. echo "building the system configuration..." NIXPKGS=/mnt/etc/nixos/nixpkgs chroot $mountPoint @nix@/bin/nix-env \ - -p @stateDir@/nix/profiles/system \ + -p /nix/var/nix/profiles/system \ -f "/mnt$NIXOS" \ --set -A system @@ -196,4 +196,4 @@ touch $mountPoint/etc/NIXOS # configuration. echo "finalising the installation..." NIXOS_INSTALL_GRUB=1 chroot $mountPoint \ - @stateDir@/nix/profiles/system/bin/switch-to-configuration boot + /nix/var/nix/profiles/system/bin/switch-to-configuration boot diff --git a/modules/installer/tools/nixos-rebuild.sh b/modules/installer/tools/nixos-rebuild.sh index 4da87c5f9b1b..90df386faa9d 100644 --- a/modules/installer/tools/nixos-rebuild.sh +++ b/modules/installer/tools/nixos-rebuild.sh @@ -133,9 +133,9 @@ if test -n "$pullManifest"; then manifests=$(nix-instantiate --eval-only --xml --strict $NIXOS -A manifests \ | grep '&2 if test "$action" = switch -o "$action" = boot; then - nix-env -p @stateDir@/nix/profiles/system -f $NIXOS --set -A system $extraBuildFlags - pathToConfig=@stateDir@/nix/profiles/system + nix-env -p /nix/var/nix/profiles/system -f $NIXOS --set -A system $extraBuildFlags + pathToConfig=/nix/var/nix/profiles/system elif test "$action" = test -o "$action" = build -o "$action" = dry-run; then nix-build $NIXOS -A system -K -k $extraBuildFlags > /dev/null pathToConfig=./result @@ -178,14 +178,14 @@ if test -z "$rollback"; then fi else # test -n "$rollback" if test "$action" = switch -o "$action" = boot; then - nix-env --rollback -p @stateDir@/nix/profiles/system - pathToConfig=@stateDir@/nix/profiles/system + nix-env --rollback -p /nix/var/nix/profiles/system + pathToConfig=/nix/var/nix/profiles/system elif test "$action" = test -o "$action" = build; then systemNumber=$( - nix-env -p @stateDir@/nix/profiles/system --list-generations | + nix-env -p /nix/var/nix/profiles/system --list-generations | sed -n '/current/ {g; p;}; s/ *\([0-9]*\).*/\1/; h' ) - ln -sT @stateDir@/nix/profiles/system-${systemNumber}-link ./result + ln -sT /nix/var/nix/profiles/system-${systemNumber}-link ./result pathToConfig=./result else showSyntax diff --git a/modules/installer/tools/tools.nix b/modules/installer/tools/tools.nix index ddbe71a321cd..069e45127ef6 100644 --- a/modules/installer/tools/tools.nix +++ b/modules/installer/tools/tools.nix @@ -10,7 +10,6 @@ let makeProg = args: pkgs.substituteAll (args // { dir = "bin"; isExecutable = true; - inherit (config.nixpkgs.config.nix) storeDir stateDir; }); nixosBuildVMS = makeProg { diff --git a/modules/misc/nixpkgs.nix b/modules/misc/nixpkgs.nix index 281ebefa853d..3154c3dd1e7d 100644 --- a/modules/misc/nixpkgs.nix +++ b/modules/misc/nixpkgs.nix @@ -70,6 +70,4 @@ in }; }; - - config.nixpkgs.config.nix = { storeDir = /nix/store; stateDir = /nix/var; }; } diff --git a/modules/security/setuid-wrappers.nix b/modules/security/setuid-wrappers.nix index 812179d4efc6..ebd9e1ed537a 100644 --- a/modules/security/setuid-wrappers.nix +++ b/modules/security/setuid-wrappers.nix @@ -100,7 +100,7 @@ in if test -z "$source"; then # If we can't find the program, fall back to the # system profile. - source=${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/bin/${program} + source=/nix/var/nix/profiles/default/bin/${program} fi cp ${setuidWrapper}/bin/setuid-wrapper ${wrapperDir}/${program} diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix index 4539680cbe0d..221ad6e1f543 100644 --- a/modules/services/misc/nix-daemon.nix +++ b/modules/services/misc/nix-daemon.nix @@ -308,26 +308,26 @@ in # Set up Nix. mkdir -p /nix/etc/nix ln -sfn /etc/nix.conf /nix/etc/nix/nix.conf - chown root.nixbld ${config.nixpkgs.config.nix.storeDir} - chmod 1775 ${config.nixpkgs.config.nix.storeDir} + chown root.nixbld /nix/store + chmod 1775 /nix/store # Nix initialisation. mkdir -m 0755 -p \ - ${config.nixpkgs.config.nix.stateDir}/nix/gcroots \ - ${config.nixpkgs.config.nix.stateDir}/nix/temproots \ - ${config.nixpkgs.config.nix.stateDir}/nix/manifests \ - ${config.nixpkgs.config.nix.stateDir}/nix/userpool \ - ${config.nixpkgs.config.nix.stateDir}/nix/profiles \ - ${config.nixpkgs.config.nix.stateDir}/nix/db \ - ${config.nixpkgs.config.nix.stateDir}/log/nix/drvs \ - ${config.nixpkgs.config.nix.stateDir}/nix/channel-cache \ - ${config.nixpkgs.config.nix.stateDir}/nix/chroots - mkdir -m 1777 -p ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/per-user - mkdir -m 1777 -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/per-user - mkdir -m 1777 -p ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/tmp + /nix/var/nix/gcroots \ + /nix/var/nix/temproots \ + /nix/var/nix/manifests \ + /nix/var/nix/userpool \ + /nix/var/nix/profiles \ + /nix/var/nix/db \ + /nix/var/log/nix/drvs \ + /nix/var/nix/channel-cache \ + /nix/var/nix/chroots + mkdir -m 1777 -p /nix/var/nix/gcroots/per-user + mkdir -m 1777 -p /nix/var/nix/profiles/per-user + mkdir -m 1777 -p /nix/var/nix/gcroots/tmp - ln -sf ${config.nixpkgs.config.nix.stateDir}/nix/profiles ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/ - ln -sf ${config.nixpkgs.config.nix.stateDir}/nix/manifests ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/ + ln -sf /nix/var/nix/profiles /nix/var/nix/gcroots/ + ln -sf /nix/var/nix/manifests /nix/var/nix/gcroots/ ''; }; diff --git a/modules/services/monitoring/ups.nix b/modules/services/monitoring/ups.nix index 10531a28865a..2874bbf20875 100644 --- a/modules/services/monitoring/ups.nix +++ b/modules/services/monitoring/ups.nix @@ -13,7 +13,7 @@ let { options = { # This can be infered from the UPS model by looking at - # ${config.nixpkgs.config.nix.storeDir}/nut/share/driver.list + # /nix/store/nut/share/driver.list driver = mkOption { type = types.uniq types.string; description = '' diff --git a/modules/services/networking/openvpn.nix b/modules/services/networking/openvpn.nix index 580328d0de77..bec5d7b8107e 100644 --- a/modules/services/networking/openvpn.nix +++ b/modules/services/networking/openvpn.nix @@ -133,7 +133,7 @@ in Additionally you can specify the up/ down scripts by setting the up down properties. - Config lines up=${config.nixpkgs.config.nix.storeDir}/xxx-up-script down=... + Config lines up=/nix/store/xxx-up-script down=... will be appended to your configuration file automatically If you define at least one of up/down "script-security 2" will be diff --git a/modules/services/networking/ssh/lshd.nix b/modules/services/networking/ssh/lshd.nix index b4f64e4b7cce..d32fabbde24b 100644 --- a/modules/services/networking/ssh/lshd.nix +++ b/modules/services/networking/ssh/lshd.nix @@ -78,7 +78,7 @@ in If non-null, override the default login shell with the specified value. ''; - example = "${config.nixpkgs.config.nix.storeDir}/xyz-bash-10.0/bin/bash10"; + example = "/nix/store/xyz-bash-10.0/bin/bash10"; }; srpKeyExchange = mkOption { diff --git a/modules/services/system/dbus.nix b/modules/services/system/dbus.nix index 2499ffc58e38..4f6d577e9369 100644 --- a/modules/services/system/dbus.nix +++ b/modules/services/system/dbus.nix @@ -155,7 +155,7 @@ in }; services.dbus.packages = - [ "${config.nixpkgs.config.nix.stateDir}/nix/profiles/default" + [ "/nix/var/nix/profiles/default" config.system.path ]; diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix index b2a1379527ad..4894276e1d39 100644 --- a/modules/services/web-servers/apache-httpd/default.nix +++ b/modules/services/web-servers/apache-httpd/default.nix @@ -339,7 +339,7 @@ let # But do allow access to files in the store so that we don't have # to generate clauses for every generated file that we # want to serve. - + Order allow,deny Allow from all diff --git a/modules/services/web-servers/jboss/default.nix b/modules/services/web-servers/jboss/default.nix index 85010bdbe78f..e1bcede6563c 100644 --- a/modules/services/web-servers/jboss/default.nix +++ b/modules/services/web-servers/jboss/default.nix @@ -45,11 +45,11 @@ in deployDir = mkOption { description = "Location of the deployment files"; - default = "${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/server/default/deploy/"; + default = "/nix/var/nix/profiles/default/server/default/deploy/"; }; libUrl = mkOption { - default = "file://${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/server/default/lib"; + default = "file:///nix/var/nix/profiles/default/server/default/lib"; description = "Location where the shared library JARs are stored"; }; diff --git a/modules/system/activation/activation-script.nix b/modules/system/activation/activation-script.nix index 26706d6a20e8..72566507eccd 100644 --- a/modules/system/activation/activation-script.nix +++ b/modules/system/activation/activation-script.nix @@ -76,7 +76,7 @@ in ln -sfn "$(readlink -f "$systemConfig")" /var/run/current-system # Prevent the current configuration from being garbage-collected. - ln -sfn /var/run/current-system ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/current-system + ln -sfn /var/run/current-system /nix/var/nix/gcroots/current-system ''; }; diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix index 7f35b861352c..08cf948fea4f 100644 --- a/modules/system/boot/stage-1.nix +++ b/modules/system/boot/stage-1.nix @@ -217,7 +217,7 @@ let # The initrd only has to mount / or any FS marked as necessary for - # booting (such as the FS containing ${config.nixpkgs.config.nix.storeDir}, or an FS needed for + # booting (such as the FS containing /nix/store, or an FS needed for # mounting /, like / on a loopback). fileSystems = filter (fs: fs.mountPoint == "/" || fs.neededForBoot) diff --git a/modules/system/etc/etc.nix b/modules/system/etc/etc.nix index f76c70c2f9fb..c84d96829f33 100644 --- a/modules/system/etc/etc.nix +++ b/modules/system/etc/etc.nix @@ -10,7 +10,7 @@ let environment.etc = mkOption { default = []; example = [ - { source = "${config.nixpkgs.config.nix.storeDir}/.../etc/dir/file.conf.example"; + { source = "/nix/store/.../etc/dir/file.conf.example"; target = "dir/file.conf"; mode = "0440"; } diff --git a/modules/system/upstart-events/shutdown.nix b/modules/system/upstart-events/shutdown.nix index 10587af35b31..cf06ba10d08b 100644 --- a/modules/system/upstart-events/shutdown.nix +++ b/modules/system/upstart-events/shutdown.nix @@ -112,7 +112,7 @@ with pkgs.lib; # (For instance, when applied to a bind-mount it # unmounts the target of the bind-mount.) !!! But # we should use `-f' for NFS. - if [ "$mp" != / -a "$mp" != /nix -a "$mp" != ${config.nixpkgs.config.nix.storeDir} ]; then + if [ "$mp" != / -a "$mp" != /nix -a "$mp" != /nix/store ]; then if umount -n "$mp"; then success=1; tryAgain=1; fi fi diff --git a/modules/virtualisation/amazon-image.nix b/modules/virtualisation/amazon-image.nix index 481c0c58b7ee..66474158c686 100644 --- a/modules/virtualisation/amazon-image.nix +++ b/modules/virtualisation/amazon-image.nix @@ -34,9 +34,9 @@ with pkgs.lib; # Copy all paths in the closure to the filesystem. storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure) - mkdir -p /mnt${config.nixpkgs.config.nix.storeDir} + mkdir -p /mnt/nix/store echo "copying everything (will take a while)..." - cp -prd $storePaths /mnt${config.nixpkgs.config.nix.storeDir}/ + cp -prd $storePaths /mnt/nix/store/ # Register the paths in the Nix database. printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \ @@ -44,7 +44,7 @@ with pkgs.lib; # Create the system profile to allow nixos-rebuild to work. chroot /mnt ${config.environment.nix}/bin/nix-env \ - -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set ${config.system.build.toplevel} + -p /nix/var/nix/profiles/system --set ${config.system.build.toplevel} # `nixos-rebuild' requires an /etc/NIXOS. mkdir -p /mnt/etc diff --git a/modules/virtualisation/nova-image.nix b/modules/virtualisation/nova-image.nix index 1b92f8d653d1..1e891c35dc09 100644 --- a/modules/virtualisation/nova-image.nix +++ b/modules/virtualisation/nova-image.nix @@ -41,8 +41,8 @@ with pkgs.lib; # Copy all paths in the closure to the filesystem. storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure) - mkdir -p /mnt${config.nixpkgs.config.nix.storeDir} - ${pkgs.rsync}/bin/rsync -av $storePaths /mnt${config.nixpkgs.config.nix.storeDir}/ + mkdir -p /mnt/nix/store + ${pkgs.rsync}/bin/rsync -av $storePaths /mnt/nix/store/ # Register the paths in the Nix database. printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \ @@ -50,7 +50,7 @@ with pkgs.lib; # Create the system profile to allow nixos-rebuild to work. chroot /mnt ${config.environment.nix}/bin/nix-env \ - -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set ${config.system.build.toplevel} + -p /nix/var/nix/profiles/system --set ${config.system.build.toplevel} # `nixos-rebuild' requires an /etc/NIXOS. mkdir -p /mnt/etc diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 1340841369d9..7738ce1f2e76 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -222,7 +222,7 @@ let # Install GRUB and generate the GRUB boot menu. touch /etc/NIXOS - mkdir -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles + mkdir -p /nix/var/nix/profiles ${config.system.build.toplevel}/bin/switch-to-configuration boot umount /boot @@ -276,11 +276,11 @@ in chmod 1777 $targetRoot/tmp mkdir -p $targetRoot/boot - mount -o remount,ro $targetRoot${config.nixpkgs.config.nix.storeDir} + mount -o remount,ro $targetRoot/nix/store ${optionalString cfg.writableStore '' mkdir /mnt-store-tmpfs mount -t tmpfs -o "mode=755" none /mnt-store-tmpfs - mount -t aufs -o dirs=/mnt-store-tmpfs=rw:$targetRoot${config.nixpkgs.config.nix.storeDir}=rr none $targetRoot${config.nixpkgs.config.nix.storeDir} + mount -t aufs -o dirs=/mnt-store-tmpfs=rw:$targetRoot/nix/store=rr none $targetRoot/nix/store ''} ''; @@ -314,7 +314,7 @@ in [ { mountPoint = "/"; device = "/dev/vda"; } - { mountPoint = "${config.nixpkgs.config.nix.storeDir}"; + { mountPoint = "/nix/store"; device = "//10.0.2.4/store"; fsType = "cifs"; options = "guest,sec=none,noperm,noacl";