Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Feb 9, 2020
2 parents 30f0909 + eee784a commit 03755ed
Show file tree
Hide file tree
Showing 101 changed files with 2,056 additions and 2,447 deletions.
2 changes: 1 addition & 1 deletion lib/systems/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ rec {
else final.parsed.cpu.name;

qemuArch =
if final.isArm then "arm"
if final.isAarch32 then "arm"
else if final.isx86_64 then "x86_64"
else if final.isx86 then "i386"
else {
Expand Down
3 changes: 0 additions & 3 deletions lib/systems/inspect.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ rec {

isEfi = map (family: { cpu.family = family; })
[ "x86" "arm" "aarch64" ];

# Deprecated after 18.03
isArm = isAarch32;
};

matchAnyAttrs = patterns:
Expand Down
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,12 @@
githubId = 192147;
name = "aszlig";
};
atemu = {
name = "Atemu";
email = "[email protected]";
github = "Atemu";
githubId = 18599032;
};
athas = {
email = "[email protected]";
github = "athas";
Expand Down
13 changes: 9 additions & 4 deletions nixos/doc/manual/installation/upgrading.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,17 @@ nixos https://nixos.org/channels/nixos-unstable
to <filename>configuration.nix</filename>:
<programlisting>
<xref linkend="opt-system.autoUpgrade.enable"/> = true;
<xref linkend="opt-system.autoUpgrade.allowReboot"/> = true;
</programlisting>
This enables a periodically executed systemd service named
<literal>nixos-upgrade.service</literal>. It runs <command>nixos-rebuild
switch --upgrade</command> to upgrade NixOS to the latest version in the
current channel. (To see when the service runs, see <command>systemctl
list-timers</command>.) You can also specify a channel explicitly, e.g.
<literal>nixos-upgrade.service</literal>. If the <literal>allowReboot</literal>
option is <literal>false</literal>, it runs <command>nixos-rebuild switch
--upgrade</command> to upgrade NixOS to the latest version in the current
channel. (To see when the service runs, see <command>systemctl list-timers</command>.)
If <literal>allowReboot</literal> is <literal>true</literal>, then the
system will automatically reboot if the new generation contains a different
kernel, initrd or kernel modules.
You can also specify a channel explicitly, e.g.
<programlisting>
<xref linkend="opt-system.autoUpgrade.channel"/> = https://nixos.org/channels/nixos-19.09;
</programlisting>
Expand Down
44 changes: 40 additions & 4 deletions nixos/lib/test-driver/test-driver.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
#! /somewhere/python3
from contextlib import contextmanager, _GeneratorContextManager
from queue import Queue, Empty
from typing import Tuple, Any, Callable, Dict, Iterator, Optional, List
from xml.sax.saxutils import XMLGenerator
import _thread
import atexit
import base64
import os
import pathlib
import ptpython.repl
import pty
from queue import Queue, Empty
import re
import shlex
import shutil
import socket
import subprocess
import sys
import tempfile
import time
import unicodedata
from typing import Tuple, Any, Callable, Dict, Iterator, Optional, List
import shlex
import pathlib

CHAR_TO_KEY = {
"A": "shift-a",
Expand Down Expand Up @@ -566,6 +567,41 @@ def screenshot(self, filename: str) -> None:
if ret.returncode != 0:
raise Exception("Cannot convert screenshot")

def copy_from_host_via_shell(self, source: str, target: str) -> None:
"""Copy a file from the host into the guest by piping it over the
shell into the destination file. Works without host-guest shared folder.
Prefer copy_from_host for whenever possible.
"""
with open(source, "rb") as fh:
content_b64 = base64.b64encode(fh.read()).decode()
self.succeed(
f"mkdir -p $(dirname {target})",
f"echo -n {content_b64} | base64 -d > {target}",
)

def copy_from_host(self, source: str, target: str) -> None:
"""Copy a file from the host into the guest via the `shared_dir` shared
among all the VMs (using a temporary directory).
"""
host_src = pathlib.Path(source)
vm_target = pathlib.Path(target)
with tempfile.TemporaryDirectory(dir=self.shared_dir) as shared_td:
shared_temp = pathlib.Path(shared_td)
host_intermediate = shared_temp / host_src.name
vm_shared_temp = pathlib.Path("/tmp/shared") / shared_temp.name
vm_intermediate = vm_shared_temp / host_src.name

self.succeed(make_command(["mkdir", "-p", vm_shared_temp]))
if host_src.is_dir():
shutil.copytree(host_src, host_intermediate)
else:
shutil.copy(host_src, host_intermediate)
self.succeed("sync")
self.succeed(make_command(["mkdir", "-p", vm_target.parent]))
self.succeed(make_command(["cp", "-r", vm_intermediate, vm_target]))
# Make sure the cleanup is synced into VM
self.succeed("sync")

def copy_from_vm(self, source: str, target_dir: str = "") -> None:
"""Copy a file from the VM (specified by an in-VM source path) to a path
relative to `$out`. The file is copied via the `shared_dir` shared among
Expand Down
3 changes: 3 additions & 0 deletions nixos/modules/config/pulseaudio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ in {
security.rtkit.enable = true;

systemd.packages = [ overriddenPackage ];

# PulseAudio is packaged with udev rules to handle various audio device quirks
services.udev.packages = [ overriddenPackage ];
})

(mkIf (cfg.extraModules != []) {
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/networking/wireguard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ let
publicKey = mkOption {
example = "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=";
type = types.str;
description = "The base64 public key the peer.";
description = "The base64 public key of the peer.";
};

presharedKey = mkOption {
Expand Down
6 changes: 4 additions & 2 deletions nixos/modules/services/x11/display-managers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ let
'';

dmDefault = cfg.desktopManager.default;
# fallback default for cases when only default wm is set
dmFallbackDefault = if dmDefault != null then dmDefault else "none";
wmDefault = cfg.windowManager.default;

defaultSessionFromLegacyOptions = concatStringsSep "+" (filter (s: s != null) ([ dmDefault ] ++ optional (wmDefault != "none") wmDefault));
defaultSessionFromLegacyOptions = dmFallbackDefault + optionalString (wmDefault != null && wmDefault != "none") "+${wmDefault}";

in

Expand Down Expand Up @@ -358,7 +360,7 @@ in
{ c = wmDefault; t = "- services.xserver.windowManager.default"; }
]))}
Please use
services.xserver.displayManager.defaultSession = "${concatStringsSep "+" (filter (s: s != null) [ dmDefault wmDefault ])}";
services.xserver.displayManager.defaultSession = "${defaultSessionFromLegacyOptions}";
instead.
''
];
Expand Down
8 changes: 6 additions & 2 deletions nixos/modules/tasks/filesystems.nix
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ in

in listToAttrs (map formatDevice (filter (fs: fs.autoFormat) fileSystems));

systemd.tmpfiles.rules = [
"Z /run/keys 0750 root ${toString config.ids.gids.keys}"
];

# Sync mount options with systemd's src/core/mount-setup.c: mount_table.
boot.specialFileSystems = {
"/proc" = { fsType = "proc"; options = [ "nosuid" "noexec" "nodev" ]; };
Expand All @@ -312,8 +316,8 @@ in
"/dev/shm" = { fsType = "tmpfs"; options = [ "nosuid" "nodev" "strictatime" "mode=1777" "size=${config.boot.devShmSize}" ]; };
"/dev/pts" = { fsType = "devpts"; options = [ "nosuid" "noexec" "mode=620" "ptmxmode=0666" "gid=${toString config.ids.gids.tty}" ]; };

# To hold secrets that shouldn't be written to disk (generally used for NixOps, harmless elsewhere)
"/run/keys" = { fsType = "ramfs"; options = [ "nosuid" "nodev" "mode=750" "gid=${toString config.ids.gids.keys}" ]; };
# To hold secrets that shouldn't be written to disk
"/run/keys" = { fsType = "ramfs"; options = [ "nosuid" "nodev" "mode=750" ]; };
} // optionalAttrs (!config.boot.isContainer) {
# systemd-nspawn populates /sys by itself, and remounting it causes all
# kinds of weird issues (most noticeably, waiting for host disk device
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ in
xss-lock = handleTest ./xss-lock.nix {};
yabar = handleTest ./yabar.nix {};
yggdrasil = handleTest ./yggdrasil.nix {};
zfs = handleTest ./zfs.nix {};
zsh-history = handleTest ./zsh-history.nix {};
zookeeper = handleTest ./zookeeper.nix {};
}
Loading

0 comments on commit 03755ed

Please sign in to comment.