From 1d828ffaab22825af408c245ca5df18bdc376f15 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Jun 2012 03:21:12 +0000 Subject: [PATCH] * systemd: use units in /etc rather than $out/etc. Also fix references to mount/umount. svn path=/nixpkgs/trunk/; revision=34332 --- pkgs/os-specific/linux/systemd/default.nix | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 27612ec50a461..142df5baddb45 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, udev, dbus, kmod -, xz, pam, acl, cryptsetup, libuuid, m4 }: +, xz, pam, acl, cryptsetup, libuuid, m4, utillinux }: stdenv.mkDerivation rec { name = "systemd-44"; @@ -16,6 +16,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--localstatedir=/var" + "--sysconfdir=/etc" "--with-distro=other" "--with-rootprefix=$(out)" "--with-rootprefix=$(out)" @@ -25,7 +26,24 @@ stdenv.mkDerivation rec { "--with-dbussessionservicedir=$(out)/share/dbus-1/services" ]; - installFlags = "localstatedir=$(TMPDIR)/var"; + preConfigure = + '' + for i in units/remount-rootfs.service src/remount-api-vfs.c src/mount.c; do + substituteInPlace $i \ + --replace /bin/mount ${utillinux}/bin/mount \ + --replace /bin/umount ${utillinux}/bin/umount + done + ''; + + installFlags = "localstatedir=$(TMPDIR)/var sysconfdir=$(out)/etc"; + + # Get rid of configuration-specific data. + postInstall = + '' + mkdir -p $out/example/systemd + mv $out/lib/{modules-load.d,binfmt.d,sysctl.d,tmpfiles.d} $out/example + mv $out/lib/systemd/{system,user} $out/example/systemd + ''; enableParallelBuilding = true;