nixos/github-runners: use mkMerge for serviceConfig
The `serviceOverrides` module option is commonly used to loosen the systemd unit's hardening. This commit merges the `serviceConfig` with `mkMerge` instead of using the update operator `//` which discards all existing values on conflict. To avoid a breaking change which requires defining each option with a higher priority (e.g., through `mkForce`), this commit prefixes hardening values with `mkDefault`. Notable exceptions are list hardening options which use `mkBefore` instead of `mkDefault`. This allows for easy extension of the existing settings. Resetting redefinitions are still possible through `mkForce`.
This commit is contained in:
@@ -127,10 +127,11 @@ with lib;
|
||||
serviceOverrides = mkOption {
|
||||
type = types.attrs;
|
||||
description = lib.mdDoc ''
|
||||
Overrides for the systemd service. Can be used to adjust the sandboxing options.
|
||||
Modify the systemd service. Can be used to, e.g., adjust the sandboxing options.
|
||||
'';
|
||||
example = {
|
||||
ProtectHome = false;
|
||||
RestrictAddressFamilies = [ "AF_PACKET" ];
|
||||
};
|
||||
default = {};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user