about summary refs log tree commit diff
path: root/pkgs/desktops
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2024-09-24 18:50:49 +0300
committerArtturin <Artturin@artturin.com>2024-09-25 00:04:37 +0300
commite0464e47880a69896f0fb1810f00e0de469f770a (patch)
tree7890601c5347b66e5c74671b9dbbcddf1b30d1c3 /pkgs/desktops
parentaaa7fb5840f278da8010fe7466c3d952f7e536da (diff)
treewide: replace `stdenv.is` with `stdenv.hostPlatform.is`
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
Diffstat (limited to 'pkgs/desktops')
-rw-r--r--pkgs/desktops/enlightenment/enlightenment/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix8
-rw-r--r--pkgs/desktops/gnome-2/platform/GConf/default.nix4
-rw-r--r--pkgs/desktops/gnustep/libobjc2/default.nix2
-rw-r--r--pkgs/desktops/lxqt/compton-conf/default.nix2
-rw-r--r--pkgs/desktops/lxqt/libdbusmenu-lxqt/default.nix2
-rw-r--r--pkgs/desktops/lxqt/libsysstat/default.nix2
-rw-r--r--pkgs/desktops/lxqt/qtermwidget/default.nix2
-rw-r--r--pkgs/desktops/mate/libmatemixer/default.nix2
-rw-r--r--pkgs/desktops/mate/mate-menus/default.nix2
11 files changed, 15 insertions, 15 deletions
diff --git a/pkgs/desktops/enlightenment/enlightenment/default.nix b/pkgs/desktops/enlightenment/enlightenment/default.nix
index 25faa26687ae4..198dae282dfae 100644
--- a/pkgs/desktops/enlightenment/enlightenment/default.nix
+++ b/pkgs/desktops/enlightenment/enlightenment/default.nix
@@ -16,7 +16,7 @@
 , udisks2
 , waylandSupport ? false, wayland-protocols, xwayland
 , bluetoothSupport ? true, bluez5
-, pulseSupport ? !stdenv.isDarwin, libpulseaudio
+, pulseSupport ? !stdenv.hostPlatform.isDarwin, libpulseaudio
 , directoryListingUpdater
 }:
 
