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 Apr 25, 2021
2 parents a956f62 + 6eb1fc6 commit c648f7e
Show file tree
Hide file tree
Showing 29 changed files with 204 additions and 181 deletions.
2 changes: 1 addition & 1 deletion nixos/modules/installer/tools/nixos-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fi

# Resolve the flake.
if [[ -n $flake ]]; then
flake=$(nix "${flakeFlags[@]}" flake info --json "${extraBuildFlags[@]}" "${lockFlags[@]}" -- "$flake" | jq -r .url)
flake=$(nix "${flakeFlags[@]}" flake metadata --json "${extraBuildFlags[@]}" "${lockFlags[@]}" -- "$flake" | jq -r .url)
fi

if [[ ! -e $NIXOS_CONFIG && -z $system && -z $flake ]]; then
Expand Down
9 changes: 8 additions & 1 deletion nixos/modules/services/mail/exim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ in
'';
};

queueRunnerInterval = mkOption {
type = types.str;
default = "5m";
description = ''
How often to spawn a new queue runner.
'';
};
};

};
Expand Down Expand Up @@ -104,7 +111,7 @@ in
wantedBy = [ "multi-user.target" ];
restartTriggers = [ config.environment.etc."exim.conf".source ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/exim -bdf -q30m";
ExecStart = "${cfg.package}/bin/exim -bdf -q${cfg.queueRunnerInterval}";
ExecReload = "${coreutils}/bin/kill -HUP $MAINPID";
};
preStart = ''
Expand Down
65 changes: 36 additions & 29 deletions nixos/modules/services/mail/spamassassin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,36 @@ in
};

systemd.services.sa-update = {
# Needs to be able to contact the update server.
wants = [ "network-online.target" ];
after = [ "network-online.target" ];

serviceConfig = {
Type = "oneshot";
User = "spamd";
Group = "spamd";
StateDirectory = "spamassassin";
ExecStartPost = "+${pkgs.systemd}/bin/systemctl -q --no-block try-reload-or-restart spamd.service";
};

script = ''
set +e
${pkgs.su}/bin/su -s "${pkgs.bash}/bin/bash" -c "${pkgs.spamassassin}/bin/sa-update --gpghomedir=/var/lib/spamassassin/sa-update-keys/" spamd
v=$?
${pkgs.spamassassin}/bin/sa-update --verbose --gpghomedir=/var/lib/spamassassin/sa-update-keys/
rc=$?
set -e
if [ $v -gt 1 ]; then
echo "sa-update execution error"
exit $v
if [[ $rc -gt 1 ]]; then
# sa-update failed.
exit $rc
fi
if [ $v -eq 0 ]; then
systemctl reload spamd.service
if [[ $rc -eq 1 ]]; then
# No update was available, exit successfully.
exit 0
fi
# An update was available and installed. Compile the rules.
${pkgs.spamassassin}/bin/sa-compile
'';
};

Expand All @@ -153,32 +170,22 @@ in
};

systemd.services.spamd = {
description = "Spam Assassin Server";
description = "SpamAssassin Server";

wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
wants = [ "sa-update.service" ];
after = [
"network.target"
"sa-update.service"
];

serviceConfig = {
ExecStart = "${pkgs.spamassassin}/bin/spamd ${optionalString cfg.debug "-D"} --username=spamd --groupname=spamd --virtual-config-dir=/var/lib/spamassassin/user-%u --allow-tell --pidfile=/run/spamd.pid";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
User = "spamd";
Group = "spamd";
ExecStart = "+${pkgs.spamassassin}/bin/spamd ${optionalString cfg.debug "-D"} --username=spamd --groupname=spamd --virtual-config-dir=%S/spamassassin/user-%u --allow-tell --pidfile=/run/spamd.pid";
ExecReload = "+${pkgs.coreutils}/bin/kill -HUP $MAINPID";
StateDirectory = "spamassassin";
};

# 0 and 1 no error, exitcode > 1 means error:
# https://spamassassin.apache.org/full/3.1.x/doc/sa-update.html#exit_codes
preStart = ''
echo "Recreating '/var/lib/spamasassin' with creating '3.004001' (or similar) and 'sa-update-keys'"
mkdir -p /var/lib/spamassassin
chown spamd:spamd /var/lib/spamassassin -R
set +e
${pkgs.su}/bin/su -s "${pkgs.bash}/bin/bash" -c "${pkgs.spamassassin}/bin/sa-update --gpghomedir=/var/lib/spamassassin/sa-update-keys/" spamd
v=$?
set -e
if [ $v -gt 1 ]; then
echo "sa-update execution error"
exit $v
fi
chown spamd:spamd /var/lib/spamassassin -R
'';
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,12 @@ def main() -> None:
gens += get_generations(profile)
remove_old_entries(gens)
for gen in gens:
write_entry(*gen, machine_id)
if os.readlink(system_dir(*gen)) == args.default_config:
write_loader_conf(*gen)
try:
write_entry(*gen, machine_id)
if os.readlink(system_dir(*gen)) == args.default_config:
write_loader_conf(*gen)
except OSError as e:
print("ignoring profile '{}' in the list of boot entries because of the following error:\n{}".format(profile, e), file=sys.stderr)

memtest_entry_file = "@efiSysMountPoint@/loader/entries/memtest86.conf"
if os.path.exists(memtest_entry_file):
Expand Down
11 changes: 3 additions & 8 deletions nixos/modules/virtualisation/nixos-containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -439,21 +439,16 @@ in
default = false;
description = ''
Whether this NixOS machine is a lightweight container running
in another NixOS system. If set to true, support for nested
containers is disabled by default, but can be reenabled by
setting <option>boot.enableContainers</option> to true.
in another NixOS system.
'';
};

boot.enableContainers = mkOption {
type = types.bool;
default = !config.boot.isContainer;
default = true;
description = ''
Whether to enable support for NixOS containers. Defaults to true
(at no cost if containers are not actually used), but only if the
system is not itself a lightweight container of a host.
To enable support for nested containers, this option has to be
explicitly set to true (in the outer container).
(at no cost if containers are not actually used).
'';
};

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 @@ -75,6 +75,7 @@ in
containers-ip = handleTest ./containers-ip.nix {};
containers-macvlans = handleTest ./containers-macvlans.nix {};
containers-names = handleTest ./containers-names.nix {};
containers-nested = handleTest ./containers-nested.nix {};
containers-physical_interfaces = handleTest ./containers-physical_interfaces.nix {};
containers-portforward = handleTest ./containers-portforward.nix {};
containers-reloadable = handleTest ./containers-reloadable.nix {};
Expand Down
30 changes: 30 additions & 0 deletions nixos/tests/containers-nested.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Test for NixOS' container nesting.

import ./make-test-python.nix ({ pkgs, ... }: {
name = "nested";

meta = with pkgs.lib.maintainers; { maintainers = [ sorki ]; };

machine = { lib, ... }:
let
makeNested = subConf: {
containers.nested = {
autoStart = true;
privateNetwork = true;
config = subConf;
};
};
in makeNested (makeNested { });

testScript = ''
machine.start()
machine.wait_for_unit("container@nested.service")
machine.succeed("systemd-run --pty --machine=nested -- machinectl list | grep nested")
print(
machine.succeed(
"systemd-run --pty --machine=nested -- systemd-run --pty --machine=nested -- systemctl status"
)
)
'';
})

5 changes: 2 additions & 3 deletions pkgs/applications/graphics/hydrus/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ lib
, fetchFromGitHub
, xz
, qt5
, wrapQtAppsHook
, miniupnpc_2
, swftools
Expand All @@ -10,14 +9,14 @@

pythonPackages.buildPythonPackage rec {
pname = "hydrus";
version = "434";
version = "436";
format = "other";

src = fetchFromGitHub {
owner = "hydrusnetwork";
repo = "hydrus";
rev = "v${version}";
sha256 = "sha256-7Allc9zawja8DO2idv+MAYZ/cBRTCMd0mbgBLfEVii8=";
sha256 = "sha256-FXm8VUEY0OZ6/dc/qNwOXekhv5H2C9jjg/eNDoMvMn0==";
};

nativeBuildInputs = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/cluster/kubeconform/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

buildGoModule rec {
pname = "kubeconform";
version = "0.4.6";
version = "0.4.7";

src = fetchFromGitHub {
owner = "yannh";
repo = pname;
rev = "v${version}";
sha256 = "sha256-lduHYYskEPUimEX54ymOyo5jY7GGBB42YTefDMNS4qo=";
sha256 = "sha256-ahVdKMx3u2KnJ30wi9rV8JCVg9wPmbgdrtG8IpWWlCs=";
};

vendorSha256 = null;
Expand Down
13 changes: 7 additions & 6 deletions pkgs/development/compilers/koka/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, buildPackages, cmake, gnumake, makeWrapper, mkDerivation, fetchFromGitHub
{ stdenv, pkgsHostTarget, cmake, makeWrapper, mkDerivation, fetchFromGitHub
, alex, array, base, bytestring, cond, containers, directory, extra
, filepath, haskeline, hpack, hspec, hspec-core, json, lib, mtl
, parsec, process, regex-compat, text, time }:
Expand All @@ -18,11 +18,12 @@ let
src = "${src}/kklib";
nativeBuildInputs = [ cmake ];
};
inherit (pkgsHostTarget.targetPackages.stdenv) cc;
runtimeDeps = [
buildPackages.stdenv.cc
buildPackages.stdenv.cc.bintools.bintools
gnumake
cmake
cc
cc.bintools.bintools
pkgsHostTarget.gnumake
pkgsHostTarget.cmake
];
in
mkDerivation rec {
Expand All @@ -42,7 +43,7 @@ mkDerivation rec {
cp -a contrib $out/share/koka/v${version}
cp -a kklib $out/share/koka/v${version}
wrapProgram "$out/bin/koka" \
--set CC "${lib.getBin buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" \
--set CC "${lib.getBin cc}/bin/${cc.targetPrefix}cc" \
--prefix PATH : "${lib.makeSearchPath "bin" runtimeDeps}"
'';
doCheck = false;
Expand Down
14 changes: 10 additions & 4 deletions pkgs/development/coq-modules/tlc/default.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
{ lib, mkCoqDerivation, coq, version ? null }:

with lib; mkCoqDerivation {
with lib; (mkCoqDerivation {
pname = "tlc";
owner = "charguer";
inherit version;
displayVersion = { tlc = false; };
defaultVersion = with versions; switch coq.coq-version [
{ case = range "8.12" "8.13"; out = "20210316"; }
{ case = range "8.10" "8.12"; out = "20200328"; }
{ case = range "8.6" "8.12"; out = "20181116"; }
] null;
release."20210316".sha256 = "1hlavnx20lxpf2iydbbxqmim9p8wdwv4phzp9ypij93yivih0g4a";
release."20200328".sha256 = "16vzild9gni8zhgb3qhmka47f8zagdh03k6nssif7drpim8233lx";
release."20181116".sha256 = "032lrbkxqm9d3fhf6nv1kq2z0mqd3czv3ijlbsjwnfh12xck4vpl";

installFlags = [ "CONTRIB=$(out)/lib/coq/${coq.coq-version}/user-contrib" ];

meta = {
homepage = "http://www.chargueraud.org/softs/tlc/";
description = "A non-constructive library for Coq";
license = licenses.free;
maintainers = [ maintainers.vbgl ];
};
}
}).overrideAttrs (x:
if versionAtLeast x.version "20210316"
then {}
else {
installFlags = [ "CONTRIB=$(out)/lib/coq/${coq.coq-version}/user-contrib" ];
}
)
4 changes: 2 additions & 2 deletions pkgs/development/libraries/zookeeper_mt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ stdenv.mkDerivation rec {

src = fetchurl {
url = "mirror://apache/zookeeper/${zookeeper.pname}-${version}/apache-${zookeeper.pname}-${version}.tar.gz";
sha512 = "16994067d460a1b6af6a71f3458c64ee32629e876a1ff6646d57be62f1a5adab57462af84074ecaded4186dd3fde035ee24cd9d578b8e5044073eb05f4ab9c3e";
sha512 = "90643aa0ae1b9bf1f5e137dfbcee7e3c53db15e5038d7e406e4a1c345d6a0531bf7afa2b03f99d419ebd0fe892f127a7abfe582f786034ba823e53a0a9246bfb";
};

sourceRoot = "apache-${zookeeper.pname}-${version}/zookeeper-client/zookeeper-client-c";

nativeBuildInputs = [
autoreconfHook
pkg-config
jre
];

buildInputs = [
openssl
pkg-config
zookeeper
];

Expand Down
12 changes: 9 additions & 3 deletions pkgs/development/python-modules/stevedore/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ buildPythonPackage rec {
sha256 = "3a5bbd0652bf552748871eaa73a4a8dc2899786bc497a2aa1fcb4dcdb0debeee";
};

propagatedBuildInputs = [ pbr setuptools six ]
++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
propagatedBuildInputs = [
pbr
setuptools
six
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
];

doCheck = false;
pythonImportsCheck = [ "stevedore" ];

meta = with lib; {
description = "Manage dynamic plugins for Python applications";
homepage = "https://pypi.python.org/pypi/stevedore";
homepage = "https://docs.openstack.org/stevedore/";
license = licenses.asl20;
maintainers = with maintainers; [ fab ];
};
}
4 changes: 4 additions & 0 deletions pkgs/development/python-modules/tensorflow/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ let
addOpenGLRunpath "$lib"
done
'';

requiredSystemFeatures = [
"big-parallel"
];
};

meta = with lib; {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/tools/esbuild/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

buildGoModule rec {
pname = "esbuild";
version = "0.11.13";
version = "0.11.14";

src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
sha256 = "0v358n2vpa1l1a699zyq43yzb3lcxjp3k4acppx0ggva05qn9zd1";
sha256 = "0qxylzc7lzpsp5hm3dl5jvy9aca8azn8dmbjz9z5n5rkdmm8vd9p";
};

vendorSha256 = "1n5538yik72x94vzfq31qaqrkpxds5xys1wlibw2gn2am0z5c06q";
Expand Down

0 comments on commit c648f7e

Please sign in to comment.