Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
aristidb committed Dec 20, 2016
2 parents 3a0f197 + a02bb00 commit bb18e10
Show file tree
Hide file tree
Showing 110 changed files with 5,289 additions and 2,255 deletions.
2 changes: 1 addition & 1 deletion doc/languages-frameworks/beam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ $ nix-env -f "<nixpkgs>" -iA beamPackages.ibrowse
development. Many times we need to create a
<literal>shell.nix</literal> file and do our development inside
of the environment specified by that file. This file looks a lot
like the packageing described above. The main difference is that
like the packaging described above. The main difference is that
<literal>src</literal> points to project root and we call the
package directly.
</para>
Expand Down
2 changes: 2 additions & 0 deletions lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
mingchuan = "Ming Chuan <ming@culpring.com>";
mirdhyn = "Merlin Gaillard <mirdhyn@gmail.com>";
mirrexagon = "Andrew Abbott <mirrexagon@mirrexagon.com>";
mjanczyk = "Marcin Janczyk <m@dragonvr.pl>";
mlieberman85 = "Michael Lieberman <mlieberman85@gmail.com>";
modulistic = "Pablo Costa <modulistic@gmail.com>";
mog = "Matthew O'Gorman <mog-lists@rldn.net>";
Expand Down Expand Up @@ -482,6 +483,7 @@
vlstill = "Vladimír Štill <xstill@fi.muni.cz>";
vmandela = "Venkateswara Rao Mandela <venkat.mandela@gmail.com>";
volhovm = "Mikhail Volkhov <volhovm.cs@gmail.com>";
volth = "Jaroslavas Pocepko <jaroslavas@volth.com>";
vozz = "Oliver Hunt <oliver.huntuk@gmail.com>";
vrthra = "Rahul Gopinath <rahul@gopinath.org>";
wedens = "wedens <kirill.wedens@gmail.com>";
Expand Down
17 changes: 10 additions & 7 deletions update.nix → maintainers/scripts/update.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

let

pkgs = import ./default.nix { };
pkgs = import ./../../default.nix { };

packagesWith = cond: return: set:
pkgs.lib.flatten
Expand All @@ -16,7 +16,7 @@ let
result = builtins.tryEval (
if pkgs.lib.isDerivation pkg && cond name pkg
then [(return name pkg)]
else if pkg.recurseForFerivations or false || pkg.recureseForRelease or false
else if pkg.recurseForDerivations or false || pkg.recurseForRelease or false
then packagesWith cond return pkg
else []
);
Expand Down Expand Up @@ -48,12 +48,15 @@ let
pkgs;

packageByName = name:
if ! builtins.hasAttr name pkgs then
let
package = pkgs.lib.attrByPath (pkgs.lib.splitString "." name) null pkgs;
in
if package == null then
builtins.throw "Package with an attribute name `${name}` does not exists."
else if ! builtins.hasAttr "updateScript" (builtins.getAttr name pkgs) then
else if ! builtins.hasAttr "updateScript" package then
builtins.throw "Package with an attribute name `${name}` does have an `passthru.updateScript` defined."
else
builtins.getAttr name pkgs;
package;

packages =
if package != null then
Expand All @@ -66,12 +69,12 @@ let
helpText = ''
Please run:
% nix-shell update.nix --argstr maintainer garbas
% nix-shell maintainers/scripts/update.nix --argstr maintainer garbas
to run all update scripts for all packages that lists \`garbas\` as a maintainer
and have \`updateScript\` defined, or:
% nix-shell update.nix --argstr package garbas
% nix-shell maintainers/scripts/update.nix --argstr package garbas
to run update script for specific package.
'';
Expand Down
11 changes: 11 additions & 0 deletions nixos/doc/manual/release-notes/rl-1703.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ following incompatible changes:</para>
or attribute sets as specified in parsoid's documentation.
</para>
</listitem>

<listitem>
<para>
<literal>Ntpd</literal> was replaced by
<literal>systemd-timesyncd</literal> as the default service to synchronize
system time with a remote NTP server. The old behavior can be restored by
setting <literal>services.ntp.enable</literal> to <literal>true</literal>.
Upstream time servers for all NTP implementations are now configured using
<literal>networking.timeServers</literal>.
</para>
</listitem>
</itemizedlist>


Expand Down
3 changes: 3 additions & 0 deletions nixos/lib/build-vms.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ rec {

inherit pkgs;

qemu = pkgs.qemu_test;


# Build a virtual network from an attribute set `{ machine1 =
# config1; ... machineN = configN; }', where `machineX' is the
Expand All @@ -27,6 +29,7 @@ rec {
[ ../modules/virtualisation/qemu-vm.nix
../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs
{ key = "no-manual"; services.nixosManual.enable = false; }
{ key = "qemu"; system.build.qemu = qemu; }
] ++ optional minimal ../modules/testing/minimal-kernel.nix;
extraArgs = { inherit nodes; };
};
Expand Down
4 changes: 2 additions & 2 deletions nixos/lib/testing.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rec {
cp ${./test-driver/Logger.pm} $libDir/Logger.pm
wrapProgram $out/bin/nixos-test-driver \
--prefix PATH : "${lib.makeBinPath [ qemu_kvm vde2 netpbm coreutils ]}" \
--prefix PATH : "${lib.makeBinPath [ qemu vde2 netpbm coreutils ]}" \
--prefix PERL5LIB : "${with perlPackages; lib.makePerlPath [ TermReadLineGnu XMLWriter IOTty FileSlurp ]}:$out/lib/perl5/site_perl"
'';
};
Expand Down Expand Up @@ -93,7 +93,7 @@ rec {

vms = map (m: m.config.system.build.vm) (lib.attrValues nodes);

ocrProg = tesseract.override { enableLanguages = [ "eng" ]; };
ocrProg = tesseract;

# Generate onvenience wrappers for running the test driver
# interactively with the specified network, and for starting the
Expand Down
6 changes: 3 additions & 3 deletions nixos/modules/installer/tools/nixos-rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ targetHostCmd() {
copyToTarget() {
if ! [ "$targetHost" = "$buildHost" ]; then
if [ -z "$targetHost" ]; then
NIX_SSHOPTS=$SSH_OPTS nix-copy-closure --from "$buildHost" "$1"
NIX_SSHOPTS=$SSHOPTS nix-copy-closure --from "$buildHost" "$1"
elif [ -z "$buildHost" ]; then
NIX_SSHOPTS=$SSH_OPTS nix-copy-closure --to "$targetHost" "$1"
NIX_SSHOPTS=$SSHOPTS nix-copy-closure --to "$targetHost" "$1"
else
buildHostCmd nix-copy-closure --to "$targetHost" "$1"
fi
Expand Down Expand Up @@ -169,7 +169,7 @@ nixBuild() {

local drv="$(nix-instantiate "${instArgs[@]}" "${extraBuildFlags[@]}")"
if [ -a "$drv" ]; then
NIX_SSHOPTS=$SSH_OPTS nix-copy-closure --to "$buildHost" "$drv"
NIX_SSHOPTS=$SSHOPTS nix-copy-closure --to "$buildHost" "$drv"
buildHostCmd nix-store -r "$drv" "${buildArgs[@]}"
else
echo "nix-instantiate failed"
Expand Down
4 changes: 1 addition & 3 deletions nixos/modules/services/databases/mysql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ in

package = mkOption {
type = types.package;
default = pkgs.mysql;
defaultText = "pkgs.mysql";
example = literalExample "pkgs.mysql55";
example = literalExample "pkgs.mysql";
description = "
Which MySQL derivation to use.
";
Expand Down
2 changes: 2 additions & 0 deletions nixos/modules/services/hardware/brltty.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ in {
ProtectSystem = "full";
SystemCallArchitectures = "native";
};
wants = [ "systemd-udev-settle.service" ];
after = [ "local-fs.target" "systemd-udev-settle.service" ];
before = [ "sysinit.target" ];
wantedBy = [ "sysinit.target" ];
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/mail/rmilter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ milter_default_action = accept
PermissionsStartOnly = true;
Restart = "always";
RuntimeDirectory = "rmilter";
RuntimeDirectoryPermissions="0755";
RuntimeDirectoryMode = "0755";
};

};
Expand Down
16 changes: 16 additions & 0 deletions nixos/modules/system/boot/systemd-unit-options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,20 @@ in rec {

targetOptions = commonUnitOptions;

sliceOptions = commonUnitOptions // {

sliceConfig = mkOption {
default = {};
example = { MemoryMax = "2G"; };
type = types.attrsOf unitOption;
description = ''
Each attribute in this set specifies an option in the
<literal>[Slice]</literal> section of the unit. See
<citerefentry><refentrytitle>systemd.slice</refentrytitle>
<manvolnum>5</manvolnum></citerefentry> for details.
'';
};

};

}
16 changes: 16 additions & 0 deletions nixos/modules/system/boot/systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,15 @@ let
'';
};

sliceToUnit = name: def:
{ inherit (def) wantedBy requiredBy enable;
text = commonUnitText def +
''
[Slice]
${attrsToSection def.sliceConfig}
'';
};

in

{
Expand Down Expand Up @@ -458,6 +467,12 @@ in
'';
};

systemd.slices = mkOption {
default = {};
type = with types; attrsOf (submodule [ { options = sliceOptions; } unitConfig] );
description = "Definition of slice configurations.";
};

systemd.generators = mkOption {
type = types.attrsOf types.path;
default = {};
Expand Down Expand Up @@ -748,6 +763,7 @@ in
// mapAttrs' (n: v: nameValuePair "${n}.socket" (socketToUnit n v)) cfg.sockets
// mapAttrs' (n: v: nameValuePair "${n}.timer" (timerToUnit n v)) cfg.timers
// mapAttrs' (n: v: nameValuePair "${n}.path" (pathToUnit n v)) cfg.paths
// mapAttrs' (n: v: nameValuePair "${n}.slice" (sliceToUnit n v)) cfg.slices
// listToAttrs (map
(v: let n = escapeSystemdPath v.where;
in nameValuePair "${n}.mount" (mountToUnit n v)) cfg.mounts)
Expand Down
3 changes: 0 additions & 3 deletions nixos/modules/testing/test-instrumentation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ let kernel = config.boot.kernelPackages.kernel; in

networking.usePredictableInterfaceNames = false;

# Make sure we use a patched QEMU that ignores file ownership.
virtualisation.qemu.program = "${pkgs.qemu_test}/bin/qemu-kvm";

# Make it easy to log in as root when running the test interactively.
users.extraUsers.root.initialHashedPassword = mkOverride 150 "";

Expand Down
22 changes: 8 additions & 14 deletions nixos/modules/virtualisation/qemu-vm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ with lib;

let

qemu = config.system.build.qemu or pkgs.qemu_test;

vmName =
if config.networking.hostName == ""
then "noname"
Expand All @@ -32,7 +34,7 @@ let
NIX_DISK_IMAGE=$(readlink -f ''${NIX_DISK_IMAGE:-${config.virtualisation.diskImage}})
if ! test -e "$NIX_DISK_IMAGE"; then
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 "$NIX_DISK_IMAGE" \
${qemu}/bin/qemu-img create -f qcow2 "$NIX_DISK_IMAGE" \
${toString config.virtualisation.diskSize}M || exit 1
fi
Expand All @@ -47,7 +49,7 @@ let
${if cfg.useBootLoader then ''
# Create a writable copy/snapshot of the boot disk.
# A writable boot disk can be booted from automatically.
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 -b ${bootDisk}/disk.img $TMPDIR/disk.img || exit 1
${qemu}/bin/qemu-img create -f qcow2 -b ${bootDisk}/disk.img $TMPDIR/disk.img || exit 1
${if cfg.useEFIBoot then ''
# VM needs a writable flash BIOS.
Expand All @@ -63,14 +65,14 @@ let
extraDisks=""
${flip concatMapStrings cfg.emptyDiskImages (size: ''
if ! test -e "empty$idx.qcow2"; then
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 "empty$idx.qcow2" "${toString size}M"
${qemu}/bin/qemu-img create -f qcow2 "empty$idx.qcow2" "${toString size}M"
fi
extraDisks="$extraDisks -drive index=$idx,file=$(pwd)/empty$idx.qcow2,if=${cfg.qemu.diskInterface},werror=report"
idx=$((idx + 1))
'')}
# Start QEMU.
exec ${cfg.qemu.program} \
exec ${qemu}/bin/qemu-kvm \
-name ${vmName} \
-m ${toString config.virtualisation.memorySize} \
${optionalString (pkgs.stdenv.system == "x86_64-linux") "-cpu kvm64"} \
Expand Down Expand Up @@ -121,7 +123,7 @@ let
mkdir $out
diskImage=$out/disk.img
bootFlash=$out/bios.bin
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 $diskImage "40M"
${qemu}/bin/qemu-img create -f qcow2 $diskImage "40M"
${if cfg.useEFIBoot then ''
cp ${pkgs.OVMF-CSM}/FV/OVMF.fd $bootFlash
chmod 0644 $bootFlash
Expand Down Expand Up @@ -272,7 +274,7 @@ in

virtualisation.writableStore =
mkOption {
default = false;
default = true; # FIXME
description =
''
If enabled, the Nix store in the VM is made writable by
Expand All @@ -299,14 +301,6 @@ in
};

virtualisation.qemu = {
program = mkOption {
type = types.path;
default = "${pkgs.qemu_kvm}/bin/qemu-kvm";
defaultText = "\${pkgs.qemu_kvm}/bin/qemu-kvm";
example = literalExample "\${pkgs.qemu_test}/bin/qemu-kvm";
description = "The QEMU variant used to start the VM.";
};

options =
mkOption {
type = types.listOf types.unspecified;
Expand Down
2 changes: 0 additions & 2 deletions nixos/tests/kde5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import ./make-test.nix ({ pkgs, ...} :
services.xserver.desktopManager.kde5.enable = true;
};

enableOCR = true;

testScript = { nodes, ... }:
let xdo = "${pkgs.xdotool}/bin/xdotool"; in
''
Expand Down
2 changes: 0 additions & 2 deletions nixos/tests/sddm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import ./make-test.nix ({ pkgs, ...} : {
services.xserver.desktopManager.default = "none";
};

enableOCR = true;

testScript = { nodes, ... }: ''
startAll;
$machine->waitForFile("/home/alice/.Xauthority");
Expand Down

0 comments on commit bb18e10

Please sign in to comment.