diff options
author | William A. Kennington III <william@wkennington.com> | 2014-12-01 01:18:26 -0800 |
---|---|---|
committer | William A. Kennington III <william@wkennington.com> | 2014-12-01 01:18:32 -0800 |
commit | 1c04e69bce4d797a6cca24a8f44e77cb3fac79f9 (patch) | |
tree | b91c79a0babb391c5661bb25387001dea7babc76 /nixos/modules | |
parent | fcb173f70f692aa6cb112b866fbb99f659b67429 (diff) | |
download | nixlib-1c04e69bce4d797a6cca24a8f44e77cb3fac79f9.tar nixlib-1c04e69bce4d797a6cca24a8f44e77cb3fac79f9.tar.gz nixlib-1c04e69bce4d797a6cca24a8f44e77cb3fac79f9.tar.bz2 nixlib-1c04e69bce4d797a6cca24a8f44e77cb3fac79f9.tar.lz nixlib-1c04e69bce4d797a6cca24a8f44e77cb3fac79f9.tar.xz nixlib-1c04e69bce4d797a6cca24a8f44e77cb3fac79f9.tar.zst nixlib-1c04e69bce4d797a6cca24a8f44e77cb3fac79f9.zip |
nixos/networking: Fix more harmless errors
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/system/boot/systemd.nix | 18 | ||||
-rw-r--r-- | nixos/modules/tasks/network-interfaces-scripted.nix | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 97cbc507e032..64667acf1277 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -986,6 +986,15 @@ in 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.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. systemd.timers = mapAttrs (name: service: @@ -1021,9 +1030,6 @@ in } (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 = { wantedBy = [ "multi-user.target" ]; before = [ "network-interfaces.target" ]; @@ -1051,9 +1057,6 @@ in services.timesyncd.enable = mkDefault config.services.ntp.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 = { wantedBy = [ "multi-user.target" ]; restartTriggers = [ config.environment.etc."systemd/resolved.conf".source ]; @@ -1065,9 +1068,6 @@ in ''; }) (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 = { wantedBy = [ "sysinit.target" ]; restartTriggers = [ config.environment.etc."systemd/timesyncd.conf".source ]; diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index 34f0cbabc3b4..a994e44c6ecf 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -66,7 +66,7 @@ in serviceConfig.RemainAfterExit = true; script = - (optionalString (!config.services.resolved.enable) '' + '' # Set the static DNS configuration, if given. ${pkgs.openresolv}/sbin/resolvconf -m 1 -a static <<EOF ${optionalString (cfg.nameservers != [] && cfg.domain != null) '' @@ -77,9 +77,9 @@ in nameserver ${ns} '')} EOF - '') + '' + # Set the default gateway. - ${optionalString (cfg.defaultGateway != null) '' + ${optionalString (cfg.defaultGateway != null && cfg.defaultGateway != "") '' # FIXME: get rid of "|| true" (necessary to make it idempotent). ip route add default via "${cfg.defaultGateway}" ${ optionalString (cfg.defaultGatewayWindowSize != null) |