Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a8ec4936ae74
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c55a47832d60
Choose a head ref
  • 7 commits
  • 9 files changed
  • 4 contributors

Commits on Mar 17, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    de1c9c0 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    2a9c405 View commit details
  3. Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    9cc7ab1 View commit details
  4. nixos/service-runner.nix: Allow quotes in commands + test

    (cherry picked from commit 43521ac)
    roberth committed Mar 17, 2020
    Copy the full SHA
    284a8e9 View commit details
  5. Merge pull request #82782 from hercules-ci/backport-20.03-81292-fix-s…

    …ervice-runner-quotes
    
    Backport to 20.03 pr 81292: fix service runner quotes
    roberth authored Mar 17, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a9c8e5b View commit details
  6. riot-desktop: 1.5.12 -> 1.5.13

    (cherry picked from commit bb9822b)
    Ma27 committed Mar 17, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Ma27 Maximilian Bosch
    Copy the full SHA
    4e245c8 View commit details
  7. riot-web: 1.5.12 -> 1.5.13

    (cherry picked from commit 09f55f8)
    Ma27 committed Mar 17, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Ma27 Maximilian Bosch
    Copy the full SHA
    c55a478 View commit details
8 changes: 0 additions & 8 deletions nixos/doc/manual/release-notes/rl-2003.xml
Original file line number Diff line number Diff line change
@@ -962,14 +962,6 @@ auth required pam_succeed_if.so uid >= 1000 quiet
For further reference, please read <link xlink:href="https://github.com/NixOS/nixpkgs/pull/68953">#68953</link> or the corresponding <link xlink:href="https://discourse.nixos.org/t/predictable-network-interface-names-in-initrd/4055">discourse thread</link>.
</para>
</listitem>
<listitem>
<para>
The <link linkend="opt-systemd.network.links">systemd.network.links</link> option is now respected
even when <link linkend="opt-systemd.network.enable">systemd-networkd</link> is disabled.
This mirrors the behaviour of systemd - It's udev that parses <literal>.link</literal> files,
not <command>systemd-networkd</command>.
</para>
</listitem>
<listitem>
<para>
The <package>matrix-synapse</package>-package has been updated to
17 changes: 8 additions & 9 deletions nixos/modules/services/networking/zerotierone.nix
Original file line number Diff line number Diff line change
@@ -69,14 +69,13 @@ in
environment.systemPackages = [ cfg.package ];

# Prevent systemd from potentially changing the MAC address
systemd.network.links."50-zerotier" = {
matchConfig = {
OriginalName = "zt*";
};
linkConfig = {
AutoNegotiation = false;
MACAddressPolicy = "none";
};
};
environment.etc."systemd/network/50-zerotier.link".text = ''
[Match]
OriginalName=zt*
[Link]
AutoNegotiation=false
MACAddressPolicy=none
'';
};
}
75 changes: 31 additions & 44 deletions nixos/modules/system/boot/networkd.nix
Original file line number Diff line number Diff line change
@@ -325,14 +325,6 @@ let
};

linkOptions = commonNetworkOptions // {
# overwrite enable option from above
enable = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable this .link unit. It's handled by udev no matter if <command>systemd-networkd</command> is enabled or not
'';
};

linkConfig = mkOption {
default = {};
@@ -992,49 +984,44 @@ in

};

