11 cfg = config.services.icecream.daemon;
19 services.icecream.daemon = {
21 enable = mkEnableOption "Icecream Daemon";
23 openFirewall = mkOption {
26 Whether to automatically open receive port in the firewall.
30 openBroadcast = mkOption {
33 Whether to automatically open the firewall for scheduler discovery.
37 cacheLimit = mkOption {
38 type = types.ints.u16;
41 Maximum size in Megabytes of cache used to store compile environments of compile clients.
49 Network name to connect to. A scheduler with the same name needs to be running.
57 Prevent jobs from other nodes being scheduled on this daemon.
61 schedulerHost = mkOption {
62 type = types.nullOr types.str;
65 Explicit scheduler hostname, useful in firewalled environments.
67 Uses scheduler autodiscovery via broadcast if set to null.
71 maxProcesses = mkOption {
72 type = types.nullOr types.ints.u16;
75 Maximum number of compile jobs started in parallel for this daemon.
77 Uses the number of CPUs if set to null.
85 The level of niceness to use.
90 type = types.nullOr types.str;
93 Hostname of the daemon in the icecream infrastructure.
95 Uses the hostname retrieved via uname if set to null.
103 User to run the icecream daemon as. Set to root to enable receive of
104 remote compile environments.
108 package = mkPackageOption pkgs "icecream" { };
110 extraArgs = mkOption {
111 type = types.listOf types.str;
113 description = "Additional command line parameters.";
119 ###### implementation
121 config = mkIf cfg.enable {
122 networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ 10245 ];
123 networking.firewall.allowedUDPPorts = mkIf cfg.openBroadcast [ 8765 ];
125 systemd.services.icecc-daemon = {
126 description = "Icecream compile daemon";
127 after = [ "network.target" ];
128 wantedBy = [ "multi-user.target" ];
131 ExecStart = escapeShellArgs (
133 "${getBin cfg.package}/bin/iceccd"
140 ++ optionals (cfg.schedulerHost != null) [
144 ++ optionals (cfg.netName != null) [
148 ++ optionals (cfg.cacheLimit != null) [
150 (toString cfg.cacheLimit)
152 ++ optionals (cfg.maxProcesses != null) [
154 (toString cfg.maxProcesses)
156 ++ optionals (cfg.hostname != null) [
160 ++ optional cfg.noRemote "--no-remote"
166 StateDirectory = "icecc";
167 RuntimeDirectory = "icecc";
168 AmbientCapabilities = "CAP_SYS_CHROOT";
169 CapabilityBoundingSet = "CAP_SYS_CHROOT";
174 meta.maintainers = with lib.maintainers; [ emantor ];