forked from mirrors/nixpkgs
Die tabs die
This commit is contained in:
parent
331fa06c79
commit
2bb8d963b1
|
@ -10,31 +10,31 @@ in {
|
||||||
|
|
||||||
services.fprot = {
|
services.fprot = {
|
||||||
updater = {
|
updater = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable automatic F-Prot virus definitions database updates.
|
Whether to enable automatic F-Prot virus definitions database updates.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
productData = mkOption {
|
productData = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
product.data file. Defaults to the one supplied with installation package.
|
product.data file. Defaults to the one supplied with installation package.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
frequency = mkOption {
|
frequency = mkOption {
|
||||||
default = 30;
|
default = 30;
|
||||||
description = ''
|
description = ''
|
||||||
Update virus definitions every X minutes.
|
Update virus definitions every X minutes.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
licenseKeyfile = mkOption {
|
licenseKeyfile = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
License keyfile. Defaults to the one supplied with installation package.
|
License keyfile. Defaults to the one supplied with installation package.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -44,8 +44,8 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.updater.enable {
|
config = mkIf cfg.updater.enable {
|
||||||
|
|
||||||
services.fprot.updater.productData = "${pkgs.fprot}/opt/f-prot/product.data";
|
services.fprot.updater.productData = mkDefault "${pkgs.fprot}/opt/f-prot/product.data";
|
||||||
services.fprot.updater.licenseKeyfile = "${pkgs.fprot}/opt/f-prot/license.key";
|
services.fprot.updater.licenseKeyfile = mkDefault "${pkgs.fprot}/opt/f-prot/license.key";
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.fprot ];
|
environment.systemPackages = [ pkgs.fprot ];
|
||||||
environment.etc = singleton {
|
environment.etc = singleton {
|
||||||
|
@ -69,22 +69,22 @@ in {
|
||||||
|
|
||||||
jobs = {
|
jobs = {
|
||||||
fprot_updater = {
|
fprot_updater = {
|
||||||
name = "fprot-updater";
|
name = "fprot-updater";
|
||||||
task = true;
|
task = true;
|
||||||
|
|
||||||
# have to copy fpupdate executable because it insists on storing the virus database in the same dir
|
# have to copy fpupdate executable because it insists on storing the virus database in the same dir
|
||||||
preStart = ''
|
preStart = ''
|
||||||
mkdir -m 0755 -p ${stateDir}
|
mkdir -m 0755 -p ${stateDir}
|
||||||
chown ${fprotUser}:${fprotGroup} ${stateDir}
|
chown ${fprotUser}:${fprotGroup} ${stateDir}
|
||||||
cp ${pkgs.fprot}/opt/f-prot/fpupdate ${stateDir}
|
cp ${pkgs.fprot}/opt/f-prot/fpupdate ${stateDir}
|
||||||
ln -sf ${cfg.updater.productData} ${stateDir}/product.data
|
ln -sf ${cfg.updater.productData} ${stateDir}/product.data
|
||||||
'';
|
'';
|
||||||
#setuid = fprotUser;
|
#setuid = fprotUser;
|
||||||
#setgid = fprotGroup;
|
#setgid = fprotGroup;
|
||||||
exec = "/var/lib/fprot/fpupdate --keyfile ${cfg.updater.licenseKeyfile}";
|
exec = "/var/lib/fprot/fpupdate --keyfile ${cfg.updater.licenseKeyfile}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue