Skip to content

Commit

Permalink
Merge branch 'NixOS:master' into update/picom-pijulius
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesStraten authored Jun 17, 2024
2 parents d71fa23 + 311a251 commit ef9c116
Show file tree
Hide file tree
Showing 9,798 changed files with 108,267 additions and 55,434 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
/nixos/lib/make-disk-image.nix @raitobezarius

# Nix, the package manager
pkgs/tools/package-management/nix/ @raitobezarius @ma27
nixos/modules/installer/tools/nix-fallback-paths.nix @raitobezarius @ma27
pkgs/tools/package-management/nix/ @raitobezarius
nixos/modules/installer/tools/nix-fallback-paths.nix @raitobezarius

# Nixpkgs documentation
/maintainers/scripts/db-to-md.sh @jtojnar @ryantm
Expand Down
18 changes: 18 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
- nixos/modules/services/x11/desktop-managers/cinnamon.nix
- nixos/tests/cinnamon.nix

"6.topic: dotnet":
- any:
- changed-files:
- any-glob-to-any-file:
- doc/languages-frameworks/dotnet.section.md
- maintainers/scripts/update-dotnet-lockfiles.nix
- pkgs/build-support/dotnet/**/*
- pkgs/development/compilers/dotnet/**/*
- pkgs/test/dotnet/**/*
- pkgs/top-level/dotnet-packages.nix

"6.topic: emacs":
- any:
- changed-files:
Expand Down Expand Up @@ -134,6 +145,12 @@
- any-glob-to-any-file:
- lib/**

"6.topic: llvm/clang":
- any:
- changed-files:
- any-glob-to-any-file:
- pkgs/development/compilers/llvm/*

"6.topic: lua":
- any:
- changed-files:
Expand Down Expand Up @@ -201,6 +218,7 @@
- pkgs/development/node-packages/**/*
- pkgs/development/tools/yarn/*
- pkgs/development/tools/yarn2nix-moretea/**/*
- pkgs/development/tools/pnpm/**/*
- pkgs/development/web/nodejs/*

"6.topic: ocaml":
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-cherry-picks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- 'release-**'
- 'staging-**'
- '!staging-next'

permissions: {}

Expand Down
6 changes: 3 additions & 3 deletions doc/build-helpers/fetchers.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil
_Default value:_ `{}`.

`passthru` (Attribute Set; _optional_)
: Specifies any extra [passthru](#var-stdenv-passthru) attributes for the derivation returned by `fetchurl`.
Note that `fetchurl` defines [passthru attributes of its own](#ssec-pkgs-fetchers-fetchurl-passthru-outputs).
: Specifies any extra [`passthru`](#chap-passthru) attributes for the derivation returned by `fetchurl`.
Note that `fetchurl` defines [`passthru` attributes of its own](#ssec-pkgs-fetchers-fetchurl-passthru-outputs).
Attributes specified in `passthru` can override the default attributes returned by `fetchurl`.

_Default value:_ `{}`.
Expand All @@ -387,7 +387,7 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil

### Passthru outputs {#ssec-pkgs-fetchers-fetchurl-passthru-outputs}

`fetchurl` also defines its own [`passthru`](#var-stdenv-passthru) attributes:
`fetchurl` also defines its own [`passthru`](#chap-passthru) attributes:

`url` (String)

Expand Down
6 changes: 3 additions & 3 deletions doc/build-helpers/images/dockertools.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Similarly, if you encounter errors similar to `Error_Protocol ("certificate has

### Passthru outputs {#ssec-pkgs-dockerTools-buildImage-passthru-outputs}

`buildImage` defines a few [`passthru`](#var-stdenv-passthru) attributes:
`buildImage` defines a few [`passthru`](#chap-passthru) attributes:

`buildArgs` (Attribute Set)

Expand Down Expand Up @@ -576,13 +576,13 @@ This allows the function to produce reproducible images.
`passthru` (Attribute Set; _optional_)
: Use this to pass any attributes as [passthru](#var-stdenv-passthru) for the resulting derivation.
: Use this to pass any attributes as [`passthru`](#chap-passthru) for the resulting derivation.
_Default value:_ `{}`
### Passthru outputs {#ssec-pkgs-dockerTools-streamLayeredImage-passthru-outputs}
`streamLayeredImage` also defines its own [`passthru`](#var-stdenv-passthru) attributes:
`streamLayeredImage` also defines its own [`passthru`](#chap-passthru) attributes:
`imageTag` (String)
Expand Down
6 changes: 2 additions & 4 deletions doc/build-helpers/images/makediskimage.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ let
in
make-disk-image {
inherit pkgs lib;
config = evalConfig {
inherit (evalConfig {
modules = [
{
fileSystems."/" = { device = "/dev/vda"; fsType = "ext4"; autoFormat = true; };
boot.grub.device = "/dev/vda";
}
];
};
}) config;
format = "qcow2";
onlyNixStore = false;
partitionTableType = "legacy+gpt";
Expand All @@ -104,5 +104,3 @@ in
memSize = 2048; # Qemu VM memory size in megabytes. Defaults to 1024M.
}
```


29 changes: 20 additions & 9 deletions doc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
let
inherit (pkgs) lib;
inherit (lib) hasPrefix removePrefix;
fs = lib.fileset;

common = import ./common.nix;

Expand Down Expand Up @@ -99,20 +100,30 @@ in pkgs.stdenv.mkDerivation {
nixos-render-docs
];

src = ./.;
src = fs.toSource {
root = ./.;
fileset = fs.unions [
(fs.fileFilter (file:
file.hasExt "md"
|| file.hasExt "md.in"
) ./.)
./style.css
./anchor-use.js
./anchor.min.js
./manpage-urls.json
];
};

postPatch = ''
ln -s ${optionsDoc.optionsJSON}/share/doc/nixos/options.json ./config-options.json
'';

buildPhase = let
pythonInterpreterTable = pkgs.callPackage ./doc-support/python-interpreter-table.nix {};
pythonSection = with lib.strings; replaceStrings
[ "@python-interpreter-table@" ]
[ pythonInterpreterTable ]
(readFile ./languages-frameworks/python.section.md);
in ''
cp ${builtins.toFile "python.section.md" pythonSection} ./languages-frameworks/python.section.md
pythonInterpreterTable = pkgs.callPackage ./doc-support/python-interpreter-table.nix {};

passAsFile = [ "pythonInterpreterTable" ];

buildPhase = ''
substituteInPlace ./languages-frameworks/python.section.md --subst-var-by python-interpreter-table "$(<"$pythonInterpreterTablePath")"
cat \
./functions/library.md.in \
Expand Down
Empty file removed doc/functions/library/.gitkeep
Empty file.
4 changes: 0 additions & 4 deletions doc/hooks/waf.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ If `wafPath` doesn't exist, then `wafHook` will copy the `waf` provided from Nix

Controls the flags passed to waf tool during build and install phases. For settings specific to build or install phases, use `wafBuildFlags` or `wafInstallFlags` respectively.

#### `dontAddWafCrossFlags` {#dont-add-waf-cross-flags}

When set to `true`, don't add cross compilation flags during configure phase.

#### `dontUseWafConfigure` {#dont-use-waf-configure}

When set to true, don't use the predefined `wafConfigurePhase`.
Expand Down
122 changes: 73 additions & 49 deletions doc/languages-frameworks/android.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,36 @@
The Android build environment provides three major features and a number of
supporting features.

## Using androidenv with Android Studio {#using-androidenv-with-android-studio}

Use the `android-studio-full` attribute for a very complete Android SDK, including system images:

```nix
buildInputs = [ android-studio-full ];
```

This is identical to:

```nix
buildInputs = [ androidStudioPackages.stable.full ];
```

Alternatively, you can pass composeAndroidPackages to the `withSdk` passthru:

```nix
buildInputs = [
(android-studio.withSdk (androidenv.composeAndroidPackages {
includeNDK = true;
}).androidsdk)
];
```

These will export ANDROID_SDK_ROOT and ANDROID_NDK_ROOT to the SDK and NDK directories
in the specified Android build environment.

## Deploying an Android SDK installation with plugins {#deploying-an-android-sdk-installation-with-plugins}

The first use case is deploying the SDK with a desired set of plugins or subsets
of an SDK.
Alternatively, you can deploy the SDK separately with a desired set of plugins, or subsets of an SDK.

```nix
with import <nixpkgs> {};
Expand Down Expand Up @@ -145,67 +171,24 @@ androidComposition.platform-tools
## Using predefined Android package compositions {#using-predefined-android-package-compositions}

In addition to composing an Android package set manually, it is also possible
to use a predefined composition that contains all basic packages for a specific
Android version, such as version 9.0 (API-level 28).
to use a predefined composition that contains a fairly complete set of Android packages:

The following Nix expression can be used to deploy the entire SDK with all basic
plugins:
The following Nix expression can be used to deploy the entire SDK:

```nix
with import <nixpkgs> {};
androidenv.androidPkgs_9_0.androidsdk
androidenv.androidPkgs.androidsdk
```

It is also possible to use one plugin only:

```nix
with import <nixpkgs> {};
androidenv.androidPkgs_9_0.platform-tools
```

## Building an Android application {#building-an-android-application}

In addition to the SDK, it is also possible to build an Ant-based Android
project and automatically deploy all the Android plugins that a project
requires.


```nix
with import <nixpkgs> {};
androidenv.buildApp {
name = "MyAndroidApp";
src = ./myappsources;
release = true;
# If release is set to true, you need to specify the following parameters
keyStore = ./keystore;
keyAlias = "myfirstapp";
keyStorePassword = "mykeystore";
keyAliasPassword = "myfirstapp";
# Any Android SDK parameters that install all the relevant plugins that a
# build requires
platformVersions = [ "24" ];
# When we include the NDK, then ndk-build is invoked before Ant gets invoked
includeNDK = true;
}
androidenv.androidPkgs.platform-tools
```

Aside from the app-specific build parameters (`name`, `src`, `release` and
keystore parameters), the `buildApp {}` function supports all the function
parameters that the SDK composition function (the function shown in the
previous section) supports.

This build function is particularly useful when it is desired to use
[Hydra](https://nixos.org/hydra): the Nix-based continuous integration solution
to build Android apps. An Android APK gets exposed as a build product and can be
installed on any Android device with a web browser by navigating to the build
result page.

## Spawning emulator instances {#spawning-emulator-instances}

For testing purposes, it can also be quite convenient to automatically generate
Expand Down Expand Up @@ -349,3 +332,44 @@ To update the expressions run the `generate.sh` script that is stored in the
```bash
./generate.sh
```

## Building an Android application with Ant {#building-an-android-application-with-ant}

In addition to the SDK, it is also possible to build an Ant-based Android
project and automatically deploy all the Android plugins that a project
requires. Most newer Android projects use Gradle, and this is included for historical
purposes.

```nix
with import <nixpkgs> {};
androidenv.buildApp {
name = "MyAndroidApp";
src = ./myappsources;
release = true;
# If release is set to true, you need to specify the following parameters
keyStore = ./keystore;
keyAlias = "myfirstapp";
keyStorePassword = "mykeystore";
keyAliasPassword = "myfirstapp";
# Any Android SDK parameters that install all the relevant plugins that a
# build requires
platformVersions = [ "24" ];
# When we include the NDK, then ndk-build is invoked before Ant gets invoked
includeNDK = true;
}
```

Aside from the app-specific build parameters (`name`, `src`, `release` and
keystore parameters), the `buildApp {}` function supports all the function
parameters that the SDK composition function (the function shown in the
previous section) supports.

This build function is particularly useful when it is desired to use
[Hydra](https://nixos.org/hydra): the Nix-based continuous integration solution
to build Android apps. An Android APK gets exposed as a build product and can be
installed on any Android device with a web browser by navigating to the build
result page.
4 changes: 3 additions & 1 deletion doc/languages-frameworks/dart.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ The function `buildFlutterApplication` builds Flutter applications.

See the [Dart documentation](#ssec-dart-applications) for more details on required files and arguments.

`flutter` in Nixpkgs always points to `flutterPackages.stable`, which is the latest packaged version. To avoid unforeseen breakage during upgrade, packages in Nixpkgs should use a specific flutter version, such as `flutter319` and `flutter322`, instead of using `flutter` directly.

```nix
{ flutter, fetchFromGitHub }:
flutter.buildFlutterApplication {
flutter322.buildFlutterApplication {
pname = "firmware-updater";
version = "0-unstable-2023-04-30";
Expand Down
Loading

0 comments on commit ef9c116

Please sign in to comment.