Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@
./services/mail/postfix.nix
./services/mail/spamassassin.nix
#./services/misc/autofs.nix
./services/misc/autofs.nix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including autfs.nix isn't a part of this pull is it?

./services/misc/boinc.nix
./services/misc/cgminer.nix
./services/misc/dictd.nix
./services/misc/disnix.nix
Expand Down
54 changes: 54 additions & 0 deletions nixos/modules/services/misc/boinc.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{ config, pkgs, ... }:

with pkgs.lib;

let
cfg = config.services.boinc;
in
{
options = {

services.boinc = {

enable = mkOption {
default = false;
description = "Whether to enable the Berkeley Open Infrastructure for Network Computing (BOINC) worker.";
};

home = mkOption {
default = "/var/lib/boinc";
description = "Location of BOINC work directory.";
};

user = mkOption {
default = "nobody";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe boinc should run as "boinc" user? The more services running as "nobody" makes the nobody account more and more privileged :-)

description = "User that shall run BOINC.";
};
};
};

config = mkIf cfg.enable {

environment.systemPackages = [ pkgs.boinc ];

systemd.services.boinc = {
description = "Berkeley Open Infrastructure for Network Computing worker";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
path = [ pkgs.boinc ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to have path = [ pkgs.boinc ]?

serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.boinc}/bin/boinc";
User = cfg.user;
WorkingDirectory = cfg.home;
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
};
};

system.activationScripts.boinc = ''
${pkgs.coreutils}/bin/mkdir -p "${cfg.home}"
${pkgs.coreutils}/bin/chown -R "${cfg.user}" "${cfg.home}"
'';
};
}
28 changes: 13 additions & 15 deletions pkgs/applications/science/misc/boinc/default.nix
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
#TODO: build without GUI for headless operation.

{ fetchgit, stdenv, autoconf, automake, pkgconfig, m4, curl,
mesa, libXmu, libXi, freeglut, libjpeg, libtool, wxGTK, xcbutil,
sqlite, gtk, patchelf, libXScrnSaver, libnotify, libX11, libxcb }:

let
version = "7.2.42";
in
stdenv.mkDerivation rec {
name = "boinc-7.0.44";
name = "boinc-${version}";

src = fetchgit {
url = "git://boinc.berkeley.edu/boinc-v2.git";
rev = "7c449b1fb8a681ceb27d6895751b62a2b3adf0f2";
sha256 = "0hdramyl9nip3gadp7xiaz8ngyld15i93d8ai1nsd04bmrvdfqia";
url = git://boinc.berkeley.edu/boinc-v2.git;
rev = "refs/tags/client_release/7.2/${version}";
sha256 = "1zifpi3mjgaj68fba6kammp3x7z8n2x164zz6fj91xfiapnan56j";
};

buildInputs = [ libtool automake autoconf m4 pkgconfig curl mesa libXmu libXi
freeglut libjpeg wxGTK sqlite gtk libXScrnSaver libnotify patchelf libX11
libxcb xcbutil
];

postConfigure = ''
sed -i -e s,/etc,$out/etc, client/scripts/Makefile
'';
patches = [ ./no-runscript.patch ];

NIX_LDFLAGS = "-lX11";

preConfigure = ''
./_autosetup
configureFlags="$configureFlags --sysconfdir=$out/etc"
'';
preConfigure = "./_autosetup";

enableParallelBuilding = true;

configureFlags = "--disable-server";

meta = {
description = "Free software for distributed and grid computing";

homepage = http://boinc.berkeley.edu/;

license = "LGPLv2+";

license = stdenv.lib.licenses.lgpl21Plus;
maintainers = [ stdenv.lib.maintainers.emery ];
platforms = stdenv.lib.platforms.linux; # arbitrary choice
};
}
13 changes: 13 additions & 0 deletions pkgs/applications/science/misc/boinc/no-runscript.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Makefile.am b/Makefile.am
index 6322db1..9820912 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,7 @@ if ENABLE_SERVER
endif

if ENABLE_CLIENT
- CLIENT_SUBDIRS = client client/scripts
+ CLIENT_SUBDIRS = client
endif

if ENABLE_MANAGER