diff --git a/pkgs/desktops/gnome-2/default.nix b/pkgs/desktops/gnome-2/default.nix
index 3f8d7c6340963..67af761d3a383 100644
--- a/pkgs/desktops/gnome-2/default.nix
+++ b/pkgs/desktops/gnome-2/default.nix
@@ -5,7 +5,7 @@ lib.makeScope pkgs.newScope (self: with self; {
 #### PLATFORM
 
   libIDL = callPackage ./platform/libIDL {
-    gettext = if stdenv.isDarwin then pkgs.gettext else null;
+    gettext = if stdenv.hostPlatform.isDarwin then pkgs.gettext else null;
   };
 
   ORBit2 = callPackage ./platform/ORBit2 { };
diff --git a/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix b/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix
index 902178d167063..94c3d49a97e0f 100644
--- a/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation (finalAttrs: {
     sha256 = "c585773743b1df8a04b1be7f7d90eecdf22681490d6810be54c81a7ae152191e";
   };
 
-  patches = lib.optionals stdenv.isDarwin [
+  patches = lib.optionals stdenv.hostPlatform.isDarwin [
     (fetchpatch {
       name = "change-igemacintegration-to-gtkosxapplication.patch";
       url = "https://gitlab.gnome.org/GNOME/gtksourceview/commit/e88357c5f210a8796104505c090fb6a04c213902.patch";
@@ -28,16 +28,16 @@ stdenv.mkDerivation (finalAttrs: {
     })
   ];
 
-  nativeBuildInputs = [ pkg-config intltool ] ++ lib.optionals stdenv.isDarwin [ autoreconfHook ];
+  nativeBuildInputs = [ pkg-config intltool ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ autoreconfHook ];
   buildInputs = [
     atk cairo glib gtk2
     pango libxml2Python perl
     gettext
-  ] ++ lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     gnome-common gtk-mac-integration-gtk2
   ];
 
-  preConfigure = lib.optionalString stdenv.isDarwin ''
+  preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
     intltoolize --force
   '';
 
diff --git a/pkgs/desktops/gnome-2/platform/GConf/default.nix b/pkgs/desktops/gnome-2/platform/GConf/default.nix
index 33430f453ab58..ea6730f88e2ee 100644
--- a/pkgs/desktops/gnome-2/platform/GConf/default.nix
+++ b/pkgs/desktops/gnome-2/platform/GConf/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ ORBit2 libxml2 ]
     # polkit requires pam, which requires shadow.h, which is not available on
     # darwin
-    ++ lib.optional (!stdenv.isDarwin) polkit;
+    ++ lib.optional (!stdenv.hostPlatform.isDarwin) polkit;
 
   propagatedBuildInputs = [ glib dbus-glib ];
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     # fixes the "libgconfbackend-oldxml.so is not portable" error on darwin
-    lib.optionals stdenv.isDarwin [ "--enable-static" ];
+    lib.optionals stdenv.hostPlatform.isDarwin [ "--enable-static" ];
 
   postPatch = ''
     2to3 --write --nobackup gsettings/gsettings-schema-convert
diff --git a/pkgs/desktops/gnustep/libobjc2/default.nix b/pkgs/desktops/gnustep/libobjc2/default.nix
index ce83250fe678e..ccbbdec13ac0f 100644
--- a/pkgs/desktops/gnustep/libobjc2/default.nix
+++ b/pkgs/desktops/gnustep/libobjc2/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: {
   cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" ];
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "Objective-C runtime for use with GNUstep";
     homepage = "https://gnustep.github.io/";
     license = licenses.mit;
diff --git a/pkgs/desktops/lxqt/compton-conf/default.nix b/pkgs/desktops/lxqt/compton-conf/default.nix
index be6d593b41778..2403975b481b7 100644
--- a/pkgs/desktops/lxqt/compton-conf/default.nix
+++ b/pkgs/desktops/lxqt/compton-conf/default.nix
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
   passthru.updateScript = gitUpdater { };
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     homepage = "https://github.com/lxqt/compton-conf";
     description = "GUI configuration tool for compton X composite manager";
     mainProgram = "compton-conf";
diff --git a/pkgs/desktops/lxqt/libdbusmenu-lxqt/default.nix b/pkgs/desktops/lxqt/libdbusmenu-lxqt/default.nix
index 9a49c10a1be9b..62504bb33b543 100644
--- a/pkgs/desktops/lxqt/libdbusmenu-lxqt/default.nix
+++ b/pkgs/desktops/lxqt/libdbusmenu-lxqt/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
   passthru.updateScript = gitUpdater { };
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "Qt implementation of the DBusMenu protocol";
     homepage = "https://github.com/lxqt/libdbusmenu-lxqt";
     license = licenses.lgpl21Plus;
diff --git a/pkgs/desktops/lxqt/libsysstat/default.nix b/pkgs/desktops/lxqt/libsysstat/default.nix
index 6f809629eaaa5..daaad022edf5d 100644
--- a/pkgs/desktops/lxqt/libsysstat/default.nix
+++ b/pkgs/desktops/lxqt/libsysstat/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   passthru.updateScript = gitUpdater { };
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "Library used to query system info and statistics";
     homepage = "https://github.com/lxqt/libsysstat";
     license = licenses.lgpl21Plus;
diff --git a/pkgs/desktops/lxqt/qtermwidget/default.nix b/pkgs/desktops/lxqt/qtermwidget/default.nix
index 51b9cef886aea..30fe20ebeefe4 100644
--- a/pkgs/desktops/lxqt/qtermwidget/default.nix
+++ b/pkgs/desktops/lxqt/qtermwidget/default.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
   passthru.updateScript = gitUpdater { };
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     homepage = "https://github.com/lxqt/qtermwidget";
     description = "Terminal emulator widget for Qt, used by QTerminal";
     license = licenses.gpl2Plus;
diff --git a/pkgs/desktops/mate/libmatemixer/default.nix b/pkgs/desktops/mate/libmatemixer/default.nix
index ebdd3eb07dda0..25b99584429f6 100644
--- a/pkgs/desktops/mate/libmatemixer/default.nix
+++ b/pkgs/desktops/mate/libmatemixer/default.nix
@@ -5,7 +5,7 @@
 , pkg-config
 , gettext
 , glib
-, alsaSupport ? stdenv.isLinux
+, alsaSupport ? stdenv.hostPlatform.isLinux
 , alsa-lib
 , udev
 , pulseaudioSupport ? config.pulseaudio or true
diff --git a/pkgs/desktops/mate/mate-menus/default.nix b/pkgs/desktops/mate/mate-menus/default.nix
index 9328147e642c8..31854538fb5ee 100644
--- a/pkgs/desktops/mate/mate-menus/default.nix
+++ b/pkgs/desktops/mate/mate-menus/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
   passthru.updateScript = mateUpdateScript { inherit pname; };
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "Menu system for MATE";
     homepage = "https://github.com/mate-desktop/mate-menus";
     license = with licenses; [ gpl2Plus lgpl2Plus ];