Unverified Commit a0be54df authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

Merge #221461: staging-next 2023-03-16

parents f9df580d 31c583a7
Loading
Loading
Loading
Loading
+92 −0
Original line number Diff line number Diff line
@@ -12,12 +12,18 @@ In addition to numerous new and upgraded packages, this release has the followin

  - default linux: 5.15 -\> 6.1, all supported kernels available

  - systemd has been updated to v253.1, see [the pull request](https://github.com/NixOS/nixpkgs/pull/216826) for more info.
    It's recommended to use `nixos-rebuild boot` and `reboot`, rather than `nixos-rebuild switch` - since in some rare cases
    the switch of a live system might fail.

- Cinnamon has been updated to 5.6, see [the pull request](https://github.com/NixOS/nixpkgs/pull/201328#issue-1449910204) for what is changed.

- KDE Plasma has been updated to v5.27, see [the release notes](https://kde.org/announcements/plasma/5/5.27.0/) for what is changed.

- `nixos-rebuild` now supports an extra `--specialisation` option that can be used to change specialisation for `switch` and `test` commands.

- `libxcrypt`, the library providing the `crypt(3)` password hashing function, is now built without support for algorithms not flagged [`strong`](https://github.com/besser82/libxcrypt/blob/v4.4.33/lib/hashes.conf#L48). This affects the availability of password hashing algorithms used for system login (`login(1)`, `passwd(1)`), but also Apache2 Basic-Auth, Samba, OpenLDAP, Dovecot, and [many other packages](https://github.com/search?q=repo%3ANixOS%2Fnixpkgs%20libxcrypt&type=code).

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

<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
@@ -183,12 +189,16 @@ In addition to numerous new and upgraded packages, this release has the followin

- conntrack helper autodetection has been removed from kernels 6.0 and up upstream, and an assertion was added to ensure things don't silently stop working. Migrate your configuration to assign helpers explicitly or use an older LTS kernel branch as a temporary workaround.

- The `services.pipewire.config` options have been removed, as they have basically never worked correctly. All behavior defined by the default configuration can be overridden with drop-in files as necessary - see [below](#sec-release-23.05-migration-pipewire) for details.

- The catch-all `hardware.video.hidpi.enable` option was removed. Users on high density displays may want to:

  - Set `services.xserver.upscaleDefaultCursor` to upscale the default X11 cursor for higher resolutions
  - Adjust settings under `fonts.fontconfig` according to preference
  - Adjust `console.font` according to preference, though the kernel will generally choose a reasonably sized font

- `services.pipewire.media-session` and the `pipewire-media-session` package have been removed, as they are no longer supported upstream. Users are encouraged to use `services.pipewire.wireplumber` instead.

- The `baget` package and module was removed due to being unmaintained.

## Other Notable Changes {#sec-release-23.05-notable-changes}
@@ -341,3 +351,85 @@ In addition to numerous new and upgraded packages, this release has the followin
- `k3s` can now be configured with an EnvironmentFile for its systemd service, allowing secrets to be provided without ending up in the Nix Store.

- `boot.initrd.luks.device.<name>` has a new `tryEmptyPassphrase` option, this is useful for OEM's who need to install an encrypted disk with a future settable passphrase

## Detailed migration information {#sec-release-23.05-migration}

### Pipewire configuration overrides {#sec-release-23.05-migration-pipewire}

#### Why this change? {#sec-release-23.05-migration-pipewire-why}

The Pipewire config semantics don't really match the NixOS module semantics, so it's extremely awkward to override the default config, especially when lists are involved. Vendoring the configuration files in nixpkgs also creates unnecessary maintenance overhead.

Also, upstream added a lot of accomodations to allow doing most of the things you'd want to do with a config edit in better ways.

#### Migrating your configuration {#sec-release-23.05-migration-pipewire-how}

Compare your settings to [the defaults](https://gitlab.freedesktop.org/pipewire/pipewire/-/tree/master/src/daemon) and where your configuration differs from them.

Then, create a drop-in JSON file in `/etc/pipewire/<config file name>.d/99-custom.conf` (the actual filename can be anything) and migrate your changes to it according to the following sections.

Repeat for every file you've modified, changing the directory name accordingly.

#### Things you can just copy over {#sec-release-23.05-migration-pipewire-simple}

If you are:

- setting properties via `*.properties`
- loading a new module to `context.modules`
- creating new objects with `context.objects`
- declaring SPA libraries with `context.spa-libs`
- running custom commands with `context.exec`
- adding new rules with `*.rules`
- running custom PulseAudio commands with `pulse.cmd`

Simply move the definitions into the drop-in.

Note that the use of `context.exec` is not recommended and other methods of running your thing are likely a better option.

```json
{
  "context.properties": {
    "your.property.name": "your.property.value"
  },
  "context.modules": [
    { "name": "libpipewire-module-my-cool-thing" }
  ],
  "context.objects": [
    { "factory": { ... } }
  ],
  "alsa.rules": [
    { "matches: { ... }, "actions": { ... } }
  ]
}
```

#### Removing a module from `context.modules` {#sec-release-23.05-migration-pipewire-removing-modules}

Look for an option to disable it via `context.properties` (`"module.x11.bell": "false"` is likely the most common use case here).
If one is not available, proceed to [Nuclear option](#sec-release-23.05-migration-pipewire).

#### Modifying a module's parameters in `context.modules` {#sec-release-23.05-migration-pipewire-modifying-modules}

For most modules (e.g. `libpipewire-module-rt`) it's enough to load the module again with the new arguments, e.g.:

```json
{
  "context.modules": [
    {
      "name": "libpipewire-module-rt",
      "args": {
        "rt.prio": 90
      }
    }
  ]
}
```

Note that `module-rt` specifically will generally use the highest values available by default, so setting limits on the `pipewire` systemd service is preferable to reloading.

If reloading the module is not an option, proceed to [Nuclear option](#sec-release-23.05-migration-pipewire).

#### Nuclear option {#sec-release-23.05-migration-pipewire-nuclear}
If all else fails, you can still manually copy the contents of the default configuration file
from `${pkgs.pipewire.lib}/share/pipewire` to `/etc/pipewire` and edit it to fully override the default.
However, this should be done only as a last resort. Please talk to the Pipewire maintainers if you ever need to do this.
+8 −5
Original line number Diff line number Diff line
@@ -539,7 +539,9 @@ in {

  ###### implementation

  config = {
  config = let
    cryptSchemeIdPatternGroup = "(${lib.concatStringsSep "|" pkgs.libxcrypt.enabledCryptSchemeIds})";
  in {

    users.users = {
      root = {
@@ -601,15 +603,16 @@ in {
      text = ''
        users=()
        while IFS=: read -r user hash tail; do
          if [[ "$hash" = "$"* && ! "$hash" =~ ^\$(y|gy|7|2b|2y|2a|6)\$ ]]; then
          if [[ "$hash" = "$"* && ! "$hash" =~ ^\''$${cryptSchemeIdPatternGroup}\$ ]]; then
            users+=("$user")
          fi
        done </etc/shadow

        if (( "''${#users[@]}" )); then
          echo "
        WARNING: The following user accounts rely on password hashes that will
        be removed in NixOS 23.05. They should be renewed as soon as possible."
        WARNING: The following user accounts rely on password hashing algorithms
        that have been removed. They need to be renewed as soon as possible, as
        they do prevent their users from logging in."
          printf ' - %s\n' "''${users[@]}"
        fi
      '';
@@ -729,7 +732,7 @@ in {
        let
          sep = "\\$";
          base64 = "[a-zA-Z0-9./]+";
          id = "[a-z0-9-]+";
          id = cryptSchemeIdPatternGroup;
          value = "[a-zA-Z0-9/+.-]+";
          options = "${id}(=${value})?(,${id}=${value})*";
          scheme  = "${id}(${sep}${options})?";
+3 −0
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@ with lib;
  # ISO naming.
  isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.iso";

  # BIOS booting
  isoImage.makeBiosBootable = true;

  # EFI booting
  isoImage.makeEfiBootable = true;

+14 −7
Original line number Diff line number Diff line
@@ -535,10 +535,17 @@ in
      '';
    };

    isoImage.makeBiosBootable = mkOption {
      default = false;
      description = lib.mdDoc ''
        Whether the ISO image should be a BIOS-bootable disk.
      '';
    };

    isoImage.makeEfiBootable = mkOption {
      default = false;
      description = lib.mdDoc ''
        Whether the ISO image should be an efi-bootable volume.
        Whether the ISO image should be an EFI-bootable volume.
      '';
    };

@@ -693,7 +700,7 @@ in
    boot.loader.grub.enable = false;

    environment.systemPackages =  [ grubPkgs.grub2 grubPkgs.grub2_efi ]
      ++ optional canx86BiosBoot pkgs.syslinux
      ++ optional (config.isoImage.makeBiosBootable && canx86BiosBoot) pkgs.syslinux
    ;

    # In stage 1 of the boot, mount the CD as the root FS by label so
@@ -744,7 +751,7 @@ in
        { source = pkgs.writeText "version" config.system.nixos.label;
          target = "/version.txt";
        }
      ] ++ optionals canx86BiosBoot [
      ] ++ optionals (config.isoImage.makeBiosBootable && canx86BiosBoot) [
        { source = config.isoImage.splashImage;
          target = "/isolinux/background.png";
        }
@@ -771,7 +778,7 @@ in
        { source = config.isoImage.efiSplashImage;
          target = "/EFI/boot/efi-background.png";
        }
      ] ++ optionals (config.boot.loader.grub.memtest86.enable && canx86BiosBoot) [
      ] ++ optionals (config.boot.loader.grub.memtest86.enable && config.isoImage.makeBiosBootable && canx86BiosBoot) [
        { source = "${pkgs.memtest86plus}/memtest.bin";
          target = "/boot/memtest.bin";
        }
@@ -786,10 +793,10 @@ in
    # Create the ISO image.
    system.build.isoImage = pkgs.callPackage ../../../lib/make-iso9660-image.nix ({
      inherit (config.isoImage) isoName compressImage volumeID contents;
      bootable = canx86BiosBoot;
      bootable = config.isoImage.makeBiosBootable && canx86BiosBoot;
      bootImage = "/isolinux/isolinux.bin";
      syslinux = if canx86BiosBoot then pkgs.syslinux else null;
    } // optionalAttrs (config.isoImage.makeUsbBootable && canx86BiosBoot) {
      syslinux = if config.isoImage.makeBiosBootable && canx86BiosBoot then pkgs.syslinux else null;
    } // optionalAttrs (config.isoImage.makeUsbBootable && config.isoImage.makeBiosBootable && canx86BiosBoot) {
      usbBootable = true;
      isohybridMbrImage = "${pkgs.syslinux}/share/syslinux/isohdpfx.bin";
    } // optionalAttrs config.isoImage.makeEfiBootable {
+0 −1
Original line number Diff line number Diff line
@@ -430,7 +430,6 @@
  ./services/desktops/gvfs.nix
  ./services/desktops/malcontent.nix
  ./services/desktops/neard.nix
  ./services/desktops/pipewire/pipewire-media-session.nix
  ./services/desktops/pipewire/pipewire.nix
  ./services/desktops/pipewire/wireplumber.nix
  ./services/desktops/profile-sync-daemon.nix
Loading