services/foldingathome: add fah module
This commit is contained in:
parent
d2bc991e68
commit
bdc3b61787
3 changed files with 42 additions and 16 deletions
32
modules/modules/services/foldingathome.nix
Normal file
32
modules/modules/services/foldingathome.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ config, lib, ... }:
|
||||
with lib;
|
||||
with lib.hlissner;
|
||||
let
|
||||
cfg = config.modules.services.foldingathome;
|
||||
in
|
||||
{
|
||||
options.modules.services.foldingathome = with types; {
|
||||
enable = mkBoolOpt false;
|
||||
user = mkOpt str config.user.name;
|
||||
daemonNiceLevel = mkOpt int 10;
|
||||
extra = {
|
||||
control = mkBoolOpt false;
|
||||
viewer = mkBoolOpt false;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enable {
|
||||
services.foldingathome = {
|
||||
enable = true;
|
||||
user = cfg.user;
|
||||
daemonNiceLevel = cfg.daemonNiceLevel;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(optional cfg.extra.control fahcontrol)
|
||||
(optional cfg.extra.viewer fahviewer)
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue