diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index 0610ad54da34..8dd92dd96af9 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -14,7 +14,7 @@ let ''; requiredPackages = - [ config.environment.nix + [ config.nix.package pkgs.acl pkgs.attr pkgs.bashInteractive # bash with ncurses support diff --git a/nixos/modules/installer/cd-dvd/channel.nix b/nixos/modules/installer/cd-dvd/channel.nix index c6e0f1577bb1..bcf3dbb3f735 100644 --- a/nixos/modules/installer/cd-dvd/channel.nix +++ b/nixos/modules/installer/cd-dvd/channel.nix @@ -33,7 +33,7 @@ in if ! [ -e /var/lib/nixos/did-channel-init ]; then echo "unpacking the NixOS/Nixpkgs sources..." mkdir -p /nix/var/nix/profiles/per-user/root - ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels \ + ${config.nix.package}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels \ -i ${channelSources} --quiet --option use-substitutes false mkdir -m 0700 -p /root/.nix-defexpr ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index de9728d677c5..b803a3f188b9 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -298,12 +298,12 @@ 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 < /nix/store/nix-path-registration + ${config.nix.package}/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 /nix/var/nix/profiles/system --set /run/current-system + ${config.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system ''; # Add vfat support to the initrd to enable people to copy the diff --git a/nixos/modules/installer/cd-dvd/system-tarball.nix b/nixos/modules/installer/cd-dvd/system-tarball.nix index 6bf8eebdac59..8d678fba71f5 100644 --- a/nixos/modules/installer/cd-dvd/system-tarball.nix +++ b/nixos/modules/installer/cd-dvd/system-tarball.nix @@ -77,14 +77,14 @@ in # After booting, register the contents of the Nix store on the # CD in the Nix database in the tmpfs. if [ -f /nix-path-registration ]; then - ${config.environment.nix}/bin/nix-store --load-db < /nix-path-registration && + ${config.nix.package}/bin/nix-store --load-db < /nix-path-registration && rm /nix-path-registration fi # nixos-rebuild also requires a "system" profile and an # /etc/NIXOS tag. touch /etc/NIXOS - ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system + ${config.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system ''; }; diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index d655210c90ee..0eca902dd741 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -109,7 +109,7 @@ fi # more conservative. if [ "$action" != dry-run -a -n "$buildNix" ]; then echo "building Nix..." >&2 - if ! nix-build '' -A config.environment.nix -o $tmpDir/nix "${extraBuildFlags[@]}" > /dev/null; then + if ! nix-build '' -A config.nix.package -o $tmpDir/nix "${extraBuildFlags[@]}" > /dev/null; then if ! nix-build '' -A nixFallback -o $tmpDir/nix "${extraBuildFlags[@]}" > /dev/null; then nix-build '' -A nixUnstable -o $tmpDir/nix "${extraBuildFlags[@]}" > /dev/null fi diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index 074c77b51467..2c68ec5fe224 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -22,10 +22,10 @@ let src = ./nixos-install.sh; inherit (pkgs) perl pathsFromGraph; - nix = config.environment.nix; + nix = config.nix.package; nixClosure = pkgs.runCommand "closure" - { exportReferencesGraph = ["refs" config.environment.nix]; } + { exportReferencesGraph = ["refs" config.nix.package]; } "cp refs $out"; }; diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 82ba051eebf3..0a8383870ee5 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -73,6 +73,7 @@ in zipModules ([] # ++ alias [ "services" "xserver" "slim" "theme" ] [ "services" "xserver" "displayManager" "slim" "theme" ] ++ obsolete [ "environment" "extraPackages" ] [ "environment" "systemPackages" ] ++ obsolete [ "environment" "enableBashCompletion" ] [ "programs" "bash" "enableCompletion" ] +++ obsolete [ "environment" "nix" ] [ "nix" "package" ] ++ obsolete [ "security" "extraSetuidPrograms" ] [ "security" "setuidPrograms" ] ++ obsolete [ "networking" "enableWLAN" ] [ "networking" "wireless" "enable" ] diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index d78c7fe2822e..441b8606b01f 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -6,7 +6,7 @@ let cfg = config.nix; - inherit (config.environment) nix; + nix = cfg.package; makeNixBuildUser = nr: { name = "nixbld${toString nr}"; @@ -55,16 +55,16 @@ in options = { - environment.nix = mkOption { - type = types.path; - default = pkgs.nix; - description = '' - This option specifies the Nix package instance to use throughout the system. - ''; - }; - nix = { + package = mkOption { + type = types.path; + default = pkgs.nix; + description = '' + This option specifies the Nix package instance to use throughout the system. + ''; + }; + maxJobs = mkOption { default = 1; example = 2; @@ -302,7 +302,7 @@ in } // optionalAttrs cfg.distributedBuilds { - NIX_BUILD_HOOK = "${config.environment.nix}/libexec/nix/build-remote.pl"; + NIX_BUILD_HOOK = "${nix}/libexec/nix/build-remote.pl"; NIX_REMOTE_SYSTEMS = "/etc/nix/machines"; NIX_CURRENT_LOAD = "/run/nix/current-load"; } diff --git a/nixos/modules/services/misc/nix-gc.nix b/nixos/modules/services/misc/nix-gc.nix index ad6889ce1428..0d7bc13b2ee6 100644 --- a/nixos/modules/services/misc/nix-gc.nix +++ b/nixos/modules/services/misc/nix-gc.nix @@ -52,7 +52,7 @@ in systemd.services.nix-gc = { description = "Nix Garbage Collector"; - script = "exec ${config.environment.nix}/bin/nix-collect-garbage ${cfg.options}"; + script = "exec ${config.nix.package}/bin/nix-collect-garbage ${cfg.options}"; startAt = optionalString cfg.automatic cfg.dates; }; diff --git a/nixos/modules/virtualisation/amazon-image.nix b/nixos/modules/virtualisation/amazon-image.nix index 7e04f0d29114..cfc582170e6c 100644 --- a/nixos/modules/virtualisation/amazon-image.nix +++ b/nixos/modules/virtualisation/amazon-image.nix @@ -40,10 +40,10 @@ with pkgs.lib; # Register the paths in the Nix database. printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \ - chroot /mnt ${config.environment.nix}/bin/nix-store --load-db + chroot /mnt ${config.nix.package}/bin/nix-store --load-db # Create the system profile to allow nixos-rebuild to work. - chroot /mnt ${config.environment.nix}/bin/nix-env \ + chroot /mnt ${config.nix.package}/bin/nix-env \ -p /nix/var/nix/profiles/system --set ${config.system.build.toplevel} # `nixos-rebuild' requires an /etc/NIXOS. diff --git a/nixos/modules/virtualisation/nova-image.nix b/nixos/modules/virtualisation/nova-image.nix index ab625dba11d3..5c9481b71278 100644 --- a/nixos/modules/virtualisation/nova-image.nix +++ b/nixos/modules/virtualisation/nova-image.nix @@ -46,10 +46,10 @@ with pkgs.lib; # Register the paths in the Nix database. printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \ - chroot /mnt ${config.environment.nix}/bin/nix-store --load-db + chroot /mnt ${config.nix.package}/bin/nix-store --load-db # Create the system profile to allow nixos-rebuild to work. - chroot /mnt ${config.environment.nix}/bin/nix-env \ + chroot /mnt ${config.nix.package}/bin/nix-env \ -p /nix/var/nix/profiles/system --set ${config.system.build.toplevel} # `nixos-rebuild' requires an /etc/NIXOS. diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 708b462e0e5d..6648b6514d01 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -329,7 +329,7 @@ in boot.postBootCommands = '' if [[ "$(cat /proc/cmdline)" =~ regInfo=([^ ]*) ]]; then - ${config.environment.nix}/bin/nix-store --load-db < ''${BASH_REMATCH[1]} + ${config.nix.package}/bin/nix-store --load-db < ''${BASH_REMATCH[1]} fi ''; diff --git a/nixos/modules/virtualisation/virtualbox-image.nix b/nixos/modules/virtualisation/virtualbox-image.nix index e1b6def8edb3..bea6414c4504 100644 --- a/nixos/modules/virtualisation/virtualbox-image.nix +++ b/nixos/modules/virtualisation/virtualbox-image.nix @@ -53,10 +53,10 @@ with pkgs.lib; # Register the paths in the Nix database. printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \ - chroot /mnt ${config.environment.nix}/bin/nix-store --load-db + chroot /mnt ${config.nix.package}/bin/nix-store --load-db # Create the system profile to allow nixos-rebuild to work. - chroot /mnt ${config.environment.nix}/bin/nix-env \ + chroot /mnt ${config.nix.package}/bin/nix-env \ -p /nix/var/nix/profiles/system --set ${config.system.build.toplevel} # `nixos-rebuild' requires an /etc/NIXOS.