diff --git a/nixos/tests/sssd-ldap.nix b/nixos/tests/sssd-ldap.nix index 9bc991f6ddce..9d18ef64f39d 100644 --- a/nixos/tests/sssd-ldap.nix +++ b/nixos/tests/sssd-ldap.nix @@ -99,6 +99,7 @@ import ./make-test-python.nix ( objectClass: posixAccount userPassword: ${testPassword} homeDirectory: /home/${testUser} + loginShell: /run/current-system/sw/bin/bash uidNumber: 1234 gidNumber: 1234 cn: "" diff --git a/pkgs/by-name/sh/shadow/package.nix b/pkgs/by-name/sh/shadow/package.nix index 74cbbbe5b574..719bfb4fb1ff 100644 --- a/pkgs/by-name/sh/shadow/package.nix +++ b/pkgs/by-name/sh/shadow/package.nix @@ -2,7 +2,6 @@ lib, stdenv, fetchFromGitHub, - runtimeShell, nixosTests, autoreconfHook, bison, @@ -49,8 +48,6 @@ stdenv.mkDerivation rec { "man" ]; - RUNTIME_SHELL = runtimeShell; - nativeBuildInputs = [ autoreconfHook bison @@ -74,13 +71,17 @@ stdenv.mkDerivation rec { ./keep-path.patch # Obtain XML resources from XML catalog (patch adapted from gtk-doc) ./respect-xml-catalog-files-var.patch - ./runtime-shell.patch ./fix-install-with-tcb.patch ]; - # The nix daemon often forbids even creating set[ug]id files. postPatch = '' + # The nix daemon often forbids even creating set[ug]id files sed 's/^\(s[ug]idperms\) = [0-9]755/\1 = 0755/' -i src/Makefile.am + + # The default shell is not defined at build time of the package. It is + # decided at build time of the NixOS configration. Thus, don't decide this + # here but just point to the location of the shell on the system. + substituteInPlace configure.ac --replace-fail '$SHELL' /bin/sh ''; # `AC_FUNC_SETPGRP' is not cross-compilation capable. diff --git a/pkgs/by-name/sh/shadow/runtime-shell.patch b/pkgs/by-name/sh/shadow/runtime-shell.patch deleted file mode 100644 index 0b2e68e330e4..000000000000 --- a/pkgs/by-name/sh/shadow/runtime-shell.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index e4c6aaec..03883ad7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -682,7 +682,7 @@ if test "$enable_utmpx" = "yes"; then - [Define if utmpx should be used]) - fi - --AC_DEFINE_UNQUOTED(SHELL, ["$SHELL"], [The default shell.]) -+AC_DEFINE_UNQUOTED(SHELL, ["$RUNTIME_SHELL"], [The runtime shell.]) - - AM_GNU_GETTEXT_VERSION(0.16) - AM_GNU_GETTEXT([external], [need-ngettext])