From 9a833f026bf55443feb3f69d0a4d3adac2da6e06 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 1 Oct 2009 12:07:33 +0000 Subject: [PATCH] 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 --- pkgs/tools/networking/openssh/default.nix | 11 ++++++----- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 7 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 = " diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 498a255253b..d5ba6486f2a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 {