nixpkgs-custom/nixos/modules/system
aszlig da9efe97d9
nixos/systemd: Allow to override serviceConfig
This has been reported by @qknight in his Stack Overflow question:

https://stackoverflow.com/q/50678639

The correct way to override a single value would be to use something
like this:

systemd.services.nagios.serviceConfig.Restart = lib.mkForce "no";

However, this doesn't work because the check is applied for the attrsOf
type and thus the attribute values might still contain the attribute set
created by mkOverride.

The unitOption type however did already account for this, but at this
stage it's already too late.

So now the actual value is unpacked while checking the values of the
attribute set, which should allow us to override values in
serviceConfig.

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @edolstra, @qknight
(cherry picked from commit 0e7c945e15117e88ac494e29c9828ccea2ec32ee)
Reason: Another user has hit this problem on Discourse[1] and I thought
        I had already backported it to 18.03, apparently I didn't. Given
        the time of the original commit I think this had enough testing
        already so it shouldn't break anything and rather make things
        less annoying.
[1]: https://discourse.nixos.org/t/is-there-a-universal-way-to-enable-a-service-auto-restart/592/3
2018-08-16 06:53:18 +02:00
..
activation nixos/switch-to-configuration: Never stop system.slice 2018-08-02 01:12:02 +02:00
boot nixos/systemd: Allow to override serviceConfig 2018-08-16 06:53:18 +02:00
etc environment.etc: add user/group option 2017-07-29 23:56:46 +01:00