define top-level attrs for getent, getconf
Note that currently getent is explicitly taken from "glibc.bin", regardless of build configuration which this preserves for now. (on non-musl anyway)
This commit is contained in:
@@ -7,18 +7,13 @@
|
|||||||
, autoreconfHook, gettext, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_45
|
, autoreconfHook, gettext, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_45
|
||||||
, ninja, meson, python3Packages, glibcLocales
|
, ninja, meson, python3Packages, glibcLocales
|
||||||
, patchelf
|
, patchelf
|
||||||
, musl-getent ? null
|
, getent
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert stdenv.isLinux;
|
assert stdenv.isLinux;
|
||||||
|
|
||||||
let
|
let
|
||||||
pythonLxmlEnv = python3Packages.python.withPackages ( ps: with ps; [ python3Packages.lxml ]);
|
pythonLxmlEnv = python3Packages.python.withPackages ( ps: with ps; [ python3Packages.lxml ]);
|
||||||
getent-bin =
|
|
||||||
if stdenv.hostPlatform.libc == "glibc" then stdenv.cc.libc.bin
|
|
||||||
else if stdenv.hostPlatform.isMusl then "${musl-getent}"
|
|
||||||
else throw "unsupported abi for systemd";
|
|
||||||
getent = "${getent-bin}/bin/getent";
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@@ -40,7 +35,7 @@ in
|
|||||||
ninja meson
|
ninja meson
|
||||||
coreutils # meson calls date, stat etc.
|
coreutils # meson calls date, stat etc.
|
||||||
pythonLxmlEnv glibcLocales
|
pythonLxmlEnv glibcLocales
|
||||||
patchelf getent-bin
|
patchelf getent
|
||||||
];
|
];
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ linuxHeaders libcap kmod xz pam acl
|
[ linuxHeaders libcap kmod xz pam acl
|
||||||
@@ -114,7 +109,7 @@ in
|
|||||||
for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c units/emergency.service.in units/rescue.service.in src/journal/cat.c src/core/shutdown.c src/nspawn/nspawn.c src/shared/generator.c; do
|
for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c units/emergency.service.in units/rescue.service.in src/journal/cat.c src/core/shutdown.c src/nspawn/nspawn.c src/shared/generator.c; do
|
||||||
test -e $i
|
test -e $i
|
||||||
substituteInPlace $i \
|
substituteInPlace $i \
|
||||||
--replace /usr/bin/getent ${getent} \
|
--replace /usr/bin/getent ${getent}/bin/getent \
|
||||||
--replace /sbin/swapon ${utillinux.bin}/sbin/swapon \
|
--replace /sbin/swapon ${utillinux.bin}/sbin/swapon \
|
||||||
--replace /sbin/swapoff ${utillinux.bin}/sbin/swapoff \
|
--replace /sbin/swapoff ${utillinux.bin}/sbin/swapoff \
|
||||||
--replace /sbin/fsck ${utillinux.bin}/sbin/fsck \
|
--replace /sbin/fsck ${utillinux.bin}/sbin/fsck \
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ stdenv, fetchurl, coreutils, utillinux,
|
{ stdenv, fetchurl, coreutils, utillinux,
|
||||||
nettools, kbd, bc, which, gnused, gnugrep,
|
nettools, kbd, bc, which, gnused, gnugrep,
|
||||||
groff, man-db, glibc, musl-getent, libiconv, pcre2,
|
groff, man-db, getent, libiconv, pcre2,
|
||||||
gettext, ncurses, python3
|
gettext, ncurses, python3
|
||||||
|
|
||||||
, writeText
|
, writeText
|
||||||
@@ -12,9 +12,6 @@
|
|||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
getent = if stdenv.hostPlatform.isMusl
|
|
||||||
then "${musl-getent}/bin/getent"
|
|
||||||
else "${glibc.bin}/bin/getent";
|
|
||||||
etcConfigAppendixText = ''
|
etcConfigAppendixText = ''
|
||||||
############### ↓ Nix hook for sourcing /etc/fish/config.fish ↓ ###############
|
############### ↓ Nix hook for sourcing /etc/fish/config.fish ↓ ###############
|
||||||
# #
|
# #
|
||||||
@@ -145,7 +142,7 @@ let
|
|||||||
sed -e "s| ul| ${utillinux}/bin/ul|" \
|
sed -e "s| ul| ${utillinux}/bin/ul|" \
|
||||||
-i "$out/share/fish/functions/__fish_print_help.fish"
|
-i "$out/share/fish/functions/__fish_print_help.fish"
|
||||||
for cur in $out/share/fish/functions/*.fish; do
|
for cur in $out/share/fish/functions/*.fish; do
|
||||||
sed -e "s|/usr/bin/getent|${getent}|" \
|
sed -e "s|/usr/bin/getent|${getent}/bin/getent|" \
|
||||||
-i "$cur"
|
-i "$cur"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -13361,6 +13361,14 @@ with pkgs;
|
|||||||
musl-fts = callPackage ../os-specific/linux/musl/fts.nix { };
|
musl-fts = callPackage ../os-specific/linux/musl/fts.nix { };
|
||||||
musl-getconf = callPackage ../os-specific/linux/musl/getconf.nix { };
|
musl-getconf = callPackage ../os-specific/linux/musl/getconf.nix { };
|
||||||
musl-getent = callPackage ../os-specific/linux/musl/getent.nix { };
|
musl-getent = callPackage ../os-specific/linux/musl/getent.nix { };
|
||||||
|
getent =
|
||||||
|
if hostPlatform.isMusl then musl-getent
|
||||||
|
# This may not be right on other platforms, but preserves existing behavior
|
||||||
|
else /* if hostPlatform.libc == "glibc" then */ glibc.bin;
|
||||||
|
getconf =
|
||||||
|
if hostPlatform.isMusl then musl-getconf
|
||||||
|
# This may not be right on other platforms, but preserves existing behavior
|
||||||
|
else /* if hostPlatform.libc == "glibc" then */ glibc.bin;
|
||||||
|
|
||||||
nettools = callPackage ../os-specific/linux/net-tools { };
|
nettools = callPackage ../os-specific/linux/net-tools { };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user