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,30 +1,31 @@
|
||||
{ stdenv, fetchurl, zlib, openssl, perl
|
||||
, pamSupport ? false, pam ? null
|
||||
, etcDir ? null
|
||||
}:
|
||||
|
||||
assert pamSupport -> pam != null;
|
||||
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "openssh-5.2p1";
|
||||
|
||||
|
||||
src = fetchurl {
|
||||
url = "ftp://ftp.nluug.nl/pub/security/OpenSSH/${name}.tar.gz";
|
||||
sha256 = "1bpc6i07hlakb9vrxr8zb1yxnc9avsv7kjwrcagdgcyh6w6728s0";
|
||||
};
|
||||
|
||||
|
||||
buildInputs = [zlib openssl perl
|
||||
(if pamSupport then pam else null)
|
||||
];
|
||||
|
||||
configureFlags = "
|
||||
--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 = "
|
||||
configureFlags=\"$configureFlags --with-privsep-path=$out/empty\"
|
||||
ensureDir $out/empty
|
||||
substituteInPlace pathnames.h --replace 'SSHDIR \"/ssh_config\"' '\"/etc/ssh/ssh_config\"'
|
||||
";
|
||||
|
||||
postInstall = "
|
||||
|
@ -1182,6 +1182,7 @@ let
|
||||
openssh = import ../tools/networking/openssh {
|
||||
inherit fetchurl stdenv zlib openssl pam perl;
|
||||
pamSupport = getPkgConfig "openssh" "pam" true;
|
||||
etcDir = getConfig [ "openssh" "etcDir" ] "/etc/ssh";
|
||||
};
|
||||
|
||||
openvpn = import ../tools/networking/openvpn {
|
||||
|
Loading…
Reference in New Issue
Block a user