diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml index b10b30146d77..eb7ad6025da4 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml @@ -1292,7 +1292,7 @@ Existing 3rd party modules that provided similar functionality, like pu 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.shutdownRamfs.enable. diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index 147512e67a52..dffa9b4aec88 100644 --- a/nixos/doc/manual/release-notes/rl-2205.section.md +++ b/nixos/doc/manual/release-notes/rl-2205.section.md @@ -513,7 +513,7 @@ In addition to numerous new and upgraded packages, this release has the followin - `systemd-nspawn@.service` 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..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`. diff --git a/nixos/lib/systemd-types.nix b/nixos/lib/systemd-types.nix index 71962fab2e17..961b6d7f9851 100644 --- a/nixos/lib/systemd-types.nix +++ b/nixos/lib/systemd-types.nix @@ -1,4 +1,4 @@ -{ lib, systemdUtils }: +{ lib, systemdUtils, pkgs }: with systemdUtils.lib; with systemdUtils.unitOptions; @@ -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') + ); + }; + })); } diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix index 497d98aa4d19..d7671a374999 100644 --- a/nixos/lib/utils.nix +++ b/nixos/lib/utils.nix @@ -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; }; }; } diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index fc4bd6ff69b6..a93fda11bec2 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -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 { diff --git a/nixos/modules/system/boot/systemd/shutdown.nix b/nixos/modules/system/boot/systemd/shutdown.nix index 934269316676..63e1751f9b41 100644 --- a/nixos/modules/system/boot/systemd/shutdown.nix +++ b/nixos/modules/system/boot/systemd/shutdown.nix @@ -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 ''; }; }; diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index fbfc61177d38..5eca68798d5d 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -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; diff --git a/nixos/tests/systemd-shutdown.nix b/nixos/tests/systemd-shutdown.nix index 9283489c2559..688cd6dd2c17 100644 --- a/nixos/tests/systemd-shutdown.nix +++ b/nixos/tests/systemd-shutdown.nix @@ -1,4 +1,6 @@ -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 ]; @@ -6,7 +8,9 @@ import ./make-test-python.nix ({ pkgs, systemdStage1 ? false, ...} : { 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 = '' @@ -14,7 +18,8 @@ import ./make-test-python.nix ({ pkgs, systemdStage1 ? false, ...} : { # .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 ''; diff --git a/pkgs/applications/misc/octoprint/default.nix b/pkgs/applications/misc/octoprint/default.nix index b7b0f8ae46bf..1f4a318287a1 100644 --- a/pkgs/applications/misc/octoprint/default.nix +++ b/pkgs/applications/misc/octoprint/default.nix @@ -174,6 +174,7 @@ let }; disabledTestPaths = [ "t/unit/backends/test_mongodb.py" + "t/unit/backends/test_cassandra.py" ]; }); } @@ -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: { @@ -406,6 +425,7 @@ let "watchdog" "wrapt" "zeroconf" + "Flask-Login" ]; in '' diff --git a/pkgs/development/coq-modules/parsec/default.nix b/pkgs/development/coq-modules/parsec/default.nix index fa1aa3c8399a..fc8fef5a4d67 100644 --- a/pkgs/development/coq-modules/parsec/default.nix +++ b/pkgs/development/coq-modules/parsec/default.nix @@ -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 ]; }; } diff --git a/pkgs/misc/scrcpy/default.nix b/pkgs/misc/scrcpy/default.nix index 75caa3fcfb3c..bd3eedbe94f7 100644 --- a/pkgs/misc/scrcpy/default.nix +++ b/pkgs/misc/scrcpy/default.nix @@ -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 { @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { owner = "Genymobile"; repo = pname; rev = "v${version}"; - sha256 = "sha256-WR70wV+EfNFFkMFkffnwaTridd33CpJ0zTAlXYyjZgM="; + sha256 = "sha256-mL0lSZUPMMcLGq4iPp/IgYZLaTeey9Nv9vVwY1gaIRk="; }; # postPatch: diff --git a/pkgs/os-specific/linux/kernel/linux-4.14.nix b/pkgs/os-specific/linux/kernel/linux-4.14.nix index 0605782003ff..b451202871e7 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.14.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.14.nix @@ -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; @@ -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 {})) diff --git a/pkgs/os-specific/linux/kernel/linux-4.19.nix b/pkgs/os-specific/linux/kernel/linux-4.19.nix index 81502bde9b0e..c03c5d5afd21 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.19.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.19.nix @@ -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; @@ -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 {})) diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix index 68a3e5163888..704423c6e99b 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.9.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix @@ -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 {})) diff --git a/pkgs/os-specific/linux/kernel/linux-5.10.nix b/pkgs/os-specific/linux/kernel/linux-5.10.nix index 1dab43b9acf8..1ac78adf7c7e 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.10.nix @@ -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; @@ -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 {})) diff --git a/pkgs/os-specific/linux/kernel/linux-5.15.nix b/pkgs/os-specific/linux/kernel/linux-5.15.nix index 53f5e476a896..44438676ae3d 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.15.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.15.nix @@ -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; @@ -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 { })) diff --git a/pkgs/os-specific/linux/kernel/linux-5.17.nix b/pkgs/os-specific/linux/kernel/linux-5.17.nix index e4718bd1eed2..4c67169b706d 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.17.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.17.nix @@ -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; @@ -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 { })) diff --git a/pkgs/os-specific/linux/kernel/linux-5.4.nix b/pkgs/os-specific/linux/kernel/linux-5.4.nix index 2376538fbe27..073d0ef77054 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.4.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.4.nix @@ -3,7 +3,7 @@ with lib; buildLinux (args // rec { - version = "5.4.190"; + version = "5.4.191"; # 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; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "157ifcl59xxj721r302hg82vmbqzx5hjrlihrc5s4maxfw3ygm41"; + sha256 = "0fharjqasvq76pciwci6qamdadpfjh2n8gdyri8fj65drmgsi318"; }; } // (args.argsOverride or {})) diff --git a/pkgs/tools/networking/godns/default.nix b/pkgs/tools/networking/godns/default.nix index 0e1096240abc..d4a71895bb2e 100644 --- a/pkgs/tools/networking/godns/default.nix +++ b/pkgs/tools/networking/godns/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "godns"; - version = "2.7.4"; + version = "2.7.5"; src = fetchFromGitHub { owner = "TimothyYe"; repo = "godns"; rev = "v${version}"; - sha256 = "sha256-0aE+XcRqk/3/auscVdqdzehrpM6CeSdAJTugHXY8rek="; + sha256 = "sha256-YQNx0MwdThA2odJMq4rRNOtEe1ul6ICJNLSVr1aqCbA="; }; vendorSha256 = "sha256-vhByl9oJjFIvOskAgLubZ5RCcitKd2jjxi8D9nU6850=";