Apply Eelco Dolstra's formatting suggestions
svn path=/nixos/trunk/; revision=18436
This commit is contained in:
parent
26f83d65e4
commit
ea2417ac87
|
@ -4,7 +4,9 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (pkgs.lib) mkOption mkIf;
|
inherit (pkgs.lib) mkOption mkIf;
|
||||||
|
|
||||||
cfg = config.services.gvpe;
|
cfg = config.services.gvpe;
|
||||||
|
|
||||||
finalConfig = if cfg.configFile != null then
|
finalConfig = if cfg.configFile != null then
|
||||||
cfg.configFile
|
cfg.configFile
|
||||||
else if cfg.configText != null then
|
else if cfg.configText != null then
|
||||||
|
@ -14,6 +16,7 @@ let
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw "You must either specify contents of the config file or the config file itself for GVPE";
|
throw "You must either specify contents of the config file or the config file itself for GVPE";
|
||||||
|
|
||||||
ifupScript = if cfg.ipAddress == null || cfg.subnet == null then
|
ifupScript = if cfg.ipAddress == null || cfg.subnet == null then
|
||||||
throw "Specify IP address and subnet (with mask) for GVPE"
|
throw "Specify IP address and subnet (with mask) for GVPE"
|
||||||
else if cfg.nodename == null then
|
else if cfg.nodename == null then
|
||||||
|
@ -34,10 +37,12 @@ let
|
||||||
'';
|
'';
|
||||||
executable = true;
|
executable = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
exec = "${pkgs.gvpe}/sbin/gvpe -c /var/gvpe -D ${cfg.nodename} "
|
exec = "${pkgs.gvpe}/sbin/gvpe -c /var/gvpe -D ${cfg.nodename} "
|
||||||
+ " ${cfg.nodename}.pid-file=/var/gvpe/gvpe.pid"
|
+ " ${cfg.nodename}.pid-file=/var/gvpe/gvpe.pid"
|
||||||
+ " ${cfg.nodename}.if-up=if-up"
|
+ " ${cfg.nodename}.if-up=if-up"
|
||||||
+ " &> /var/log/gvpe";
|
+ " &> /var/log/gvpe";
|
||||||
|
|
||||||
inherit (cfg) startOn stopOn;
|
inherit (cfg) startOn stopOn;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -116,8 +121,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable
|
config = mkIf cfg.enable {
|
||||||
{
|
|
||||||
jobs.gvpe = {
|
jobs.gvpe = {
|
||||||
description = "GNU Virtual Private Ethernet node";
|
description = "GNU Virtual Private Ethernet node";
|
||||||
|
|
||||||
|
@ -129,7 +133,7 @@ in
|
||||||
chown root /var/gvpe
|
chown root /var/gvpe
|
||||||
chmod 700 /var/gvpe
|
chmod 700 /var/gvpe
|
||||||
cp ${finalConfig} /var/gvpe/gvpe.conf
|
cp ${finalConfig} /var/gvpe/gvpe.conf
|
||||||
cp ${ifupScript} /var/gvpe/if-up
|
cp ${ifupScript} /var/gvpe/if-up
|
||||||
'';
|
'';
|
||||||
|
|
||||||
inherit exec;
|
inherit exec;
|
||||||
|
|
Loading…
Reference in New Issue