about summary refs log tree commit diff
path: root/pkgs/desktops/gnome/core/gdm/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/desktops/gnome/core/gdm/default.nix')
-rw-r--r--pkgs/desktops/gnome/core/gdm/default.nix35
1 files changed, 18 insertions, 17 deletions
diff --git a/pkgs/desktops/gnome/core/gdm/default.nix b/pkgs/desktops/gnome/core/gdm/default.nix
index f44278f896c3c..25f9fe8c63401 100644
--- a/pkgs/desktops/gnome/core/gdm/default.nix
+++ b/pkgs/desktops/gnome/core/gdm/default.nix
@@ -5,7 +5,6 @@
 , substituteAll
 , meson
 , ninja
-, rsync
 , pkg-config
 , glib
 , itstool
@@ -70,7 +69,6 @@ stdenv.mkDerivation (finalAttrs: {
     meson
     ninja
     pkg-config
-    rsync
     gobject-introspection
   ];
 
@@ -131,33 +129,36 @@ stdenv.mkDerivation (finalAttrs: {
   '';
 
   preInstall = ''
-    install -D ${override} $DESTDIR/$out/share/glib-2.0/schemas/org.gnome.login-screen.gschema.override
+    install -D ${override} "$DESTDIR/$out/share/glib-2.0/schemas/org.gnome.login-screen.gschema.override"
   '';
 
   postInstall = ''
     # Move stuff from DESTDIR to proper location.
-    # We use rsync to merge the directories.
-    rsync --archive "$DESTDIR/etc" "$out"
-    rm --recursive "$DESTDIR/etc"
     for o in $(getAllOutputNames); do
+        # debug is created later by _separateDebugInfo hook.
         if [[ "$o" = "debug" ]]; then continue; fi
-        rsync --archive "$DESTDIR/''${!o}" "$(dirname "''${!o}")"
-        rm --recursive "$DESTDIR/''${!o}"
+        mv "$DESTDIR''${!o}" "$(dirname "''${!o}")"
     done
-    # Ensure the DESTDIR is removed.
-    rmdir "$DESTDIR/nix/store" "$DESTDIR/nix" "$DESTDIR"
+
+    mv "$DESTDIR/etc" "$out"
+
+    # Ensure we did not forget to install anything.
+    rmdir --parents --ignore-fail-on-non-empty "$DESTDIR${builtins.storeDir}"
+    ! test -e "$DESTDIR"
 
     # We are setting DESTDIR so the post-install script does not compile the schemas.
     glib-compile-schemas "$out/share/glib-2.0/schemas"
   '';
 
-  # HACK: We want to install configuration files to $out/etc
-  # but GDM should read them from /etc on a NixOS system.
-  # With autotools, it was possible to override Make variables
-  # at install time but Meson does not support this
-  # so we need to convince it to install all files to a temporary
-  # location using DESTDIR and then move it to proper one in postInstall.
-  DESTDIR = "${placeholder "out"}/dest";
+  env = {
+    # HACK: We want to install configuration files to $out/etc
+    # but GDM should read them from /etc on a NixOS system.
+    # With autotools, it was possible to override Make variables
+    # at install time but Meson does not support this
+    # so we need to convince it to install all files to a temporary
+    # location using DESTDIR and then move it to proper one in postInstall.
+    DESTDIR = "dest";
+  };
 
   separateDebugInfo = true;