summary refs log tree commit diff
path: root/pkgs/os-specific/linux/hibernate/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/hibernate/default.nix')
-rw-r--r--pkgs/os-specific/linux/hibernate/default.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/hibernate/default.nix b/pkgs/os-specific/linux/hibernate/default.nix
index 2b6a9bda374..91dc9068103 100644
--- a/pkgs/os-specific/linux/hibernate/default.nix
+++ b/pkgs/os-specific/linux/hibernate/default.nix
@@ -9,13 +9,25 @@ in
       sha256 = "1xpc2i16jczc3nhvxlkn6fb044srqrh528gnp92cwy4hxf2nzi1z";
     };
 
-    patches = [ ./install.patch ./gen-manpages.patch ];
+    patches = [ ./install.patch ./gen-manpages.patch ./hibernate.patch ];
 
     buildInputs = [ gawk ];
 
     installPhase = ''
       # FIXME: Storing config files under `$out/etc' is not very useful.
+
+      substituteInPlace "hibernate.sh" --replace \
+        'SWSUSP_D="/etc/hibernate"' "SWSUSP_D=\"$out/etc/hibernate\""
+
+      # Remove all references to `/bin' and `/sbin'.
+      for i in scriptlets.d/*
+      do
+        substituteInPlace "$i" --replace "/bin/" "" --replace "/sbin/" ""
+      done
+
       PREFIX="$out" CONFIG_PREFIX="$out" ./install.sh
+
+      ln -s "$out/share/hibernate/scriptlets.d" "$out/etc/hibernate"
     '';
 
     meta = {