services/foldingathome: add fah module
This commit is contained in:
parent
d2bc991e68
commit
bdc3b61787
3 changed files with 42 additions and 16 deletions
|
@ -10,10 +10,6 @@
|
||||||
|
|
||||||
btrfs
|
btrfs
|
||||||
virtualization
|
virtualization
|
||||||
|
|
||||||
(with services; [
|
|
||||||
foldingathome
|
|
||||||
])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
@ -28,6 +24,16 @@
|
||||||
wireless.enable = true;
|
wireless.enable = true;
|
||||||
form.desktop = true;
|
form.desktop = true;
|
||||||
};
|
};
|
||||||
|
services = {
|
||||||
|
foldingathome = {
|
||||||
|
enable = true;
|
||||||
|
user = "Infinidoge";
|
||||||
|
extra = {
|
||||||
|
control = true;
|
||||||
|
viewer = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.interfaces = {
|
networking.interfaces = {
|
||||||
|
|
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)
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,12 +0,0 @@
|
||||||
{ pkgs, ... }: {
|
|
||||||
services.foldingathome = {
|
|
||||||
enable = true;
|
|
||||||
user = "Infinidoge";
|
|
||||||
daemonNiceLevel = 10;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
fahcontrol
|
|
||||||
fahviewer
|
|
||||||
];
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue