Skip to content

Commit

Permalink
Merge staging-next into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Apr 29, 2022
2 parents 7ada728 + 2254d18 commit fbd6785
Show file tree
Hide file tree
Showing 19 changed files with 126 additions and 64 deletions.
2 changes: 1 addition & 1 deletion nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ Existing 3rd party modules that provided similar functionality, like <literal>pu
<literal>systemd-shutdown</literal> is now properly linked on
shutdown to unmount all filesystems and device mapper devices
cleanly. This can be disabled using
<literal>boot.systemd.shutdown.enable</literal>.
<literal>systemd.shutdownRamfs.enable</literal>.
</para>
</listitem>
<listitem>
Expand Down
2 changes: 1 addition & 1 deletion nixos/doc/manual/release-notes/rl-2205.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ In addition to numerous new and upgraded packages, this release has the followin

- `[email protected]` settings have been reverted to the default systemd behaviour. User namespaces are now activated by default. If you want to keep running nspawn containers without user namespaces you need to set `systemd.nspawn.<name>.execConfig.PrivateUsers = false`

- `systemd-shutdown` is now properly linked on shutdown to unmount all filesystems and device mapper devices cleanly. This can be disabled using `boot.systemd.shutdown.enable`.
- `systemd-shutdown` is now properly linked on shutdown to unmount all filesystems and device mapper devices cleanly. This can be disabled using `systemd.shutdownRamfs.enable`.

- The Tor SOCKS proxy is now actually disabled if `services.tor.client.enable` is set to `false` (the default). If you are using this functionality but didn't change the setting or set it to `false`, you now need to set it to `true`.

Expand Down
34 changes: 33 additions & 1 deletion nixos/lib/systemd-types.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, systemdUtils }:
{ lib, systemdUtils, pkgs }:

with systemdUtils.lib;
with systemdUtils.unitOptions;
Expand Down Expand Up @@ -34,4 +34,36 @@ rec {

automounts = with types; listOf (submodule [ stage2AutomountOptions unitConfig automountConfig ]);
initrdAutomounts = with types; attrsOf (submodule [ stage1AutomountOptions unitConfig automountConfig ]);

initrdContents = types.attrsOf (types.submodule ({ config, options, name, ... }: {
options = {
enable = mkEnableOption "copying of this file and symlinking it" // { default = true; };

target = mkOption {
type = types.path;
description = ''
Path of the symlink.
'';
default = name;
};

text = mkOption {
default = null;
type = types.nullOr types.lines;
description = "Text of the file.";
};

source = mkOption {
type = types.path;
description = "Path of the source file.";
};
};

config = {
source = mkIf (config.text != null) (
let name' = "initrd-" + baseNameOf name;
in mkDerivedConfig options.text (pkgs.writeText name')
);
};
}));
}
2 changes: 1 addition & 1 deletion nixos/lib/utils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,6 @@ rec {
systemdUtils = {
lib = import ./systemd-lib.nix { inherit lib config pkgs; };
unitOptions = import ./systemd-unit-options.nix { inherit lib systemdUtils; };
types = import ./systemd-types.nix { inherit lib systemdUtils; };
types = import ./systemd-types.nix { inherit lib systemdUtils pkgs; };
};
}
32 changes: 1 addition & 31 deletions nixos/modules/system/boot/systemd/initrd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -155,37 +155,7 @@ in {
'';
visible = false;
default = {};
type = types.attrsOf (types.submodule ({ config, options, name, ... }: {
options = {
enable = mkEnableOption "copying of this file to initrd and symlinking it" // { default = true; };

target = mkOption {
type = types.path;
description = ''
Path of the symlink.
'';
default = name;
};

text = mkOption {
default = null;
type = types.nullOr types.lines;
description = "Text of the file.";
};

source = mkOption {
type = types.path;
description = "Path of the source file.";
};
};

config = {
source = mkIf (config.text != null) (
let name' = "initrd-" + baseNameOf name;
in mkDerivedConfig options.text (pkgs.writeText name')
);
};
}));
type = utils.systemdUtils.types.initrdContents;
};

storePaths = mkOption {
Expand Down
36 changes: 31 additions & 5 deletions nixos/modules/system/boot/systemd/shutdown.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,57 @@
{ config, lib, ... }: let
{ config, lib, utils, pkgs, ... }: let

cfg = config.boot.systemd.shutdown;
cfg = config.systemd.shutdownRamfs;

ramfsContents = let
storePaths = map (p: "${p}\n") cfg.storePaths;
contents = lib.mapAttrsToList (_: v: "${v.source}\n${v.target}") (lib.filterAttrs (_: v: v.enable) cfg.contents);
in pkgs.writeText "shutdown-ramfs-contents" (lib.concatStringsSep "\n" (storePaths ++ contents));

in {
options.boot.systemd.shutdown = {
options.systemd.shutdownRamfs = {
enable = lib.mkEnableOption "pivoting back to an initramfs for shutdown" // { default = true; };
contents = lib.mkOption {
description = "Set of files that have to be linked into the shutdown ramfs";
example = lib.literalExpression ''
{
"/lib/systemd/system-shutdown/zpool-sync-shutdown".source = writeShellScript "zpool" "exec ''${zfs}/bin/zpool sync"
}
'';
type = utils.systemdUtils.types.initrdContents;
};

storePaths = lib.mkOption {
description = ''
Store paths to copy into the shutdown ramfs as well.
'';
type = lib.types.listOf lib.types.singleLineStr;
default = [];
};
};

config = lib.mkIf cfg.enable {
systemd.shutdownRamfs.contents."/shutdown".source = "${config.systemd.package}/lib/systemd/systemd-shutdown";
systemd.shutdownRamfs.storePaths = [pkgs.runtimeShell "${pkgs.coreutils}/bin"];

systemd.services.generate-shutdown-ramfs = {
description = "Generate shutdown ramfs";
wantedBy = [ "shutdown.target" ];
before = [ "shutdown.target" ];
unitConfig = {
DefaultDependencies = false;
ConditionFileIsExecutable = [
"!/run/initramfs/shutdown"
"/run/current-system/systemd/lib/systemd/systemd-shutdown"
];
};

path = [pkgs.util-linux pkgs.makeInitrdNGTool pkgs.glibc pkgs.patchelf];
serviceConfig.Type = "oneshot";
script = ''
mkdir -p /run/initramfs
if ! mountpoint -q /run/initramfs; then
mount -t tmpfs tmpfs /run/initramfs
fi
cp /run/current-system/systemd/lib/systemd/systemd-shutdown /run/initramfs/shutdown
make-initrd-ng ${ramfsContents} /run/initramfs
'';
};
};
Expand Down
5 changes: 5 additions & 0 deletions nixos/modules/tasks/filesystems/zfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,11 @@ in
'') rootPools));
};

systemd.shutdownRamfs.contents."/etc/systemd/system-shutdown/zpool".source = pkgs.writeShellScript "zpool-sync-shutdown" ''
exec ${cfgZfs.package}/bin/zpool sync
'';
systemd.shutdownRamfs.storePaths = ["${cfgZfs.package}/bin/zpool"];

# TODO FIXME See https://github.com/NixOS/nixpkgs/pull/99386#issuecomment-798813567. To not break people's bootloader and as probably not everybody would read release notes that thoroughly add inSystem.
boot.loader.grub = mkIf (inInitrd || inSystem) {
zfsSupport = true;
Expand Down
11 changes: 8 additions & 3 deletions nixos/tests/systemd-shutdown.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import ./make-test-python.nix ({ pkgs, systemdStage1 ? false, ...} : {
import ./make-test-python.nix ({ pkgs, systemdStage1 ? false, ...} : let
msg = "Shutting down NixOS";
in {
name = "systemd-shutdown";
meta = with pkgs.lib.maintainers; {
maintainers = [ das_j ];
};

nodes.machine = {
imports = [ ../modules/profiles/minimal.nix ];
boot.initrd.systemd.enable = systemdStage1;
systemd.shutdownRamfs.contents."/etc/systemd/system-shutdown/shutdown-message".source = pkgs.writeShellScript "shutdown-message" ''
echo "${msg}"
'';
};

testScript = ''
machine.wait_for_unit("multi-user.target")
# .shutdown() would wait for the machine to power off
machine.succeed("systemctl poweroff")
# Message printed by systemd-shutdown
machine.wait_for_console_text("All filesystems, swaps, loop devices, MD devices and DM devices detached.")
machine.wait_for_console_text("Unmounting '/oldroot'")
machine.wait_for_console_text("${msg}")
# Don't try to sync filesystems
machine.booted = False
'';
Expand Down
20 changes: 20 additions & 0 deletions pkgs/applications/misc/octoprint/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ let
};
disabledTestPaths = [
"t/unit/backends/test_mongodb.py"
"t/unit/backends/test_cassandra.py"
];
});
}
Expand Down Expand Up @@ -254,6 +255,24 @@ let
}
)

(
self: super: {
flask-restful = super.flask-restful.overridePythonAttrs (oldAttrs: rec {
# remove werkzeug patch
patches = [];
});
}
)

(
self: super: {
trytond = super.trytond.overridePythonAttrs (oldAttrs: rec {
# remove werkzeug patch
patches = [];
});
}
)

# Built-in dependency
(
self: super: {
Expand Down Expand Up @@ -406,6 +425,7 @@ let
"watchdog"
"wrapt"
"zeroconf"
"Flask-Login"
];
in
''
Expand Down
8 changes: 6 additions & 2 deletions pkgs/development/coq-modules/parsec/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ mkCoqDerivation {
releaseRev = (v: "v${v}");

inherit version;
defaultVersion = if versions.range "8.12" "8.13" coq.version then "0.1.0" else null;
defaultVersion = with versions; switch coq.version [
{ case = range "8.12" "8.15"; out = "0.1.1"; }
{ case = range "8.12" "8.13"; out = "0.1.0"; }
] null;
release."0.1.1".sha256 = "sha256:1c0l18s68pzd4c8i3jimh2yz0pqm4g38pca4bm7fr18r8xmqf189";
release."0.1.0".sha256 = "sha256:01avfcqirz2b9wjzi9iywbhz9szybpnnj3672dgkfsimyg9jgnsr";

meta = {
description = "Library for serialization to S-expressions";
license = licenses.mit;
license = licenses.bsd3;
maintainers = with maintainers; [ Zimmi48 ];
};
}
6 changes: 3 additions & 3 deletions pkgs/misc/scrcpy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
}:

let
version = "1.23";
version = "1.24";
prebuilt_server = fetchurl {
url = "https://github.com/Genymobile/scrcpy/releases/download/v${version}/scrcpy-server-v${version}";
sha256 = "sha256-KpE/1HR4wLMG/KUHywvrYl5JoZ/5/Hq5BONu9bn+fmg=";
sha256 = "sha256-rnSoHqecDcclDlhmJ8J4wKmoxd5GyftcOMFn+xo28FY=";
};
in
stdenv.mkDerivation rec {
Expand All @@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
owner = "Genymobile";
repo = pname;
rev = "v${version}";
sha256 = "sha256-WR70wV+EfNFFkMFkffnwaTridd33CpJ0zTAlXYyjZgM=";
sha256 = "sha256-mL0lSZUPMMcLGq4iPp/IgYZLaTeey9Nv9vVwY1gaIRk=";
};

# postPatch:
Expand Down
4 changes: 2 additions & 2 deletions pkgs/os-specific/linux/kernel/linux-4.14.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with lib;

buildLinux (args // rec {
version = "4.14.276";
version = "4.14.277";

# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
Expand All @@ -13,6 +13,6 @@ buildLinux (args // rec {

src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "1rxksrmkh5raz930y9khfg85dglgphrgcvkj21n86m333pajs4mf";
sha256 = "058vzn1gcsc194hgwrj78afawz2anm7ga8a1x5m5i4cw8p1arp73";
};
} // (args.argsOverride or {}))
4 changes: 2 additions & 2 deletions pkgs/os-specific/linux/kernel/linux-4.19.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with lib;

buildLinux (args // rec {
version = "4.19.239";
version = "4.19.240";

# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
Expand All @@ -13,6 +13,6 @@ buildLinux (args // rec {

src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "0fsr9jy8d1rpg6ixp7av01pqz3vq50rgfcjd7vj16ccsdk15sz5z";
sha256 = "1hj6vngynx6kjaczjl77jjwqq0kh0lm6jdqjvakd1cgrppaizb3j";
};
} // (args.argsOverride or {}))
4 changes: 2 additions & 2 deletions pkgs/os-specific/linux/kernel/linux-4.9.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{ buildPackages, fetchurl, perl, buildLinux, nixosTests, stdenv, ... } @ args:

buildLinux (args // rec {
version = "4.9.311";
version = "4.9.312";
extraMeta.branch = "4.9";
extraMeta.broken = stdenv.isAarch64;

src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "15wqwplq1qk3ni5arfigfl62zbdwhaki3vkg1lv3sln2gnpm059l";
sha256 = "09y6wl4j3y46fza6kmssibmxspxx0i44fqrhc2cyvrm2bgxv2bzs";
};
} // (args.argsOverride or {}))
4 changes: 2 additions & 2 deletions pkgs/os-specific/linux/kernel/linux-5.10.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with lib;

buildLinux (args // rec {
version = "5.10.112";
version = "5.10.113";

# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
Expand All @@ -13,6 +13,6 @@ buildLinux (args // rec {

src = fetchurl {
url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
sha256 = "19aa7fq8n75gh0vv01mpxg4cxkfpr5lj0sv6lxiyzcgbc71isv4c";
sha256 = "1z3dd5hrdbn2axsi2n70n41q1dq2dvg7s8aph1p6yiajpc16llc2";
};
} // (args.argsOverride or {}))
4 changes: 2 additions & 2 deletions pkgs/os-specific/linux/kernel/linux-5.15.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with lib;

buildLinux (args // rec {
version = "5.15.35";
version = "5.15.36";

# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
Expand All @@ -15,6 +15,6 @@ buildLinux (args // rec {

src = fetchurl {
url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
sha256 = "1n05c4c4ish25x483a2p5177zgda8pq7g4752n1b7chfygi5l6ha";
sha256 = "1466557034q1fzvpy8vwj8ps3cv2q8s7z76af9y1jz4kgaqmsd1n";
};
} // (args.argsOverride or { }))
4 changes: 2 additions & 2 deletions pkgs/os-specific/linux/kernel/linux-5.17.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with lib;

buildLinux (args // rec {
version = "5.17.4";
version = "5.17.5";

# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
Expand All @@ -13,6 +13,6 @@ buildLinux (args // rec {

src = fetchurl {
url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
sha256 = "1ifkl1j5dimipqxwki26i4v6gav70g24456y7ynbb71sx1pdag3f";
sha256 = "11z95wsgmj97pg77yck26l0383gncbla0zwpzv4gjdj4p62x3g4v";
};
} // (args.argsOverride or { }))
Loading

0 comments on commit fbd6785

Please sign in to comment.