OpenSSH: allow users to configure --sysconfdir via $NIXPKGS_CONFIG
The OpenSSH binaries built by the expression by default expect system-wide configuration files in "/etc/ssh", which is a bit of an impurity (and certainly inconsistent with the way other package handle --sysconfdir in Nix). Those who prefer a clean installation, can now configure that directory path. Adding the line "openssh = { etcDir = null; };" to $NIXPKGS_CONFIG configures OpenSSH to use the default location, i.e. $out/etc. Setting that attribute to a string will configure OpenSSH to use that concrete path instead. svn path=/nixpkgs/trunk/; revision=17570
This commit is contained in:
parent
d8d1aa8685
commit
9a833f026b
@ -1,5 +1,6 @@
|
|||||||
{ stdenv, fetchurl, zlib, openssl, perl
|
{ stdenv, fetchurl, zlib, openssl, perl
|
||||||
, pamSupport ? false, pam ? null
|
, pamSupport ? false, pam ? null
|
||||||
|
, etcDir ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert pamSupport -> pam != null;
|
assert pamSupport -> pam != null;
|
||||||
@ -18,13 +19,13 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
configureFlags = "
|
configureFlags = "
|
||||||
--with-mantype=man
|
--with-mantype=man
|
||||||
${if pamSupport then "--with-pam" else ""}
|
${if pamSupport then "--with-pam" else "--without-pam"}
|
||||||
|
${if etcDir != null then "--sysconfdir=${etcDir}" else ""}
|
||||||
";
|
";
|
||||||
|
|
||||||
preConfigure = "
|
preConfigure = "
|
||||||
configureFlags=\"$configureFlags --with-privsep-path=$out/empty\"
|
configureFlags=\"$configureFlags --with-privsep-path=$out/empty\"
|
||||||
ensureDir $out/empty
|
ensureDir $out/empty
|
||||||
substituteInPlace pathnames.h --replace 'SSHDIR \"/ssh_config\"' '\"/etc/ssh/ssh_config\"'
|
|
||||||
";
|
";
|
||||||
|
|
||||||
postInstall = "
|
postInstall = "
|
||||||
|
@ -1182,6 +1182,7 @@ let
|
|||||||
openssh = import ../tools/networking/openssh {
|
openssh = import ../tools/networking/openssh {
|
||||||
inherit fetchurl stdenv zlib openssl pam perl;
|
inherit fetchurl stdenv zlib openssl pam perl;
|
||||||
pamSupport = getPkgConfig "openssh" "pam" true;
|
pamSupport = getPkgConfig "openssh" "pam" true;
|
||||||
|
etcDir = getConfig [ "openssh" "etcDir" ] "/etc/ssh";
|
||||||
};
|
};
|
||||||
|
|
||||||
openvpn = import ../tools/networking/openvpn {
|
openvpn = import ../tools/networking/openvpn {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user