Skip to content

Commit

Permalink
Merge branch 'NixOS:master' into starship-xonsh
Browse files Browse the repository at this point in the history
  • Loading branch information
cswimr authored Nov 27, 2024
2 parents 2c90272 + 19f40a3 commit fc2c80d
Show file tree
Hide file tree
Showing 616 changed files with 10,108 additions and 17,184 deletions.
21 changes: 20 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,32 @@
- any:
- changed-files:
- any-glob-to-any-file:
- nixos/modules/programs/java.nix
# Distributions
- pkgs/development/compilers/adoptopenjdk-icedtea-web/**/*
- pkgs/development/compilers/corretto/**/*
- pkgs/development/compilers/graalvm/**/*
- pkgs/development/compilers/openjdk/**/*
- pkgs/development/compilers/semeru-bin/**/*
- pkgs/development/compilers/temurin-bin/**/*
- pkgs/development/compilers/zulu/**/*
# Documentation
- doc/languages-frameworks/java.section.md
# Gradle
- doc/languages-frameworks/gradle.section.md
- pkgs/development/tools/build-managers/gradle/**/*
- pkgs/by-name/gr/gradle-completion/**/*
# Maven
- pkgs/by-name/ma/maven/**/*
- doc/languages-frameworks/maven.section.md
# Ant
- pkgs/by-name/ap/apacheAnt/**/*
# javaPackages attrset
- pkgs/development/java-modules/**/*
- pkgs/top-level/java-packages.nix
# Maintainer tooling
- pkgs/by-name/ni/nixpkgs-openjdk-updater/**/*
# Misc
- nixos/modules/programs/java.nix

"6.topic: jitsi":
- any:
Expand Down
4 changes: 2 additions & 2 deletions doc/languages-frameworks/chicken.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ all the other eggs:

```nix
let
myChickenPackages = pkgs.chickenPackages.overrideScope' (self: super: {
myChickenPackages = pkgs.chickenPackages.overrideScope (self: super: {
# The chicken package itself can be overridden to effect the whole ecosystem.
# chicken = super.chicken.overrideAttrs {
# src = ...
# };
chickenEggs = super.chickenEggs.overrideScope' (eggself: eggsuper: {
chickenEggs = super.chickenEggs.overrideScope (eggself: eggsuper: {
srfi-180 = eggsuper.srfi-180.overrideAttrs {
# path to a local copy of srfi-180
src = <...>;
Expand Down
84 changes: 84 additions & 0 deletions doc/languages-frameworks/maven.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,90 @@ This package calls `maven.buildMavenPackage` to do its work. The primary differe
After setting `maven.buildMavenPackage`, we then do standard Java `.jar` installation by saving the `.jar` to `$out/share/java` and then making a wrapper which allows executing that file; see [](#sec-language-java) for additional generic information about packaging Java applications.
:::

### Overriding Maven package attributes {#maven-overriding-package-attributes}

```
overrideMavenAttrs :: (AttrSet -> Derivation) | ((AttrSet -> Attrset) -> Derivation) -> Derivation
```

The output of `buildMavenPackage` has an `overrideMavenAttrs` attribute, which is a function that takes either
- any subset of the attributes that can be passed to `buildMavenPackage`

or
- a function that takes the argument passed to the previous invocation of `buildMavenPackage` (conventionally called `old`) and returns an attribute set that can be passed to `buildMavenPackage`

and returns a derivation that builds a Maven package based on the old and new arguments merged.

This is similar to [](#sec-pkg-overrideAttrs), but notably does not allow accessing the final value of the argument to `buildMavenPackage`.

:::{.example}
### `overrideMavenAttrs` Example

Use `overrideMavenAttrs` to build `jd-cli` version 1.2.0 and disable some flaky test:

```nix
jd-cli.overrideMavenAttrs (old: rec {
version = "1.2.0";
src = fetchFromGitHub {
owner = old.src.owner;
repo = old.src.repo;
rev = "${old.pname}-${version}";
# old source hash of 1.2.0 version
hash = "sha256-US7j6tQ6mh1libeHnQdFxPGoxHzbZHqehWSgCYynKx8=";
};
# tests can be disabled by prefixing it with `!`
# see Maven documentation for more details:
# https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html#Multiple_Formats_in_One
mvnParameters = lib.escapeShellArgs [
"-Dsurefire.failIfNoSpecifiedTests=false"
"-Dtest=!JavaDecompilerTest#basicTest,!JavaDecompilerTest#patternMatchingTest"
];
# old mvnHash of 1.2.0 maven dependencies
mvnHash = "sha256-N9XC1pg6Y4sUiBWIQUf16QSXCuiAPpXEHGlgApviF4I=";
});
```
:::

### Offline build {#maven-offline-build}

By default, `buildMavenPackage` does the following:

1. Run `mvn package -Dmaven.repo.local=$out/.m2 ${mvnParameters}` in the
`fetchedMavenDeps` [fixed-output derivation](https://nixos.org/manual/nix/stable/glossary.html#gloss-fixed-output-derivation).
2. Run `mvn package -o -nsu "-Dmaven.repo.local=$mvnDeps/.m2"
${mvnParameters}` again in the main derivation.

As a result, tests are run twice.
This also means that a failing test will trigger a new attempt to realise the fixed-output derivation, which in turn downloads all dependencies again.
For bigger Maven projects, this might lead to a long feedback cycle.

Use `buildOffline = true` to change the behaviour of `buildMavenPackage to the following:
1. Run `mvn de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies
-Dmaven.repo.local=$out/.m2 ${mvnDepsParameters}` in the fixed-output derivation.
2. Run `mvn package -o -nsu "-Dmaven.repo.local=$mvnDeps/.m2"
${mvnParameters}` in the main derivation.

As a result, all dependencies are downloaded in step 1 and the tests are executed in step 2.
A failing test only triggers a rebuild of step 2 as it can reuse the dependencies of step 1 because they have not changed.

::: {.warning}
Test dependencies are not downloaded in step 1 and are therefore missing in
step 2 which will most probably fail the build. The `go-offline` plugin cannot
handle these so-called [dynamic dependencies](https://github.com/qaware/go-offline-maven-plugin?tab=readme-ov-file#dynamic-dependencies).
In that case you must add these dynamic dependencies manually with:
```nix
maven.buildMavenPackage rec {
manualMvnArtifacts = [
# add dynamic test dependencies here
"org.apache.maven.surefire:surefire-junit-platform:3.1.2"
"org.junit.platform:junit-platform-launcher:1.10.0"
];
};
```
:::

### Stable Maven plugins {#stable-maven-plugins}

Maven defines default versions for its core plugins, e.g. `maven-compiler-plugin`. If your project does not override these versions, an upgrade of Maven will change the version of the used plugins, and therefore the derivation and hash.
Expand Down
6 changes: 6 additions & 0 deletions doc/redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -3190,6 +3190,12 @@
"maven-buildmavenpackage": [
"index.html#maven-buildmavenpackage"
],
"maven-overriding-package-attributes": [
"index.html#maven-overriding-package-attributes"
],
"maven-offline-build": [
"index.html#maven-offline-build"
],
"stable-maven-plugins": [
"index.html#stable-maven-plugins"
],
Expand Down
4 changes: 0 additions & 4 deletions lib/customisation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,6 @@ rec {
newScope = scope: newScope (self // scope);
callPackage = self.newScope {};
overrideScope = g: makeScope newScope (extends g f);
# Remove after 24.11 is released.
overrideScope' = g: warnIf (isInOldestRelease 2311)
"`overrideScope'` (from `lib.makeScope`) has been renamed to `overrideScope`."
(makeScope newScope (extends g f));
packages = f;
};
in self;
Expand Down
13 changes: 7 additions & 6 deletions lib/systems/architectures.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ rec {
x86-64-v3 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "avx" "avx2" "fma" ];
x86-64-v4 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "avx" "avx2" "avx512" "fma" ];
# x86_64 Intel
nehalem = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" ];
westmere = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" ];
sandybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ];
ivybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ];
haswell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ];
broadwell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ];
nehalem = [ "sse3" "ssse3" "sse4_1" "sse4_2" ];
westmere = [ "sse3" "ssse3" "sse4_1" "sse4_2" ];
silvermont = [ "sse3" "ssse3" "sse4_1" "sse4_2" ];
sandybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "avx" ];
ivybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "avx" ];
haswell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "avx" "avx2" "fma" ];
broadwell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "avx" "avx2" "fma" ];
skylake = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ];
skylake-avx512 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "avx512" "fma" ];
cannonlake = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "avx512" "fma" ];
Expand Down
2 changes: 1 addition & 1 deletion lib/systems/doubles.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let
"x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin"

# FreeBSD
"i686-freebsd" "x86_64-freebsd"
"i686-freebsd" "x86_64-freebsd" "aarch64-freebsd"

# Genode
"aarch64-genode" "i686-genode" "x86_64-genode"
Expand Down
5 changes: 5 additions & 0 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,11 @@ rec {

# BSDs

aarch64-freebsd = {
config = "aarch64-unknown-freebsd";
useLLVM = true;
};

x86_64-freebsd = {
config = "x86_64-unknown-freebsd";
useLLVM = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/systems.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ lib.runTests (

testcygwin = mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ];
testdarwin = mseteq darwin [ "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" ];
testfreebsd = mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ];
testfreebsd = mseteq freebsd [ "aarch64-freebsd" "i686-freebsd" "x86_64-freebsd" ];
testgenode = mseteq genode [ "aarch64-genode" "i686-genode" "x86_64-genode" ];
testredox = mseteq redox [ "x86_64-redox" ];
testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */);
Expand Down
26 changes: 26 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6927,6 +6927,12 @@
githubId = 30512529;
name = "Evils";
};
evris99 = {
name = "Evrymachos Koukoumakas";
github = "evris99";
githubId = 32963606;
email = "cptevris@gmail.com";
};
ewok = {
email = "ewok@ewok.ru";
github = "ewok-old";
Expand Down Expand Up @@ -11697,6 +11703,12 @@
name = "Kat Inskip";
keys = [ { fingerprint = "9CC6 44B5 69CD A59B C874 C4C9 E8DD E3ED 1C90 F3A0"; } ];
};
kivikakk = {
email = "ashe@kivikakk.ee";
github = "kivikakk";
githubId = 1915;
name = "Asherah Connor";
};
kjeremy = {
email = "kjeremy@gmail.com";
name = "Jeremy Kolb";
Expand Down Expand Up @@ -16258,6 +16270,13 @@
github = "octodi";
githubId = 127038896;
};
octvs = {
name = "octvs";
email = "octvs@posteo.de";
matrix = "@octvs:matrix.org";
github = "octvs";
githubId = 42993892;
};
oddlama = {
email = "oddlama@oddlama.org";
github = "oddlama";
Expand Down Expand Up @@ -18133,6 +18152,13 @@
matrix = "@qyriad:katesiria.org";
name = "Qyriad";
};
r17x = {
email = "hi@rin.rocks";
github = "r17x";
githubId = 16365952;
name = "Rin";
keys = [ { fingerprint = "476A F55D 6378 F878 0709 848A 18F9 F516 1CC0 576C"; } ];
};
r3dl3g = {
email = "redleg@rothfuss-web.de";
github = "r3dl3g";
Expand Down
3 changes: 2 additions & 1 deletion nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,6 @@
- The `atlassian-crowd` package and its `services.crowd` NixOS module
- The `atlassian-jira` package and its `services.jira` NixOS module


- `python3Packages.nose` has been removed, as it has been deprecated and unmaintained for almost a decade and does not work on Python 3.12.
Please switch to `pytest` or another test runner/framework.

Expand Down Expand Up @@ -825,6 +824,8 @@
Note that first solution of the [official FAQ answer](https://cloud.seatable.io/dtable/external-links/7b976c85f504491cbe8e/?tid=0000&vid=0000&row-id=BQhH-2HSQs68Nq2EW91DBA)
is not allowed by the `services.nginx` module's config-checker.

- The new option `boot.binfmt.addEmulatedSystemsToNixSandbox` allows you to skip adding the emulated systems to `nix.settings.extra-platforms`. Now you can emulate foreign binaries locally while only building them on native remote builders.

- The latest available version of Nextcloud is v30 (available as `pkgs.nextcloud30`). The installation logic is as follows:
- If [`services.nextcloud.package`](#opt-services.nextcloud.package) is specified explicitly, this package will be installed (**recommended**)
- If [`system.stateVersion`](#opt-system.stateVersion) is >=24.05, `pkgs.nextcloud29` will be installed by default.
Expand Down
12 changes: 12 additions & 0 deletions nixos/doc/manual/release-notes/rl-2505.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->

- `binwalk` was updated to 3.1.0, which has been rewritten in rust. The python module is no longer available.
See the release notes of [3.1.0](https://github.com/ReFirmLabs/binwalk/releases/tag/v3.1.0) for more information.

- `buildGoPackage` has been removed. Use `buildGoModule` instead. See the [Go section in the nixpkgs manual](https://nixos.org/manual/nixpkgs/unstable/#sec-language-go) for details.

- `timescaledb` requires manual upgrade steps.
Expand All @@ -30,10 +33,19 @@

- Support for CUDA 10 has been dropped, as announced in the 24.11 release notes.

- `zammad` has had its support for MySQL removed, since it was never working correctly and is now deprecated upstream. Check the [migration guide](https://docs.zammad.org/en/latest/appendix/migrate-to-postgresql.html) for how to convert your database to PostgreSQL.

- `kanata` was updated to v1.7.0, which introduces several breaking changes.
See the release notes of
[v1.7.0](https://github.com/jtroo/kanata/releases/tag/v1.7.0)
for more information.
- `vscode-utils.buildVscodeExtension` now requires pname as an argument

- `nerdfonts` has been separated into individual font packages under the namespace `nerd-fonts`. The directories for font
files have changed from `$out/share/fonts/{opentype,truetype}/NerdFonts` to
`$out/share/fonts/{opentype,truetype}/NerdFonts/<fontDirName>`, where `<fontDirName>` can be found in the
[official website](https://www.nerdfonts.com/font-downloads) as the titles in preview images, with the "Nerd Font"
suffix and any whitespaces trimmed.

- the notmuch vim plugin now lives in a separate output of the `notmuch`
package. Installing `notmuch` will not bring the notmuch vim package anymore,
Expand Down
5 changes: 4 additions & 1 deletion nixos/lib/make-disk-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ To solve this, you can run `fdisk -l $image` and generate `dd if=$image of=$imag
, # Disk image format, one of qcow2, qcow2-compressed, vdi, vpc, raw.
format ? "raw"

, # Disk image filename, without any extensions (e.g. `image_1`).
baseName ? "nixos"

# Whether to fix:
# - GPT Disk Unique Identifier (diskGUID)
# - GPT Partition Unique Identifier: depends on the layout, root partition UUID can be controlled through `rootGPUID` option
Expand Down Expand Up @@ -208,7 +211,7 @@ let format' = format; in let

compress = lib.optionalString (format' == "qcow2-compressed") "-c";

filename = "nixos." + {
filename = "${baseName}." + {
qcow2 = "qcow2";
vdi = "vdi";
vpc = "vhd";
Expand Down
48 changes: 48 additions & 0 deletions nixos/modules/image/file-options.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
lib,
config,
pkgs,
...
}:
{
options.image = {
baseName = lib.mkOption {
type = lib.types.str;
default = "nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
description = ''
Basename of the image filename without any extension (e.g. `image_1`).
'';
};

extension = lib.mkOption {
type = lib.types.str;
description = ''
Extension of the image filename (e.g. `raw`).
'';
};

# FIXME: this should be marked readOnly, when there are no
# mkRenamedOptionModuleWith calls with `image.fileName` as
# as a target left anymore (i.e. 24.11). We can't do it
# before, as some source options where writable before.
# Those should use image.baseName and image.extension instead.
fileName = lib.mkOption {
type = lib.types.str;
default = "${config.image.baseName}.${config.image.extension}";
description = ''
Filename of the image including all extensions (e.g `image_1.raw` or
`image_1.raw.zst`).
'';
};

filePath = lib.mkOption {
type = lib.types.str;
default = config.image.fileName;
description = ''
Path of the image, relative to `$out` in `system.build.image`.
While it defaults to `config.image.fileName`, it can be different for builders where
the image is in sub directory, such as `iso`, `sd-card` or `kexec` images.
'';
};
};
}
Loading

0 comments on commit fc2c80d

Please sign in to comment.