removed all __primops from nixos
svn path=/nixos/trunk/; revision=15696
This commit is contained in:
parent
6b2f1a0ce9
commit
dafb4b8c5d
@ -24,7 +24,7 @@ let
|
|||||||
(
|
(
|
||||||
let
|
let
|
||||||
inherit (pkgs.lib) attrByPath;
|
inherit (pkgs.lib) attrByPath;
|
||||||
inherit (builtins) attrNames pathExists map;
|
inherit (builtins) attrNames pathExists map hasAttr getAttr;
|
||||||
services = attrByPath [ "servicesProposal" ] {} config;
|
services = attrByPath [ "servicesProposal" ] {} config;
|
||||||
nameToJobs = name : (
|
nameToJobs = name : (
|
||||||
(
|
(
|
||||||
@ -54,10 +54,10 @@ let
|
|||||||
else abort "service ${name} requested but there is no ${p}.nix or ${p}/default.nix file!";
|
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;
|
options = (jobFunc (args (abort "you can't use configV within options!"))).options;
|
||||||
errorWhere = name : "${name} of service ${builtins.toString path}";
|
errorWhere = name : "${name} of service ${builtins.toString path}";
|
||||||
configV = name : if (__hasAttr name options ) then
|
configV = name : if (hasAttr name options ) then
|
||||||
let opt = (__getAttr name options ); # this config option description
|
let opt = (getAttr name options ); # this config option description
|
||||||
in if (__hasAttr name thisConfig )
|
in if (hasAttr name thisConfig )
|
||||||
then let v = (__getAttr name thisConfig); in if opt ? apply then opt.apply v else v
|
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 if opt ? default then opt.default else abort "you need to specify the configuration option ${errorWhere name}"
|
||||||
else abort "unkown option ${errorWhere name}";
|
else abort "unkown option ${errorWhere name}";
|
||||||
checkConfig = (attrByPath ["environment" "checkConfigurationOptions"]
|
checkConfig = (attrByPath ["environment" "checkConfigurationOptions"]
|
||||||
|
@ -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 = {
|
options = {
|
||||||
description = "tightvnc vnc server (share virtual desktop over network";
|
description = "tightvnc vnc server (share virtual desktop over network";
|
||||||
|
|
||||||
@ -18,7 +20,7 @@
|
|||||||
value must be something between 8 and 32
|
value must be something between 8 and 32
|
||||||
'';
|
'';
|
||||||
apply = x: "-depth '${x}'";
|
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 {
|
display = mkOption {
|
||||||
default = ":8";
|
default = ":8";
|
||||||
@ -33,7 +35,7 @@
|
|||||||
Can be created using vncpasswd
|
Can be created using vncpasswd
|
||||||
'';
|
'';
|
||||||
apply = x: "-auth '${x}'";
|
apply = x: "-auth '${x}'";
|
||||||
check = __pathExists;
|
check = pathExists;
|
||||||
};
|
};
|
||||||
httpPort = mkOption {
|
httpPort = mkOption {
|
||||||
default = "-httpport 5900";
|
default = "-httpport 5900";
|
||||||
@ -82,7 +84,7 @@ description \"${name}\"
|
|||||||
start on network-interfaces/started and xserver/started
|
start on network-interfaces/started and xserver/started
|
||||||
stop on network-interfaces/stop or xserver/stop
|
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 ) ) }
|
||||||
";
|
";
|
||||||
} ) ];
|
} ) ];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user