mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 05:29:20 +03:00
nixos/networking: Fix more harmless errors
This commit is contained in:
parent
fcb173f70f
commit
1c04e69bce
2 changed files with 12 additions and 12 deletions
|
@ -986,6 +986,15 @@ in
|
||||||
users.extraUsers.systemd-journal-gateway.uid = config.ids.uids.systemd-journal-gateway;
|
users.extraUsers.systemd-journal-gateway.uid = config.ids.uids.systemd-journal-gateway;
|
||||||
users.extraGroups.systemd-journal-gateway.gid = config.ids.gids.systemd-journal-gateway;
|
users.extraGroups.systemd-journal-gateway.gid = config.ids.gids.systemd-journal-gateway;
|
||||||
|
|
||||||
|
users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network;
|
||||||
|
users.extraGroups.systemd-network.gid = config.ids.gids.systemd-network;
|
||||||
|
|
||||||
|
users.extraUsers.systemd-resolve.uid = config.ids.uids.systemd-resolve;
|
||||||
|
users.extraGroups.systemd-resolve.gid = config.ids.gids.systemd-resolve;
|
||||||
|
|
||||||
|
users.extraUsers.systemd-timesync.uid = config.ids.uids.systemd-timesync;
|
||||||
|
users.extraGroups.systemd-timesync.gid = config.ids.gids.systemd-timesync;
|
||||||
|
|
||||||
# Generate timer units for all services that have a ‘startAt’ value.
|
# Generate timer units for all services that have a ‘startAt’ value.
|
||||||
systemd.timers =
|
systemd.timers =
|
||||||
mapAttrs (name: service:
|
mapAttrs (name: service:
|
||||||
|
@ -1021,9 +1030,6 @@ in
|
||||||
|
|
||||||
}
|
}
|
||||||
(mkIf config.systemd.network.enable {
|
(mkIf config.systemd.network.enable {
|
||||||
users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network;
|
|
||||||
users.extraGroups.systemd-network.gid = config.ids.gids.systemd-network;
|
|
||||||
|
|
||||||
systemd.services.systemd-networkd = {
|
systemd.services.systemd-networkd = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
before = [ "network-interfaces.target" ];
|
before = [ "network-interfaces.target" ];
|
||||||
|
@ -1051,9 +1057,6 @@ in
|
||||||
services.timesyncd.enable = mkDefault config.services.ntp.enable;
|
services.timesyncd.enable = mkDefault config.services.ntp.enable;
|
||||||
})
|
})
|
||||||
(mkIf config.services.resolved.enable {
|
(mkIf config.services.resolved.enable {
|
||||||
users.extraUsers.systemd-resolve.uid = config.ids.uids.systemd-resolve;
|
|
||||||
users.extraGroups.systemd-resolve.gid = config.ids.gids.systemd-resolve;
|
|
||||||
|
|
||||||
systemd.services.systemd-resolved = {
|
systemd.services.systemd-resolved = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
restartTriggers = [ config.environment.etc."systemd/resolved.conf".source ];
|
restartTriggers = [ config.environment.etc."systemd/resolved.conf".source ];
|
||||||
|
@ -1065,9 +1068,6 @@ in
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
(mkIf config.services.timesyncd.enable {
|
(mkIf config.services.timesyncd.enable {
|
||||||
users.extraUsers.systemd-timesync.uid = config.ids.uids.systemd-timesync;
|
|
||||||
users.extraGroups.systemd-timesync.gid = config.ids.gids.systemd-timesync;
|
|
||||||
|
|
||||||
systemd.services.systemd-timesyncd = {
|
systemd.services.systemd-timesyncd = {
|
||||||
wantedBy = [ "sysinit.target" ];
|
wantedBy = [ "sysinit.target" ];
|
||||||
restartTriggers = [ config.environment.etc."systemd/timesyncd.conf".source ];
|
restartTriggers = [ config.environment.etc."systemd/timesyncd.conf".source ];
|
||||||
|
|
|
@ -66,7 +66,7 @@ in
|
||||||
serviceConfig.RemainAfterExit = true;
|
serviceConfig.RemainAfterExit = true;
|
||||||
|
|
||||||
script =
|
script =
|
||||||
(optionalString (!config.services.resolved.enable) ''
|
''
|
||||||
# Set the static DNS configuration, if given.
|
# Set the static DNS configuration, if given.
|
||||||
${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF
|
${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF
|
||||||
${optionalString (cfg.nameservers != [] && cfg.domain != null) ''
|
${optionalString (cfg.nameservers != [] && cfg.domain != null) ''
|
||||||
|
@ -77,9 +77,9 @@ in
|
||||||
nameserver ${ns}
|
nameserver ${ns}
|
||||||
'')}
|
'')}
|
||||||
EOF
|
EOF
|
||||||
'') + ''
|
|
||||||
# Set the default gateway.
|
# Set the default gateway.
|
||||||
${optionalString (cfg.defaultGateway != null) ''
|
${optionalString (cfg.defaultGateway != null && cfg.defaultGateway != "") ''
|
||||||
# FIXME: get rid of "|| true" (necessary to make it idempotent).
|
# FIXME: get rid of "|| true" (necessary to make it idempotent).
|
||||||
ip route add default via "${cfg.defaultGateway}" ${
|
ip route add default via "${cfg.defaultGateway}" ${
|
||||||
optionalString (cfg.defaultGatewayWindowSize != null)
|
optionalString (cfg.defaultGatewayWindowSize != null)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue