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

Merge master into staging-next

parents 563bb0fb cc75a581
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -467,6 +467,7 @@ Yarn based projects use a `yarn.lock` file instead of a `package-lock.json` to p

- `yarnConfigHook`: Fetches the dependencies from the offline cache and installs them into `node_modules`.
- `yarnBuildHook`: Runs `yarn build` or a specified `yarn` command that builds the project.
- `yarnInstallHook`: Runs `yarn install --production` to prune dependencies and installs the project into `$out`.

An example usage of the above attributes is:

@@ -501,9 +502,9 @@ stdenv.mkDerivation (finalAttrs: {
  nativeBuildInputs = [
    yarnConfigHook
    yarnBuildHook
    yarnInstallHook
    # Needed for executing package.json scripts
    nodejs
    npmHooks.npmInstallHook
  ];

  meta = {
@@ -512,8 +513,6 @@ stdenv.mkDerivation (finalAttrs: {
})
```

Note that there is no setup hook for installing yarn based packages - `npmHooks.npmInstallHook` should fit most cases, but sometimes you may need to override the `installPhase` completely.

#### `yarnConfigHook` arguments {#javascript-yarnconfighook}

By default, `yarnConfigHook` relies upon the attribute `${yarnOfflineCache}` (or `${offlineCache}` if the former is not set) to find the location of the offline cache produced by `fetchYarnDeps`. To disable this phase, you can set `dontYarnInstallDeps = true` or override the `configurePhase`.
@@ -525,9 +524,15 @@ This script by default runs `yarn --offline build`, and it relies upon the proje
- `yarnBuildScript`: Sets a different `yarn --offline` subcommand (defaults to `build`).
- `yarnBuildFlags`: Single string list of additional flags to pass the above command, or a Nix list of such additional flags.

#### `yarnInstallHook` arguments {#javascript-yarninstallhook}

To install the package `yarnInstallHook` uses both `npm` and `yarn` to cleanup project files and dependencies. To disable this phase, you can set `dontYarnInstall = true` or override the `installPhase`. Below is a list of additional `mkDerivation` arguments read by this hook:

- `yarnKeepDevDeps`: Disables the removal of devDependencies from `node_modules` before installation.

### yarn2nix {#javascript-yarn2nix}

WARNING: The `yarn2nix` functions have been deprecated in favor of the new `yarnConfigHook` and `yarnBuildHook`. Documentation for them still appears here for the sake of the packages that still use them. See also a tracking issue [#324246](https://github.com/NixOS/nixpkgs/issues/324246).
WARNING: The `yarn2nix` functions have been deprecated in favor of the new `yarnConfigHook`, `yarnBuildHook` and `yarnInstallHook`. Documentation for them still appears here for the sake of the packages that still use them. See also a tracking issue [#324246](https://github.com/NixOS/nixpkgs/issues/324246).

#### Preparation {#javascript-yarn2nix-preparation}

+8 −0
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@
  Users can use it by `services.displayManager.ly.enable` and config it by
  `services.displayManager.ly.settings` to generate `/etc/ly/config.ini`

- The default sound server for most graphical sessions has been switched from PulseAudio to PipeWire.
  Users that want to keep PulseAudio will want to set `services.pipewire.enable = false;` and `hardware.pulseaudio.enable = true;`.
  There is currently no plan to fully deprecate and remove PulseAudio, however, PipeWire should generally be preferred for new installs.

## New Modules {#sec-release-24.11-new-modules}

- [TaskChampion Sync-Server](https://github.com/GothenburgBitFactory/taskchampion-sync-server), a [Taskwariror 3](https://taskwarrior.org/docs/upgrade-3/) sync server, replacing Taskwarrior 2's sync server named [`taskserver`](https://github.com/GothenburgBitFactory/taskserver).
@@ -333,6 +337,10 @@
- `zx` was updated to v8, which introduces several breaking changes.
  See the [v8 changelog](https://github.com/google/zx/releases/tag/8.0.0) for more information.

- `system.stateVersion` is now validated. If you never changed this yourself, you don't need to do anything. If your `stateVersion` is not a valid NixOS release version (e.g. "24.11" is valid),
  your system was already at risk of experiencing silent incompatible state updates. If your previous value is a well-formed version but not a valid release (e.g. "23.12"),
  round down to the nearest actual release. If it wasn't a well-formed version (e.g. "nixos-unstable"), set it to the version of NixOS that you originally installed.

- The `portunus` package and service do not support weak password hashes anymore.
  If you installed Portunus on NixOS 23.11 or earlier, upgrade to NixOS 24.05 first to get support for strong password hashing.
  Then, follow the instructions on the [upstream release notes](https://github.com/majewsky/portunus/releases/tag/v2.0.0) to upgrade all existing user accounts to strong password hashes.
+0 −3
Original line number Diff line number Diff line
@@ -32,9 +32,6 @@ with lib;
  # there is no power management backend such as upower).
  powerManagement.enable = true;

  # Enable sound in graphical iso's.
  hardware.pulseaudio.enable = true;

  # VM guest additions to improve host-guest interaction
  services.spice-vdagentd.enable = true;
  services.qemuGuest.enable = true;
+45 −2
Original line number Diff line number Diff line
@@ -44,6 +44,49 @@ let
  };
  initrdRelease = pkgs.writeText "initrd-release" (attrsToText initrdReleaseContents);

  checkRelease = version:
    let
      parts = lib.versions.splitVersion version;
      isVersion = lib.length parts == 2 && lib.all (p: lib.stringLength p == 2) parts;
      majorVersion = lib.toIntBase10 (lib.elemAt parts 0);
      minorVersion = lib.elemAt parts 1;

      versionPatterns = [
        # only 13.10
        { fromMajor = 13; minor = [ "10" ]; }
        # 14.04 and 14.12
        { fromMajor = 14; minor = [ "04" "12" ]; }
        # only 15.09
        { fromMajor = 15; minor = [ "09" ]; }
        # 16.03 to 20.09
        { fromMajor = 16; minor = [ "03" "09" ]; }
        # from 21.05
        { fromMajor = 21; minor = [ "05" "11" ]; }
      ];

      # find the versioning pattern that applies by looking for the first
      # major version newer than `majorVersion`, and picking the previous pattern
      patternIndex = lib.lists.findFirstIndex
        ({ fromMajor, ... }: fromMajor > majorVersion)
        (lib.length versionPatterns)
        versionPatterns;

      validMinorVersions =
        if patternIndex == 0
        then []
        else (lib.elemAt versionPatterns (patternIndex - 1)).minor;

      correctMinorVersion = lib.elem minorVersion validMinorVersions;
      notNewerThanNixpkgs = lib.versionAtLeast trivial.release version;
    in isVersion && correctMinorVersion && notNewerThanNixpkgs;

  releaseType = types.addCheck
    (types.strMatching "[[:digit:]]{2}\\.[[:digit:]]{2}")
    checkRelease // {
      name = "nixosRelease";
      description = "NixOS release version, e.g. \"${trivial.release}\"";
      descriptionClass = "nonRestrictiveClause";
    };
in
{
  imports = [
@@ -70,7 +113,7 @@ in

      release = mkOption {
        readOnly = true;
        type = types.str;
        type = releaseType;
        default = trivial.release;
        description = "The NixOS release (e.g. `16.03`).";
      };
@@ -151,7 +194,7 @@ in
    };

    stateVersion = mkOption {
      type = types.str;
      type = releaseType;
      # TODO Remove this and drop the default of the option so people are forced to set it.
      # Doing this also means fixing the comment in nixos/modules/testing/test-instrumentation.nix
      apply = v:
+0 −3
Original line number Diff line number Diff line
@@ -14,8 +14,5 @@
    libinput.enable = true; # for touchpad support on many laptops
  };

  # Enable sound in virtualbox appliances.
  hardware.pulseaudio.enable = true;

  environment.systemPackages = [ pkgs.mesa-demos pkgs.firefox ];
}
Loading