about summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-04-13 16:48:38 -0400
committerGitHub <noreply@github.com>2020-04-13 16:48:38 -0400
commite520d6af29158ff6d17c34ec16b1f2e79bccad45 (patch)
treeddf031dda697cba7549ed8357ca3454c30433fbd /nixos/modules/services
parent940c35568bc2fa135eafe0817027c765d9840469 (diff)
parentc6ff360cc437d366c10f2f827edd5a7fb47e73c3 (diff)
downloadnixlib-e520d6af29158ff6d17c34ec16b1f2e79bccad45.tar
nixlib-e520d6af29158ff6d17c34ec16b1f2e79bccad45.tar.gz
nixlib-e520d6af29158ff6d17c34ec16b1f2e79bccad45.tar.bz2
nixlib-e520d6af29158ff6d17c34ec16b1f2e79bccad45.tar.lz
nixlib-e520d6af29158ff6d17c34ec16b1f2e79bccad45.tar.xz
nixlib-e520d6af29158ff6d17c34ec16b1f2e79bccad45.tar.zst
nixlib-e520d6af29158ff6d17c34ec16b1f2e79bccad45.zip
Merge pull request #84415 from matthewbauer/mb-cross-fixes-april2020
Cross compilation fixes [april 2020]
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/system/nscd.nix12
-rw-r--r--nixos/modules/services/x11/gdk-pixbuf.nix4
2 files changed, 10 insertions, 6 deletions
diff --git a/nixos/modules/services/system/nscd.nix b/nixos/modules/services/system/nscd.nix
index e11f7e049d8f..af26dd847073 100644
--- a/nixos/modules/services/system/nscd.nix
+++ b/nixos/modules/services/system/nscd.nix
@@ -7,6 +7,10 @@ let
   nssModulesPath = config.system.nssModules.path;
   cfg = config.services.nscd;
 
+  nscd = if pkgs.stdenv.hostPlatform.libc == "glibc"
+         then pkgs.stdenv.cc.libc.bin
+         else pkgs.glibc.bin;
+
 in
 
 {
@@ -59,16 +63,16 @@ in
         # files. So prefix the ExecStart command with "!" to prevent systemd
         # from dropping privileges early. See ExecStart in systemd.service(5).
         serviceConfig =
-          { ExecStart = "!@${pkgs.glibc.bin}/sbin/nscd nscd";
+          { ExecStart = "!@${nscd}/sbin/nscd nscd";
             Type = "forking";
             DynamicUser = true;
             RuntimeDirectory = "nscd";
             PIDFile = "/run/nscd/nscd.pid";
             Restart = "always";
             ExecReload =
-              [ "${pkgs.glibc.bin}/sbin/nscd --invalidate passwd"
-                "${pkgs.glibc.bin}/sbin/nscd --invalidate group"
-                "${pkgs.glibc.bin}/sbin/nscd --invalidate hosts"
+              [ "${nscd}/sbin/nscd --invalidate passwd"
+                "${nscd}/sbin/nscd --invalidate group"
+                "${nscd}/sbin/nscd --invalidate hosts"
               ];
           };
       };
diff --git a/nixos/modules/services/x11/gdk-pixbuf.nix b/nixos/modules/services/x11/gdk-pixbuf.nix
index 9ad926369ec7..e6a24a2f1a30 100644
--- a/nixos/modules/services/x11/gdk-pixbuf.nix
+++ b/nixos/modules/services/x11/gdk-pixbuf.nix
@@ -19,7 +19,7 @@ let
           continue
         fi
         GDK_PIXBUF_MODULEDIR="$module_dir" \
-          ${pkgs.gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders
+          ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} ${pkgs.gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders
       done
     ) > "$out"
   '';
@@ -37,7 +37,7 @@ in
   # If there is any package configured in modulePackages, we generate the
   # loaders.cache based on that and set the environment variable
   # GDK_PIXBUF_MODULE_FILE to point to it.
-  config = mkIf (cfg.modulePackages != []) {
+  config = mkIf (cfg.modulePackages != [] || pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform) {
     environment.variables = {
       GDK_PIXBUF_MODULE_FILE = "${loadersCache}";
     };