From d9fb721e1a1bd7a9f45a22f9a835d39d0f31a9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 15 Mar 2008 23:39:18 +0000 Subject: [PATCH] Add `makePortmap' function, for use by NixOS. svn path=/nixpkgs/trunk/; revision=11139 --- pkgs/servers/portmap/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/servers/portmap/default.nix b/pkgs/servers/portmap/default.nix index df50c3320296..3664bdba661d 100644 --- a/pkgs/servers/portmap/default.nix +++ b/pkgs/servers/portmap/default.nix @@ -17,9 +17,9 @@ stdenv.mkDerivation rec { makeFlags = lib.concatStringsSep " " - (lib.optional daemonUser "RPCUSER=\"${daemonUser}\"" - ++ lib.optional daemonUID "DAEMON_UID=${daemonUID}" - ++ lib.optional daemonGID "DAEMON_GID=${daemonGID}"); + (lib.optional (daemonUser != false) "RPCUSER=\"${daemonUser}\"" + ++ lib.optional (daemonUID != false) "DAEMON_UID=${toString daemonUID}" + ++ lib.optional (daemonGID != false) "DAEMON_GID=${toString daemonGID}"); buildInputs = [ tcpWrapper ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2dcb1ee8619e..805e656aa99d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3656,14 +3656,15 @@ rec { inherit fetchurl stdenv apacheHttpd jdk; }; - portmap = import ../servers/portmap { - inherit fetchurl stdenv lib tcpWrapper; + # This function is typically called by the NixOS Upstart job to specify the + # right UID/GID for `portmap'. + makePortmap = { daemonUser ? false, daemonGID ? false, daemonUID ? false }: + (import ../servers/portmap { + inherit fetchurl stdenv lib tcpWrapper + daemonUser daemonGID daemonUID; + }); - # This settings should typically be defined by NixOS Upstart job. - daemonUser = false; - daemonGID = false; - daemonUID = false; - }; + portmap = (makePortmap); mysql4 = import ../servers/sql/mysql { inherit fetchurl stdenv ncurses zlib perl;