config = mkMerge [
# .link units are honored by udev, no matter if systemd-networkd is enabled or not.
{
systemd.network.units = mapAttrs' (n: v: nameValuePair "${n}.link" (linkToUnit n v)) cfg.links;
environment.etc = unitFiles;
}
config = mkIf config.systemd.network.enable {

(mkIf config.systemd.network.enable {
users.users.systemd-network.group = "systemd-network";

users.users.systemd-network.group = "systemd-network";
systemd.additionalUpstreamSystemUnits = [
"systemd-networkd.service" "systemd-networkd-wait-online.service"
];

systemd.additionalUpstreamSystemUnits = [
"systemd-networkd.service" "systemd-networkd-wait-online.service"
];
systemd.network.units = mapAttrs' (n: v: nameValuePair "${n}.link" (linkToUnit n v)) cfg.links
// mapAttrs' (n: v: nameValuePair "${n}.netdev" (netdevToUnit n v)) cfg.netdevs
// mapAttrs' (n: v: nameValuePair "${n}.network" (networkToUnit n v)) cfg.networks;

systemd.network.units = mapAttrs' (n: v: nameValuePair "${n}.netdev" (netdevToUnit n v)) cfg.netdevs
// mapAttrs' (n: v: nameValuePair "${n}.network" (networkToUnit n v)) cfg.networks;
environment.etc = unitFiles;

systemd.services.systemd-networkd = {
wantedBy = [ "multi-user.target" ];
restartTriggers = attrNames unitFiles;
# prevent race condition with interface renaming (#39069)
requires = [ "systemd-udev-settle.service" ];
after = [ "systemd-udev-settle.service" ];
};
systemd.services.systemd-networkd = {
wantedBy = [ "multi-user.target" ];
restartTriggers = attrNames unitFiles;
# prevent race condition with interface renaming (#39069)
requires = [ "systemd-udev-settle.service" ];
after = [ "systemd-udev-settle.service" ];
};

systemd.services.systemd-networkd-wait-online = {
wantedBy = [ "network-online.target" ];
};
systemd.services.systemd-networkd-wait-online = {
wantedBy = [ "network-online.target" ];
};

systemd.services."systemd-network-wait-online@" = {
description = "Wait for Network Interface %I to be Configured";
conflicts = [ "shutdown.target" ];
requisite = [ "systemd-networkd.service" ];
after = [ "systemd-networkd.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online -i %I";
};
systemd.services."systemd-network-wait-online@" = {
description = "Wait for Network Interface %I to be Configured";
conflicts = [ "shutdown.target" ];
requisite = [ "systemd-networkd.service" ];
after = [ "systemd-networkd.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online -i %I";
};
};

services.resolved.enable = mkDefault true;
})
];
services.resolved.enable = mkDefault true;
};
}
28 changes: 20 additions & 8 deletions nixos/modules/testing/service-runner.nix
Original file line number Diff line number Diff line change
@@ -12,7 +12,10 @@ let
sub run {
my ($cmd) = @_;
my @args = split " ", $cmd;
my @args = ();
while ($cmd =~ /([^ \t\n']+)|(\'([^'])\')\s*/g) {
push @args, $1;
}
my $prog;
if (substr($args[0], 0, 1) eq "@") {
$prog = substr($args[0], 1);
@@ -48,15 +51,20 @@ let
'') service.environment)}
# Run the ExecStartPre program. FIXME: this could be a list.
my $preStart = '${service.serviceConfig.ExecStartPre or ""}';
if ($preStart ne "") {
my $preStart = <<END_CMD;
${service.serviceConfig.ExecStartPre or ""}
END_CMD
if (defined $preStart && $preStart ne "\n") {
print STDERR "running ExecStartPre: $preStart\n";
my $res = run_wait $preStart;
die "$0: ExecStartPre failed with status $res\n" if $res;
};
# Run the ExecStart program.
my $cmd = '${service.serviceConfig.ExecStart}';
my $cmd = <<END_CMD;
${service.serviceConfig.ExecStart}
END_CMD
print STDERR "running ExecStart: $cmd\n";
my $mainPid = run $cmd;
$ENV{'MAINPID'} = $mainPid;
@@ -70,8 +78,10 @@ let
$SIG{'QUIT'} = \&intHandler;
# Run the ExecStartPost program.
my $postStart = '${service.serviceConfig.ExecStartPost or ""}';
if ($postStart ne "") {
my $postStart = <<END_CMD;
${service.serviceConfig.ExecStartPost or ""}
END_CMD
if (defined $postStart && $postStart ne "\n") {
print STDERR "running ExecStartPost: $postStart\n";
my $res = run_wait $postStart;
die "$0: ExecStartPost failed with status $res\n" if $res;
@@ -82,8 +92,10 @@ let
my $mainRes = $?;
# Run the ExecStopPost program.
my $postStop = '${service.serviceConfig.ExecStopPost or ""}';
if ($postStop ne "") {
my $postStop = <<END_CMD;
${service.serviceConfig.ExecStopPost or ""}
END_CMD
if (defined $postStop && $postStop ne "\n") {
print STDERR "running ExecStopPost: $postStop\n";
my $res = run_wait $postStop;
die "$0: ExecStopPost failed with status $res\n" if $res;
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
@@ -261,6 +261,7 @@ in
samba = handleTest ./samba.nix {};
sanoid = handleTest ./sanoid.nix {};
sddm = handleTest ./sddm.nix {};
service-runner = handleTest ./service-runner.nix {};
shiori = handleTest ./shiori.nix {};
signal-desktop = handleTest ./signal-desktop.nix {};
simple = handleTest ./simple.nix {};
60 changes: 18 additions & 42 deletions nixos/tests/networking.nix
Original file line number Diff line number Diff line change
@@ -5,10 +5,11 @@
, networkd }:

with import ../lib/testing-python.nix { inherit system pkgs; };
with pkgs.lib;

let
router = { config, pkgs, lib, ... }:
with lib;
router = { config, pkgs, ... }:
with pkgs.lib;
let
vlanIfs = range 1 (length config.virtualisation.vlans);
in {
@@ -84,7 +85,7 @@ let
static = {
name = "Static";
nodes.router = router;
nodes.client = { pkgs, lib, ... }: with lib; {
nodes.client = { pkgs, ... }: with pkgs.lib; {
virtualisation.vlans = [ 1 2 ];
networking = {
useNetworkd = networkd;
@@ -136,7 +137,7 @@ let
dhcpSimple = {
name = "SimpleDHCP";
nodes.router = router;
nodes.client = { pkgs, lib, ... }: with lib; {
nodes.client = { pkgs, ... }: with pkgs.lib; {
virtualisation.vlans = [ 1 2 ];
networking = {
useNetworkd = networkd;
@@ -192,7 +193,7 @@ let
dhcpOneIf = {
name = "OneInterfaceDHCP";
nodes.router = router;
nodes.client = { pkgs, lib, ... }: with lib; {
nodes.client = { pkgs, ... }: with pkgs.lib; {
virtualisation.vlans = [ 1 2 ];
networking = {
useNetworkd = networkd;
@@ -231,7 +232,7 @@ let
'';
};
bond = let
node = address: { pkgs, lib, ... }: with lib; {
node = address: { pkgs, ... }: with pkgs.lib; {
virtualisation.vlans = [ 1 2 ];
networking = {
useNetworkd = networkd;
@@ -267,7 +268,7 @@ let
'';
};
bridge = let
node = { address, vlan }: { pkgs, lib, ... }: with lib; {
node = { address, vlan }: { pkgs, ... }: with pkgs.lib; {
virtualisation.vlans = [ vlan ];
networking = {
useNetworkd = networkd;
@@ -280,7 +281,7 @@ let
name = "Bridge";
nodes.client1 = node { address = "192.168.1.2"; vlan = 1; };
nodes.client2 = node { address = "192.168.1.3"; vlan = 2; };
nodes.router = { pkgs, lib, ... }: with lib; {
nodes.router = { pkgs, ... }: with pkgs.lib; {
virtualisation.vlans = [ 1 2 ];
networking = {
useNetworkd = networkd;
@@ -317,7 +318,7 @@ let
macvlan = {
name = "MACVLAN";
nodes.router = router;
nodes.client = { pkgs, lib, ... }: with lib; {
nodes.client = { pkgs, ... }: with pkgs.lib; {
environment.systemPackages = [ pkgs.iptables ]; # to debug firewall rules
virtualisation.vlans = [ 1 ];
networking = {
@@ -371,7 +372,7 @@ let
'';
};
sit = let
node = { address4, remote, address6 }: { pkgs, lib, ... }: with lib; {
node = { address4, remote, address6 }: { pkgs, ... }: with pkgs.lib; {
virtualisation.vlans = [ 1 ];
networking = {
useNetworkd = networkd;
@@ -413,7 +414,7 @@ let
'';
};
vlan = let
node = address: { pkgs, lib, ... }: with lib; {
node = address: { pkgs, ... }: with pkgs.lib; {
#virtualisation.vlans = [ 1 ];
networking = {
useNetworkd = networkd;
@@ -526,7 +527,7 @@ let
'';
};
};
nodes.client_with_privacy = { pkgs, lib, ... }: with lib; {
nodes.client_with_privacy = { pkgs, ... }: with pkgs.lib; {
virtualisation.vlans = [ 1 ];
networking = {
useNetworkd = networkd;
@@ -539,7 +540,7 @@ let
};
};
};
nodes.client = { pkgs, lib, ... }: with lib; {
nodes.client = { pkgs, ... }: with pkgs.lib; {
virtualisation.vlans = [ 1 ];
networking = {
useNetworkd = networkd;
@@ -602,9 +603,9 @@ let

testScript = ''
targetIPv4Table = """
10.0.0.0/16 proto static scope link mtu 1500
192.168.1.0/24 proto kernel scope link src 192.168.1.2
192.168.2.0/24 via 192.168.1.1 proto static
10.0.0.0/16 proto static scope link mtu 1500
192.168.1.0/24 proto kernel scope link src 192.168.1.2
192.168.2.0/24 via 192.168.1.1 proto static
""".strip()
targetIPv6Table = """
@@ -654,33 +655,8 @@ let
), "The IPv6 routing table has not been properly cleaned:\n{}".format(ipv6Residue)
'';
};
# even with disabled networkd, systemd.network.links should work
# (as it's handled by udev, not networkd)
link = {
name = "Link";
nodes.client = { pkgs, ... }: {
virtualisation.vlans = [ 1 ];
networking = {
useNetworkd = networkd;
useDHCP = false;
};
systemd.network.links."50-foo" = {
matchConfig = {
Name = "foo";
Driver = "dummy";
};
linkConfig.MTUBytes = "1442";
};
};
testScript = ''
print(client.succeed("ip l add name foo type dummy"))
print(client.succeed("stat /etc/systemd/network/50-foo.link"))
client.succeed("udevadm settle")
assert "mtu 1442" in client.succeed("ip l show dummy0")
'';
};
};

in pkgs.lib.mapAttrs (pkgs.lib.const (attrs: makeTest (attrs // {
in mapAttrs (const (attrs: makeTest (attrs // {
name = "${attrs.name}-Networking-${if networkd then "Networkd" else "Scripted"}";
}))) testCases
36 changes: 36 additions & 0 deletions nixos/tests/service-runner.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "service-runner";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ roberth ];
};

nodes = {
machine = { pkgs, lib, ... }: {
services.nginx.enable = true;
services.nginx.virtualHosts.machine.root = pkgs.runCommand "webroot" {} ''
mkdir $out
echo 'yay' >$out/index.html
'';
systemd.services.nginx.enable = false;
};

};

testScript = { nodes, ... }: ''
url = "http://localhost/index.html"
with subtest("check systemd.services.nginx.runner"):
machine.fail(f"curl {url}")
machine.succeed(
"""
mkdir -p /run/nginx /var/spool/nginx/logs
${nodes.machine.config.systemd.services.nginx.runner} &
echo $!>my-nginx.pid
"""
)
machine.wait_for_open_port(80)
machine.succeed(f"curl {url}")
machine.succeed("kill -INT $(cat my-nginx.pid)")
machine.wait_for_closed_port(80)
'';
})
Original file line number Diff line number Diff line change
@@ -6,12 +6,12 @@

let
executableName = "riot-desktop";
version = "1.5.12";
version = "1.5.13";
riot-web-src = fetchFromGitHub {
owner = "vector-im";
repo = "riot-web";
rev = "v${version}";
sha256 = "1qz3n2dlklhbi6rbhv2v769xbr4rcp9s6pm2cc9r33ak6axn4aym";
sha256 = "1p2bdqq8yziv3l7kjkwqvi27a8djav7rk3lsipl7dvdjk1926941";
};
electron = electron_7;

Original file line number Diff line number Diff line change
@@ -12,11 +12,11 @@ let

in stdenv.mkDerivation rec {
pname = "riot-web";
version = "1.5.12";
version = "1.5.13";

src = fetchurl {
url = "https://github.com/vector-im/riot-web/releases/download/v${version}/riot-v${version}.tar.gz";
sha256 = "064zghrsl348ydzngwxhwjn0d0gkkf3nkzq03v5gad2f11qwnwb6";
sha256 = "0xghpf9rv7ns5aipc6n517qd9dp50rr93arvx6r36kqhkdyzbfad";
};

installPhase = ''