Skip to content

Commit

Permalink
reewide: Purge all uses stdenv.system and top-level system
Browse files Browse the repository at this point in the history
It is deprecated and will be removed after 18.09.
  • Loading branch information
Ericson2314 committed Aug 30, 2018
1 parent 94f71d8 commit 2c2f1e3
Show file tree
Hide file tree
Showing 263 changed files with 594 additions and 577 deletions.
2 changes: 1 addition & 1 deletion doc/old/cross.txt
Expand Up @@ -78,7 +78,7 @@ Step 2: build kernel headers for the target architecture
---
{stdenv, fetchurl}:

assert stdenv.system == "i686-linux";
assert stdenv.buildPlatform.system == "i686-linux";

stdenv.mkDerivation {
name = "linux-headers-2.6.13.1-arm";
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/make-system-tarball.nix
@@ -1,7 +1,7 @@
{ stdenv, perl, pixz, pathsFromGraph

, # The file name of the resulting tarball
fileName ? "nixos-system-${stdenv.system}"
fileName ? "nixos-system-${stdenv.hostPlatform.system}"

, # The files and directories to be placed in the tarball.
# This is a list of attribute sets {source, target} where `source'
Expand Down
4 changes: 2 additions & 2 deletions nixos/lib/qemu-flags.nix
Expand Up @@ -14,12 +14,12 @@ in

qemuSerialDevice = if pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64 then "ttyS0"
else if pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64 then "ttyAMA0"
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.system}'";
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'";

qemuBinary = qemuPkg: {
"x86_64-linux" = "${qemuPkg}/bin/qemu-kvm -cpu kvm64";
"armv7l-linux" = "${qemuPkg}/bin/qemu-system-arm -enable-kvm -machine virt -cpu host";
"aarch64-linux" = "${qemuPkg}/bin/qemu-system-aarch64 -enable-kvm -machine virt,gic-version=host -cpu host";
"x86_64-darwin" = "${qemuPkg}/bin/qemu-kvm -cpu kvm64";
}.${pkgs.stdenv.system} or "${qemuPkg}/bin/qemu-kvm";
}.${pkgs.stdenv.hostPlatform.system} or "${qemuPkg}/bin/qemu-kvm";
}
2 changes: 1 addition & 1 deletion nixos/modules/installer/cd-dvd/installation-cd-base.nix
Expand Up @@ -16,7 +16,7 @@ with lib;
];

# ISO naming.
isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.system}.iso";
isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.iso";

isoImage.volumeID = substring 0 11 "NIXOS_ISO";

Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/installer/cd-dvd/sd-image-aarch64.nix
Expand Up @@ -16,7 +16,8 @@ in
];

assertions = lib.singleton {
assertion = pkgs.stdenv.system == "aarch64-linux";
assertion = pkgs.stdenv.hostPlatform.system == "aarch64-linux"
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
message = "sd-image-aarch64.nix can be only built natively on Aarch64 / ARM64; " +
"it cannot be cross compiled";
};
Expand Down
Expand Up @@ -16,7 +16,8 @@ in
];

assertions = lib.singleton {
assertion = pkgs.stdenv.system == "armv7l-linux";
assertion = pkgs.stdenv.hostPlatform.system == "armv7l-linux"
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
message = "sd-image-armv7l-multiplatform.nix can be only built natively on ARMv7; " +
"it cannot be cross compiled";
};
Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix
Expand Up @@ -16,7 +16,8 @@ in
];

