add distccd
This commit is contained in:
parent
af46de5628
commit
3ed2f2e1a8
7 changed files with 227 additions and 11 deletions
50
modules/dynamicism/distccd.nix
Normal file
50
modules/dynamicism/distccd.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
cfg = config.services.distccd;
|
||||
|
||||
cliArgs = lib.cli.toCommandLineShellGNU { explicitBool = false; } {
|
||||
no-detach = true;
|
||||
daemon = true;
|
||||
enable-tcp-insecure = true;
|
||||
port = cfg.port;
|
||||
|
||||
# Nulls are handled automatically.
|
||||
job-lifetime = cfg.jobTimeout;
|
||||
log-level = cfg.logLevel;
|
||||
jobs = cfg.maxJobs;
|
||||
nice = cfg.nice;
|
||||
stats = cfg.stats.enable;
|
||||
stats-port = if cfg.stats.enable then cfg.stats.port else null;
|
||||
zeroconf = cfg.zeroconf;
|
||||
allow = cfg.allowedClients;
|
||||
};
|
||||
|
||||
startDistccd = pkgs.writeShellApplication {
|
||||
name = "start-distccd";
|
||||
runtimeInputs = [ pkgs.distccMasquerade ];
|
||||
|
||||
text = ''
|
||||
${lib.getExe' cfg.package "distccd"} \
|
||||
${cliArgs}
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
dynamicism.for.distccd = {
|
||||
source-options = [
|
||||
"services.distccd.jobTimeout"
|
||||
"services.distccd.logLevel"
|
||||
"services.distccd.maxJobs"
|
||||
"services.distccd.nice"
|
||||
];
|
||||
unitDropins."distccd.service" = pkgs.writeTextFile {
|
||||
name = "distccd-override.conf";
|
||||
text = ''
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=${lib.getExe startDistccd}
|
||||
'';
|
||||
passthru.startScript = startDistccd;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -138,6 +138,6 @@ in
|
|||
imports = [
|
||||
./gotosocial.nix
|
||||
./harmonia.nix
|
||||
#./tzupdate.nix
|
||||
./distccd.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,16 +83,18 @@ in
|
|||
doEdits = config.unitDropins
|
||||
|> lib.mapAttrsToList (service: dropin: ''
|
||||
cat "${dropin}" | systemctl edit "${service}" --runtime --drop=dynix-${dropin.name} --stdin
|
||||
'');
|
||||
'')
|
||||
|> lib.concatStringsSep "\n";
|
||||
doReloads = config.unitDropins
|
||||
|> lib.mapAttrsToList (service: _: ''
|
||||
systemctl reload-or-restart "${service}"
|
||||
'');
|
||||
in [
|
||||
doEdits
|
||||
doReloads
|
||||
] |> lib.concatLists
|
||||
|> lib.concatStringsSep "\n";
|
||||
|> lib.mapAttrsToList (service: _: ''
|
||||
systemctl reload-or-restart "${service}"
|
||||
'')
|
||||
|> lib.concatStringsSep "\n";
|
||||
in ''
|
||||
${doEdits}
|
||||
|
||||
${doReloads}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue