summary refs log tree commit diff
path: root/pkgs/os-specific/linux/util-linux/default.nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-07-23 17:03:39 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-02 15:12:11 -0400
commitf83b5e4f7a7e1136237b434811914f3c79f43c46 (patch)
treec920fda1a5efa52a9bdc759c441626da4d3e90bb /pkgs/os-specific/linux/util-linux/default.nix
parente517da392990b219f81611a615088045f3e04fde (diff)
downloadnixpkgs-f83b5e4f7a7e1136237b434811914f3c79f43c46.tar
nixpkgs-f83b5e4f7a7e1136237b434811914f3c79f43c46.tar.gz
nixpkgs-f83b5e4f7a7e1136237b434811914f3c79f43c46.tar.bz2
nixpkgs-f83b5e4f7a7e1136237b434811914f3c79f43c46.tar.lz
nixpkgs-f83b5e4f7a7e1136237b434811914f3c79f43c46.tar.xz
nixpkgs-f83b5e4f7a7e1136237b434811914f3c79f43c46.tar.zst
nixpkgs-f83b5e4f7a7e1136237b434811914f3c79f43c46.zip
util-linux: Clean up to use less bash
Diffstat (limited to 'pkgs/os-specific/linux/util-linux/default.nix')
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index d2f75f5875e..1a7232afedb 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -28,10 +28,6 @@ in stdenv.mkDerivation rec {
       --replace "/bin/umount" "$out/bin/umount"
   '';
 
-  preConfigure = lib.optionalString (systemd != null) ''
-    configureFlags+=" --with-systemd --with-systemdsystemunitdir=$bin/lib/systemd/system/"
-  '';
-
   # !!! It would be better to obtain the path to the mount helpers
   # (/sbin/mount.*) through an environment variable, but that's
   # somewhat risky because we have to consider that mount can setuid
@@ -43,8 +39,11 @@ in stdenv.mkDerivation rec {
     "--disable-use-tty-group"
     "--enable-fs-paths-default=/run/wrappers/bin:/var/run/current-system/sw/bin:/sbin"
     "--disable-makeinstall-setuid" "--disable-makeinstall-chown"
-  ] ++ lib.optional (ncurses == null) "--without-ncurses"
-    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    (lib.withFeature (ncurses != null) "ncurses")
+    (lib.withFeature (systemd != null) "systemd")
+    (lib.withFeatureAs (systemd != null)
+       "systemdsystemunitdir" "$bin/lib/systemd/system/")
+  ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
        "scanf_cv_type_modifier=ms"
   ;