summary refs log tree commit diff
path: root/pkgs/tools/networking
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2009-10-01 12:07:33 +0000
committerPeter Simons <simons@cryp.to>2009-10-01 12:07:33 +0000
commit9a833f026bf55443feb3f69d0a4d3adac2da6e06 (patch)
treeb5de9a690fcc763ef3fbbee7a03f5cbdd19a8c19 /pkgs/tools/networking
parentd8d1aa868590fc11794260b89c95c13a2c53e653 (diff)
downloadnixpkgs-9a833f026bf55443feb3f69d0a4d3adac2da6e06.tar
nixpkgs-9a833f026bf55443feb3f69d0a4d3adac2da6e06.tar.gz
nixpkgs-9a833f026bf55443feb3f69d0a4d3adac2da6e06.tar.bz2
nixpkgs-9a833f026bf55443feb3f69d0a4d3adac2da6e06.tar.lz
nixpkgs-9a833f026bf55443feb3f69d0a4d3adac2da6e06.tar.xz
nixpkgs-9a833f026bf55443feb3f69d0a4d3adac2da6e06.tar.zst
nixpkgs-9a833f026bf55443feb3f69d0a4d3adac2da6e06.zip
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
Diffstat (limited to 'pkgs/tools/networking')
-rw-r--r--pkgs/tools/networking/openssh/default.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/pkgs/tools/networking/openssh/default.nix b/pkgs/tools/networking/openssh/default.nix
index 69e9d2c849b..6b3b09805cc 100644
--- a/pkgs/tools/networking/openssh/default.nix
+++ b/pkgs/tools/networking/openssh/default.nix
@@ -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 = "