From dafb4b8c5d52132f25504308e16be753f193e68c Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sun, 24 May 2009 10:58:28 +0000 Subject: [PATCH] removed all __primops from nixos svn path=/nixos/trunk/; revision=15696 --- upstart-jobs/default.nix | 10 +++++----- upstart-jobs/new-proposal/tightvnc.nix | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 2216a564963..47356114788 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -24,7 +24,7 @@ let ( let inherit (pkgs.lib) attrByPath; - inherit (builtins) attrNames pathExists map; + inherit (builtins) attrNames pathExists map hasAttr getAttr; services = attrByPath [ "servicesProposal" ] {} config; nameToJobs = name : ( ( @@ -54,10 +54,10 @@ let else abort "service ${name} requested but there is no ${p}.nix or ${p}/default.nix file!"; options = (jobFunc (args (abort "you can't use configV within options!"))).options; errorWhere = name : "${name} of service ${builtins.toString path}"; - configV = name : if (__hasAttr name options ) then - let opt = (__getAttr name options ); # this config option description - in if (__hasAttr name thisConfig ) - then let v = (__getAttr name thisConfig); in if opt ? apply then opt.apply v else v + configV = name : if (hasAttr name options ) then + let opt = (getAttr name options ); # this config option description + in if (hasAttr name thisConfig ) + then let v = (getAttr name thisConfig); in if opt ? apply then opt.apply v else v else if opt ? default then opt.default else abort "you need to specify the configuration option ${errorWhere name}" else abort "unkown option ${errorWhere name}"; checkConfig = (attrByPath ["environment" "checkConfigurationOptions"] diff --git a/upstart-jobs/new-proposal/tightvnc.nix b/upstart-jobs/new-proposal/tightvnc.nix index 342910fc886..b1f8e084810 100644 --- a/upstart-jobs/new-proposal/tightvnc.nix +++ b/upstart-jobs/new-proposal/tightvnc.nix @@ -1,4 +1,6 @@ -{ path, thisConfig, config, lib, pkgs, upstartHelpers } : with upstartHelpers; rec { +{ path, thisConfig, config, lib, pkgs, upstartHelpers } : with upstartHelpers; +let inherit (builtins) lessThan pathExists attrNames; in +rec { options = { description = "tightvnc vnc server (share virtual desktop over network"; @@ -18,7 +20,7 @@ value must be something between 8 and 32 ''; apply = x: "-depth '${x}'"; - check = x: (__lessThan x 33) && (7 __lessThan x); # not yet used + check = x: (lessThan x 33) && (7 lessThan x); # not yet used }; display = mkOption { default = ":8"; @@ -33,7 +35,7 @@ Can be created using vncpasswd ''; apply = x: "-auth '${x}'"; - check = __pathExists; + check = pathExists; }; httpPort = mkOption { default = "-httpport 5900"; @@ -82,7 +84,7 @@ description \"${name}\" start on network-interfaces/started and xserver/started stop on network-interfaces/stop or xserver/stop -exec ${pkgs.tightvnc}/bin/Xvnc -fp unix/:7100 ${lib.concatStringsSep " " (lib.mapIf (x : x != "description") configV (__attrNames options ) ) } +exec ${pkgs.tightvnc}/bin/Xvnc -fp unix/:7100 ${lib.concatStringsSep " " (lib.mapIf (x : x != "description") configV (attrNames options ) ) } "; } ) ]; }