assertions = lib.singleton {
assertion = pkgs.stdenv.system == "armv6l-linux";
assertion = pkgs.stdenv.hostPlatform.system == "armv6l-linux"
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
message = "sd-image-raspberrypi.nix can be only built natively on ARMv6; " +
"it cannot be cross compiled";
};
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/installer/cd-dvd/sd-image.nix
Expand Up @@ -22,7 +22,7 @@ in
{
options.sdImage = {
imageName = mkOption {
default = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.system}.img";
default = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.img";
description = ''
Name of the generated image file.
'';
Expand Down Expand Up @@ -102,7 +102,7 @@ in
mkdir -p $out/nix-support $out/sd-image
export img=$out/sd-image/${config.sdImage.imageName}
echo "${pkgs.stdenv.system}" > $out/nix-support/system
echo "${pkgs.stdenv.buildPlatform.system}" > $out/nix-support/system
echo "file sd-image $img" >> $out/nix-support/hydra-build-products
# Create the image file sized to fit /boot and /, plus 20M of slack
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/installer/netboot/netboot.nix
Expand Up @@ -25,7 +25,7 @@ with lib;

# !!! Hack - attributes expected by other modules.
environment.systemPackages = [ pkgs.grub2_efi ]
++ (if pkgs.stdenv.system == "aarch64-linux"
++ (if pkgs.stdenv.hostPlatform.system == "aarch64-linux"
then []
else [ pkgs.grub2 pkgs.syslinux ]);

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/gitit.nix
Expand Up @@ -10,7 +10,7 @@ let

toYesNo = b: if b then "yes" else "no";

gititShared = with cfg.haskellPackages; gitit + "/share/" + pkgs.stdenv.system + "-" + ghc.name + "/" + gitit.pname + "-" + gitit.version;
gititShared = with cfg.haskellPackages; gitit + "/share/" + pkgs.stdenv.hostPlatform.system + "-" + ghc.name + "/" + gitit.pname + "-" + gitit.version;

gititWithPkgs = hsPkgs: extras: hsPkgs.ghcWithPackages (self: with self; [ gitit ] ++ (extras self));

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/networking/vsftpd.nix
Expand Up @@ -99,7 +99,7 @@ let
nopriv_user=vsftpd
secure_chroot_dir=/var/empty
syslog_enable=YES
${optionalString (pkgs.stdenv.system == "x86_64-linux") ''
${optionalString (pkgs.stdenv.hostPlatform.system == "x86_64-linux") ''
seccomp_sandbox=NO
''}
anon_umask=${cfg.anonymousUmask}
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/luksroot.nix
Expand Up @@ -324,7 +324,7 @@ in
[ "aes" "aes_generic" "blowfish" "twofish"
"serpent" "cbc" "xts" "lrw" "sha1" "sha256" "sha512"

(if pkgs.stdenv.system == "x86_64-linux" then "aes_x86_64" else "aes_i586")
(if pkgs.stdenv.hostPlatform.system == "x86_64-linux" then "aes_x86_64" else "aes_i586")
];
description = ''
A list of cryptographic kernel modules needed to decrypt the root device(s).
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/azure-agent.nix
Expand Up @@ -77,7 +77,7 @@ in
config = mkIf cfg.enable {
assertions = [ {
assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
message = "Azure not currently supported on ${pkgs.stdenv.system}";
message = "Azure not currently supported on ${pkgs.stdenv.hostPlatform.system}";
} {
assertion = config.networking.networkmanager.enable == false;
message = "Windows Azure Linux Agent is not compatible with NetworkManager";
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/brightbox-image.nix
Expand Up @@ -26,7 +26,7 @@ in
rm $diskImageBase
popd
'';
diskImageBase = "nixos-image-${config.system.nixos.label}-${pkgs.stdenv.system}.raw";
diskImageBase = "nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw";
buildInputs = [ pkgs.utillinux pkgs.perl ];
exportReferencesGraph =
[ "closure" config.system.build.toplevel ];
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/google-compute-image.nix
Expand Up @@ -14,7 +14,7 @@ in
PATH=$PATH:${pkgs.stdenv.lib.makeBinPath [ pkgs.gnutar pkgs.gzip ]}
pushd $out
mv $diskImage disk.raw
tar -Szcf nixos-image-${config.system.nixos.label}-${pkgs.stdenv.system}.raw.tar.gz disk.raw
tar -Szcf nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw.tar.gz disk.raw
rm $out/disk.raw
popd
'';
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/virtualbox-guest.nix
Expand Up @@ -34,7 +34,7 @@ in
config = mkIf cfg.enable (mkMerge [{
assertions = [{
assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
message = "Virtualbox not currently supported on ${pkgs.stdenv.system}";
message = "Virtualbox not currently supported on ${pkgs.stdenv.hostPlatform.system}";
}];

environment.systemPackages = [ kernel.virtualboxGuestAdditions ];
Expand Down
10 changes: 5 additions & 5 deletions nixos/modules/virtualisation/virtualbox-image.nix
Expand Up @@ -26,21 +26,21 @@ in {
};
vmDerivationName = mkOption {
type = types.str;
default = "nixos-ova-${config.system.nixos.label}-${pkgs.stdenv.system}";
default = "nixos-ova-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
description = ''
The name of the derivation for the VirtualBox appliance.
'';
};
vmName = mkOption {
type = types.str;
default = "NixOS ${config.system.nixos.label} (${pkgs.stdenv.system})";
default = "NixOS ${config.system.nixos.label} (${pkgs.stdenv.hostPlatform.system})";
description = ''
The name of the VirtualBox appliance.
'';
};
vmFileName = mkOption {
type = types.str;
default = "nixos-${config.system.nixos.label}-${pkgs.stdenv.system}.ova";
default = "nixos-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.ova";
description = ''
The file name of the VirtualBox appliance.
'';
Expand All @@ -67,10 +67,10 @@ in {
echo "creating VirtualBox VM..."
vmName="${cfg.vmName}";
VBoxManage createvm --name "$vmName" --register \
--ostype ${if pkgs.stdenv.system == "x86_64-linux" then "Linux26_64" else "Linux26"}
--ostype ${if pkgs.stdenv.hostPlatform.system == "x86_64-linux" then "Linux26_64" else "Linux26"}
VBoxManage modifyvm "$vmName" \
--memory ${toString cfg.memorySize} --acpi on --vram 32 \
${optionalString (pkgs.stdenv.system == "i686-linux") "--pae on"} \
${optionalString (pkgs.stdenv.hostPlatform.system == "i686-linux") "--pae on"} \
--nictype1 virtio --nic1 nat \
--audiocontroller ac97 --audio alsa \
--rtcuseutc on \
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/vmware-guest.nix
Expand Up @@ -22,7 +22,7 @@ in
config = mkIf cfg.enable {
assertions = [ {
assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
message = "VMWare guest is not currently supported on ${pkgs.stdenv.system}";
message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}";
} ];

environment.systemPackages = [ open-vm-tools ];
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/xen-dom0.nix
Expand Up @@ -146,7 +146,7 @@ in
config = mkIf cfg.enable {
assertions = [ {
assertion = pkgs.stdenv.isx86_64;
message = "Xen currently not supported on ${pkgs.stdenv.system}";
message = "Xen currently not supported on ${pkgs.stdenv.hostPlatform.system}";
} {
assertion = config.boot.loader.grub.enable && (config.boot.loader.grub.efiSupport == false);
message = "Xen currently does not support EFI boot";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/altcoins/mist.nix
Expand Up @@ -4,7 +4,7 @@ let
version = "0.11.1";
name = "mist";

throwSystem = throw "Unsupported system: ${stdenv.system}";
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";

meta = with stdenv.lib; {
description = "Browse and use Ðapps on the Ethereum network";
Expand Down Expand Up @@ -37,7 +37,7 @@ let
url = "https://github.com/ethereum/mist/releases/download/v${version}/Mist-linux64-${urlVersion}.zip";
sha256 = "0yx4x72l8gk68yh9saki48zgqx8k92xnkm79dc651wdpd5c25cz3";
};
}.${stdenv.system} or throwSystem;
}.${stdenv.hostPlatform.system} or throwSystem;

buildInputs = [ unzip makeWrapper ];

Expand Down
6 changes: 3 additions & 3 deletions pkgs/applications/audio/baudline/default.nix
Expand Up @@ -11,18 +11,18 @@ stdenv.mkDerivation rec {
version = "1.08";

src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "http://www.baudline.com/baudline_${version}_linux_x86_64.tar.gz";
sha256 = "09fn0046i69in1jpizkzbaq5ggij0mpflcsparyskm3wh71mbzvr";
}
else if stdenv.system == "i686-linux" then
else if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
url = "http://www.baudline.com/baudline_${version}_linux_i686.tar.gz";
sha256 = "1waip5pmcf5ffcfvn8lf1rvsaq2ab66imrbfqs777scz7k8fhhjb";
}
else
throw "baudline isn't supported (yet?) on ${stdenv.system}";
throw "baudline isn't supported (yet?) on ${stdenv.hostPlatform.system}";

buildInputs = [ makeWrapper ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/google-musicmanager/default.nix
@@ -1,6 +1,6 @@
{ stdenv, fetchurl
, flac, expat, libidn, qtbase, qtwebkit, libvorbis }:
assert stdenv.system == "x86_64-linux";
assert stdenv.hostPlatform.system == "x86_64-linux";

stdenv.mkDerivation rec {
version = "beta_1.0.467.4929-r0"; # friendly to nix-env version sorting algo
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/audio/renoise/default.nix
Expand Up @@ -17,15 +17,15 @@ stdenv.mkDerivation rec {
version = "3.1.0";

src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
if builtins.isNull releasePath then
fetchurl {
url = "https://files.renoise.com/demo/Renoise_${urlVersion version}_Demo_x86_64.tar.bz2";
sha256 = "0pan68fr22xbj7a930y29527vpry3f07q3i9ya4fp6g7aawffsga";
}
else
releasePath
else if stdenv.system == "i686-linux" then
else if stdenv.hostPlatform.system == "i686-linux" then
if builtins.isNull releasePath then
fetchurl {
url = "http://files.renoise.com/demo/Renoise_${urlVersion version}_Demo_x86.tar.bz2";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/audio/transcribe/default.nix
Expand Up @@ -7,12 +7,12 @@ stdenv.mkDerivation rec {
name = "transcribe-${version}";
version = "8.40";

src = if stdenv.system == "i686-linux" then
src = if stdenv.hostPlatform.system == "i686-linux" then
fetchzip {
url = "https://www.seventhstring.com/xscribe/downlinux32_old/xscsetup.tar.gz";
sha256 = "1ngidmj9zz8bmv754s5xfsjv7v6xr03vck4kigzq4bpc9b1fdhjq";
}
else if stdenv.system == "x86_64-linux" then
else if stdenv.hostPlatform.system == "x86_64-linux" then
fetchzip {
url = "https://www.seventhstring.com/xscribe/downlinux64_old/xsc64setup.tar.gz";
sha256 = "0svzi8svj6zn06gj0hr8mpnhq4416dvb4g5al0gpb1g3paywdaf9";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/eclipse/build-eclipse.nix
Expand Up @@ -2,7 +2,7 @@
, zlib, jdk, glib, gtk3, libXtst, gsettings-desktop-schemas, webkitgtk
, makeWrapper, ... }:

{ name, src ? builtins.getAttr stdenv.system sources, sources ? null, description }:
{ name, src ? builtins.getAttr stdenv.hostPlatform.system sources, sources ? null, description }:

stdenv.mkDerivation rec {
inherit name src;
Expand Down
14 changes: 7 additions & 7 deletions pkgs/applications/editors/eclipse/default.nix
Expand Up @@ -27,24 +27,24 @@ rec {
name = "eclipse-cpp-4.7.0";
description = "Eclipse IDE for C/C++ Developers, Oxygen release";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/oxygen/R/eclipse-cpp-oxygen-R-linux-gtk-x86_64.tar.gz;
sha512 = "813c791e739d7d0e2ab242a5bacadca135bbeee20ef97aa830353cd90f63fa6e9c89cfcc6aadf635c742befe035bd6e3f15103013f63c419f6144e86ebde3ed1";
}
else if stdenv.system == "i686-linux" then
else if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/oxygen/R/eclipse-cpp-oxygen-R-linux-gtk.tar.gz;
sha512 = "2b50f4a00306a89cda1aaaa606e62285cacbf93464a9dd3f3319dca3e2c578b802e685de6f78e5e617d269e21271188effe73d41f491a6de946e28795d82db8a";
}
else throw "Unsupported system: ${stdenv.system}";
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
};

eclipse-cpp-37 = buildEclipse {
name = "eclipse-cpp-3.7";
description = "Eclipse IDE for C/C++ Developers";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk-x86_64.tar.gz;
sha256 = "14ppc9g9igzvj1pq7jl01vwhzb66nmzbl9wsdl1sf3xnwa9wnqk3";
Expand All @@ -65,7 +65,7 @@ rec {
name = "eclipse-modeling-4.7";
description = "Eclipse Modeling Tools";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/oxygen/R/eclipse-modeling-oxygen-R-linux-gtk-x86_64.tar.gz;
sha512 = "3b9a7ad4b5d6b77fbdd64e8d323e0adb6c2904763ad042b374b4d87cef8607408cb407e395870fc755d58c0c800e20818adcf456ebe193d76cede16c5fe12271";
Expand All @@ -81,7 +81,7 @@ rec {
name = "eclipse-modeling-3.6.2";
description = "Eclipse Modeling Tools (includes Incubating components)";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk-x86_64.tar.gz;
sha1 = "e96f5f006298f68476f4a15a2be8589158d5cc61";
Expand Down Expand Up @@ -151,7 +151,7 @@ rec {
name = "eclipse-scala-sdk-4.4.1";
description = "Eclipse IDE for Scala Developers";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl { # tested
url = https://downloads.typesafe.com/scalaide-pack/4.4.1-vfinal-luna-211-20160504/scala-SDK-4.4.1-vfinal-2.11-linux.gtk.x86_64.tar.gz;
sha256 = "4c2d1ac68384e12a11a851cf0fc7757aea087eba69329b21d539382a65340d27";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/jetbrains/common.nix
Expand Up @@ -42,7 +42,7 @@ with stdenv; lib.makeOverridable mkDerivation rec {
}
interpreter=$(echo ${stdenv.glibc.out}/lib/ld-linux*.so.2)
if [ "${stdenv.system}" == "x86_64-linux" ]; then
if [ "${stdenv.hostPlatform.system}" == "x86_64-linux" ]; then
target_size=$(get_file_size bin/fsnotifier64)
patchelf --set-interpreter "$interpreter" bin/fsnotifier64
munge_size_hack bin/fsnotifier64 $target_size
Expand Down

0 comments on commit 2c2f1e3

Please sign in to comment.