mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
chore: tweak niceness of some services
This commit is contained in:
parent
43bb5e3059
commit
8f4ea912a1
4 changed files with 34 additions and 23 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.modules) mkIf mkDefault mkForce;
|
inherit (lib.modules) mkIf mkMerge mkDefault mkForce;
|
||||||
inherit (lib.attrsets) attrNames attrValues filterAttrs mapAttrs' nameValuePair;
|
inherit (lib.attrsets) attrNames attrValues filterAttrs mapAttrs' nameValuePair;
|
||||||
inherit (gensokyo-zone.lib) unmerged;
|
inherit (gensokyo-zone.lib) unmerged;
|
||||||
cfg = config.services.github-runners;
|
cfg = config.services.github-runners;
|
||||||
|
|
@ -24,28 +24,32 @@
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
replace = mkIf config.ephemeral (mkDefault true);
|
replace = mkIf config.ephemeral (mkDefault true);
|
||||||
serviceSettings = mkIf (config.networkNamespace.name != null) {
|
serviceSettings = mkMerge [
|
||||||
networkNamespace = {
|
(mkIf (config.networkNamespace.name != null) {
|
||||||
name = mkDefault config.networkNamespace.name;
|
networkNamespace = {
|
||||||
afterOnline = mkDefault true;
|
name = mkDefault config.networkNamespace.name;
|
||||||
};
|
afterOnline = mkDefault true;
|
||||||
restartTriggers = [
|
};
|
||||||
config.ephemeral
|
})
|
||||||
config.url
|
{
|
||||||
config.name
|
restartTriggers = [
|
||||||
config.runnerGroup
|
config.ephemeral
|
||||||
config.extraLabels
|
config.url
|
||||||
config.noDefaultLabels
|
config.name
|
||||||
config.user
|
config.runnerGroup
|
||||||
config.group
|
config.extraLabels
|
||||||
config.workDir
|
config.noDefaultLabels
|
||||||
"${config.package}"
|
config.user
|
||||||
config.extraPackages
|
config.group
|
||||||
config.nodeRuntimes
|
config.workDir
|
||||||
(attrNames config.extraEnvironment)
|
"${config.package}"
|
||||||
(attrValues config.extraEnvironment)
|
config.extraPackages
|
||||||
];
|
config.nodeRuntimes
|
||||||
};
|
(attrNames config.extraEnvironment)
|
||||||
|
(attrValues config.extraEnvironment)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
serviceOverrides = mkIf (config.user != null || config.group != null) {
|
serviceOverrides = mkIf (config.user != null || config.group != null) {
|
||||||
DynamicUser = mkForce true;
|
DynamicUser = mkForce true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,9 @@ in {
|
||||||
unitConfig = {
|
unitConfig = {
|
||||||
StopPropagatedFrom = ["${cfg.targetName}.target"];
|
StopPropagatedFrom = ["${cfg.targetName}.target"];
|
||||||
};
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
Nice = mkDefault 5;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
serviceOverrides = mkIf (!cfg.dynamicUser) {
|
serviceOverrides = mkIf (!cfg.dynamicUser) {
|
||||||
# XXX: the ci sshd hack requires this for now :<
|
# XXX: the ci sshd hack requires this for now :<
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ in {
|
||||||
systemd = mkIf cfg.enable {
|
systemd = mkIf cfg.enable {
|
||||||
services.klipper = {
|
services.klipper = {
|
||||||
restartIfChanged = false;
|
restartIfChanged = false;
|
||||||
|
serviceConfig = {
|
||||||
|
Nice = mkDefault (-5);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
tmpfiles.rules = mkIf (cfg.logFile != null) [
|
tmpfiles.rules = mkIf (cfg.logFile != null) [
|
||||||
"d ${dirOf cfg.logFile} 0755 ${cfg.user} ${cfg.group} 8w -"
|
"d ${dirOf cfg.logFile} 0755 ${cfg.user} ${cfg.group} 8w -"
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ in {
|
||||||
"~.*Invalid modellist patch"
|
"~.*Invalid modellist patch"
|
||||||
"~.*Invalid modellist patch.*"
|
"~.*Invalid modellist patch.*"
|
||||||
];
|
];
|
||||||
|
Nice = mkDefault (-4);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
tmpfiles.rules = let
|
tmpfiles.rules = let
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue