about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2014-12-30 04:36:14 +0100
committerVladimír Čunát <vcunat@gmail.com>2014-12-30 10:31:20 +0100
commit8cf4ef7ab747b3e3d0b1319de538257281355b33 (patch)
treefd7fc0c3fdfe2097fa2452543d699948e5a2eb20
parent488e6e6e9c214efcd902d733b70380365c4752c6 (diff)
downloadnixlib-8cf4ef7ab747b3e3d0b1319de538257281355b33.tar
nixlib-8cf4ef7ab747b3e3d0b1319de538257281355b33.tar.gz
nixlib-8cf4ef7ab747b3e3d0b1319de538257281355b33.tar.bz2
nixlib-8cf4ef7ab747b3e3d0b1319de538257281355b33.tar.lz
nixlib-8cf4ef7ab747b3e3d0b1319de538257281355b33.tar.xz
nixlib-8cf4ef7ab747b3e3d0b1319de538257281355b33.tar.zst
nixlib-8cf4ef7ab747b3e3d0b1319de538257281355b33.zip
merge #5505: use /run/current-system/sw/bin/*
A working /sbin/shutdown (usually provided by systemd) is required by
"rtcwake -m off". Creating a circular dependency on systemd for this
just isn't worth the trouble, so take the straightforward way out.

One could easily make the argument that rtcwake wants to shut down the
*currently running system*, and that the correct API for that *is* in
fact /run/current-system. And it makes a very tempting sort of sense.

@vcunat moved to postPatch and added #FIXME.
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 3b76eb63ea5f..3715a93d9328 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -8,6 +8,14 @@ stdenv.mkDerivation rec {
     sha256 = "e0457f715b73f4a349e1acb08cb410bf0edc9a74a3f75c357070f31f70e33cd6";
   };
 
+  #FIXME: make it also work on non-nixos?
+  postPatch = ''
+    # Substituting store paths would create a circular dependency on systemd
+    substituteInPlace include/pathnames.h \
+      --replace "/bin/login" "/run/current-system/sw/bin/login" \
+      --replace "/sbin/shutdown" "/run/current-system/sw/bin/shutdown"
+  '';
+
   crossAttrs = {
     # Work around use of `AC_RUN_IFELSE'.
     preConfigure = "export scanf_cv_type_modifier=ms";