Unverified Commit 72404a8f authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge master into staging-next

parents 86c023d5 2dc458d3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@

- LXD now supports virtual machine instances to complement the existing container support

- The `nixos-rebuild` command has been given a `list-generations` subcommand. See `man nixos-rebuild` for more details.

## New Services {#sec-release-23.11-new-services}

- [MCHPRS](https://github.com/MCHPR/MCHPRS), a multithreaded Minecraft server built for redstone. Available as [services.mchprs](#opt-services.mchprs.enable).
@@ -290,3 +292,5 @@ The module update takes care of the new config syntax and the data itself (user
  ./common/auto-format-root-device.nix ];` When you use the systemd initrd, you
  can automatically format the root device by setting
  `virtualisation.fileSystems."/".autoFormat = true;`.

- The `electron` packages now places its application files in `$out/libexec/electron` instead of `$out/lib/electron`. Packages using electron-builder will fail to build and need to be adjusted by changing `lib` to `libexec`.
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ in
          ProtectSystem = "strict";
          ReadWritePaths = cfg.recordingsDir;
          RemoveIPC = true;
          RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
          RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_NETLINK" ];
          RestrictNamespaces = true;
          RestrictRealtime = true;
          RestrictSUIDSGID = true;
+3 −1
Original line number Diff line number Diff line
@@ -395,7 +395,9 @@ in
      description = lib.mdDoc ''
        The amount of time which can elapse after a reboot has been triggered
        before a watchdog hardware device will automatically reboot the system.
        Valid time units include "ms", "s", "min", "h", "d", and "w".
        Valid time units include "ms", "s", "min", "h", "d", and "w". If left
        `null`, systemd will use its default of `10min`; see also {command}`man
        5 systemd-system.conf`.
      '';
    };

+10 −4
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

  cfg = config.boot.swraid;

  mdadm_conf = config.environment.etc."mdadm.conf";

in {
  imports = [
    (lib.mkRenamedOptionModule [ "boot" "initrd" "services" "swraid" "enable" ] [ "boot" "swraid" "enable" ])
@@ -36,8 +38,14 @@ in {
  };

  config = lib.mkIf cfg.enable {
    warnings = lib.mkIf
        ((builtins.match ".*(MAILADDR|PROGRAM).*" mdadm_conf.text) == null)
        [ "mdadm: Neither MAILADDR nor PROGRAM has been set. This will cause the `mdmon` service to crash." ];

    environment.systemPackages = [ pkgs.mdadm ];

    environment.etc."mdadm.conf".text = lib.mkAfter cfg.mdadmConf;

    services.udev.packages = [ pkgs.mdadm ];

    systemd.packages = [ pkgs.mdadm ];
@@ -59,12 +67,10 @@ in {
        $out/bin/mdadm --version
      '';

      extraFiles."/etc/mdadm.conf".source = pkgs.writeText "mdadm.conf" config.boot.swraid.mdadmConf;
      extraFiles."/etc/mdadm.conf" = mdadm_conf;

      systemd = {
        contents."/etc/mdadm.conf" = lib.mkIf (cfg.mdadmConf != "") {
          text = cfg.mdadmConf;
        };
        contents."/etc/mdadm.conf".text = mdadm_conf.text;

        packages = [ pkgs.mdadm ];
        initrdBin = [ pkgs.mdadm ];
+12 −1
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
        ARRAY /dev/md0 devices=/dev/vdb,/dev/vdc
      '';
    };
    environment.etc."mdadm.conf".text = ''
      MAILADDR test@example.com
    '';
    boot.initrd = {
      systemd = {
        enable = true;
@@ -33,7 +36,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {

  testScript = ''
    # Create RAID
    machine.succeed("mdadm --create --force /dev/md0 -n 2 --level=raid0 /dev/vdb /dev/vdc")
    machine.succeed("mdadm --create --force /dev/md0 -n 2 --level=raid1 /dev/vdb /dev/vdc --metadata=0.90")
    machine.succeed("mkfs.ext4 -L testraid /dev/md0")
    machine.succeed("mkdir -p /mnt && mount /dev/md0 /mnt && echo hello > /mnt/test && umount /mnt")

@@ -48,5 +51,13 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
    assert "/dev/md0 on / type ext4" in machine.succeed("mount")
    assert "hello" in machine.succeed("cat /test")
    assert "md0" in machine.succeed("cat /proc/mdstat")

    expected_config = """MAILADDR test@example.com

    ARRAY /dev/md0 devices=/dev/vdb,/dev/vdc
    """
    got_config = machine.execute("cat /etc/mdadm.conf")[1]
    assert expected_config == got_config, repr((expected_config, got_config))
    machine.wait_for_unit("mdmonitor.service")
  '';
})
Loading