mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-22 08:30:57 +00:00
Compare commits
1 Commits
python-upd
...
26.05-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
705e992991 |
6
.github/ISSUE_TEMPLATE.md
vendored
Normal file
6
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<!--
|
||||
Please note: This blank issue template is meant for extraordinary issues
|
||||
that do not fit the templates. Unless you know your issue is relevant to
|
||||
Nixpkgs and requires the free-form blank issue, please use the issue
|
||||
templates instead.
|
||||
-->
|
||||
4
.github/ISSUE_TEMPLATE/01_bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/01_bug_report.yml
vendored
@@ -35,8 +35,8 @@ body:
|
||||
If you are using an older version, please update to the latest stable version and check if the issue persists before continuing this bug report.
|
||||
options:
|
||||
- "Please select a version."
|
||||
- "- Unstable (26.11)"
|
||||
- "- Stable (26.05)"
|
||||
- "- Unstable (26.05)"
|
||||
- "- Stable (25.11)"
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -35,8 +35,8 @@ body:
|
||||
If you are using an older version, please update to the latest stable version and check if the issue persists before continuing this bug report.
|
||||
options:
|
||||
- "Please select a version."
|
||||
- "- Unstable (26.11)"
|
||||
- "- Stable (26.05)"
|
||||
- "- Unstable (26.05)"
|
||||
- "- Stable (25.11)"
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
@@ -99,7 +99,7 @@ body:
|
||||
attributes:
|
||||
label: "Are you using nix-darwin?"
|
||||
description: |
|
||||
[`nix-darwin`](https://github.com/nix-darwin/nix-darwin) is a set of NixOS-like modules for macOS systems. Depending on your issue, this information may be relevant.
|
||||
[`nix-darwin`](https://github.com/LnL7/nix-darwin) is a set of NixOS-like modules for macOS systems. Depending on your issue, this information may be relevant.
|
||||
options:
|
||||
- "Yes, I am using nix-darwin."
|
||||
- "No, I am not using nix-darwin."
|
||||
|
||||
@@ -35,8 +35,8 @@ body:
|
||||
If you are using an older version, please update to the latest stable version and check if the issue persists before continuing this bug report.
|
||||
options:
|
||||
- "Please select a version."
|
||||
- "- Unstable (26.11)"
|
||||
- "- Stable (26.05)"
|
||||
- "- Unstable (26.05)"
|
||||
- "- Stable (25.11)"
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
14
.github/ISSUE_TEMPLATE/04_build_failure.yml
vendored
14
.github/ISSUE_TEMPLATE/04_build_failure.yml
vendored
@@ -37,8 +37,8 @@ body:
|
||||
If you are purposefully trying to build an ancient version of a package in an older Nixpkgs, please coordinate with the [NixOS Archivists](https://matrix.to/#/#archivists:nixos.org).
|
||||
options:
|
||||
- "Please select a version."
|
||||
- "- Unstable (26.11)"
|
||||
- "- Stable (26.05)"
|
||||
- "- Unstable (26.05)"
|
||||
- "- Stable (25.11)"
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
@@ -56,12 +56,12 @@ body:
|
||||
description: |
|
||||
Can [Hydra](https://hydra.nixos.org), Nixpkgs' Continuous Integration system, reproduce this build failure?
|
||||
Please use the search function in the header bar to locate the last build job for the package in question.
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/subprojects/hydra/root/static/images/emojione-red-x-274c.svg" width="20px" align="top" alt="Red X"> icon near the package entry, say '**Yes, Hydra can reproduce this build failure.**'
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/subprojects/hydra/root/static/images/emojione-gray-x-2716.svg" width="20px" align="top" alt="Dark Gray X"> icon near the package entry, then the build failure occurs with another package, and you need to track the original failing package by going down the chain of 'Cached failures' until you reach the final package in the failing dependency chain. Once you locate the failing package, re-write this report against that package and say '**Yes, Hydra can reproduce this build failure.**'
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/subprojects/hydra/root/static/images/emojione-check-2714.svg" width="20px" align="top" alt="Green Check Mark"> icon near the package entry, then it most likely means it's a local issue with your system. (Maybe you ran out of space?)
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/src/root/static/images/emojione-red-x-274c.svg" width="20px" align="top" alt="Red X"> icon near the package entry, say '**Yes, Hydra can reproduce this build failure.**'
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/src/root/static/images/emojione-gray-x-2716.svg" width="20px" align="top" alt="Dark Gray X"> icon near the package entry, then the build failure occurs with another package, and you need to track the original failing package by going down the chain of 'Cached failures' until you reach the final package in the failing dependency chain. Once you locate the failing package, re-write this report against that package and say '**Yes, Hydra can reproduce this build failure.**'
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/src/root/static/images/emojione-check-2714.svg" width="20px" align="top" alt="Green Check Mark"> icon near the package entry, then it most likely means it's a local issue with your system. (Maybe you ran out of space?)
|
||||
You can still open a build failure report, but please say '**No, Hydra cannot reproduce this build failure.**' below.
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/subprojects/hydra/root/static/images/emojione-question-2754.svg" width="20px" align="top" alt="Gray Question Mark"> icon near the package entry, say '**Hydra is currently rebuilding this package.**'
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/subprojects/hydra/root/static/images/emojione-stopsign-1f6d1.svg" width="20px" align="top" alt="Red Stop Sign"> icon near the package entry, then the build job was stopped manually. If this occurs, please coordinate with the [Infrastructure Team](https://matrix.to/#/#infra:nixos.org), and say '**The last build job was manually cancelled.**'
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/src/root/static/images/emojione-question-2754.svg" width="20px" align="top" alt="Gray Question Mark"> icon near the package entry, say '**Hydra is currently rebuilding this package.**'
|
||||
- If there's a <img src="https://raw.githubusercontent.com/NixOS/hydra/refs/heads/master/src/root/static/images/emojione-stopsign-1f6d1.svg" width="20px" align="top" alt="Red Stop Sign"> icon near the package entry, then the build job was stopped manually. If this occurs, please coordinate with the [Infrastructure Team](https://matrix.to/#/#infra:nixos.org), and say '**The last build job was manually cancelled.**'
|
||||
- If Hydra isn't supposed to build the package at all, say '**Hydra doesn’t try to build the package.**'
|
||||
options:
|
||||
- "Please select the Hydra Status."
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/05_update_request.yml
vendored
4
.github/ISSUE_TEMPLATE/05_update_request.yml
vendored
@@ -37,8 +37,8 @@ body:
|
||||
If the package has been updated in unstable, but you believe the update should be backported to the stable release of Nixpkgs, please file the '**Request: backport to stable**' form instead.
|
||||
options:
|
||||
- "Please select a version."
|
||||
- "- Unstable (26.11)"
|
||||
- "- Stable (26.05)"
|
||||
- "- Unstable (26.05)"
|
||||
- "- Stable (25.11)"
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/06_module_request.yml
vendored
4
.github/ISSUE_TEMPLATE/06_module_request.yml
vendored
@@ -35,8 +35,8 @@ body:
|
||||
If you are using an older or stable version, please update to the latest **unstable** version and check if the module still does not exist before continuing this request.
|
||||
options:
|
||||
- "Please select a version."
|
||||
- "- Unstable (26.11)"
|
||||
- "- Stable (26.05)"
|
||||
- "- Unstable (26.05)"
|
||||
- "- Stable (25.11)"
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -13,6 +13,7 @@ For new packages please briefly describe the package or provide a link to its ho
|
||||
- Built on platform:
|
||||
- [ ] x86_64-linux
|
||||
- [ ] aarch64-linux
|
||||
- [ ] x86_64-darwin
|
||||
- [ ] aarch64-darwin
|
||||
- Tested, as applicable:
|
||||
- [ ] [NixOS tests] in [nixos/tests].
|
||||
|
||||
1
.github/actions/checkout/action.yml
vendored
1
.github/actions/checkout/action.yml
vendored
@@ -19,7 +19,6 @@ runs:
|
||||
TARGET_SHA: ${{ inputs.target-as-trusted-at }}
|
||||
PIN_BUMP_SHA: ${{ inputs.untrusted-pin-bump }}
|
||||
with:
|
||||
retries: 3
|
||||
script: |
|
||||
const { rm, writeFile } = require('node:fs/promises')
|
||||
const { spawn } = require('node:child_process')
|
||||
|
||||
2
.github/labeler-no-sync.yml
vendored
2
.github/labeler-no-sync.yml
vendored
@@ -22,7 +22,7 @@
|
||||
- doc/**/*
|
||||
- nixos/doc/**/*
|
||||
|
||||
"backport release-26.05":
|
||||
"backport release-25.11":
|
||||
- all:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
|
||||
1
.github/labeler.yml
vendored
1
.github/labeler.yml
vendored
@@ -9,7 +9,6 @@
|
||||
- '^release-'
|
||||
- '^staging-\d'
|
||||
- '^staging-next-\d'
|
||||
- '^staging-nixos-\d'
|
||||
|
||||
# NOTE: bsd, darwin and cross-compilation labels are handled by ofborg
|
||||
"6.topic: agda":
|
||||
|
||||
8
.github/workflows/backport.yml
vendored
8
.github/workflows/backport.yml
vendored
@@ -21,7 +21,7 @@ defaults:
|
||||
jobs:
|
||||
backport:
|
||||
name: Backport Pull Request
|
||||
if: vars.NIXPKGS_CI_CLIENT_ID && github.event.pull_request.merged == true && (github.event.action != 'labeled' || startsWith(github.event.label.name, 'backport'))
|
||||
if: vars.NIXPKGS_CI_APP_ID && github.event.pull_request.merged == true && (github.event.action != 'labeled' || startsWith(github.event.label.name, 'backport'))
|
||||
runs-on: ubuntu-slim
|
||||
timeout-minutes: 3
|
||||
steps:
|
||||
@@ -30,13 +30,13 @@ jobs:
|
||||
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
id: app-token
|
||||
with:
|
||||
client-id: ${{ vars.NIXPKGS_CI_CLIENT_ID }}
|
||||
app-id: ${{ vars.NIXPKGS_CI_APP_ID }}
|
||||
private-key: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||
permission-contents: write
|
||||
permission-pull-requests: write
|
||||
permission-workflows: write
|
||||
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
|
||||
- name: Create backport PRs
|
||||
id: backport
|
||||
uses: korthout/backport-action@2e830a1d0b8269505846ddd407a70876913ad1f8 # v4.6.0
|
||||
uses: korthout/backport-action@66065406958f46e82238fd59546f5a99e69e22aa # v4.5.2
|
||||
with:
|
||||
# Config README: https://github.com/korthout/backport-action#backport-action
|
||||
add_author_as_reviewer: true
|
||||
|
||||
12
.github/workflows/bot.yml
vendored
12
.github/workflows/bot.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
||||
# https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: |
|
||||
@@ -57,10 +57,10 @@ jobs:
|
||||
|
||||
# Use a GitHub App, because it has much higher rate limits: 12,500 instead of 5,000 req / hour.
|
||||
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
if: github.event_name != 'pull_request' && vars.NIXPKGS_CI_CLIENT_ID
|
||||
if: github.event_name != 'pull_request' && vars.NIXPKGS_CI_APP_ID
|
||||
id: app-token
|
||||
with:
|
||||
client-id: ${{ vars.NIXPKGS_CI_CLIENT_ID }}
|
||||
app-id: ${{ vars.NIXPKGS_CI_APP_ID }}
|
||||
private-key: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||
permission-administration: read
|
||||
permission-contents: write
|
||||
@@ -91,7 +91,7 @@ jobs:
|
||||
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
|
||||
run: gh api /rate_limit | jq
|
||||
|
||||
- uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6.2.0
|
||||
- uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
|
||||
name: Labels from touched files
|
||||
if: |
|
||||
github.event_name == 'pull_request_target' &&
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
configuration-path: .github/labeler.yml # default
|
||||
sync-labels: true
|
||||
|
||||
- uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6.2.0
|
||||
- uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
|
||||
name: Labels from touched files (no sync)
|
||||
if: |
|
||||
github.event_name == 'pull_request_target' &&
|
||||
@@ -111,7 +111,7 @@ jobs:
|
||||
configuration-path: .github/labeler-no-sync.yml
|
||||
sync-labels: false
|
||||
|
||||
- uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6.2.0
|
||||
- uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
|
||||
name: Labels from touched files (development branches)
|
||||
# Development branches like staging-next, haskell-updates and python-updates get special labels.
|
||||
# This is to avoid the mass of labels there, which is mostly useless - and really annoying for
|
||||
|
||||
21
.github/workflows/build.yml
vendored
21
.github/workflows/build.yml
vendored
@@ -34,22 +34,25 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- runner: ubuntu-24.04
|
||||
system: x86_64-linux
|
||||
name: x86_64-linux
|
||||
systems: x86_64-linux
|
||||
builds: [shell, manual-nixos, lib-tests, tarball]
|
||||
desc: shell, docs, lib, tarball
|
||||
- runner: ubuntu-24.04-arm
|
||||
system: aarch64-linux
|
||||
name: aarch64-linux
|
||||
systems: aarch64-linux
|
||||
builds: [shell, manual-nixos, manual-nixpkgs]
|
||||
desc: shell, docs
|
||||
- runner: macos-14
|
||||
system: aarch64-darwin
|
||||
name: darwin
|
||||
systems: aarch64-darwin x86_64-darwin
|
||||
builds: [shell]
|
||||
desc: shell
|
||||
name: '${{ matrix.system }}: ${{ matrix.desc }}'
|
||||
name: '${{ matrix.name }}: ${{ matrix.desc }}'
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/actions
|
||||
@@ -59,7 +62,7 @@ jobs:
|
||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||
target-as-trusted-at: ${{ inputs.targetSha }}
|
||||
|
||||
- uses: cachix/install-nix-action@a49548c11d9846ad46ecc0115273879b045f001c # v31.10.7
|
||||
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
|
||||
with:
|
||||
# Sandbox is disabled on MacOS by default.
|
||||
extra_nix_config: sandbox = true
|
||||
@@ -77,9 +80,7 @@ jobs:
|
||||
|
||||
- name: Build shell
|
||||
if: contains(matrix.builds, 'shell')
|
||||
env:
|
||||
system: ${{ matrix.system }}
|
||||
run: nix-build-uncached nixpkgs/untrusted/ci --arg nixpkgs ./nixpkgs/untrusted-pinned -A shell --argstr system "$system"
|
||||
run: echo "${{ matrix.systems }}" | xargs -n1 nix-build-uncached nixpkgs/untrusted/ci --arg nixpkgs ./nixpkgs/untrusted-pinned -A shell --argstr system
|
||||
|
||||
- name: Build NixOS manual
|
||||
if: |
|
||||
@@ -107,5 +108,5 @@ jobs:
|
||||
contains(fromJSON(inputs.baseBranch).type, 'primary')
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: ${{ inputs.artifact-prefix }}nixos-manual-${{ matrix.system }}
|
||||
name: ${{ inputs.artifact-prefix }}nixos-manual-${{ matrix.name }}
|
||||
path: nixos-manual
|
||||
|
||||
12
.github/workflows/check.yml
vendored
12
.github/workflows/check.yml
vendored
@@ -43,7 +43,7 @@ jobs:
|
||||
runs-on: ubuntu-slim
|
||||
timeout-minutes: 3
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
path: trusted
|
||||
@@ -92,10 +92,10 @@ jobs:
|
||||
if: inputs.baseBranch && inputs.headBranch
|
||||
permissions:
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 8
|
||||
runs-on: ubuntu-slim
|
||||
timeout-minutes: 3
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
path: trusted
|
||||
@@ -137,7 +137,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/actions
|
||||
@@ -147,7 +147,7 @@ jobs:
|
||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||
target-as-trusted-at: ${{ inputs.targetSha }}
|
||||
|
||||
- uses: cachix/install-nix-action@a49548c11d9846ad46ecc0115273879b045f001c # v31.10.7
|
||||
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
|
||||
|
||||
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
||||
continue-on-error: true
|
||||
|
||||
6
.github/workflows/comment.yml
vendored
6
.github/workflows/comment.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
timeout-minutes: 2
|
||||
if: contains(github.event.comment.body, '@NixOS/nixpkgs-merge-bot merge')
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: |
|
||||
@@ -31,10 +31,10 @@ jobs:
|
||||
|
||||
# Use the GitHub App to make sure the reaction happens with the same user who will later merge.
|
||||
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
if: github.event_name != 'pull_request' && vars.NIXPKGS_CI_CLIENT_ID
|
||||
if: github.event_name != 'pull_request' && vars.NIXPKGS_CI_APP_ID
|
||||
id: app-token
|
||||
with:
|
||||
client-id: ${{ vars.NIXPKGS_CI_CLIENT_ID }}
|
||||
app-id: ${{ vars.NIXPKGS_CI_APP_ID }}
|
||||
private-key: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||
permission-pull-requests: write
|
||||
|
||||
|
||||
2
.github/workflows/edited.yml
vendored
2
.github/workflows/edited.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
id: app-token
|
||||
with:
|
||||
client-id: ${{ vars.NIXPKGS_CI_CLIENT_ID }}
|
||||
app-id: ${{ vars.NIXPKGS_CI_APP_ID }}
|
||||
private-key: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||
permission-pull-requests: write
|
||||
|
||||
|
||||
23
.github/workflows/eval.yml
vendored
23
.github/workflows/eval.yml
vendored
@@ -15,9 +15,6 @@ on:
|
||||
targetSha:
|
||||
required: true
|
||||
type: string
|
||||
baseBranch:
|
||||
required: true
|
||||
type: string
|
||||
systems:
|
||||
required: true
|
||||
type: string
|
||||
@@ -50,7 +47,7 @@ jobs:
|
||||
ciPinBumpCommit: ${{ steps.find-pinned-commit.outputs.ciPinBumpCommit }}
|
||||
ciPinBumpCommitShort: ${{ steps.find-pinned-commit.outputs.ciPinBumpCommitShort }}
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
path: trusted
|
||||
@@ -58,7 +55,7 @@ jobs:
|
||||
ci/supportedVersions.nix
|
||||
|
||||
- name: Check out the PR at the test merge commit
|
||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ inputs.mergedSha }}
|
||||
@@ -139,7 +136,7 @@ jobs:
|
||||
core.info(`Found pinned.json commit: ${ciPinBumpCommit}`)
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@a49548c11d9846ad46ecc0115273879b045f001c # v31.10.7
|
||||
uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
|
||||
|
||||
- name: Load supported versions
|
||||
id: versions
|
||||
@@ -174,7 +171,7 @@ jobs:
|
||||
sudo mkswap /swap
|
||||
sudo swapon /swap
|
||||
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/actions
|
||||
@@ -187,7 +184,7 @@ jobs:
|
||||
target-as-trusted-at: ${{ inputs.targetSha }}
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@a49548c11d9846ad46ecc0115273879b045f001c # v31.10.7
|
||||
uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
|
||||
|
||||
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
||||
continue-on-error: true
|
||||
@@ -259,7 +256,7 @@ jobs:
|
||||
statuses: write # creating 'Eval Summary' commit statuses
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/actions
|
||||
@@ -277,7 +274,7 @@ jobs:
|
||||
merge-multiple: true
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@a49548c11d9846ad46ecc0115273879b045f001c # v31.10.7
|
||||
uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
|
||||
|
||||
- name: Combine all output paths and eval stats
|
||||
run: |
|
||||
@@ -294,7 +291,6 @@ jobs:
|
||||
- name: Compare against the target branch
|
||||
env:
|
||||
TARGET_SHA: ${{ inputs.mergedSha }}
|
||||
BASE_BRANCH: ${{ fromJSON(inputs.baseBranch).branch }}
|
||||
run: |
|
||||
git -C nixpkgs/trusted diff --name-only "$TARGET_SHA" \
|
||||
| jq --raw-input --slurp 'split("\n")[:-1]' > touched-files.json
|
||||
@@ -303,7 +299,6 @@ jobs:
|
||||
nix-build nixpkgs/trusted/ci --arg nixpkgs ./nixpkgs/trusted-pinned -A eval.compare \
|
||||
--arg combinedDir ./combined \
|
||||
--arg touchedFilesJson ./touched-files.json \
|
||||
--argstr baseBranch "$BASE_BRANCH" \
|
||||
--out-link comparison
|
||||
|
||||
cat comparison/step-summary.md >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -476,7 +471,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/actions
|
||||
@@ -486,7 +481,7 @@ jobs:
|
||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@a49548c11d9846ad46ecc0115273879b045f001c # v31.10.7
|
||||
uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
|
||||
|
||||
- name: Ensure flake outputs on all systems still evaluate
|
||||
run: nix flake check --all-systems --no-build './nixpkgs/untrusted?shallow=1'
|
||||
|
||||
18
.github/workflows/lint.yml
vendored
18
.github/workflows/lint.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/actions
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
with:
|
||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||
|
||||
- uses: cachix/install-nix-action@a49548c11d9846ad46ecc0115273879b045f001c # v31.10.7
|
||||
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
|
||||
|
||||
# TODO: Figure out how to best enable caching for the treefmt job. Cachix won't work well,
|
||||
# because the cache would be invalidated on every commit - treefmt checks every file.
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/actions
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
with:
|
||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||
|
||||
- uses: cachix/install-nix-action@a49548c11d9846ad46ecc0115273879b045f001c # v31.10.7
|
||||
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
|
||||
|
||||
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
||||
continue-on-error: true
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/actions
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||
target-as-trusted-at: ${{ inputs.targetSha }}
|
||||
|
||||
- uses: cachix/install-nix-action@a49548c11d9846ad46ecc0115273879b045f001c # v31.10.7
|
||||
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
|
||||
|
||||
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
||||
continue-on-error: true
|
||||
@@ -131,10 +131,10 @@ jobs:
|
||||
# Luckily there's no need to lint commit messages in the Merge Queue, because
|
||||
# changes to the target branch can't change commit messages on the base branch.
|
||||
if: ${{ github.event.pull_request.number }}
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 8
|
||||
runs-on: ubuntu-slim
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: true # Needed to run git fetch for large PRs.
|
||||
path: trusted
|
||||
|
||||
3
.github/workflows/merge-group.yml
vendored
3
.github/workflows/merge-group.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
targetSha: ${{ steps.prepare.outputs.targetSha }}
|
||||
systems: ${{ steps.prepare.outputs.systems }}
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: |
|
||||
@@ -97,7 +97,6 @@ jobs:
|
||||
artifact-prefix: ${{ inputs.artifact-prefix }}
|
||||
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
|
||||
targetSha: ${{ needs.prepare.outputs.targetSha }}
|
||||
baseBranch: ${{ needs.prepare.outputs.baseBranch }}
|
||||
systems: ${{ needs.prepare.outputs.systems }}
|
||||
|
||||
build:
|
||||
|
||||
41
.github/workflows/periodic-merge-24h.yml
vendored
41
.github/workflows/periodic-merge-24h.yml
vendored
@@ -22,7 +22,7 @@ defaults:
|
||||
|
||||
jobs:
|
||||
periodic-merge:
|
||||
if: github.repository_owner == 'NixOS' || github.event_name == 'workflow_dispatch'
|
||||
if: github.repository_owner == 'NixOS'
|
||||
strategy:
|
||||
# don't fail fast, so that all pairs are tried
|
||||
fail-fast: false
|
||||
@@ -31,12 +31,14 @@ jobs:
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
pairs:
|
||||
- from: release-26.05
|
||||
- from: release-25.11
|
||||
into: staging-next-25.11
|
||||
- from: staging-next-25.11
|
||||
into: staging-25.11
|
||||
- from: master
|
||||
into: staging-next-26.05
|
||||
- from: staging-next-26.05
|
||||
into: staging-26.05
|
||||
- from: release-26.05
|
||||
into: staging-nixos-26.05
|
||||
- name: merge-base(master,staging) → haskell-updates
|
||||
from: master staging
|
||||
into: haskell-updates
|
||||
@@ -47,34 +49,3 @@ jobs:
|
||||
name: ${{ matrix.pairs.name || format('{0} → {1}', matrix.pairs.from, matrix.pairs.into) }}
|
||||
secrets:
|
||||
NIXPKGS_CI_APP_PRIVATE_KEY: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||
|
||||
# Resets the target branch of the current haskell-updates PR.
|
||||
# This makes GitHub hide all the commits that are already part of staging and gives us a much clearer PR view.
|
||||
haskell-updates:
|
||||
needs: periodic-merge
|
||||
runs-on: ubuntu-slim
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Find PR and update target branch
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
with:
|
||||
script: |
|
||||
// There will at most be a single haskell-updates PR anyway, so no need to paginate.
|
||||
await Promise.all(
|
||||
(
|
||||
await github.rest.pulls.list({
|
||||
...context.repo,
|
||||
state: 'open',
|
||||
head: `${context.repo.owner}:haskell-updates`,
|
||||
})
|
||||
).data.map((pr) =>
|
||||
github.rest.pulls.update({
|
||||
...context.repo,
|
||||
pull_number: pr.number,
|
||||
// Just updating to the same branch to trigger a UI update.
|
||||
// This is staging most of the time, but could be staging-next in rare cases.
|
||||
base: pr.base.ref,
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
||||
2
.github/workflows/periodic-merge-6h.yml
vendored
2
.github/workflows/periodic-merge-6h.yml
vendored
@@ -22,7 +22,7 @@ defaults:
|
||||
|
||||
jobs:
|
||||
periodic-merge:
|
||||
if: github.repository_owner == 'NixOS' || github.event_name == 'workflow_dispatch'
|
||||
if: github.repository_owner == 'NixOS'
|
||||
strategy:
|
||||
# don't fail fast, so that all pairs are tried
|
||||
fail-fast: false
|
||||
|
||||
4
.github/workflows/periodic-merge.yml
vendored
4
.github/workflows/periodic-merge.yml
vendored
@@ -29,12 +29,12 @@ jobs:
|
||||
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
id: app-token
|
||||
with:
|
||||
client-id: ${{ vars.NIXPKGS_CI_CLIENT_ID }}
|
||||
app-id: ${{ vars.NIXPKGS_CI_APP_ID }}
|
||||
private-key: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||
permission-contents: write
|
||||
permission-pull-requests: write
|
||||
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
3
.github/workflows/pull-request-target.yml
vendored
3
.github/workflows/pull-request-target.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
systems: ${{ steps.prepare.outputs.systems }}
|
||||
touched: ${{ steps.prepare.outputs.touched }}
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout-cone-mode: true # default, for clarity
|
||||
@@ -110,7 +110,6 @@ jobs:
|
||||
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
|
||||
headSha: ${{ github.event.pull_request.head.sha }}
|
||||
targetSha: ${{ needs.prepare.outputs.targetSha }}
|
||||
baseBranch: ${{ needs.prepare.outputs.baseBranch }}
|
||||
systems: ${{ needs.prepare.outputs.systems }}
|
||||
testVersions: ${{ contains(fromJSON(needs.prepare.outputs.touched), 'pinned') && !contains(fromJSON(needs.prepare.outputs.headBranch).type, 'development') }}
|
||||
|
||||
|
||||
6
.github/workflows/review.yml
vendored
6
.github/workflows/review.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
runs-on: ubuntu-slim
|
||||
timeout-minutes: 2
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: |
|
||||
@@ -28,10 +28,10 @@ jobs:
|
||||
|
||||
# Use the GitHub App to make sure the reaction happens with the same user who will later merge.
|
||||
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
if: github.event_name != 'pull_request' && vars.NIXPKGS_CI_CLIENT_ID
|
||||
if: github.event_name != 'pull_request' && vars.NIXPKGS_CI_APP_ID
|
||||
id: app-token
|
||||
with:
|
||||
client-id: ${{ vars.NIXPKGS_CI_CLIENT_ID }}
|
||||
app-id: ${{ vars.NIXPKGS_CI_APP_ID }}
|
||||
private-key: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||
permission-pull-requests: write
|
||||
|
||||
|
||||
6
.github/workflows/teams.yml
vendored
6
.github/workflows/teams.yml
vendored
@@ -2,7 +2,7 @@ name: Teams
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Every Monday at 19:42 (randomly chosen)
|
||||
# Every Tuesday at 19:42 (randomly chosen)
|
||||
- cron: '42 19 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
id: app-token
|
||||
with:
|
||||
client-id: ${{ vars.NIXPKGS_CI_CLIENT_ID }}
|
||||
app-id: ${{ vars.NIXPKGS_CI_APP_ID }}
|
||||
private-key: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||
permission-administration: read
|
||||
permission-contents: write
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
permission-pull-requests: write
|
||||
|
||||
- name: Fetch source
|
||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: |
|
||||
|
||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
push: ${{ steps.files.outputs.push }}
|
||||
targetSha: ${{ steps.prepare.outputs.targetSha }}
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout-cone-mode: true # default, for clarity
|
||||
@@ -64,7 +64,6 @@ jobs:
|
||||
'ci/github-script/supportedSystems.js',
|
||||
'ci/pinned.json',
|
||||
'ci/supportedBranches.js',
|
||||
'pkgs/top-level/release-supported-systems.json',
|
||||
].includes(file))) core.setOutput('merge-group', true)
|
||||
|
||||
if (files.some(file => [
|
||||
@@ -89,7 +88,6 @@ jobs:
|
||||
'ci/github-script/withRateLimit.js',
|
||||
'ci/pinned.json',
|
||||
'ci/supportedBranches.js',
|
||||
'pkgs/top-level/release-supported-systems.json',
|
||||
].includes(file))) core.setOutput('pr', true)
|
||||
|
||||
merge-group:
|
||||
|
||||
1
.mailmap
1
.mailmap
@@ -17,7 +17,6 @@ jopejoe1 <nixpkgs@missing.ninja> <34899572+jopejoe1@users.noreply.github.com>
|
||||
jopejoe1 <nixpkgs@missing.ninja> <jopejoe1@missing.ninja>
|
||||
jopejoe1 <nixpkgs@missing.ninja> <jopejoe1>
|
||||
Jörg Thalheim <joerg@thalheim.io> <Mic92@users.noreply.github.com>
|
||||
Katalin Rebhan <me@dblsaiko.net>
|
||||
Lin Jian <me@linj.tech> <linj.dev@outlook.com>
|
||||
Lin Jian <me@linj.tech> <75130626+jian-lin@users.noreply.github.com>
|
||||
Martin Weinelt <hexa@darmstadt.ccc.de> <mweinelt@users.noreply.github.com>
|
||||
|
||||
@@ -442,7 +442,6 @@ The staging workflow is used for all stable branches with corresponding names:
|
||||
- `master`/`release-YY.MM`
|
||||
- `staging`/`staging-YY.MM`
|
||||
- `staging-next`/`staging-next-YY.MM`
|
||||
- `staging-nixos`/`staging-nixos-YY.MM`
|
||||
|
||||
[^1]: Except changes that cause no more rebuilds than kernel updates
|
||||
|
||||
@@ -506,7 +505,7 @@ These PRs go to `staging-nixos`, see [the next section for more context](#change
|
||||
Changes causing a rebuild of all NixOS tests get a special [`10.rebuild-nixos-tests`](https://github.com/NixOS/nixpkgs/issues?q=state%3Aopen%20label%3A10.rebuild-nixos-tests) label.
|
||||
These changes pose a significant impact on the build infrastructure.
|
||||
|
||||
Hence, these PRs should either target a `staging`-branch or `staging-nixos`-branch, provided one of following conditions applies:
|
||||
Hence, these PRs should either target a `staging`-branch or `staging-nixos`, provided one of following conditions applies:
|
||||
|
||||
* The label `10.rebuild-nixos-tests` is set, or
|
||||
* The PR is a change affecting the Linux kernel.
|
||||
|
||||
12
README.md
12
README.md
@@ -1,9 +1,9 @@
|
||||
<p align="center">
|
||||
<a href="https://nixos.org">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://brand.nixos.org/logos/nixos-logo-rainbow-gradient-black-regular-horizontal-minimal.svg">
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://brand.nixos.org/logos/nixos-logo-rainbow-gradient-white-regular-horizontal-minimal.svg">
|
||||
<img src="https://brand.nixos.org/logos/nixos-logo-rainbow-gradient-black-regular-horizontal-minimal.svg" width="500px" alt="NixOS logo">
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://brand.nixos.org/logos/nixos-logo-default-gradient-black-regular-horizontal-minimal.svg">
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://brand.nixos.org/logos/nixos-logo-default-gradient-white-regular-horizontal-minimal.svg">
|
||||
<img src="https://brand.nixos.org/logos/nixos-logo-default-gradient-black-regular-horizontal-minimal.svg" width="500px" alt="NixOS logo">
|
||||
</picture>
|
||||
</a>
|
||||
</p>
|
||||
@@ -13,7 +13,7 @@
|
||||
<a href="https://opencollective.com/nixos"><img src="https://opencollective.com/nixos/tiers/supporter/badge.svg?label=supporters&color=brightgreen" alt="Open Collective supporters" /></a>
|
||||
</p>
|
||||
|
||||
[Nixpkgs](https://github.com/nixos/nixpkgs) is a collection of over 140,000 software packages that can be installed with the [Nix](https://nixos.org/nix/) package manager.
|
||||
[Nixpkgs](https://github.com/nixos/nixpkgs) is a collection of over 120,000 software packages that can be installed with the [Nix](https://nixos.org/nix/) package manager.
|
||||
It also implements [NixOS](https://nixos.org/nixos/), a purely-functional Linux distribution.
|
||||
|
||||
# Manuals
|
||||
@@ -47,9 +47,9 @@ Here are some of the main ones:
|
||||
Nixpkgs and NixOS are built and tested by our continuous integration system, [Hydra](https://hydra.nixos.org/).
|
||||
|
||||
* [Continuous package builds for unstable/master](https://hydra.nixos.org/jobset/nixos/trunk-combined)
|
||||
* [Continuous package builds for the NixOS 26.05 release](https://hydra.nixos.org/jobset/nixos/release-26.05)
|
||||
* [Continuous package builds for the NixOS 25.11 release](https://hydra.nixos.org/jobset/nixos/release-25.11)
|
||||
* [Tests for unstable/master](https://hydra.nixos.org/job/nixos/trunk-combined/tested#tabs-constituents)
|
||||
* [Tests for the NixOS 26.05 release](https://hydra.nixos.org/job/nixos/release-26.05/tested#tabs-constituents)
|
||||
* [Tests for the NixOS 25.11 release](https://hydra.nixos.org/job/nixos/release-25.11/tested#tabs-constituents)
|
||||
|
||||
Artifacts successfully built with Hydra are published to cache at https://cache.nixos.org/.
|
||||
When successful build and test criteria are met, the Nixpkgs expressions are distributed via [Nix channels](https://nix.dev/manual/nix/stable/command-ref/nix-channel.html).
|
||||
|
||||
144
ci/OWNERS
144
ci/OWNERS
@@ -25,27 +25,26 @@
|
||||
/shell.nix @infinisil @NixOS/Security
|
||||
|
||||
# Libraries
|
||||
/lib @infinisil @hsjobeki @llakala
|
||||
/lib/generators.nix @infinisil @hsjobeki @llakala
|
||||
/lib/cli.nix @infinisil @hsjobeki @llakala
|
||||
/lib/debug.nix @infinisil @hsjobeki @llakala
|
||||
/lib/asserts.nix @infinisil @hsjobeki @llakala
|
||||
/lib/path/* @infinisil @hsjobeki @llakala
|
||||
/lib/fileset @infinisil @hsjobeki @llakala
|
||||
/maintainers/github-teams.json @infinisil @llakala
|
||||
/maintainers/computed-team-list.nix @infinisil @llakala
|
||||
/lib @infinisil @hsjobeki
|
||||
/lib/generators.nix @infinisil @hsjobeki
|
||||
/lib/cli.nix @infinisil @hsjobeki
|
||||
/lib/debug.nix @infinisil @hsjobeki
|
||||
/lib/asserts.nix @infinisil @hsjobeki
|
||||
/lib/path/* @infinisil @hsjobeki
|
||||
/lib/fileset @infinisil @hsjobeki
|
||||
/maintainers/github-teams.json @infinisil
|
||||
/maintainers/computed-team-list.nix @infinisil
|
||||
## Standard environment–related libraries
|
||||
/lib/customisation.nix @alyssais @NixOS/stdenv @llakala
|
||||
/lib/derivations.nix @NixOS/stdenv @llakala
|
||||
/lib/fetchers.nix @alyssais @NixOS/stdenv @llakala
|
||||
/lib/meta.nix @alyssais @NixOS/stdenv @llakala
|
||||
/lib/meta-types.nix @infinisil @adisbladis @NixOS/stdenv @llakala
|
||||
/lib/source-types.nix @alyssais @NixOS/stdenv @llakala
|
||||
/lib/systems @alyssais @NixOS/stdenv @llakala
|
||||
/lib/customisation.nix @alyssais @NixOS/stdenv
|
||||
/lib/derivations.nix @NixOS/stdenv
|
||||
/lib/fetchers.nix @alyssais @NixOS/stdenv
|
||||
/lib/meta.nix @alyssais @NixOS/stdenv
|
||||
/lib/source-types.nix @alyssais @NixOS/stdenv
|
||||
/lib/systems @alyssais @NixOS/stdenv
|
||||
## Libraries / Module system
|
||||
/lib/modules.nix @infinisil @roberth @hsjobeki @llakala
|
||||
/lib/types.nix @infinisil @roberth @hsjobeki @llakala
|
||||
/lib/options.nix @infinisil @roberth @hsjobeki @llakala
|
||||
/lib/modules.nix @infinisil @roberth @hsjobeki
|
||||
/lib/types.nix @infinisil @roberth @hsjobeki
|
||||
/lib/options.nix @infinisil @roberth @hsjobeki
|
||||
/lib/tests/modules.sh @infinisil @roberth @hsjobeki
|
||||
/lib/tests/modules @infinisil @roberth @hsjobeki
|
||||
|
||||
@@ -57,31 +56,31 @@
|
||||
/pkgs/top-level/splice.nix @Ericson2314
|
||||
/pkgs/top-level/release-cross.nix @Ericson2314
|
||||
/pkgs/top-level/by-name-overlay.nix @infinisil @philiptaron
|
||||
/pkgs/top-level/config.nix @jopejoe1
|
||||
/pkgs/top-level/make-tarball.nix @jopejoe1
|
||||
/pkgs/top-level/packages-config.nix @jopejoe1
|
||||
/pkgs/top-level/packages-info.nix @jopejoe1
|
||||
/pkgs/top-level/release-lib.nix @jopejoe1
|
||||
/pkgs/top-level/release.nix @jopejoe1
|
||||
/pkgs/stdenv @philiptaron @NixOS/stdenv @llakala
|
||||
/pkgs/stdenv/generic @Ericson2314 @NixOS/stdenv @llakala
|
||||
/pkgs/stdenv/generic/problems.nix @infinisil @llakala
|
||||
/pkgs/stdenv @philiptaron @NixOS/stdenv
|
||||
/pkgs/stdenv/generic @Ericson2314 @NixOS/stdenv
|
||||
/pkgs/stdenv/generic/problems.nix @infinisil
|
||||
/pkgs/test/problems @infinisil
|
||||
/pkgs/stdenv/generic/check-meta.nix @infinisil @Ericson2314 @adisbladis @NixOS/stdenv @llakala
|
||||
/pkgs/stdenv/generic/check-meta.nix @infinisil @Ericson2314 @adisbladis @NixOS/stdenv
|
||||
/pkgs/stdenv/generic/meta-types.nix @infinisil @adisbladis @NixOS/stdenv
|
||||
/pkgs/stdenv/cross @Ericson2314 @NixOS/stdenv
|
||||
/pkgs/build-support @philiptaron
|
||||
/pkgs/build-support/cc-wrapper @Ericson2314
|
||||
/pkgs/build-support/bintools-wrapper @Ericson2314
|
||||
/pkgs/build-support/setup-hooks @Ericson2314
|
||||
/pkgs/build-support/setup-hooks/arrayUtilities @ConnorBaker
|
||||
/pkgs/build-support/setup-hooks/auto-patchelf.sh @layus
|
||||
/pkgs/by-name/au/auto-patchelf @layus
|
||||
|
||||
## Format generators/serializers
|
||||
/pkgs/pkgs-lib @Stunkymonkey @h7x4
|
||||
/pkgs/pkgs-lib/formats/json2x @Stunkymonkey @h7x4 @figsoda
|
||||
|
||||
# Nixpkgs build-support
|
||||
/pkgs/build-support/writers @lassulus
|
||||
|
||||
# Nixpkgs make-disk-image
|
||||
/doc/build-helpers/images/makediskimage.section.md @raitobezarius
|
||||
/nixos/lib/make-disk-image.nix @raitobezarius
|
||||
|
||||
# Nix, the package manager
|
||||
# @raitobezarius is not "code owner", but is listed here to be notified of changes
|
||||
# pertaining to the Nix package manager.
|
||||
@@ -95,16 +94,16 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @Artturin @Ericson2314 @lo
|
||||
/maintainers/scripts/doc @jtojnar @ryantm
|
||||
|
||||
# Contributor documentation
|
||||
/CONTRIBUTING.md
|
||||
/.github/PULL_REQUEST_TEMPLATE.md
|
||||
/doc/contributing/
|
||||
/doc/contributing/contributing-to-documentation.chapter.md @jtojnar
|
||||
/lib/README.md
|
||||
/doc/README.md
|
||||
/nixos/README.md
|
||||
/pkgs/README.md
|
||||
/pkgs/by-name/README.md
|
||||
/maintainers/README.md
|
||||
/CONTRIBUTING.md @infinisil
|
||||
/.github/PULL_REQUEST_TEMPLATE.md @infinisil
|
||||
/doc/contributing/ @infinisil
|
||||
/doc/contributing/contributing-to-documentation.chapter.md @jtojnar @infinisil
|
||||
/lib/README.md @infinisil
|
||||
/doc/README.md @infinisil
|
||||
/nixos/README.md @infinisil
|
||||
/pkgs/README.md @infinisil
|
||||
/pkgs/by-name/README.md @infinisil
|
||||
/maintainers/README.md @infinisil
|
||||
|
||||
# User-facing development documentation
|
||||
/doc/development.md @infinisil
|
||||
@@ -123,6 +122,9 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @Artturin @Ericson2314 @lo
|
||||
/doc/redirects.json @GetPsyched
|
||||
/nixos/doc/manual/redirects.json @GetPsyched
|
||||
|
||||
# NixOS integration test driver
|
||||
/nixos/lib/test-driver @tfc
|
||||
|
||||
# NixOS QEMU virtualisation
|
||||
/nixos/modules/virtualisation/qemu-vm.nix @raitobezarius
|
||||
/nixos/modules/services/backup/libvirtd-autosnapshot.nix @6543
|
||||
@@ -182,10 +184,12 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @Artturin @Ericson2314 @lo
|
||||
/pkgs/by-name/an/android* @NixOS/android
|
||||
|
||||
# Python-related code and docs
|
||||
/doc/languages-frameworks/python.section.md @mweinelt
|
||||
/maintainers/scripts/update-python-libraries @mweinelt
|
||||
/pkgs/by-name/up/update-python-libraries @mweinelt
|
||||
/pkgs/development/interpreters/python @mweinelt
|
||||
/doc/languages-frameworks/python.section.md @mweinelt @natsukium
|
||||
/maintainers/scripts/update-python-libraries @mweinelt @natsukium
|
||||
/pkgs/by-name/up/update-python-libraries @mweinelt @natsukium
|
||||
/pkgs/development/interpreters/python @mweinelt @natsukium
|
||||
/pkgs/top-level/python-packages.nix @natsukium
|
||||
/pkgs/top-level/release-python.nix @natsukium
|
||||
|
||||
# CUDA
|
||||
/pkgs/top-level/cuda-packages.nix @NixOS/cuda-maintainers
|
||||
@@ -215,10 +219,10 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @Artturin @Ericson2314 @lo
|
||||
/pkgs/development/r-modules @jbedo
|
||||
|
||||
# Rust
|
||||
/pkgs/development/compilers/rust @NixOS/rust @alyssais
|
||||
/pkgs/build-support/rust @NixOS/rust
|
||||
/pkgs/development/compilers/rust @alyssais @Mic92 @winterqt
|
||||
/pkgs/build-support/rust @winterqt
|
||||
/pkgs/build-support/rust/fetch-cargo-vendor* @TomaSajt
|
||||
/doc/languages-frameworks/rust.section.md @NixOS/rust
|
||||
/doc/languages-frameworks/rust.section.md @winterqt
|
||||
|
||||
# Tcl
|
||||
/pkgs/development/interpreters/tcl @fgaz
|
||||
@@ -230,10 +234,14 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @Artturin @Ericson2314 @lo
|
||||
# C compilers
|
||||
/pkgs/development/compilers/gcc
|
||||
/pkgs/development/compilers/llvm @NixOS/llvm
|
||||
/pkgs/development/compilers/emscripten @raitobezarius
|
||||
/doc/toolchains/llvm.chapter.md @NixOS/llvm
|
||||
/doc/languages-frameworks/emscripten.section.md @raitobezarius
|
||||
|
||||
# Audio
|
||||
/nixos/modules/services/audio/botamusique.nix @mweinelt
|
||||
/nixos/modules/services/audio/snapserver.nix @mweinelt
|
||||
/nixos/tests/botamusique.nix @mweinelt
|
||||
/nixos/tests/snapcast.nix @mweinelt
|
||||
|
||||
# Browsers
|
||||
@@ -260,18 +268,18 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt
|
||||
/pkgs/applications/editors/jetbrains @leona-ya @theCapypara
|
||||
|
||||
# Licenses
|
||||
/lib/licenses @alyssais @emilazy @jopejoe1 @llakala
|
||||
/lib/licenses @alyssais @emilazy @jopejoe1
|
||||
|
||||
# Qt
|
||||
/pkgs/development/libraries/qt-5 @K900 @NickCao @SuperSandro2000
|
||||
/pkgs/development/libraries/qt-6 @K900 @NickCao @SuperSandro2000
|
||||
/pkgs/development/libraries/qt-5 @K900 @NickCao @SuperSandro2000 @ttuegel
|
||||
/pkgs/development/libraries/qt-6 @K900 @NickCao @SuperSandro2000 @ttuegel
|
||||
|
||||
# KDE Frameworks 5
|
||||
/pkgs/development/libraries/kde-frameworks @K900 @NickCao @SuperSandro2000
|
||||
/pkgs/development/libraries/kde-frameworks @K900 @NickCao @SuperSandro2000 @ttuegel
|
||||
|
||||
# KDE / Plasma 6
|
||||
/pkgs/kde @K900 @NickCao @SuperSandro2000
|
||||
/maintainers/scripts/kde @K900 @NickCao @SuperSandro2000
|
||||
/pkgs/kde @K900 @NickCao @SuperSandro2000 @ttuegel
|
||||
/maintainers/scripts/kde @K900 @NickCao @SuperSandro2000 @ttuegel
|
||||
|
||||
# PostgreSQL and related stuff
|
||||
/pkgs/by-name/po/postgresqlTestHook @NixOS/postgres
|
||||
@@ -322,9 +330,9 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt
|
||||
/nixos/tests/knot.nix @mweinelt
|
||||
|
||||
# Web servers
|
||||
/doc/packages/nginx.section.md @leona-ya @Ma27
|
||||
/pkgs/servers/http/nginx/ @helsinki-Jo @leona-ya @Ma27
|
||||
/nixos/modules/services/web-servers/nginx/ @leona-ya @Ma27
|
||||
/doc/packages/nginx.section.md @raitobezarius
|
||||
/pkgs/servers/http/nginx/ @raitobezarius
|
||||
/nixos/modules/services/web-servers/nginx/ @raitobezarius
|
||||
|
||||
# D
|
||||
/pkgs/build-support/dlang @jtbx @TomaSajt
|
||||
@@ -364,8 +372,7 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt
|
||||
/pkgs/development/lua-modules @NixOS/lua
|
||||
|
||||
# Neovim
|
||||
/pkgs/applications/editors/neovim @NixOS/neovim
|
||||
/doc/languages-frameworks/neovim.section.md @NixOS/neovim
|
||||
/pkgs/applications/editors/neovim @NixOS/neovim
|
||||
|
||||
# VimPlugins
|
||||
/pkgs/applications/editors/vim/plugins @NixOS/neovim
|
||||
@@ -389,15 +396,18 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt
|
||||
/nixos/tests/docker-tools* @roberth @jhol
|
||||
/doc/build-helpers/images/dockertools.section.md @roberth @jhol
|
||||
|
||||
# Blockchains
|
||||
/pkgs/applications/blockchains @mmahut @RaghavSood
|
||||
|
||||
# Go
|
||||
/doc/languages-frameworks/go.section.md @kalbasit @katexochen @Mic92
|
||||
/pkgs/build-support/go @kalbasit @katexochen @Mic92
|
||||
/pkgs/development/compilers/go @kalbasit @katexochen @Mic92
|
||||
|
||||
# GNOME
|
||||
/pkgs/desktops/gnome @NixOS/gnome
|
||||
/pkgs/desktops/gnome/extensions @NixOS/gnome
|
||||
/pkgs/build-support/make-hardcode-gsettings-patch @NixOS/gnome
|
||||
/pkgs/desktops/gnome @jtojnar
|
||||
/pkgs/desktops/gnome/extensions @jtojnar
|
||||
/pkgs/build-support/make-hardcode-gsettings-patch @jtojnar
|
||||
|
||||
# Cinnamon
|
||||
/pkgs/by-name/ci/cinnamon-* @mkg20001
|
||||
@@ -429,7 +439,6 @@ nixos/tests/forgejo.nix @adamcstephens @bendlas @christoph-heiss @
|
||||
/doc/languages-frameworks/javascript.section.md @winterqt
|
||||
/pkgs/development/tools/pnpm @Scrumplex @gepbird
|
||||
/pkgs/build-support/node/fetch-pnpm-deps @Scrumplex @gepbird
|
||||
/pkgs/test/pnpm @Scrumplex @gepbird
|
||||
|
||||
# OCaml
|
||||
/pkgs/build-support/ocaml @ulrikstrid
|
||||
@@ -506,7 +515,7 @@ pkgs/by-name/oc/octodns/ @anthonyroussel
|
||||
pkgs/by-name/te/teleport* @arianvp @justinas @sigma @tomberek @techknowlogick @JuliusFreudenberger
|
||||
|
||||
# Warp-terminal
|
||||
pkgs/by-name/wa/warp-terminal/ @emilytrau @imadnyc @4evy @johnrtitor
|
||||
pkgs/by-name/wa/warp-terminal/ @emilytrau @imadnyc @FlameFlag @johnrtitor
|
||||
|
||||
# Nim
|
||||
/doc/languages-frameworks/nim.section.md @NixOS/nim
|
||||
@@ -517,12 +526,3 @@ pkgs/by-name/wa/warp-terminal/ @emilytrau @imadnyc @4evy @johnrtitor
|
||||
# Radicle
|
||||
/pkgs/build-support/fetchradicle/ @NixOS/radicle
|
||||
/pkgs/build-support/fetchradiclepatch/ @NixOS/radicle
|
||||
|
||||
# Zellij plugins
|
||||
/pkgs/by-name/ze/zellij/plugins/ @PerchunPak
|
||||
|
||||
# Test-driver
|
||||
/nixos/lib/test-driver @NixOS/test-driver
|
||||
/nixos/lib/testing @NixOS/test-driver
|
||||
/nixos/tests/nixos-test-driver @NixOS/test-driver
|
||||
/nixos/modules/virtualisation/nspawn-container/run-nspawn @NixOS/test-driver
|
||||
|
||||
11
ci/README.md
11
ci/README.md
@@ -51,16 +51,6 @@ To ensure security and a focused utility, the bot adheres to specific limitation
|
||||
- opened by [@r-ryantm](https://nix-community.github.io/nixpkgs-update/r-ryantm/).
|
||||
- The user attempting to merge is a member of [@NixOS/nixpkgs-maintainers].
|
||||
- The user attempting to merge is a maintainer of all packages touched by the PR.
|
||||
- No [committer][@NixOS/nixpkgs-committers] has an outstanding "changes requested" review.
|
||||
These block both the merge queue and auto-merge, so the bot refuses to merge until the review is addressed or dismissed.
|
||||
|
||||
Once these constraints are met, the bot picks a merge strategy based on the `no PR failures` commit status:
|
||||
|
||||
- CI passing: the PR is added to the merge queue.
|
||||
- CI unfinished (pending or missing status): the bot enables [Auto Merge], which queues the PR once required checks succeed.
|
||||
Note that if CI later fails, nothing happens until it is fixed and passes.
|
||||
- CI already failing (`error`/`failure` status): the bot does not enable Auto Merge, because it would never trigger, and fixing CI requires a new push that invalidates the merge command.
|
||||
A fresh `@NixOS/nixpkgs-merge-bot merge` comment is needed once CI is green again.
|
||||
|
||||
### Approving merge bot changes
|
||||
|
||||
@@ -114,4 +104,3 @@ This script can also be run locally to print basic test cases.
|
||||
[@NixOS/nixpkgs-ci]: https://github.com/orgs/NixOS/teams/nixpkgs-ci
|
||||
[@NixOS/nixpkgs-core]: https://github.com/orgs/NixOS/teams/nixpkgs-core
|
||||
[RFC 172]: https://github.com/NixOS/rfcs/pull/172
|
||||
[Auto Merge]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request
|
||||
|
||||
149
ci/default.nix
149
ci/default.nix
@@ -26,7 +26,132 @@ let
|
||||
|
||||
fmt =
|
||||
let
|
||||
treefmt = pkgs.treefmt.withConfig ./treefmt.nix;
|
||||
treefmtNixSrc = fetchTarball {
|
||||
inherit (pinned.treefmt-nix) url;
|
||||
sha256 = pinned.treefmt-nix.hash;
|
||||
};
|
||||
treefmtEval = (import treefmtNixSrc).evalModule pkgs {
|
||||
# Important: The auto-rebase script uses `git filter-branch --tree-filter`,
|
||||
# which creates trees within the Git repository under `.git-rewrite/t`,
|
||||
# notably without having a `.git` themselves.
|
||||
# So if this projectRootFile were the default `.git/config`,
|
||||
# having the auto-rebase script use treefmt on such a tree would make it
|
||||
# format all files in the _parent_ Git tree as well.
|
||||
projectRootFile = ".git-blame-ignore-revs";
|
||||
|
||||
# Be a bit more verbose by default, so we can see progress happening
|
||||
settings.verbose = 1;
|
||||
|
||||
# By default it's info, which is too noisy since we have many unmatched files
|
||||
settings.on-unmatched = "debug";
|
||||
|
||||
programs.actionlint.enable = true;
|
||||
|
||||
programs.biome = {
|
||||
enable = true;
|
||||
# Disable settings validation because its inputs are liable to hash mismatch
|
||||
validate.enable = false;
|
||||
settings.formatter = {
|
||||
useEditorconfig = true;
|
||||
};
|
||||
settings.javascript.formatter = {
|
||||
quoteStyle = "single";
|
||||
semicolons = "asNeeded";
|
||||
};
|
||||
settings.json.formatter.enabled = false;
|
||||
};
|
||||
settings.formatter.biome.excludes = [
|
||||
"*.min.js"
|
||||
"pkgs/*"
|
||||
];
|
||||
|
||||
programs.keep-sorted.enable = true;
|
||||
|
||||
# This uses nixfmt underneath, the default formatter for Nix code.
|
||||
# See https://github.com/NixOS/nixfmt
|
||||
programs.nixfmt = {
|
||||
enable = true;
|
||||
package = pkgs.nixfmt;
|
||||
};
|
||||
|
||||
programs.yamlfmt = {
|
||||
enable = true;
|
||||
settings.formatter = {
|
||||
retain_line_breaks = true;
|
||||
};
|
||||
};
|
||||
settings.formatter.yamlfmt.excludes = [
|
||||
# Aligns comments with whitespace
|
||||
"pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml"
|
||||
# TODO: Fix formatting for auto-generated file
|
||||
"pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml"
|
||||
];
|
||||
|
||||
programs.nixf-diagnose = {
|
||||
enable = true;
|
||||
ignore = [
|
||||
# Rule names can currently be looked up here:
|
||||
# https://github.com/nix-community/nixd/blob/main/libnixf/src/Basic/diagnostic.py
|
||||
# TODO: Remove the following and fix things.
|
||||
"sema-unused-def-lambda-noarg-formal"
|
||||
"sema-unused-def-lambda-witharg-arg"
|
||||
"sema-unused-def-lambda-witharg-formal"
|
||||
"sema-unused-def-let"
|
||||
# Keep this rule, because we have `lib.or`.
|
||||
"or-identifier"
|
||||
# TODO: remove after outstanding prelude diagnostics issues are fixed:
|
||||
# https://github.com/nix-community/nixd/issues/761
|
||||
# https://github.com/nix-community/nixd/issues/762
|
||||
"sema-primop-removed-prefix"
|
||||
"sema-primop-overridden"
|
||||
"sema-constant-overridden"
|
||||
"sema-primop-unknown"
|
||||
];
|
||||
};
|
||||
settings.formatter.nixf-diagnose = {
|
||||
# Ensure nixfmt cleans up after nixf-diagnose.
|
||||
priority = -1;
|
||||
excludes = [
|
||||
# Auto-generated; violates sema-extra-with
|
||||
# Can only sensibly be removed when --auto-fix supports multiple fixes at once:
|
||||
# https://github.com/inclyc/nixf-diagnose/issues/13
|
||||
"pkgs/servers/home-assistant/component-packages.nix"
|
||||
# https://github.com/nix-community/nixd/issues/708
|
||||
"nixos/maintainers/scripts/azure-new/examples/basic/system.nix"
|
||||
];
|
||||
};
|
||||
|
||||
settings.formatter.editorconfig-checker = {
|
||||
command = "${pkgs.lib.getExe pkgs.editorconfig-checker}";
|
||||
options = [
|
||||
"-disable-indent-size"
|
||||
# TODO: Remove this once this upstream issue is fixed:
|
||||
# https://github.com/editorconfig-checker/editorconfig-checker/issues/505
|
||||
"-disable-charset"
|
||||
];
|
||||
includes = [ "*" ];
|
||||
priority = 1;
|
||||
};
|
||||
|
||||
# TODO: Upstream this into treefmt-nix eventually:
|
||||
# https://github.com/numtide/treefmt-nix/issues/387
|
||||
settings.formatter.markdown-code-runner = {
|
||||
command = pkgs.lib.getExe pkgs.markdown-code-runner;
|
||||
options =
|
||||
let
|
||||
config = pkgs.writers.writeTOML "markdown-code-runner-config" {
|
||||
presets.nixfmt = {
|
||||
language = "nix";
|
||||
command = [ (pkgs.lib.getExe pkgs.nixfmt) ];
|
||||
};
|
||||
};
|
||||
in
|
||||
[ "--config=${config}" ];
|
||||
includes = [ "*.md" ];
|
||||
};
|
||||
|
||||
programs.zizmor.enable = true;
|
||||
};
|
||||
fs = pkgs.lib.fileset;
|
||||
nixFilesSrc = fs.toSource {
|
||||
root = ../.;
|
||||
@@ -34,24 +159,14 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
pkg = treefmt;
|
||||
check = treefmt.check nixFilesSrc;
|
||||
shell = treefmtEval.config.build.devShell;
|
||||
pkg = treefmtEval.config.build.wrapper;
|
||||
check = treefmtEval.config.build.check nixFilesSrc;
|
||||
};
|
||||
|
||||
# nixos-render-docs and nixos-render-docs-redirects
|
||||
# Should be used from tree to build the matching in-tree documentation
|
||||
docPkgs = pkgs.extend (
|
||||
final: prev: {
|
||||
nixos-render-docs = final.callPackage ../pkgs/by-name/ni/nixos-render-docs/package.nix { };
|
||||
nixos-render-docs-redirects =
|
||||
final.callPackage ../pkgs/by-name/ni/nixos-render-docs-redirects/package.nix
|
||||
{ };
|
||||
}
|
||||
);
|
||||
|
||||
in
|
||||
rec {
|
||||
inherit pkgs docPkgs fmt;
|
||||
inherit pkgs fmt;
|
||||
codeownersValidator = pkgs.callPackage ./codeowners-validator { };
|
||||
|
||||
# FIXME(lf-): it might be useful to test other Nix implementations
|
||||
@@ -64,13 +179,13 @@ rec {
|
||||
# CI jobs
|
||||
lib-tests = import ../lib/tests/release.nix { inherit pkgs; };
|
||||
manual-nixos = (import ../nixos/release.nix { }).manual.${system} or null;
|
||||
manual-nixpkgs = (import ../doc { pkgs = docPkgs; });
|
||||
manual-nixpkgs = (import ../doc { inherit pkgs; });
|
||||
nixpkgs-vet = pkgs.callPackage ./nixpkgs-vet.nix {
|
||||
nix = pkgs.nixVersions.latest;
|
||||
};
|
||||
parse = pkgs.lib.recurseIntoAttrs {
|
||||
nix_latest = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.latest; };
|
||||
stable = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.stable; };
|
||||
nix_2_28 = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.nix_2_28; };
|
||||
lix = pkgs.callPackage ./parse.nix { nix = pkgs.lix; };
|
||||
lix_latest = pkgs.callPackage ./parse.nix { nix = pkgs.lixPackageSets.latest.lix; };
|
||||
};
|
||||
|
||||
85
ci/eval/attrpaths.nix
Normal file
85
ci/eval/attrpaths.nix
Normal file
@@ -0,0 +1,85 @@
|
||||
# This expression will, as efficiently as possible, dump a
|
||||
# *superset* of all attrpaths of derivations which might be
|
||||
# part of a release on *any* platform.
|
||||
#
|
||||
# This expression runs single-threaded under all current Nix
|
||||
# implementations, but much faster and with much less memory
|
||||
# used than ./outpaths.nix itself.
|
||||
#
|
||||
# Once you have the list of attrnames you can split it up into
|
||||
# $NUM_CORES batches and evaluate the outpaths separately for each
|
||||
# batch, in parallel.
|
||||
#
|
||||
# To dump the attrnames:
|
||||
#
|
||||
# nix-instantiate --eval --strict --json ci/eval/attrpaths.nix -A names
|
||||
#
|
||||
{
|
||||
lib ? import (path + "/lib"),
|
||||
trace ? false,
|
||||
path ? ./../..,
|
||||
extraNixpkgsConfigJson ? "{}",
|
||||
}:
|
||||
let
|
||||
|
||||
# TODO: Use mapAttrsToListRecursiveCond when this PR lands:
|
||||
# https://github.com/NixOS/nixpkgs/pull/395160
|
||||
justAttrNames =
|
||||
path: value:
|
||||
let
|
||||
result =
|
||||
if path == [ "AAAAAASomeThingsFailToEvaluate" ] || !(lib.isAttrs value) then
|
||||
[ ]
|
||||
else if lib.isDerivation value then
|
||||
[ path ]
|
||||
else
|
||||
lib.pipe value [
|
||||
(lib.mapAttrsToList (
|
||||
name: value:
|
||||
lib.addErrorContext "while evaluating package set attribute path '${
|
||||
lib.showAttrPath (path ++ [ name ])
|
||||
}'" (justAttrNames (path ++ [ name ]) value)
|
||||
))
|
||||
lib.concatLists
|
||||
];
|
||||
in
|
||||
lib.traceIf trace "** ${lib.showAttrPath path}" result;
|
||||
|
||||
outpaths = import ./outpaths.nix {
|
||||
inherit path;
|
||||
extraNixpkgsConfig = builtins.fromJSON extraNixpkgsConfigJson;
|
||||
attrNamesOnly = true;
|
||||
};
|
||||
|
||||
paths = [
|
||||
# Some of the following are based on variants, which are disabled with `attrNamesOnly = true`.
|
||||
# Until these have been removed from release.nix / hydra, we manually add them to the list.
|
||||
[
|
||||
"pkgsLLVM"
|
||||
"stdenv"
|
||||
]
|
||||
[
|
||||
"pkgsArocc"
|
||||
"stdenv"
|
||||
]
|
||||
[
|
||||
"pkgsZig"
|
||||
"stdenv"
|
||||
]
|
||||
[
|
||||
"pkgsStatic"
|
||||
"stdenv"
|
||||
]
|
||||
[
|
||||
"pkgsMusl"
|
||||
"stdenv"
|
||||
]
|
||||
]
|
||||
++ justAttrNames [ ] outpaths;
|
||||
|
||||
names = map lib.showAttrPath paths;
|
||||
|
||||
in
|
||||
{
|
||||
inherit paths names;
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
{
|
||||
lib ? import ../../lib,
|
||||
path ? ../..,
|
||||
# The file containing the preEval result
|
||||
preEvalFile,
|
||||
# The file containing all available attribute paths, which are split into chunks here
|
||||
attrpathFile,
|
||||
chunkSize,
|
||||
myChunk,
|
||||
includeBroken,
|
||||
@@ -12,13 +12,12 @@
|
||||
}:
|
||||
|
||||
let
|
||||
preEvalResult = lib.importJSON preEvalFile;
|
||||
myAttrpaths = lib.sublist (chunkSize * myChunk) chunkSize preEvalResult.paths;
|
||||
attrpaths = lib.importJSON attrpathFile;
|
||||
myAttrpaths = lib.sublist (chunkSize * myChunk) chunkSize attrpaths;
|
||||
|
||||
unfiltered = import ./outpaths.nix {
|
||||
inherit path;
|
||||
inherit includeBroken systems;
|
||||
inherit (preEvalResult) attrPathsDisallowedForInternalUse;
|
||||
extraNixpkgsConfig = builtins.fromJSON extraNixpkgsConfigJson;
|
||||
};
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ in
|
||||
{
|
||||
combinedDir,
|
||||
touchedFilesJson,
|
||||
baseBranch,
|
||||
ownersFile ? ../../OWNERS,
|
||||
}:
|
||||
let
|
||||
@@ -239,33 +238,34 @@ runCommand "compare"
|
||||
jq -r -f ${./generate-step-summary.jq} < ${changed-paths}
|
||||
} >> $out/step-summary.md
|
||||
|
||||
{
|
||||
echo
|
||||
echo "# Performance comparison"
|
||||
echo
|
||||
echo "This compares the performance of this branch against the \`${baseBranch}\` branch."
|
||||
echo
|
||||
} >> $out/step-summary.md
|
||||
|
||||
# cmp-stats only compares the stats chunks present in both revisions, so the
|
||||
# comparison is still produced when packages were added/removed. The paired
|
||||
# chunks may cover different attrs in that case, so caveat the figures.
|
||||
if ! jq -e '(.attrdiff.added | length == 0) and (.attrdiff.removed | length == 0)' "${changed-paths}" > /dev/null; then
|
||||
if jq -e '(.attrdiff.added | length == 0) and (.attrdiff.removed | length == 0)' "${changed-paths}" > /dev/null; then
|
||||
# Chunks have changed between revisions
|
||||
# We cannot generate a performance comparison
|
||||
{
|
||||
echo "> [!NOTE]"
|
||||
echo "> The package sets differ between the two revisions. This comparison only"
|
||||
echo "> covers packages evaluated in both, so treat the figures as approximate."
|
||||
echo
|
||||
echo "# Performance comparison"
|
||||
echo
|
||||
echo "This compares the performance of this branch against its pull request base branch (e.g., 'master')"
|
||||
echo
|
||||
echo "For further help please refer to: [ci/README.md](https://github.com/NixOS/nixpkgs/blob/master/ci/README.md)"
|
||||
echo
|
||||
} >> $out/step-summary.md
|
||||
|
||||
cmp-stats --explain ${combined}/before/stats ${combined}/after/stats >> $out/step-summary.md
|
||||
|
||||
else
|
||||
# Package chunks are the same in both revisions
|
||||
# We can use the to generate a performance comparison
|
||||
{
|
||||
echo
|
||||
echo "# Performance Comparison"
|
||||
echo
|
||||
echo "Performance stats were skipped because the package sets differ between the two revisions."
|
||||
echo
|
||||
echo "For further help please refer to: [ci/README.md](https://github.com/NixOS/nixpkgs/blob/master/ci/README.md)"
|
||||
} >> $out/step-summary.md
|
||||
fi
|
||||
|
||||
{
|
||||
echo "For further help please refer to: [ci/README.md](https://github.com/NixOS/nixpkgs/blob/master/ci/README.md)"
|
||||
echo
|
||||
} >> $out/step-summary.md
|
||||
|
||||
cmp-stats --explain ${combined}/before/stats ${combined}/after/stats >> $out/step-summary.md
|
||||
|
||||
jq -r '.[]' "${touchedFilesJson}" > ./touched-files
|
||||
readarray -t touchedFiles < ./touched-files
|
||||
echo "This PR touches ''${#touchedFiles[@]} files"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
busybox,
|
||||
jq,
|
||||
nix,
|
||||
perf,
|
||||
}:
|
||||
|
||||
{
|
||||
@@ -39,7 +38,7 @@ let
|
||||
fileset = unions (
|
||||
map (lib.path.append ../..) [
|
||||
".version"
|
||||
"ci/eval/pre-eval.nix"
|
||||
"ci/eval/attrpaths.nix"
|
||||
"ci/eval/chunk.nix"
|
||||
"ci/eval/outpaths.nix"
|
||||
"default.nix"
|
||||
@@ -57,11 +56,11 @@ let
|
||||
builtins.readFile ../../pkgs/top-level/release-supported-systems.json
|
||||
);
|
||||
|
||||
preEval =
|
||||
attrpathsSuperset =
|
||||
{
|
||||
evalSystem,
|
||||
}:
|
||||
runCommand "pre-eval"
|
||||
runCommand "attrpaths-superset.json"
|
||||
{
|
||||
src = nixpkgs;
|
||||
# Don't depend on -dev outputs to reduce closure size for CI.
|
||||
@@ -74,15 +73,15 @@ let
|
||||
export NIX_STATE_DIR=$(mktemp -d)
|
||||
mkdir $out
|
||||
export GC_INITIAL_HEAP_SIZE=4g
|
||||
command time -f "Pre-eval done [%MKB max resident, %Es elapsed] %C" \
|
||||
command time -f "Attribute eval done [%MKB max resident, %Es elapsed] %C" \
|
||||
nix-instantiate --eval --strict --json --show-trace \
|
||||
"$src/ci/eval/pre-eval.nix" \
|
||||
-A result \
|
||||
"$src/ci/eval/attrpaths.nix" \
|
||||
-A paths \
|
||||
-I "$src" \
|
||||
--argstr extraNixpkgsConfigJson ${lib.escapeShellArg (builtins.toJSON extraNixpkgsConfig)} \
|
||||
--option restrict-eval true \
|
||||
--option allow-import-from-derivation false \
|
||||
--option eval-system "${evalSystem}" > $out/result.json
|
||||
--option eval-system "${evalSystem}" > $out/paths.json
|
||||
'';
|
||||
|
||||
singleSystem =
|
||||
@@ -91,10 +90,8 @@ let
|
||||
# Note that this is intentionally not called `system`,
|
||||
# because `--argstr system` would only be passed to the ci/default.nix file!
|
||||
evalSystem ? builtins.currentSystem,
|
||||
# The path to the `result.json` file from `preEval`
|
||||
preEvalFile ? "${preEval { inherit evalSystem; }}/result.json",
|
||||
# Output the number of assembly instructions executed during evaluation
|
||||
countInstructions ? false,
|
||||
# The path to the `paths.json` file from `attrpathsSuperset`
|
||||
attrpathFile ? "${attrpathsSuperset { inherit evalSystem; }}/paths.json",
|
||||
}:
|
||||
let
|
||||
singleChunk = writeShellScript "single-chunk" ''
|
||||
@@ -103,7 +100,6 @@ let
|
||||
myChunk=$2
|
||||
system=$3
|
||||
outputDir=$4
|
||||
preEvalFile=$5
|
||||
|
||||
# Default is 5, higher values effectively disable the warning.
|
||||
# This randomly breaks Eval.
|
||||
@@ -125,12 +121,12 @@ let
|
||||
--show-trace \
|
||||
--arg chunkSize "$chunkSize" \
|
||||
--arg myChunk "$myChunk" \
|
||||
--arg preEvalFile "$preEvalFile" \
|
||||
--arg attrpathFile "${attrpathFile}" \
|
||||
--arg systems "[ \"$system\" ]" \
|
||||
--arg includeBroken ${lib.boolToString includeBroken} \
|
||||
--argstr extraNixpkgsConfigJson ${lib.escapeShellArg (builtins.toJSON extraNixpkgsConfig)} \
|
||||
-I ${nixpkgs} \
|
||||
-I "$preEvalFile" \
|
||||
-I ${attrpathFile} \
|
||||
> "$outputDir/result/$myChunk" \
|
||||
2> "$outputDir/stderr/$myChunk"
|
||||
exitCode=$?
|
||||
@@ -150,16 +146,13 @@ let
|
||||
runCommand "nixpkgs-eval-${evalSystem}"
|
||||
{
|
||||
# Don't depend on -dev outputs to reduce closure size for CI.
|
||||
nativeBuildInputs = map lib.getBin (
|
||||
[
|
||||
busybox
|
||||
jq
|
||||
nix
|
||||
]
|
||||
++ lib.optionals countInstructions [ perf ]
|
||||
);
|
||||
nativeBuildInputs = map lib.getBin [
|
||||
busybox
|
||||
jq
|
||||
nix
|
||||
];
|
||||
env = {
|
||||
inherit evalSystem chunkSize countInstructions;
|
||||
inherit evalSystem chunkSize;
|
||||
};
|
||||
__structuredAttrs = true;
|
||||
unsafeDiscardReferences.out = true;
|
||||
@@ -171,6 +164,12 @@ let
|
||||
echo "System: $evalSystem"
|
||||
cores=$NIX_BUILD_CORES
|
||||
echo "Cores: $cores"
|
||||
attrCount=$(jq length "${attrpathFile}")
|
||||
echo "Attribute count: $attrCount"
|
||||
echo "Chunk size: $chunkSize"
|
||||
# Same as `attrCount / chunkSize` but rounded up
|
||||
chunkCount=$(( (attrCount - 1) / chunkSize + 1 ))
|
||||
echo "Chunk count: $chunkCount"
|
||||
|
||||
mkdir -p $out/${evalSystem}
|
||||
|
||||
@@ -191,78 +190,29 @@ let
|
||||
done
|
||||
) &
|
||||
|
||||
chunkedEval() {
|
||||
local chunkOutputDir=$1
|
||||
local preEvalFile=$2
|
||||
seq_end=$(( chunkCount - 1 ))
|
||||
|
||||
local attrCount=$(jq '.paths | length' "$preEvalFile")
|
||||
echo "Attribute count: $attrCount"
|
||||
echo "Chunk size: $chunkSize"
|
||||
# Same as `attrCount / chunkSize` but rounded up
|
||||
local chunkCount=$(( (attrCount - 1) / chunkSize + 1 ))
|
||||
echo "Chunk count: $chunkCount"
|
||||
${lib.optionalString quickTest ''
|
||||
seq_end=0
|
||||
''}
|
||||
|
||||
local seq_end=$(( chunkCount - 1 ))
|
||||
${lib.optionalString quickTest ''
|
||||
seq_end=0
|
||||
''}
|
||||
chunkOutputDir=$(mktemp -d)
|
||||
mkdir "$chunkOutputDir"/{result,stats,timestats,stderr}
|
||||
|
||||
mkdir -p "$chunkOutputDir"/{result,stats,timestats,stderr}
|
||||
seq -w 0 "$seq_end" |
|
||||
command time -f "%e" -o "$out/${evalSystem}/total-time" \
|
||||
xargs -I{} -P"$cores" \
|
||||
${singleChunk} "$chunkSize" {} "$evalSystem" "$chunkOutputDir"
|
||||
|
||||
runAllChunks() {
|
||||
seq -w 0 "$seq_end" |
|
||||
xargs -I{} -P"$cores" \
|
||||
${singleChunk} "$chunkSize" {} "$evalSystem" "$chunkOutputDir" "$preEvalFile"
|
||||
}
|
||||
cp -r "$chunkOutputDir"/stats $out/${evalSystem}/stats-by-chunk
|
||||
|
||||
if [[ -n "$countInstructions" ]]; then
|
||||
export seq_end cores chunkSize evalSystem chunkOutputDir preEvalFile
|
||||
export -f runAllChunks
|
||||
perf stat \
|
||||
--event instructions:u --field-separator , --output "$chunkOutputDir"/perf-output-file \
|
||||
bash -c runAllChunks
|
||||
cat "$chunkOutputDir"/perf-output-file | tail -n 1 | cut -d, -f1 > "$chunkOutputDir"/instructions
|
||||
rm "$chunkOutputDir"/perf-output-file
|
||||
else
|
||||
runAllChunks
|
||||
fi
|
||||
|
||||
if (( chunkSize * chunkCount != attrCount )); then
|
||||
# A final incomplete chunk would mess up the stats, don't include it
|
||||
rm "$chunkOutputDir"/stats/"$seq_end"
|
||||
fi
|
||||
}
|
||||
|
||||
chunkOutputDirs=$(mktemp -d)
|
||||
|
||||
# Preparation for the second eval
|
||||
disallowedAttributesPreEvalFile=$(mktemp)
|
||||
jq '{
|
||||
paths: (.attrPathsDisallowedForInternalUse | map(.attrPath)),
|
||||
attrPathsDisallowedForInternalUse: []
|
||||
}' ${preEvalFile} > "$disallowedAttributesPreEvalFile"
|
||||
|
||||
startEpoch=$(date +%s)
|
||||
|
||||
# The first eval evaluates only attributes that are not disallowed for internal Nixpkgs use, ensuring that they don't depend on disallowed attributes
|
||||
# Because the first eval doesn't evaluate the disallowed attributes themselves, but we still want to check that they don't fail evaluation, we evaluate them separately in a second eval
|
||||
# The reason we need two evals is because we want disallowed attributes to be able to depend on other disallowed attributes, which inherently needs a separate Nixpkgs instantiation
|
||||
# And while we could interleave that instantiation into a single eval, that would ~double memory usage for all chunks, while doing it separately doesn't
|
||||
echo "Evaluating the internally allowed attributes"
|
||||
chunkedEval "$chunkOutputDirs"/allowed ${preEvalFile}
|
||||
echo "Evaluating the internally disallowed attributes"
|
||||
chunkedEval "$chunkOutputDirs"/disallowed "$disallowedAttributesPreEvalFile"
|
||||
|
||||
echo $(( $(date +%s) - startEpoch )) > "$out/${evalSystem}/total-time"
|
||||
|
||||
# We only use the stats from the allowed attrs eval, because the disallowed attrs are generally not even a full chunk
|
||||
cp -r "$chunkOutputDirs"/allowed/stats $out/${evalSystem}/stats-by-chunk
|
||||
if [[ -f "$chunkOutputDirs"/allowed/instructions ]]; then
|
||||
cp "$chunkOutputDirs"/allowed/instructions $out/${evalSystem}/instructions
|
||||
if (( chunkSize * chunkCount != attrCount )); then
|
||||
# A final incomplete chunk would mess up the stats, don't include it
|
||||
rm "$chunkOutputDir"/stats/"$seq_end"
|
||||
fi
|
||||
|
||||
cat "$chunkOutputDirs"/*/result/* | jq -s 'add | map_values(.outputs)' > $out/${evalSystem}/paths.json
|
||||
cat "$chunkOutputDirs"/*/result/* | jq -s 'add | map_values(.meta)' > $out/${evalSystem}/meta.json
|
||||
cat "$chunkOutputDir"/result/* | jq -s 'add | map_values(.outputs)' > $out/${evalSystem}/paths.json
|
||||
cat "$chunkOutputDir"/result/* | jq -s 'add | map_values(.meta)' > $out/${evalSystem}/meta.json
|
||||
'';
|
||||
|
||||
diff = callPackage ./diff.nix { };
|
||||
@@ -299,20 +249,14 @@ let
|
||||
}) | from_entries
|
||||
' > $out/maintainers.json
|
||||
|
||||
mkdir -p $out/before/stats $out/before/instructions
|
||||
mkdir -p $out/before/stats
|
||||
for d in ${diffDir}/before/*; do
|
||||
cp -r "$d"/stats-by-chunk $out/before/stats/$(basename "$d")
|
||||
if [[ -f "$d"/instructions ]]; then
|
||||
cp "$d"/instructions $out/before/instructions/$(basename "$d")
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p $out/after/stats $out/after/instructions
|
||||
mkdir -p $out/after/stats
|
||||
for d in ${diffDir}/after/*; do
|
||||
cp -r "$d"/stats-by-chunk $out/after/stats/$(basename "$d")
|
||||
if [[ -f "$d"/instructions ]]; then
|
||||
cp "$d"/instructions $out/after/instructions/$(basename "$d")
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
@@ -322,16 +266,13 @@ let
|
||||
{
|
||||
# Whether to evaluate on a specific set of systems, by default all are evaluated
|
||||
evalSystems ? if quickTest then [ "x86_64-linux" ] else supportedSystems,
|
||||
# Output the number of assembly instructions executed during evaluation on
|
||||
# each system
|
||||
countInstructions ? false,
|
||||
}:
|
||||
symlinkJoin {
|
||||
name = "nixpkgs-eval-baseline";
|
||||
paths = map (
|
||||
evalSystem:
|
||||
singleSystem {
|
||||
inherit evalSystem countInstructions;
|
||||
inherit evalSystem;
|
||||
}
|
||||
) evalSystems;
|
||||
};
|
||||
@@ -347,12 +288,6 @@ let
|
||||
# | jq --raw-input --slurp 'split("\n")[:-1]' > touched-files.json
|
||||
# ```
|
||||
touchedFilesJson ? builtins.toFile "touched-files.json" "[ ]",
|
||||
# The branch the local comparison is made against; matches the `master`
|
||||
# used in the touched-files expression above.
|
||||
baseBranch ? "master",
|
||||
# Output the number of assembly instructions executed during evaluation on
|
||||
# each system
|
||||
countInstructions ? false,
|
||||
}:
|
||||
let
|
||||
diffs = symlinkJoin {
|
||||
@@ -363,14 +298,14 @@ let
|
||||
inherit evalSystem;
|
||||
beforeDir = baseline;
|
||||
afterDir = singleSystem {
|
||||
inherit evalSystem countInstructions;
|
||||
inherit evalSystem;
|
||||
};
|
||||
}
|
||||
) evalSystems;
|
||||
};
|
||||
comparisonReport = compare {
|
||||
combinedDir = combine { diffDir = diffs; };
|
||||
inherit touchedFilesJson baseBranch;
|
||||
inherit touchedFilesJson;
|
||||
};
|
||||
in
|
||||
comparisonReport;
|
||||
@@ -378,7 +313,7 @@ let
|
||||
in
|
||||
{
|
||||
inherit
|
||||
preEval
|
||||
attrpathsSuperset
|
||||
singleSystem
|
||||
diff
|
||||
combine
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
includeBroken ? true, # set this to false to exclude meta.broken packages from the output
|
||||
path ? ./../..,
|
||||
|
||||
# used by ./pre-eval.nix
|
||||
# used by ./attrpaths.nix
|
||||
attrNamesOnly ? false,
|
||||
|
||||
# Set this to `null` to build for builtins.currentSystem only
|
||||
@@ -14,8 +14,6 @@
|
||||
builtins.readFile (path + "/pkgs/top-level/release-supported-systems.json")
|
||||
),
|
||||
|
||||
attrPathsDisallowedForInternalUse ? [ ],
|
||||
|
||||
# Customize the config used to evaluate nixpkgs
|
||||
extraNixpkgsConfig ? { },
|
||||
}:
|
||||
@@ -37,22 +35,6 @@ let
|
||||
allowVariants = !attrNamesOnly;
|
||||
checkMeta = true;
|
||||
|
||||
# We don't need to care about problems being caught using the
|
||||
# standard mechanism, because any problems whose kind is not
|
||||
# nixpkgsInternalUseAllowed cause the corresponding attributes to
|
||||
# be disallowed entirely for internal use with
|
||||
# attrPathsDisallowedForInternalUse, see also ./pre-eval.nix
|
||||
problems.matchers = lib.mkForce [
|
||||
# We only need to set the broken handler to error, so that CI
|
||||
# doesn't evaluate those. No reason it couldn't evaluate them
|
||||
# afaik, but this is how it's been before.
|
||||
{
|
||||
kind = "broken";
|
||||
handler = "error";
|
||||
}
|
||||
];
|
||||
inherit attrPathsDisallowedForInternalUse;
|
||||
|
||||
# Silence the `x86_64-darwin` deprecation warning.
|
||||
allowDeprecatedx86_64Darwin = true;
|
||||
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
# This file does a fast pre-evaluation of Nixpkgs to determine:
|
||||
# - paths: A *superset* of all attrpaths of derivations which might be part of a release on *any* platform.
|
||||
# - attrPathsDisallowedForInternalUse: Attribute paths whose meta.problems has problems whose kinds should not be used internally in Nixpkgs
|
||||
#
|
||||
# This expression runs single-threaded under all current Nix
|
||||
# implementations, but much faster and with much less memory
|
||||
# used than ./outpaths.nix itself.
|
||||
#
|
||||
# Once you have the list of attrnames you can split it up into
|
||||
# $NUM_CORES batches and evaluate the outpaths separately for each
|
||||
# batch, in parallel.
|
||||
#
|
||||
# To dump the result:
|
||||
#
|
||||
# nix-instantiate --eval --strict --json ci/eval/pre-eval.nix -A result
|
||||
#
|
||||
{
|
||||
lib ? import (path + "/lib"),
|
||||
trace ? false,
|
||||
path ? ./../..,
|
||||
extraNixpkgsConfigJson ? "{}",
|
||||
}:
|
||||
let
|
||||
|
||||
# TODO: Use mapAttrsToListRecursiveCond when this PR lands:
|
||||
# https://github.com/NixOS/nixpkgs/pull/395160
|
||||
listAttrs =
|
||||
path: value:
|
||||
let
|
||||
result =
|
||||
if path == [ "AAAAAASomeThingsFailToEvaluate" ] || !(lib.isAttrs value) then
|
||||
[ ]
|
||||
else if lib.isDerivation value then
|
||||
[
|
||||
{
|
||||
inherit path value;
|
||||
}
|
||||
]
|
||||
else
|
||||
lib.pipe value [
|
||||
(lib.mapAttrsToList (
|
||||
name: value:
|
||||
lib.addErrorContext "while evaluating package set attribute path '${
|
||||
lib.showAttrPath (path ++ [ name ])
|
||||
}'" (listAttrs (path ++ [ name ]) value)
|
||||
))
|
||||
lib.concatLists
|
||||
];
|
||||
in
|
||||
lib.traceIf trace "** ${lib.showAttrPath path}" result;
|
||||
|
||||
outpaths = import ./outpaths.nix {
|
||||
inherit path;
|
||||
extraNixpkgsConfig = builtins.fromJSON extraNixpkgsConfigJson;
|
||||
attrNamesOnly = true;
|
||||
};
|
||||
|
||||
list =
|
||||
map
|
||||
(path: {
|
||||
inherit path;
|
||||
# This looks a bit weird, but the only reason we care about this value
|
||||
# is for the meta.problems check below, and stdenv's certainly don't
|
||||
# have any problems, so this is fine :)
|
||||
value = { };
|
||||
})
|
||||
[
|
||||
# Some of the following are based on variants, which are disabled with `attrNamesOnly = true`.
|
||||
# Until these have been removed from release.nix / hydra, we manually add them to the list.
|
||||
[
|
||||
"pkgsLLVM"
|
||||
"stdenv"
|
||||
]
|
||||
[
|
||||
"pkgsArocc"
|
||||
"stdenv"
|
||||
]
|
||||
[
|
||||
"pkgsZig"
|
||||
"stdenv"
|
||||
]
|
||||
[
|
||||
"pkgsStatic"
|
||||
"stdenv"
|
||||
]
|
||||
[
|
||||
"pkgsMusl"
|
||||
"stdenv"
|
||||
]
|
||||
]
|
||||
++ listAttrs [ ] outpaths;
|
||||
paths = map (attrs: attrs.path) list;
|
||||
names = map lib.showAttrPath paths;
|
||||
|
||||
inherit (import ../../pkgs/stdenv/generic/problems.nix { inherit lib; })
|
||||
disallowNixpkgsInternalUseKinds
|
||||
;
|
||||
|
||||
# Determine the list of attributes whose packages have any meta.problems
|
||||
# with a kind that's disallowed from internal Nixpkgs use
|
||||
attrPathsDisallowedForInternalUse = lib.pipe list [
|
||||
(lib.map (
|
||||
attrs:
|
||||
attrs
|
||||
// {
|
||||
problematicProblems = builtins.tryEval (
|
||||
lib.filterAttrs (name: problem: disallowNixpkgsInternalUseKinds ? ${problem.kind}) (
|
||||
attrs.value.meta.problems or { }
|
||||
)
|
||||
);
|
||||
}
|
||||
))
|
||||
(lib.filter (attrs: attrs.problematicProblems.success && attrs.problematicProblems.value != { }))
|
||||
(lib.map (attrs: {
|
||||
attrPath = attrs.path;
|
||||
reason = "it has certain meta.problems whose kinds are disallowed: ${
|
||||
lib.generators.toPretty { } attrs.problematicProblems.value
|
||||
}";
|
||||
}))
|
||||
];
|
||||
in
|
||||
{
|
||||
# TODO: Do we still need these? Probably not
|
||||
inherit paths names;
|
||||
result = {
|
||||
inherit paths attrPathsDisallowedForInternalUse;
|
||||
};
|
||||
}
|
||||
@@ -206,8 +206,20 @@ module.exports = async ({ github, context, core, dry }) => {
|
||||
|
||||
const maintainers = await getMaintainerMap(pull_request.base.ref)
|
||||
|
||||
const merge_bot_eligible = await handleMerge({
|
||||
github,
|
||||
context,
|
||||
core,
|
||||
log,
|
||||
dry,
|
||||
pull_request,
|
||||
events,
|
||||
maintainers,
|
||||
getTeamMembers,
|
||||
getUser,
|
||||
})
|
||||
|
||||
// Check for any human reviews other than the PR author, GitHub actions and other GitHub apps.
|
||||
// `commit { oid }` is needed by handleMerge to verify approvals are against the current head.
|
||||
const reviews = (
|
||||
await github.graphql(
|
||||
`query($owner: String!, $repo: String!, $pr: Int!) {
|
||||
@@ -219,7 +231,6 @@ module.exports = async ({ github, context, core, dry }) => {
|
||||
reviews(first: 100) {
|
||||
nodes {
|
||||
state
|
||||
commit { oid }
|
||||
user: author {
|
||||
# Only get users, no bots
|
||||
... on User {
|
||||
@@ -255,20 +266,6 @@ module.exports = async ({ github, context, core, dry }) => {
|
||||
r.user.id !== pull_request.user?.id,
|
||||
)
|
||||
|
||||
const merge_bot_eligible = await handleMerge({
|
||||
github,
|
||||
context,
|
||||
core,
|
||||
log,
|
||||
dry,
|
||||
pull_request,
|
||||
events,
|
||||
reviews,
|
||||
maintainers,
|
||||
getTeamMembers,
|
||||
getUser,
|
||||
})
|
||||
|
||||
const approvals = new Set(
|
||||
reviews
|
||||
.filter((review) => review.state === 'APPROVED')
|
||||
|
||||
@@ -102,8 +102,9 @@ async function checkTargetBranch({ github, context, core, dry }) {
|
||||
changed.attrdiff.changed.includes('nixosTests.simple-container') ||
|
||||
changed.attrdiff.changed.includes('nixosTests.simple-vm')
|
||||
|
||||
// https://github.com/NixOS/nixpkgs/pull/521157
|
||||
// These should go to master and release-xx.xx when backported
|
||||
// https://github.com/NixOS/nixpkgs/pull/481205#issuecomment-3790123921
|
||||
// These should go to staging-nixos instead of master,
|
||||
// but release-xx.xx (not staging-xx.xx) when backported
|
||||
let isExemptKernelUpdate = false
|
||||
if (prInfo.changed_files === 1) {
|
||||
const changedFiles = (
|
||||
@@ -114,8 +115,11 @@ async function checkTargetBranch({ github, context, core, dry }) {
|
||||
).data
|
||||
isExemptKernelUpdate =
|
||||
changedFiles.length === 1 &&
|
||||
changedFiles[0].filename ===
|
||||
'pkgs/os-specific/linux/kernel/xanmod-kernels.nix'
|
||||
(changedFiles[0].filename ===
|
||||
'pkgs/os-specific/linux/kernel/xanmod-kernels.nix' ||
|
||||
(base.startsWith('release-') &&
|
||||
changedFiles[0].filename ===
|
||||
'pkgs/os-specific/linux/kernel/kernels-org.json'))
|
||||
}
|
||||
|
||||
// https://github.com/NixOS/nixpkgs/pull/483194#issuecomment-3793393218
|
||||
@@ -160,10 +164,8 @@ async function checkTargetBranch({ github, context, core, dry }) {
|
||||
branchText = '(probably either `staging-nixos` or `staging`)'
|
||||
} else if (base === 'master') {
|
||||
branchText = '(probably `staging-nixos`)'
|
||||
} else if (maxRebuildCount >= 500) {
|
||||
branchText = `(probably either \`staging-nixos-${split(base).version}\` or \`staging-${split(base).version}\`)`
|
||||
} else {
|
||||
branchText = `(probably \`staging-nixos-${split(base).version}\`)`
|
||||
branchText = `(probably \`staging-${split(base).version}\`)`
|
||||
}
|
||||
const body = [
|
||||
`The PR's base branch is set to \`${base}\`, but this PR rebuilds all NixOS tests.`,
|
||||
|
||||
@@ -2,11 +2,11 @@ const { classify } = require('../supportedBranches.js')
|
||||
|
||||
function runChecklist({
|
||||
committers,
|
||||
events,
|
||||
files,
|
||||
pull_request,
|
||||
log,
|
||||
maintainers,
|
||||
reviews,
|
||||
user,
|
||||
userIsMaintainer,
|
||||
}) {
|
||||
@@ -27,35 +27,18 @@ function runChecklist({
|
||||
.reduce((acc, cur) => acc?.intersection(cur) ?? cur)
|
||||
|
||||
const approvals = new Set(
|
||||
reviews
|
||||
events
|
||||
.filter(
|
||||
({ state, commit }) =>
|
||||
state === 'APPROVED' &&
|
||||
({ event, state, commit_id }) =>
|
||||
event === 'reviewed' &&
|
||||
state === 'approved' &&
|
||||
// Only approvals for the current head SHA count, otherwise authors could push
|
||||
// bad code between the approval and the merge.
|
||||
commit?.oid === pull_request.head.sha,
|
||||
commit_id === pull_request.head.sha,
|
||||
)
|
||||
.map(({ user }) => user.id),
|
||||
)
|
||||
|
||||
// A "changes requested" review from a committer blocks both the merge queue and
|
||||
// auto-merge, even if it was made on an older commit (unlike approvals, GitHub does
|
||||
// not auto-dismiss changes-requested reviews on push). For each committer, take their
|
||||
// latest actionable review; if it's CHANGES_REQUESTED, they're blocking the PR.
|
||||
// Dismissed reviews surface as DISMISSED and comment-only follow-ups as COMMENTED, so
|
||||
// both are skipped naturally — the prior actionable review still stands until the
|
||||
// committer explicitly approves or requests changes again.
|
||||
const committerReviewState = new Map()
|
||||
for (const { user, state } of reviews) {
|
||||
if (
|
||||
committers.has(user.id) &&
|
||||
['APPROVED', 'CHANGES_REQUESTED'].includes(state)
|
||||
) {
|
||||
committerReviewState.set(user.id, state)
|
||||
}
|
||||
}
|
||||
const noBlockingReviews = !Array.from(committerReviewState.values()).includes(
|
||||
'CHANGES_REQUESTED',
|
||||
.map(({ user }) => user?.id)
|
||||
// Some users have been deleted, so filter these out.
|
||||
.filter(Boolean),
|
||||
)
|
||||
|
||||
const checklist = {
|
||||
@@ -74,11 +57,6 @@ function runChecklist({
|
||||
pull_request.user.login === 'r-ryantm',
|
||||
},
|
||||
'PR is not a draft': !pull_request.draft,
|
||||
// CI state is intentionally *not* a checklist item: auto-merge exists precisely to
|
||||
// cover unfinished CI, and an already-failed CI is reported via the merge message
|
||||
// (see merge() below) rather than a blanket refusal.
|
||||
'PR is not blocked by a "changes requested" review from a [committer](https://github.com/orgs/NixOS/teams/nixpkgs-committers).':
|
||||
noBlockingReviews,
|
||||
}
|
||||
|
||||
if (user) {
|
||||
@@ -119,7 +97,7 @@ function hasMergeCommand(body) {
|
||||
return (body ?? '')
|
||||
.replace(/<!--.*?-->/gms, '')
|
||||
.replace(/(^`{3,})[^`].*?\1/gms, '')
|
||||
.match(/^@NixOS\/nixpkgs-merge-bot merge\s*$/im)
|
||||
.match(/^@NixOS\/nixpkgs-merge-bot merge\s*$/m)
|
||||
}
|
||||
|
||||
async function handleMergeComment({ github, body, node_id, reaction }) {
|
||||
@@ -145,7 +123,6 @@ async function handleMerge({
|
||||
dry,
|
||||
pull_request,
|
||||
events,
|
||||
reviews,
|
||||
maintainers,
|
||||
getTeamMembers,
|
||||
getUser,
|
||||
@@ -171,14 +148,6 @@ async function handleMerge({
|
||||
// including an early exit when the first non-by-name file is found.
|
||||
if (files.length >= 100) return false
|
||||
|
||||
const noPrFailuresState = (
|
||||
await github.rest.repos.listCommitStatusesForRef({
|
||||
...context.repo,
|
||||
ref: pull_request.head.sha,
|
||||
per_page: 100,
|
||||
})
|
||||
).data.find(({ context }) => context === 'no PR failures')?.state
|
||||
|
||||
// Only look through comments *after* the latest (force) push.
|
||||
const lastPush = events.findLastIndex(
|
||||
({ event, sha, commit_id }) =>
|
||||
@@ -204,12 +173,10 @@ async function handleMerge({
|
||||
)),
|
||||
)
|
||||
|
||||
// Returns `{ reaction, messages }`: the reaction to leave on the merge comment and the
|
||||
// lines to append to the bot's reply. Throws only on an unexpected API error.
|
||||
async function merge() {
|
||||
if (dry) {
|
||||
core.info(`Merging #${pull_number}... (dry)`)
|
||||
return { reaction: 'ROCKET', messages: ['Merge completed (dry)'] }
|
||||
return ['Merge completed (dry)']
|
||||
}
|
||||
|
||||
// Using GraphQL mutations instead of the REST /merge endpoint, because the latter
|
||||
@@ -230,37 +197,16 @@ async function handleMerge({
|
||||
{ node_id: pull_request.node_id, sha: pull_request.head.sha },
|
||||
)
|
||||
log('merge', 'Queued for merge')
|
||||
return {
|
||||
reaction: 'ROCKET',
|
||||
messages: [
|
||||
`:heavy_check_mark: [Queued](${resp.enqueuePullRequest.mergeQueueEntry.mergeQueue.url}) for merge (#306934)`,
|
||||
],
|
||||
}
|
||||
return [
|
||||
`:heavy_check_mark: [Queued](${resp.enqueuePullRequest.mergeQueueEntry.mergeQueue.url}) for merge (#306934)`,
|
||||
]
|
||||
} catch (e) {
|
||||
log('Enqueuing failed', e.response.errors[0].message)
|
||||
}
|
||||
|
||||
// Enqueuing fails when the required status checks are not satisfied, yet. If CI has
|
||||
// already failed, enabling auto-merge would be pointless: it would never fire, and
|
||||
// fixing CI requires a new push, which invalidates this merge command anyway (we only
|
||||
// act on comments after the latest push). So we don't enable auto-merge and instead
|
||||
// ask for a fresh command once CI is green again.
|
||||
if (['error', 'failure'].includes(noPrFailuresState)) {
|
||||
log('merge', 'CI has failed, not enabling auto-merge')
|
||||
return {
|
||||
reaction: 'THUMBS_DOWN',
|
||||
messages: [
|
||||
':x: Pull Request could not be merged: CI has failed (#305350).',
|
||||
'',
|
||||
'> [!TIP]',
|
||||
'> PRs cannot be merged while CI is failing.',
|
||||
'> Once CI is passing, comment `@NixOS/nixpkgs-merge-bot merge` again.',
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
// CI has not finished yet, so we enable auto-merge. We could also only use auto-merge,
|
||||
// but this often gets stuck for no apparent reason.
|
||||
// If required status checks are not satisfied, yet, the above will fail. In this case
|
||||
// we can enable auto-merge. We could also only use auto-merge, but this often gets
|
||||
// stuck for no apparent reason.
|
||||
try {
|
||||
await github.graphql(
|
||||
`mutation($node_id: ID!, $sha: GitObjectID) {
|
||||
@@ -273,17 +219,12 @@ async function handleMerge({
|
||||
{ node_id: pull_request.node_id, sha: pull_request.head.sha },
|
||||
)
|
||||
log('merge', 'Auto-merge enabled')
|
||||
return {
|
||||
reaction: 'ROCKET',
|
||||
messages: [
|
||||
`:heavy_check_mark: Enabled Auto Merge (#306934)`,
|
||||
'',
|
||||
'> [!TIP]',
|
||||
'> [Auto Merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request) will queue this PR once required CI checks succeed.',
|
||||
'> If CI fails instead, fixing it needs a new push, which disables Auto Merge and invalidates this command — comment `@NixOS/nixpkgs-merge-bot merge` again once CI is green.',
|
||||
'> If GitHub gets stuck even though CI passed (it sometimes does), leaving another approval should kick off the merge.',
|
||||
],
|
||||
}
|
||||
return [
|
||||
`:heavy_check_mark: Enabled Auto Merge (#306934)`,
|
||||
'',
|
||||
'> [!TIP]',
|
||||
'> Sometimes GitHub gets stuck after enabling Auto Merge. In this case, leaving another approval should trigger the merge.',
|
||||
]
|
||||
} catch (e) {
|
||||
log('Auto Merge failed', e.response.errors[0].message)
|
||||
throw new Error(e.response.errors[0].message)
|
||||
@@ -326,11 +267,11 @@ async function handleMerge({
|
||||
|
||||
const { result, eligible, checklist } = runChecklist({
|
||||
committers,
|
||||
events,
|
||||
files,
|
||||
pull_request,
|
||||
log,
|
||||
maintainers,
|
||||
reviews,
|
||||
user: comment.user,
|
||||
userIsMaintainer: await isMaintainer(comment.user.login),
|
||||
})
|
||||
@@ -367,12 +308,10 @@ async function handleMerge({
|
||||
}
|
||||
|
||||
if (result) {
|
||||
await react('ROCKET')
|
||||
try {
|
||||
const { reaction, messages } = await merge()
|
||||
await react(reaction)
|
||||
body.push(...messages)
|
||||
body.push(...(await merge()))
|
||||
} catch (e) {
|
||||
await react('THUMBS_DOWN')
|
||||
// Remove the HTML comment with node_id reference to allow retrying this merge on the next run.
|
||||
body.shift()
|
||||
body.push(`:x: Merge failed with: ${e} (#371492)`)
|
||||
@@ -397,11 +336,11 @@ async function handleMerge({
|
||||
|
||||
const { result } = runChecklist({
|
||||
committers,
|
||||
events,
|
||||
files,
|
||||
pull_request,
|
||||
log,
|
||||
maintainers,
|
||||
reviews,
|
||||
})
|
||||
|
||||
// Returns a boolean, which indicates whether the PR is merge-bot eligible in principle.
|
||||
|
||||
@@ -9,10 +9,23 @@
|
||||
},
|
||||
"branch": "nixpkgs-unstable",
|
||||
"submodules": false,
|
||||
"revision": "6edbf1a6a03e75886a6609c088801a0856449e88",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/6edbf1a6a03e75886a6609c088801a0856449e88.tar.gz",
|
||||
"hash": "sha256-0lkauQbtrljJqwtzTCILPAiHAJyMvn6XDo264moDv30="
|
||||
"revision": "02f3fa0374fa13707d42d55d58ecc76b091f223c",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/02f3fa0374fa13707d42d55d58ecc76b091f223c.tar.gz",
|
||||
"hash": "0z8d33c5g0gk9a74ppqq77npisf9xx9c8ai9isxa2hyjx4lv1pki"
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix"
|
||||
},
|
||||
"branch": "main",
|
||||
"submodules": false,
|
||||
"revision": "790751ff7fd3801feeaf96d7dc416a8d581265ba",
|
||||
"url": "https://github.com/numtide/treefmt-nix/archive/790751ff7fd3801feeaf96d7dc416a8d581265ba.tar.gz",
|
||||
"hash": "1zah3dmbpn3ap5acg22kq1j19dg32gj73l43yamjcxhc38sv9kd5"
|
||||
}
|
||||
},
|
||||
"version": 8
|
||||
"version": 5
|
||||
}
|
||||
|
||||
175
ci/treefmt.nix
175
ci/treefmt.nix
@@ -1,175 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
runtimeInputs = [
|
||||
# tree-root uses `git rev-parse --show-toplevel`
|
||||
pkgs.gitMinimal
|
||||
];
|
||||
|
||||
settings = {
|
||||
# numtide/treefmt-nix defaults
|
||||
excludes = [
|
||||
"*.lock"
|
||||
"*.patch"
|
||||
"*.diff"
|
||||
"package-lock.json"
|
||||
"go.mod"
|
||||
"go.sum"
|
||||
".gitattributes"
|
||||
".gitignore"
|
||||
".gitmodules"
|
||||
"COPYING"
|
||||
"LICENSE"
|
||||
];
|
||||
|
||||
# Be a bit more verbose by default, so we can see progress happening
|
||||
verbose = 1;
|
||||
|
||||
# By default it's info, which is too noisy since we have many unmatched files
|
||||
on-unmatched = "debug";
|
||||
|
||||
formatter = {
|
||||
# keep-sorted start block=yes newline_separated=yes
|
||||
actionlint = {
|
||||
command = lib.getExe pkgs.actionlint;
|
||||
includes = [
|
||||
".github/workflows/*.yml"
|
||||
".github/workflows/*.yaml"
|
||||
];
|
||||
};
|
||||
|
||||
biome = {
|
||||
command = lib.getExe pkgs.biome;
|
||||
excludes = [
|
||||
"*.min.js"
|
||||
"pkgs/*"
|
||||
];
|
||||
includes = [
|
||||
"*.js"
|
||||
"*.ts"
|
||||
"*.mjs"
|
||||
"*.mts"
|
||||
"*.cjs"
|
||||
"*.cts"
|
||||
"*.jsx"
|
||||
"*.tsx"
|
||||
"*.d.ts"
|
||||
"*.d.cts"
|
||||
"*.d.mts"
|
||||
"*.css"
|
||||
];
|
||||
options = [
|
||||
"check"
|
||||
"--write"
|
||||
"--no-errors-on-unmatched"
|
||||
"--use-editorconfig=true"
|
||||
"--javascript-formatter-quote-style=single"
|
||||
"--semicolons=as-needed"
|
||||
];
|
||||
};
|
||||
|
||||
editorconfig-checker = {
|
||||
command = lib.getExe pkgs.editorconfig-checker;
|
||||
options = [
|
||||
"-disable-indent-size"
|
||||
# TODO: Remove this once this upstream issue is fixed:
|
||||
# https://github.com/editorconfig-checker/editorconfig-checker/issues/505
|
||||
"-disable-charset"
|
||||
];
|
||||
includes = [ "*" ];
|
||||
priority = 1;
|
||||
};
|
||||
|
||||
keep-sorted = {
|
||||
command = lib.getExe pkgs.keep-sorted;
|
||||
includes = [ "*" ];
|
||||
};
|
||||
|
||||
markdown-code-runner = {
|
||||
command = lib.getExe pkgs.markdown-code-runner;
|
||||
options =
|
||||
let
|
||||
config = pkgs.writers.writeTOML "markdown-code-runner-config" {
|
||||
presets.nixfmt = {
|
||||
language = "nix";
|
||||
command = [ (lib.getExe pkgs.nixfmt) ];
|
||||
};
|
||||
};
|
||||
in
|
||||
[ "--config=${config}" ];
|
||||
includes = [ "*.md" ];
|
||||
};
|
||||
|
||||
nixf-diagnose = {
|
||||
command = lib.getExe pkgs.nixf-diagnose;
|
||||
excludes = [
|
||||
# Auto-generated; violates sema-extra-with
|
||||
# Can only sensibly be removed when --auto-fix supports multiple fixes at once:
|
||||
# https://github.com/inclyc/nixf-diagnose/issues/13
|
||||
"pkgs/servers/home-assistant/component-packages.nix"
|
||||
# https://github.com/nix-community/nixd/issues/708
|
||||
"nixos/maintainers/scripts/azure-new/examples/basic/system.nix"
|
||||
];
|
||||
includes = [ "*.nix" ];
|
||||
options = [
|
||||
"--auto-fix"
|
||||
# Rule names can currently be looked up here:
|
||||
# https://github.com/nix-community/nixd/blob/main/libnixf/src/Basic/diagnostic.py
|
||||
# TODO: Remove the following and fix things.
|
||||
"--ignore=sema-unused-def-lambda-noarg-formal"
|
||||
"--ignore=sema-unused-def-lambda-witharg-arg"
|
||||
"--ignore=sema-unused-def-lambda-witharg-formal"
|
||||
"--ignore=sema-unused-def-let"
|
||||
# TODO: remove after outstanding prelude diagnostics issues are fixed:
|
||||
# https://github.com/nix-community/nixd/issues/761
|
||||
# https://github.com/nix-community/nixd/issues/762
|
||||
"--ignore=sema-primop-removed-prefix"
|
||||
"--ignore=sema-primop-overridden"
|
||||
"--ignore=sema-constant-overridden"
|
||||
"--ignore=sema-primop-unknown"
|
||||
];
|
||||
# Ensure nixfmt cleans up after nixf-diagnose.
|
||||
priority = -1;
|
||||
};
|
||||
|
||||
# This uses nixfmt underneath, the default formatter for Nix code.
|
||||
# See https://github.com/NixOS/nixfmt
|
||||
nixfmt = {
|
||||
command = lib.getExe pkgs.nixfmt;
|
||||
includes = [ "*.nix" ];
|
||||
};
|
||||
|
||||
yamlfmt = {
|
||||
command = lib.getExe pkgs.yamlfmt;
|
||||
excludes = [
|
||||
# Aligns comments with whitespace
|
||||
"pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml"
|
||||
# TODO: Fix formatting for auto-generated file
|
||||
"pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml"
|
||||
];
|
||||
includes = [
|
||||
"*.yaml"
|
||||
"*.yml"
|
||||
];
|
||||
options = [
|
||||
"-formatter"
|
||||
"retain_line_breaks=true"
|
||||
];
|
||||
};
|
||||
|
||||
zizmor = {
|
||||
command = lib.getExe pkgs.zizmor;
|
||||
includes = [
|
||||
".github/workflows/*.yml"
|
||||
".github/workflows/*.yaml"
|
||||
".github/actions/**/*.yml"
|
||||
".github/actions/**/*.yaml"
|
||||
];
|
||||
};
|
||||
# keep-sorted end
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -E 'with import ../. {}; mkShell { packages = [ npins ]; }'
|
||||
#!nix-shell -i bash -p npins
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
npins --lock-file pinned.json upgrade
|
||||
npins --lock-file pinned.json update
|
||||
|
||||
124
doc/README.md
124
doc/README.md
@@ -1,32 +1,21 @@
|
||||
# Contributing to the Nixpkgs manual
|
||||
# Contributing to the Nixpkgs reference manual
|
||||
|
||||
This directory houses the source files for the Nixpkgs manual.
|
||||
This directory houses the source files for the Nixpkgs reference manual.
|
||||
|
||||
> [!NOTE]
|
||||
> [!IMPORTANT]
|
||||
> We are actively restructuring our documentation to follow the [Diátaxis framework](https://diataxis.fr/)
|
||||
>
|
||||
> We are actively restructuring our documentation to be more beginner friendly.
|
||||
> Going forward, this directory should **only** contain [reference documentation](https://nix.dev/contributing/documentation/diataxis#reference).
|
||||
> For tutorials, guides and explanations, contribute to <https://nix.dev/> instead.
|
||||
>
|
||||
> We are actively working to generate **all** reference documentation from the [doc-comments](https://github.com/NixOS/rfcs/blob/master/rfcs/0145-doc-strings.md) present in code.
|
||||
> This also provides the benefit of using `:doc` in the `nix repl` to view reference documentation locally on the fly.
|
||||
|
||||
When writing new docs use **Progressive Disclosure**
|
||||
For documentation only relevant for contributors, use Markdown files next to the source and regular code comments.
|
||||
|
||||
Start simple, pick up beginners.
|
||||
Use **examples** first to show how to get something done. Keep **Explanation** lean.
|
||||
|
||||
Use our [styleguide](./styleguide.md) for more in depth guidance on writing good documentation.
|
||||
|
||||
This directory contains **guides** and **reference** documentation for Nixpkgs.
|
||||
|
||||
Borrowing from [Diátaxis framework](https://diataxis.fr/) what suits our needs:
|
||||
|
||||
**Guides** are task-oriented. They can be tutorial-style walkthroughs or how-to sections.
|
||||
Explanations appear as prose after examples.
|
||||
|
||||
**Reference** documentation is the specification of functions and attributes.
|
||||
|
||||
We are actively working to generate **all** reference documentation from the [doc-comments](https://github.com/NixOS/rfcs/blob/master/rfcs/0145-doc-strings.md) present in code.
|
||||
This also provides the benefit of using `:doc` in the `nix repl` to view reference documentation locally on the fly.
|
||||
|
||||
See [Document structure](#document-structure) for a structural template.
|
||||
> [!TIP]
|
||||
> Feedback for improving support for parsing and rendering doc-comments is highly appreciated.
|
||||
> [Open an issue](https://github.com/NixOS/nixpkgs/issues/new?labels=6.topic%3A+documentation&title=Doc%3A+) to request bugfixes or new features.
|
||||
|
||||
Rendered documentation:
|
||||
- [Unstable (from master)](https://nixos.org/manual/nixpkgs/unstable/)
|
||||
@@ -47,7 +36,7 @@ If the build succeeds, the manual will be in `./result/share/doc/nixpkgs/manual.
|
||||
|
||||
### Development environment
|
||||
|
||||
To reduce repetition, consider using tools from the provided development environment:
|
||||
In order to reduce repetition, consider using tools from the provided development environment:
|
||||
|
||||
Load it from the Nixpkgs documentation directory with
|
||||
|
||||
@@ -65,11 +54,9 @@ Make sure that your local files aren't added to Git history by adding the follow
|
||||
/**/.direnv
|
||||
```
|
||||
|
||||
#### Live preview
|
||||
#### `devmode`
|
||||
|
||||
Run [`devmode`](../pkgs/by-name/de/devmode/README.md) for a live preview while editing the manual: it rebuilds on every change and reloads the page in your browser automatically.
|
||||
|
||||
Changes to the renderer 'pkgs/by-name/ni/nixos-render-docs' need a manual restart. Run: `devmode` again.
|
||||
Use [`devmode`](../pkgs/by-name/de/devmode/README.md) for a live preview when editing the manual.
|
||||
|
||||
### Testing redirects
|
||||
|
||||
@@ -220,64 +207,6 @@ When needed, each convention explains why it exists, so you can make a decision
|
||||
Note that these conventions are about the **structure** of the manual (and its source files), not about the content that goes in it.
|
||||
You, as the writer of documentation, are still in charge of its content.
|
||||
|
||||
**For prose style, see the [documentation styleguide](./styleguide.md).**
|
||||
|
||||
### Document structure
|
||||
|
||||
Organize each chapter as guide sections first, then a single `## Reference` section.
|
||||
|
||||
A well-structured chapter looks like this:
|
||||
|
||||
````markdown
|
||||
# Foo {#foo}
|
||||
|
||||
`foo` builds Foo projects from a `foo.toml`.
|
||||
|
||||
## Package a Foo application {#foo-packaging}
|
||||
|
||||
:::{.example #ex-foo-packaging}
|
||||
|
||||
# Package the hello app
|
||||
|
||||
```nix
|
||||
{ foo }:
|
||||
buildFooPackage {
|
||||
pname = "hello";
|
||||
version = "1.0";
|
||||
}
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
`buildFooPackage` needs `pname` and `version`.
|
||||
Keep explanation short, and place it after the example.
|
||||
|
||||
## Reference {#foo-reference}
|
||||
|
||||
### `buildFooPackage` {#foo-buildFooPackage}
|
||||
|
||||
Builds a Foo application from source.
|
||||
|
||||
#### Inputs {#foo-buildFooPackage-inputs}
|
||||
|
||||
`pname` (String)
|
||||
: The program name.
|
||||
|
||||
#### Examples {#foo-buildFooPackage-examples}
|
||||
|
||||
See [](#ex-foo-packaging).
|
||||
````
|
||||
|
||||
Examples live in one place: the guide owns them and the reference links to them.
|
||||
|
||||
Guides introduce minimal working examples that are goal-oriented (typical usage).
|
||||
|
||||
Reference may introduce additional examples that are unit-oriented. (minimal usage, edge-cases).
|
||||
If the guide example is already sufficient, just link to it from the reference.
|
||||
|
||||
Follow this structure strictly; to deviate, ping @NixOS/documentation-team.
|
||||
|
||||
|
||||
### One sentence per line
|
||||
|
||||
Put each sentence in its own line.
|
||||
@@ -290,16 +219,17 @@ When changing existing content, update formatting if possible, but avoid excessi
|
||||
|
||||
### Examples first
|
||||
|
||||
Put examples before detailed explanations (see the [styleguide](./styleguide.md) for the rationale).
|
||||
Readers look at examples first: an example communicates what something does faster than a description.
|
||||
Put examples before detailed explanations.
|
||||
|
||||
Use this structure for each documented item:
|
||||
Prefer this structure for each documented item:
|
||||
|
||||
1. Title
|
||||
2. Abstract (optional, one sentence max)
|
||||
2. Abstract (optional, one sentence max, the example often speaks for itself)
|
||||
3. Example
|
||||
4. Explanation (details, edge cases, types, defaults)
|
||||
|
||||
Rendered example:
|
||||
For instance:
|
||||
|
||||
````markdown
|
||||
## `lib.toUpper`
|
||||
@@ -351,17 +281,11 @@ Returns the difference as a number.
|
||||
|
||||
Use the [admonition syntax](#admonitions) for callouts and examples.
|
||||
|
||||
### `callPackage`-compatible examples
|
||||
### Provide self-contained examples
|
||||
|
||||
Provide at least one example per function, in its doc-comment.
|
||||
|
||||
Keep each example at the level it documents:
|
||||
|
||||
- A **reference example** might sometimes live in a doc-comment and show function call shape.
|
||||
- A **guide example** lives in a guide section and shows a complete task that may compose several functions.
|
||||
|
||||
When the task is nothing more than the call itself, the guide example is enough.
|
||||
The reference example links to the guide example.
|
||||
Provide at least one example per function, and make examples self-contained.
|
||||
This is easier to understand for beginners.
|
||||
It also helps with testing that it actually works – especially once we introduce automation.
|
||||
|
||||
Example code should be such that it can be passed to `pkgs.callPackage`.
|
||||
Instead of something like:
|
||||
|
||||
@@ -25,5 +25,6 @@ build-helpers/dev-shell-tools.chapter.md
|
||||
build-helpers/special.md
|
||||
build-helpers/images.md
|
||||
hooks/index.md
|
||||
languages-frameworks/index.md
|
||||
packages/index.md
|
||||
```
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
The `nix-shell` command has popularized the concept of transient shell environments for development or testing purposes.
|
||||
<!--
|
||||
We should try to document the product, not its development process in the Nixpkgs manual,
|
||||
We should try to document the product, not its development process in the Nixpkgs reference manual,
|
||||
but *something* needs to be said to provide context for this library.
|
||||
This is the most future proof sentence I could come up with while Nix itself does not yet make use of this.
|
||||
Relevant is the current status of the devShell attribute "project": https://github.com/NixOS/nix/issues/7501
|
||||
|
||||
@@ -1,50 +1,48 @@
|
||||
# Fixed-point arguments of build helpers {#chap-build-helpers-finalAttrs}
|
||||
|
||||
`stdenv.mkDerivation` also accepts a [fixed-point function](#function-library-lib.fixedPoints.fix) instead of a plain attribute set:
|
||||
As mentioned in the beginning of this part, `stdenv.mkDerivation` could alternatively accept a fixed-point function. The input of this function, typically named `finalAttrs`, is expected to be the final state of the attribute set. A build helper like this is said to accept **fixed-point arguments**.
|
||||
|
||||
```nix
|
||||
{
|
||||
stdenv,
|
||||
fetchurl,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hello";
|
||||
version = "2.12";
|
||||
Build helpers don't always support fixed-point arguments yet, as support in [`stdenv.mkDerivation`](#mkderivation-recursive-attributes) was first included in Nixpkgs 22.05.
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/hello/hello-${finalAttrs.version}.tar.gz";
|
||||
hash = "sha256-...";
|
||||
};
|
||||
})
|
||||
```
|
||||
## Defining a build helper with `lib.extendMkDerivation` {#sec-build-helper-extendMkDerivation}
|
||||
|
||||
The function's input, conventionally named `finalAttrs`, is the final state of the attribute set. Here `src` reads `finalAttrs.version` instead of repeating the version string. A build helper like this is said to accept **fixed-point arguments**.
|
||||
|
||||
Attributes that reference each other through `finalAttrs` stay correct when changing any of them with [`overrideAttrs`](#sec-pkg-overrideAttrs), because they all access the final values of the fixed-point computation.
|
||||
|
||||
`rec` cannot do this: its self-references are fixed when the set is defined and ignore later overrides.
|
||||
See [recursive-sets](https://nix.dev/manual/nix/stable/language/syntax#recursive-sets) for the underlying mechanism.
|
||||
|
||||
## Define a build helper with `lib.extendMkDerivation` {#sec-build-helper-extendMkDerivation}
|
||||
|
||||
Use [`lib.customisation.extendMkDerivation`](#function-library-lib.customisation.extendMkDerivation) to define a build helper with fixed-point support from an existing one.
|
||||
Its argument `extendDrvArgs` takes an attribute overlay similar to [`<pkg>.overrideAttrs`](#sec-pkg-overrideAttrs).
|
||||
Developers can use the Nixpkgs library function [`lib.customisation.extendMkDerivation`](#function-library-lib.customisation.extendMkDerivation) to define a build helper supporting fixed-point arguments from an existing one with such support, with an attribute overlay similar to the one taken by [`<pkg>.overrideAttrs`](#sec-pkg-overrideAttrs).
|
||||
|
||||
Besides overriding, `lib.extendMkDerivation` also supports `excludeDrvArgNames` to optionally exclude some arguments in the input fixed-point arguments from passing down to the base build helper (specified as `constructDrv`).
|
||||
|
||||
:::{.example #ex-build-helpers-extendMkDerivation}
|
||||
|
||||
# Example `mkLocalDerivation` - a build helper over `mkDerivation`
|
||||
# Example definition of `mkLocalDerivation` extended from `stdenv.mkDerivation` with `lib.extendMkDerivation`
|
||||
|
||||
Define a build helper named `mkLocalDerivation` that builds locally without using substitutes by default.
|
||||
We want to define a build helper named `mkLocalDerivation` that builds locally without using substitutes by default.
|
||||
|
||||
Use `lib.extendMkDerivation`:
|
||||
Instead of taking a plain attribute set,
|
||||
|
||||
```nix
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
}:
|
||||
preferLocalBuild ? true,
|
||||
allowSubstitute ? false,
|
||||
specialArg ? (_: false),
|
||||
...
|
||||
}@args:
|
||||
|
||||
stdenv.mkDerivation (
|
||||
removeAttrs [
|
||||
# Don't pass specialArg into mkDerivation.
|
||||
"specialArg"
|
||||
] args
|
||||
// {
|
||||
# Arguments to pass
|
||||
inherit preferLocalBuild allowSubstitute;
|
||||
# Some expressions involving specialArg
|
||||
greeting = if specialArg "hi" then "hi" else "hello";
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
we could define with `lib.extendMkDerivation` an attribute overlay to make the result build helper also accept the attribute set's fixed point passing to the underlying `stdenv.mkDerivation`, named `finalAttrs` here:
|
||||
|
||||
```nix
|
||||
lib.extendMkDerivation {
|
||||
constructDrv = stdenv.mkDerivation;
|
||||
excludeDrvArgNames = [
|
||||
@@ -69,77 +67,4 @@ lib.extendMkDerivation {
|
||||
```
|
||||
:::
|
||||
|
||||
To apply extra changes to the result derivation, pass `transformDrv` to `lib.extendMkDerivation`:
|
||||
|
||||
```nix
|
||||
lib.customisation.extendMkDerivation { transformDrv = drv: /...; }
|
||||
```
|
||||
|
||||
Construct a wrapper derivation around another derivation using `transformDrv`
|
||||
|
||||
The wrapper has access to the original arguments
|
||||
|
||||
:::{.example #ex-build-helpers-extendMkDerivation-transformDrv-wrapper}
|
||||
|
||||
# Define a custom build helper that downloads and builds
|
||||
|
||||
```nix
|
||||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
cacert,
|
||||
configure-example,
|
||||
download-example,
|
||||
}:
|
||||
|
||||
lib.extendMkDerivation {
|
||||
constructDrv = stdenvNoCC.mkDerivation;
|
||||
|
||||
excludeDrvArgNames = [
|
||||
"bar"
|
||||
];
|
||||
|
||||
extendDrvArgs =
|
||||
finalAttrs:
|
||||
{
|
||||
bar,
|
||||
foo,
|
||||
hash ? "",
|
||||
...
|
||||
}@args:
|
||||
{
|
||||
inherit hash;
|
||||
nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [
|
||||
cacert
|
||||
download-example
|
||||
];
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
download-example --foo="$foo" --out="$out"
|
||||
runHook postBuild
|
||||
'';
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
||||
outputHash = if finalAttrs.hash != "" then finalAttrs.hash else lib.fakeHash;
|
||||
outputHashFormat = "recursive";
|
||||
passthru = args.passthru or { } // {
|
||||
inherit bar;
|
||||
};
|
||||
};
|
||||
|
||||
transformDrv =
|
||||
unwrapped:
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
name = finalAttrs.src.name + "-wrapped";
|
||||
src = unwrapped;
|
||||
nativeBuildInputs = [
|
||||
configure-example
|
||||
];
|
||||
inherit (unwrapped) bar;
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
configure-example --bar="$bar"
|
||||
runHook postBuild
|
||||
'';
|
||||
});
|
||||
}
|
||||
```
|
||||
If one needs to apply extra changes to the result derivation, pass the derivation transformation function to `lib.extendMkDerivation` as `lib.customisation.extendMkDerivation { transformDrv = drv: ...; }`.
|
||||
|
||||
@@ -98,14 +98,6 @@ It has two modes:
|
||||
|
||||
: The path to the files to check.
|
||||
|
||||
`relocatable` (boolean, optional) {#tester-lycheeLinkCheck-param-relocatable}
|
||||
|
||||
: Whether the site is expected to be relocatable, i.e. servable from any URL path prefix.
|
||||
|
||||
When `true` (the default), root-relative links (starting with `/`) are treated as errors, because they break when the site is served from a subpath or opened via `file://` URLs.
|
||||
|
||||
When `false`, root-relative links are resolved against the `site` directory.
|
||||
|
||||
`remap` (attribute set, optional) {#tester-lycheeLinkCheck-param-remap}
|
||||
|
||||
: An attribute set where the attribute names are regular expressions.
|
||||
@@ -737,102 +729,4 @@ Notable attributes:
|
||||
|
||||
* `driverInteractive`: a script that launches an interactive Python session in the context of the `testScript`.
|
||||
|
||||
## `modularServiceCompliance` {#tester-modularServiceCompliance}
|
||||
|
||||
Compliance suite for [modular service](https://nixos.org/manual/nixos/unstable/#modular-services) integrations.
|
||||
|
||||
Tests that a service manager integration correctly handles the portable modular services contract: `process.argv`, sub-services, assertions, and warnings.
|
||||
|
||||
### Return value {#tester-modularServiceCompliance-return}
|
||||
|
||||
An attribute set of derivations which perform the tests during their build.
|
||||
|
||||
### Inputs {#tester-modularServiceCompliance-inputs}
|
||||
|
||||
`evalConfig` (function)
|
||||
|
||||
: `{ services } -> { config; checkDrv; }`.
|
||||
Function to evaluate the given services in the integration's full context.
|
||||
This function is called for evaluation checks on configurations that will not be run.
|
||||
- Input `services` is an attrset of modular service configurations. These should be used verbatim.
|
||||
- Output attribute `config` is the resulting evaluated services attrset (e.g., the value of the `system.services` option in NixOS).
|
||||
This attribute must be available even if `checkDrv` would fail.
|
||||
- Output attribute `checkDrv` is a representative derivation whose existence and buildability prove the eval is sound (e.g., `system.build.toplevel` in NixOS, but could perhaps be more specific in the case of another process manager integration).
|
||||
|
||||
`mkTest` (function)
|
||||
|
||||
: `{ name, services, testExe } -> derivation`.
|
||||
- Input `name` is a test name, suitable for use as a derivation name.
|
||||
- Input `services` is an attrset of modular service configurations, matching the structure of the integration's services option.
|
||||
- Input `testExe` is a store path to an executable that verifies the services.
|
||||
- Output: a derivation that runs the service manager with the provided configuration inputs and then calls `testExe` after starting the services. That executable must have access to `sharedDir`.
|
||||
|
||||
`sharedDir` (string)
|
||||
|
||||
: Path to a directory writable by service processes and readable by `testExe`.
|
||||
The integration must ensure this directory is available when the services and `testExe` run.
|
||||
|
||||
:::{.example #ex-modularServiceCompliance-nixos}
|
||||
|
||||
# NixOS invocation of the compliance suite
|
||||
|
||||
```nix
|
||||
# In nixos/tests/all-tests.nix:
|
||||
# modularServiceCompliance =
|
||||
recurseIntoAttrs (
|
||||
pkgs.testers.modularServiceCompliance {
|
||||
sharedDir = "/tmp/modular-service-compliance";
|
||||
evalConfig =
|
||||
{ services }:
|
||||
let
|
||||
machine = evalSystem (
|
||||
{ ... }:
|
||||
{
|
||||
system.services = services;
|
||||
system.stateVersion = "25.05";
|
||||
fileSystems."/" = {
|
||||
device = "/test/dummy";
|
||||
fsType = "auto";
|
||||
};
|
||||
boot.loader.grub.enable = false;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
config = machine.config.system.services;
|
||||
checkDrv = machine.config.system.build.toplevel;
|
||||
};
|
||||
mkTest =
|
||||
{
|
||||
name,
|
||||
services,
|
||||
testExe,
|
||||
}:
|
||||
runTest {
|
||||
_class = "nixosTest";
|
||||
inherit name;
|
||||
nodes.machine.system.services = services;
|
||||
testScript = ''
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.succeed("${testExe}")
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
### Manual compliance items {#tester-modularServiceCompliance-manual}
|
||||
|
||||
The following compliance items are not yet automated and must be verified manually when implementing a new modular service integration.
|
||||
|
||||
- **Failing assertions prevent deployment.**
|
||||
A service with `assertions = [{ assertion = false; message = "..."; }]` must cause the deployment to fail.
|
||||
The mechanism is integration-specific (e.g., NixOS checks assertions during `system.build.toplevel` evaluation).
|
||||
|
||||
- **Warnings are visible to the user.**
|
||||
A service with `warnings = [ "..." ]` must surface the warning to the user.
|
||||
On NixOS these are `builtins.warn` messages emitted during evaluation.
|
||||
|
||||
[file system object]: https://nix.dev/manual/nix/latest/store/file-system-object
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
pkgs ? (import ../ci { }).docPkgs,
|
||||
pkgs ? (import ../ci { }).pkgs,
|
||||
nixpkgs ? { },
|
||||
}:
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<div class="manual-header">
|
||||
<nav class="manual-header--tabs">
|
||||
<a class="manual-header--tab manual-header--tab-active" href="#">Nixpkgs</a>
|
||||
<a class="manual-header--tab" href="https://nixos.org/manual/nixos/stable/">NixOS</a>
|
||||
</nav>
|
||||
<span class="manual-header--title">Nixpkgs Manual</span>
|
||||
</div>
|
||||
@@ -73,7 +73,6 @@ stdenvNoCC.mkDerivation (
|
||||
../anchor.min.js
|
||||
../manpage-urls.json
|
||||
../redirects.json
|
||||
../nav.json
|
||||
]
|
||||
);
|
||||
};
|
||||
@@ -117,10 +116,8 @@ stdenvNoCC.mkDerivation (
|
||||
--script ./highlightjs/loader.js \
|
||||
--script ./anchor.min.js \
|
||||
--script ./anchor-use.js \
|
||||
--sidebar-depth 3 \
|
||||
--nav ./nav.json \
|
||||
--header ${./header.html}\
|
||||
--no-navheader \
|
||||
--toc-depth 1 \
|
||||
--section-toc-depth 1 \
|
||||
manual.md \
|
||||
out/index.html
|
||||
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
# Package your first application {#chap-first-package}
|
||||
|
||||
Package an application with Nixpkgs by picking the build helper for its language and setting a few attributes.
|
||||
|
||||
Each language ecosystem has its own build helper.
|
||||
See [](#chap-language-support) for the full set.
|
||||
|
||||
## Package a Go application {#first-package-go}
|
||||
|
||||
`buildGoModule` builds Go programs that use Go modules.
|
||||
|
||||
Write the package to `package.nix`:
|
||||
|
||||
:::{.example #ex-first-package-go}
|
||||
|
||||
# Package `pet` with `buildGoModule`
|
||||
|
||||
```nix
|
||||
# package.nix
|
||||
{
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
}:
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "pet";
|
||||
version = "0.3.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "knqyf263";
|
||||
repo = "pet";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-Gjw1dRrgM8D3G7v6WIM2+50r4HmTXvx0Xxme2fH9TlQ=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-6hCgv2/8UIRHw1kCe3nLkxF23zE/7t5RDwEjSzX3pBQ=";
|
||||
|
||||
meta = {
|
||||
description = "Simple command-line snippet manager, written in Go";
|
||||
homepage = "https://github.com/knqyf263/pet";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ kalbasit ];
|
||||
};
|
||||
})
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
`buildGoModule` needs `pname`, `version`, `src`, and `vendorHash`.
|
||||
|
||||
Pin Nixpkgs and call the package from `default.nix`:
|
||||
|
||||
```nix
|
||||
# default.nix
|
||||
let
|
||||
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
|
||||
pkgs = import nixpkgs { };
|
||||
in
|
||||
pkgs.callPackage ./package.nix { }
|
||||
```
|
||||
|
||||
Build it:
|
||||
|
||||
```shell
|
||||
$ nix-build ./default.nix
|
||||
# or equivalent
|
||||
$ nix-build
|
||||
```
|
||||
|
||||
Run it:
|
||||
|
||||
```shell
|
||||
$ ./result/bin/pet --help
|
||||
pet - Simple command-line snippet manager.
|
||||
```
|
||||
|
||||
`vendorHash` pins the fetched dependencies.
|
||||
To find its value:
|
||||
|
||||
1. Set `vendorHash` to an empty string `""`.
|
||||
2. Run `nix-build`.
|
||||
3. Copy the correct value from the error into `vendorHash`.
|
||||
|
||||
See the [Go reference](#sec-language-go) for every attribute and advanced usage.
|
||||
@@ -1,24 +0,0 @@
|
||||
# checkPhaseThreadLimitHook {#setup-hook-check-phase-thread-limit}
|
||||
|
||||
This hook defaults a variety of environment variables known
|
||||
to control thread counts to 1. Many of these otherwise default
|
||||
to `$(nproc)`, which causes massive overloads on build machines
|
||||
if nix build jobs and build cores are already tuned to fully utilize
|
||||
compute capacity of a builder without additional parallelism.
|
||||
|
||||
Currently sets the following environment variables:
|
||||
- [`OMP_NUM_THREADS`](https://www.openmp.org/spec-html/5.0/openmpse50.html)
|
||||
- [`OPENBLAS_NUM_THREADS`](https://github.com/OpenMathLib/OpenBLAS/blob/e7b45174355edec1f04de1cabcf5ca6a98ea7fbc/USAGE.md#how-can-i-use-openblas-in-multi-threaded-applications)
|
||||
- [`MKL_NUM_THREADS`](https://www.intel.com/content/www/us/en/docs/onemkl/developer-guide-linux/2023-0/mkl-domain-num-threads.html)
|
||||
- [`BLIS_NUM_THREADS`](https://github.com/flame/blis/blob/b8b75b4e19459f5d618b57aa814ca38b1d82eb82/docs/Multithreading.md#specifying-multithreading)
|
||||
- `VECLIB_MAXIMUM_THREADS`: Only affects darwin, see [`man 7 Accelerate`](https://manp.gs/mac/7/Accelerate)
|
||||
- [`NUMBA_NUM_THREADS`](https://numba.readthedocs.io/en/stable/reference/envvars.html#threading-control)
|
||||
- [`NUMEXPR_NUM_THREADS`](https://numexpr.readthedocs.io/en/latest/user_guide.html#threadpool-configuration)
|
||||
|
||||
The `NIX_CHECK_PHASE_DEFAULT_NUM_THREADS` environment variable
|
||||
can be used to override the default thread count limit.
|
||||
`dontLimitCheckPhaseThreads = true;` can be used to disable
|
||||
thread limiting on an individual package.
|
||||
|
||||
This hook will not attempt to override already existing
|
||||
definitions for thread count environment variables.
|
||||
@@ -13,7 +13,6 @@ aws-c-common.section.md
|
||||
bmake.section.md
|
||||
breakpoint.section.md
|
||||
cernlib.section.md
|
||||
check-phase-thread-limit-hook.section.md
|
||||
cmake.section.md
|
||||
desktop-file-utils.section.md
|
||||
gdk-pixbuf.section.md
|
||||
@@ -38,7 +37,6 @@ npm-install-hook.section.md
|
||||
patch-rc-path-hooks.section.md
|
||||
perl.section.md
|
||||
pkg-config.section.md
|
||||
pnpm.section.md
|
||||
postgresql-test-hook.section.md
|
||||
premake.section.md
|
||||
python.section.md
|
||||
@@ -50,7 +48,6 @@ unzip.section.md
|
||||
validatePkgConfig.section.md
|
||||
versionCheckHook.section.md
|
||||
waf.section.md
|
||||
writable-tmpdir-as-home-hook.section.md
|
||||
zig.section.md
|
||||
xcbuild.section.md
|
||||
xfce4-dev-tools.section.md
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
# pnpmBuildHook {#pnpm-build-hook}
|
||||
|
||||
[pnpm](https://pnpm.io/) is a an NPM-compatible package manager focused on increasing managment speeds, and reducing disk space.
|
||||
|
||||
The `pnpmBuildHook` in Nixpkgs overrides the default build phase for building packages that use pnpm.
|
||||
|
||||
:::{.example #ex-pnpm-build-hook}
|
||||
## pnpmBuildHook example code snippet {#pnpm-build-hook-code-snippet}
|
||||
|
||||
```nix
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchPnpmDeps,
|
||||
pnpmConfigHook,
|
||||
pnpmBuildHook,
|
||||
makeBinaryWrapper,
|
||||
pnpm_10,
|
||||
}:
|
||||
let
|
||||
pnpm = pnpm_10;
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "coolPackages";
|
||||
version = "1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "JaneCool";
|
||||
repo = "coolpackage";
|
||||
tag = finalAttrs.version;
|
||||
hash = lib.fakeHash;
|
||||
};
|
||||
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
inherit pnpm;
|
||||
fetcherversion = 4;
|
||||
hash = lib.fakeHash;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pnpmConfigHook
|
||||
pnpmBuildHook
|
||||
makeBinaryWrapper
|
||||
];
|
||||
|
||||
pnpmBuildScript = "build";
|
||||
pnpmBuildFlags = [
|
||||
"--mode"
|
||||
"production"
|
||||
];
|
||||
pnpmWorkspaces = [
|
||||
"test"
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir "$out"
|
||||
cp -r dist/. "$out"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "very cool package that does cool things";
|
||||
mainProgram = "cool";
|
||||
};
|
||||
})
|
||||
```
|
||||
:::
|
||||
|
||||
## Variables controlling pnpmBuildHook {#pnpm-build-hook-variables}
|
||||
|
||||
### pnpm Exclusive Variables {#pnpm-build-hook-exclusive-variables}
|
||||
|
||||
#### `pnpmBuildScript` {#pnpm-build-hook-script}
|
||||
|
||||
Controls the script ran to build the package, by default the script is `build`.
|
||||
|
||||
#### `pnpmFlags` {#pnpm-build-hook-flags}
|
||||
|
||||
Controls flags used for all invocations of pnpm across all hooks local to this derivation.
|
||||
|
||||
#### `pnpmBuildFlags` {#pnpm-build-hook-build-flags}
|
||||
|
||||
Controls the flags pass only to the pnpm build script invocation.
|
||||
|
||||
#### `dontPnpmBuild` {#pnpm-build-hook-dont}
|
||||
|
||||
Disables automatically running `pnpmBuildHook`. The build can still be run manually if needed, for example:
|
||||
|
||||
```nix
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
pnpmBuildHook,
|
||||
pnpmConfigHook,
|
||||
fetchPnpmDeps,
|
||||
emptyDirectory,
|
||||
pnpm_10,
|
||||
}:
|
||||
let
|
||||
pnpm = pnpm_10;
|
||||
in
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "super-fast-application";
|
||||
version = "1.0";
|
||||
|
||||
src = emptyDirectory;
|
||||
|
||||
cargoHash = lib.fakeHash;
|
||||
|
||||
nativeBuildInputs = [
|
||||
pnpmBuildHook
|
||||
pnpmConfigHook
|
||||
];
|
||||
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
inherit pnpm;
|
||||
fetcherversion = 4;
|
||||
hash = lib.fakeHash;
|
||||
};
|
||||
|
||||
dontPnpmBuild = true;
|
||||
postBuild = ''
|
||||
pnpmBuildHook
|
||||
'';
|
||||
})
|
||||
```
|
||||
|
||||
### Honored Variables {#pnpm-build-hook-honored-variables}
|
||||
|
||||
The following variables are honored by `pnpmBuildHook`.
|
||||
|
||||
* [`pnpmRoot`](#javascript-pnpm-sourceRoot)
|
||||
* [`pnpmWorkspaces`](#javascript-pnpm-workspaces)
|
||||
@@ -1,5 +0,0 @@
|
||||
# writableTmpDirAsHomeHook {#writableTmpDirAsHomeHook}
|
||||
|
||||
This setup hook provides a writable home directory for packages that require it.
|
||||
|
||||
To use, just add the hook to the `nativeBuildInputs` of the package.
|
||||
@@ -6,68 +6,46 @@ In this document and related Nix expressions, we use the term, _BEAM_, to descri
|
||||
|
||||
## Available versions and deprecations schedule {#available-versions-and-deprecations-schedule}
|
||||
|
||||
### Erlang OTP {#erlang}
|
||||
|
||||
Nixpkgs follows upstream Erlang in their [support lifecycle](https://erlang.org/download/otp_versions_tree.html) and keeps up to the last 3 released versions of Erlang available. Due to upstream and NixOS release timings, this may mean removal of the oldest release prior to upstream fully dropping support.
|
||||
|
||||
### Elixir {#elixir}
|
||||
|
||||
Nixpkgs follows the [official elixir deprecation schedule](https://hexdocs.pm/elixir/compatibility-and-deprecations.html) and keeps up to the last 5 released versions of Elixir available.
|
||||
Nixpkgs follows the [official elixir deprecation schedule](https://hexdocs.pm/elixir/compatibility-and-deprecations.html) and keeps the last 5 released versions of Elixir available.
|
||||
|
||||
## Structure {#beam-structure}
|
||||
|
||||
All BEAM-related expressions are available via top-level package sets. It is recommended to work with a single package set to ensure consistent versions.
|
||||
All BEAM-related expressions are available via the top-level `beam` attribute, which includes:
|
||||
|
||||
- `beamPackages` - default OTP version
|
||||
- `beamMinimalPackages` - default OTP version, without wxwidgets, which saves ~1GB in closure size
|
||||
- `interpreters`: a set of compilers running on the BEAM, including multiple Erlang/OTP versions (`beam.interpreters.erlang_22`, etc), Elixir (`beam.interpreters.elixir`) and LFE (Lisp Flavoured Erlang) (`beam.interpreters.lfe`).
|
||||
|
||||
There are also OTP version specific package sets, e.g. for OTP 28:
|
||||
- `packages`: a set of package builders (Mix and rebar3), each compiled with a specific Erlang/OTP version, e.g. `beam.packages.erlang22`.
|
||||
|
||||
- `beam28Packages`
|
||||
- `beamMinimal28Packages`
|
||||
The default Erlang compiler, defined by `beam.interpreters.erlang`, is aliased as `erlang`. The default BEAM package set is defined by `beam.packages.erlang` and aliased at the top level as `beamPackages`.
|
||||
|
||||
Inside each package set are:
|
||||
To create a package builder built with a custom Erlang version, use the lambda, `beam.packagesWith`, which accepts an Erlang/OTP derivation and produces a package builder similar to `beam.packages.erlang`.
|
||||
|
||||
- erlang itself (version comes from package set)
|
||||
- interpreters: elixir (multiple versions, e.g. elixir_1_18) and lfe
|
||||
- packages: rebar3, hex, etc
|
||||
- builders: mixRelease, buildRebar3, etc
|
||||
- hooks: for composing builders and packages
|
||||
Many Erlang/OTP distributions available in `beam.interpreters` have versions with ODBC and/or Java enabled or without wx (no observer support). For example, there's `beam.interpreters.erlang_22_odbc_javac`, which corresponds to `beam.interpreters.erlang_22` and `beam.interpreters.erlang_22_nox`, which corresponds to `beam.interpreters.erlang_22`.
|
||||
|
||||
To use a non-default Elixir it's important to keep the rest of the package set consistent, so it's recommended to use `.extend`. This ensures that builders like `mixRelease`, `fetchMixDeps`, and `buildMix` all pick up the overridden Elixir:
|
||||
## Build Tools {#build-tools}
|
||||
|
||||
```nix
|
||||
let
|
||||
beamPackages = beam27Packages.extend (self: super: { elixir = self.elixir_1_18; });
|
||||
in
|
||||
beamPackages.mixRelease {
|
||||
# ...
|
||||
}
|
||||
```
|
||||
### Rebar3 {#build-tools-rebar3}
|
||||
|
||||
## Build Tools {#beam-build-tools}
|
||||
We provide a version of Rebar3, under `rebar3`. We also provide a helper to fetch Rebar3 dependencies from a lockfile under `fetchRebar3Deps`.
|
||||
|
||||
### Rebar3 {#beam-build-tools-rebar3}
|
||||
|
||||
We provide a version of Rebar3, under `beamPackages.rebar3`. We also provide a helper to fetch Rebar3 dependencies from a lockfile under `beamPackages.fetchRebar3Deps`.
|
||||
|
||||
We also provide a version on Rebar3 with plugins included, under `beamPackages.rebar3WithPlugins`. This package is a function which takes two arguments: `plugins`, a list of nix derivations to include as plugins (loaded only when specified in `rebar.config`), and `globalPlugins`, which should always be loaded by rebar3. Example: `beamPackages.rebar3WithPlugins { globalPlugins = [beamPackages.pc]; }`.
|
||||
We also provide a version on Rebar3 with plugins included, under `rebar3WithPlugins`. This package is a function which takes two arguments: `plugins`, a list of nix derivations to include as plugins (loaded only when specified in `rebar.config`), and `globalPlugins`, which should always be loaded by rebar3. Example: `rebar3WithPlugins { globalPlugins = [beamPackages.pc]; }`.
|
||||
|
||||
When adding a new plugin it is important that the `name` attribute is the same as the atom used by rebar3 to refer to the plugin.
|
||||
|
||||
### Erlang.mk {#beam-build-tools-erlangmk}
|
||||
### Mix & Erlang.mk {#build-tools-other}
|
||||
|
||||
Erlang.mk works exactly as expected. There is a bootstrap process that needs to be run, which is supported by the `buildErlangMk` derivation.
|
||||
|
||||
### Mix {#beam-build-tools-mix}
|
||||
For Elixir applications use `mixRelease` to make a release. See examples for more details.
|
||||
|
||||
For Elixir applications that use [mix release](https://hexdocs.pm/mix/Mix.Release.html), use the `mixRelease` builder to make a release. See examples for more details.
|
||||
|
||||
There is also a `buildMix` helper, whose behavior is closer to that of `buildErlangMk` and `buildRebar3`. The primary difference is that `mixRelease` makes a release, while `buildMix` only builds the package, which is more useful for libraries and other dependencies.
|
||||
There is also a `buildMix` helper, whose behavior is closer to that of `buildErlangMk` and `buildRebar3`. The primary difference is that mixRelease makes a release, while buildMix only builds the package, making it useful for libraries and other dependencies.
|
||||
|
||||
## How to Install BEAM Packages {#how-to-install-beam-packages}
|
||||
|
||||
To use any of these builders in your environment, refer to them by their attribute path under `beamPackages` (or another BEAM package set), e.g. `beamPackages.rebar3`:
|
||||
BEAM builders are not registered at the top level, because they are not relevant to the vast majority of Nix users.
|
||||
To use any of those builders into your environment, refer to them by their attribute path under `beamPackages`, e.g. `beamPackages.rebar3`:
|
||||
|
||||
::: {.example #ex-beam-ephemeral-shell}
|
||||
# Ephemeral shell
|
||||
@@ -97,39 +75,35 @@ pkgs.mkShell { packages = [ pkgs.beamPackages.rebar3 ]; }
|
||||
|
||||
#### Rebar3 Packages {#rebar3-packages}
|
||||
|
||||
The builder `beamPackages.buildRebar3` can be used to build a derivation that understands how to build a Rebar3 project.
|
||||
The Nix function, `buildRebar3`, defined in `beam.packages.erlang.buildRebar3` and aliased at the top level, can be used to build a derivation that understands how to build a Rebar3 project.
|
||||
|
||||
If a package needs to compile native code via Rebar3's port compilation mechanism, add `compilePort = true;` to the derivation.
|
||||
|
||||
#### Erlang.mk Packages {#erlang-mk-packages}
|
||||
|
||||
Erlang.mk functions similarly to Rebar3, except we use `beamPackages.buildErlangMk` instead of `beamPackages.buildRebar3`.
|
||||
|
||||
If a package needs to compile native code via Erlang.mk's port compilation mechanism, add `compilePorts = true;` to the derivation.
|
||||
|
||||
### Elixir Applications {#packaging-elixir-applications}
|
||||
Erlang.mk functions similarly to Rebar3, except we use `buildErlangMk` instead of `buildRebar3`.
|
||||
|
||||
#### Mix Packages {#mix-packages}
|
||||
|
||||
`beamPackages.mixRelease` is used to make a release in the mix sense. Dependencies will need to be fetched with `beamPackages.fetchMixDeps` and passed to it.
|
||||
`mixRelease` is used to make a release in the mix sense. Dependencies will need to be fetched with `fetchMixDeps` and passed to it.
|
||||
|
||||
#### mixRelease - Elixir Phoenix example {#mix-release-elixir-phoenix-example}
|
||||
|
||||
There are 3 steps: frontend dependencies (javascript), backend dependencies (elixir), and the final derivation that puts both of those together.
|
||||
there are 3 steps: frontend dependencies (javascript), backend dependencies (elixir), and the final derivation that puts both of those together
|
||||
|
||||
##### mixRelease - Frontend dependencies (javascript) {#mix-release-javascript-deps}
|
||||
|
||||
For phoenix projects, inside of Nixpkgs you can either use `fetchYarnDeps` or `buildNpmPackage`. An example with `buildNpmPackage` can be found [here](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pl/plausible/package.nix), and an example with `fetchYarnDeps` can be found [here](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pi/pinchflat/package.nix).
|
||||
For phoenix projects, inside of Nixpkgs you can either use `fetchYarnDeps` or `buildNpmPackage`. An example with `fetchYarnDeps` can be found [here](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pl/plausible/package.nix). An example with `fetchYarnDeps` will follow. To package something outside of nixpkgs, you have alternatives like [npmlock2nix](https://github.com/nix-community/npmlock2nix) or [nix-npm-buildpackage](https://github.com/serokell/nix-npm-buildpackage)
|
||||
|
||||
##### mixRelease - backend dependencies (mix) {#mix-release-mix-deps}
|
||||
|
||||
There are 2 ways to package backend dependencies: either per-dependency mix2nix or with a fixed-output-derivation (FOD).
|
||||
There are 2 ways to package backend dependencies. With mix2nix and with a fixed-output-derivation (FOD).
|
||||
|
||||
When writing an elixir project targeting `mixRelease`, you can also consider using [deps_nix](https://github.com/code-supply/deps_nix) with `mixNixDeps`. `deps_nix` supports git dependencies, but is intended to be added to the project's `mix.exs` directly.
|
||||
|
||||
##### mix2nix {#mix2nix}
|
||||
###### mix2nix {#mix2nix}
|
||||
|
||||
`mix2nix` is a cli tool available in Nixpkgs. It will generate a Nix expression from a `mix.lock` file. It is quite standard in the 2nix tool series.
|
||||
|
||||
Note that currently mix2nix can't handle git dependencies inside the mix.lock file. If you have git dependencies, you can either add them manually (see [example](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pl/pleroma/package.nix)) or use the FOD method.
|
||||
Note that currently mix2nix can't handle git dependencies inside the mix.lock file. If you have git dependencies, you can either add them manually (see [example](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/pleroma/default.nix#L20)) or use the FOD method.
|
||||
|
||||
The advantage of using mix2nix is that nix will know your whole dependency graph. On a dependency update, this won't trigger a full rebuild and download of all the dependencies, where FOD will do so.
|
||||
|
||||
@@ -175,9 +149,9 @@ If there are git dependencies.
|
||||
|
||||
You will need to run the build process once to fix the hash to correspond to your new git src.
|
||||
|
||||
##### FOD {#fixed-output-derivation}
|
||||
###### FOD {#fixed-output-derivation}
|
||||
|
||||
A fixed output derivation will download mix dependencies from the internet. To ensure reproducibility, a hash will be supplied. Note that mix is relatively reproducible. An FOD generating a different hash on each run hasn't been observed (as opposed to npm where the chances are relatively high). See [akkoma](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/ak/akkoma/package.nix) for a usage example of FOD.
|
||||
A fixed output derivation will download mix dependencies from the internet. To ensure reproducibility, a hash will be supplied. Note that mix is relatively reproducible. An FOD generating a different hash on each run hasn't been observed (as opposed to npm where the chances are relatively high). See [elixir-ls](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/beam-modules/elixir-ls/default.nix) for a usage example of FOD.
|
||||
|
||||
Practical steps
|
||||
|
||||
@@ -202,11 +176,12 @@ Note that if after you've replaced the value, nix suggests another hash, then mi
|
||||
Here is how your `default.nix` file would look for a Phoenix project.
|
||||
|
||||
```nix
|
||||
{
|
||||
# beam27Packages or beam29Packages is available if you need a particular version
|
||||
beamPackages,
|
||||
}:
|
||||
with import <nixpkgs> { };
|
||||
|
||||
let
|
||||
# beam.interpreters.erlang_26 is available if you need a particular version
|
||||
packages = beam.packagesWith beam.interpreters.erlang;
|
||||
|
||||
pname = "your_project";
|
||||
version = "0.0.1";
|
||||
|
||||
@@ -216,7 +191,7 @@ let
|
||||
};
|
||||
|
||||
# if using mix2nix you can use the mixNixDeps attribute
|
||||
mixFodDeps = beamPackages.fetchMixDeps {
|
||||
mixFodDeps = packages.fetchMixDeps {
|
||||
pname = "mix-deps-${pname}";
|
||||
inherit src version;
|
||||
# nix will complain and tell you the right value to replace this with
|
||||
@@ -225,8 +200,11 @@ let
|
||||
# if you have build time environment variables add them here
|
||||
MY_ENV_VAR = "my_value";
|
||||
};
|
||||
|
||||
nodeDependencies = (pkgs.callPackage ./assets/default.nix { }).shell.nodeDependencies;
|
||||
|
||||
in
|
||||
beamPackages.mixRelease {
|
||||
packages.mixRelease {
|
||||
inherit
|
||||
src
|
||||
pname
|
||||
@@ -237,6 +215,9 @@ beamPackages.mixRelease {
|
||||
MY_ENV_VAR = "my_value";
|
||||
|
||||
postBuild = ''
|
||||
ln -sf ${nodeDependencies}/lib/node_modules assets/node_modules
|
||||
npm run deploy --prefix ./assets
|
||||
|
||||
# for external task you need a workaround for the no deps check flag
|
||||
# https://github.com/phoenixframework/phoenix/issues/2690
|
||||
mix do deps.loadpaths --no-deps-check, phx.digest
|
||||
@@ -248,14 +229,14 @@ beamPackages.mixRelease {
|
||||
Setup will require the following steps:
|
||||
|
||||
- Move your secrets to runtime environment variables. For more information refer to the [runtime.exs docs](https://hexdocs.pm/mix/Mix.Tasks.Release.html#module-runtime-configuration). On a fresh Phoenix build that would mean that both `DATABASE_URL` and `SECRET_KEY` need to be moved to `runtime.exs`.
|
||||
- Generate a Nix expression for your frontend dependencies using `fetchNpmDeps`/`buildNpmPackage` or `fetchYarnDeps`, depending on whether the project uses npm or yarn
|
||||
- `cd assets` and `nix-shell -p node2nix --run "node2nix --development"` will generate a Nix expression containing your frontend dependencies
|
||||
- commit and push those changes
|
||||
- you can now `nix-build .`
|
||||
- To run the release, set the `RELEASE_TMP` environment variable to a directory that your program has write access to. It will be used to store the BEAM settings.
|
||||
|
||||
#### Example of creating a service for an Elixir - Phoenix project {#example-of-creating-a-service-for-an-elixir---phoenix-project}
|
||||
|
||||
To create a service with your release, you could add a `service.nix`
|
||||
In order to create a service with your release, you could add a `service.nix`
|
||||
in your project with the following
|
||||
|
||||
```nix
|
||||
@@ -267,7 +248,7 @@ in your project with the following
|
||||
}:
|
||||
|
||||
let
|
||||
release = pkgs.callPackage ./default.nix { };
|
||||
release = pkgs.callPackage ./default.nix;
|
||||
release_name = "app";
|
||||
working_directory = "/home/app";
|
||||
in
|
||||
@@ -339,10 +320,9 @@ Usually, we need to create a `shell.nix` file and do our development inside the
|
||||
|
||||
with pkgs;
|
||||
let
|
||||
# pin OTP via beam27Packages/beam28Packages/... and Elixir via .extend
|
||||
beamPackages = beam27Packages.extend (self: super: { elixir = self.elixir_1_18; });
|
||||
elixir = beam.packages.erlang_27.elixir_1_18;
|
||||
in
|
||||
mkShell { buildInputs = [ beamPackages.elixir ]; }
|
||||
mkShell { buildInputs = [ elixir ]; }
|
||||
```
|
||||
|
||||
### Using an overlay {#beam-using-overlays}
|
||||
@@ -357,7 +337,7 @@ let
|
||||
self: super: {
|
||||
elixir_1_18 = super.elixir_1_18.override {
|
||||
version = "1.18.1";
|
||||
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
|
||||
sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -375,17 +355,18 @@ Here is an example `shell.nix`.
|
||||
with import <nixpkgs> { };
|
||||
|
||||
let
|
||||
# pin OTP via beam27Packages/beam28Packages/... and Elixir via .extend
|
||||
beamPackages = beam27Packages.extend (self: super: { elixir = self.elixir_1_18; });
|
||||
|
||||
# define packages to install
|
||||
basePackages = [
|
||||
git
|
||||
beamPackages.elixir
|
||||
# replace with beam.packages.erlang.elixir_1_18 if you need
|
||||
beam.packages.erlang.elixir
|
||||
nodejs
|
||||
postgresql_14
|
||||
# only used for frontend dependencies
|
||||
# you are free to use yarn2nix as well
|
||||
nodePackages.node2nix
|
||||
# formatting js file
|
||||
prettier
|
||||
nodePackages.prettier
|
||||
];
|
||||
|
||||
inputs = basePackages ++ lib.optionals stdenv.hostPlatform.isLinux [ inotify-tools ];
|
||||
@@ -398,13 +379,13 @@ let
|
||||
export HEX_HOME=$PWD/.nix-mix
|
||||
# make hex from Nixpkgs available
|
||||
# `mix local.hex` will install hex into MIX_HOME and should take precedence
|
||||
export MIX_PATH="${beamPackages.hex}/lib/erlang/lib/hex/ebin"
|
||||
export MIX_PATH="${beam.packages.erlang.hex}/lib/erlang/lib/hex/ebin"
|
||||
export PATH=$MIX_HOME/bin:$HEX_HOME/bin:$PATH
|
||||
export LANG=C.UTF-8
|
||||
# keep your shell history in iex
|
||||
export ERL_AFLAGS="-kernel shell_history enabled"
|
||||
|
||||
# postgres related
|
||||
# postges related
|
||||
# keep all your db data in a folder inside the project
|
||||
export PGDATA="$PWD/db"
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ Given the requirements above, the package expression would become messy quickly:
|
||||
}
|
||||
```
|
||||
|
||||
Fortunately, we have a [family of hooks]{#ssec-gnome-hooks-wrapgappshook} that automate this. They work in conjunction with other setup hooks that populate environment variables, and will then wrap all executables in `bin` and `libexec` directories using said variables. If a package has multiple outputs, these hooks will work on `outputBin` by default, or on the outputs listed in `wrapGAppsInOutputs` if set.
|
||||
Fortunately, we have a [family of hooks]{#ssec-gnome-hooks-wrapgappshook} that automate this. They work in conjunction with other setup hooks that populate environment variables, and will then wrap all executables in `bin` and `libexec` directories using said variables.
|
||||
|
||||
- [`wrapGAppsHook3`]{#ssec-gnome-hooks-wrapgappshook3} for GTK 3 apps. For convenience, it also adds `dconf.lib` for a GIO module implementing a GSettings backend using `dconf`, `gtk3` for GSettings schemas, and `librsvg` for GdkPixbuf loader to the closure.
|
||||
- [`wrapGAppsHook4`]{#ssec-gnome-hooks-wrapgappshook4} for GTK 4 apps. Same as `wrapGAppsHook3` but replaces `gtk3` with `gtk4`.
|
||||
|
||||
@@ -679,7 +679,7 @@ Defaults to `false`.
|
||||
|
||||
`genericBuilderArgsModifier`
|
||||
: This argument accepts a function allowing you to modify the arguments passed
|
||||
to `mkDerivation` to create the development environment. For example,
|
||||
to `mkDerivation` in order to create the development environment. For example,
|
||||
`args: { doCheck = false; }` would cause the environment to not include any test
|
||||
dependencies. Defaults to `lib.id`.
|
||||
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
The [standard build environment](#chap-stdenv) makes it easy to build typical Autotools-based packages with very little code. Any other kind of package can be accommodated by overriding the appropriate phases of `stdenv`. However, there are specialised functions in Nixpkgs to easily build packages for other programming languages, such as Perl or Haskell. These are described in this chapter.
|
||||
|
||||
::: {.tip}
|
||||
New to packaging? Start with [](#chap-first-package), then return here for the ecosystem you need.
|
||||
:::
|
||||
|
||||
Each supported language or software ecosystem has its own package set named `<language or ecosystem>Packages`, which can be explored in various ways:
|
||||
|
||||
- Search on [search.nixos.org](https://search.nixos.org/packages)
|
||||
@@ -60,6 +56,7 @@ android.section.md
|
||||
astal.section.md
|
||||
beam.section.md
|
||||
chicken.section.md
|
||||
rocq.section.md
|
||||
cosmic.section.md
|
||||
crystal.section.md
|
||||
cuda.section.md
|
||||
@@ -95,7 +92,6 @@ pkg-config.section.md
|
||||
python.section.md
|
||||
qt.section.md
|
||||
r.section.md
|
||||
rocq.section.md
|
||||
ruby.section.md
|
||||
rust.section.md
|
||||
scheme.section.md
|
||||
|
||||
@@ -305,12 +305,10 @@ This package puts the corepack wrappers for pnpm and yarn in your PATH, and they
|
||||
|
||||
### pnpm {#javascript-pnpm}
|
||||
|
||||
pnpm is available as the top-level package `pnpm`. Additionally, there are variants pinned to certain major versions, like `pnpm_9`, `pnpm_10`, `pnpm_10_29_2` and `pnpm_11`, which support different sets of lock file versions.
|
||||
pnpm is available as the top-level package `pnpm`. Additionally, there are variants pinned to certain major versions, like `pnpm_8`, `pnpm_9`, `pnpm_10`, `pnpm_10_29_2` and `pnpm_11`, which support different sets of lock file versions.
|
||||
|
||||
When packaging an application that includes a `pnpm-lock.yaml`, you need to fetch the pnpm store for that project using a fixed-output-derivation. The function `fetchPnpmDeps` can create this pnpm store derivation. In conjunction, the setup hook `pnpmConfigHook` will prepare the build environment to install the pre-fetched dependencies store. Here is an example for a package that contains `package.json` and a `pnpm-lock.yaml` files using the fetcher and setup hook above:
|
||||
|
||||
There is also the [`pnpmBuildHook`](#pnpm-build-hook) for building packages with `pnpm`, as seen in [](#ex-pnpm-build-hook).
|
||||
|
||||
```nix
|
||||
{
|
||||
fetchPnpmDeps,
|
||||
@@ -366,7 +364,7 @@ It is highly recommended to use a pinned version of pnpm (i.e., `pnpm_9` or `pnp
|
||||
+let
|
||||
+ # Optionally override pnpm to use a custom nodejs version
|
||||
+ # Make sure that the same nodejs version is referenced in nativeBuildInputs
|
||||
+ # pnpm = pnpm_10.override { nodejs-slim = nodejs-slim_22; };
|
||||
+ # pnpm = pnpm_10.override { nodejs = nodejs-slim_22; };
|
||||
+in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "foo";
|
||||
@@ -408,8 +406,6 @@ In case you are patching `package.json` or `pnpm-lock.yaml`, make sure to pass `
|
||||
}
|
||||
```
|
||||
|
||||
If needed, `dontPnpmConfigure = true;` can be used to fully disable `pnpmConfigHook` without manually removing it from inputs.
|
||||
|
||||
#### Dealing with `sourceRoot` {#javascript-pnpm-sourceRoot}
|
||||
|
||||
If the pnpm project is in a subdirectory, you can just define `sourceRoot` or `setSourceRoot` for `fetchPnpmDeps`.
|
||||
@@ -495,7 +491,7 @@ In this example, `prePnpmInstall` will be run by both `pnpmConfigHook` and by th
|
||||
|
||||
#### pnpm `fetcherVersion` {#javascript-pnpm-fetcherVersion}
|
||||
|
||||
This is the version of the output of `fetchPnpmDeps`. New packages should use `4`:
|
||||
This is the version of the output of `fetchPnpmDeps`. New packages should use `3`:
|
||||
|
||||
```nix
|
||||
{
|
||||
@@ -515,10 +511,10 @@ Changes can include workarounds or bug fixes to existing PNPM issues.
|
||||
|
||||
##### Version history {#javascript-pnpm-fetcherVersion-versionHistory}
|
||||
|
||||
Version 3 is the minimum supported value. Versions 1 and 2 were removed in the 26.11 release; packages that still use them fail to evaluate and must migrate to `fetcherVersion = 3` (or later) and regenerate their hashes.
|
||||
Version 3 is the recommended value for new packages. Versions 1 and 2 are deprecated and scheduled for removal in the 26.11 release; existing packages must migrate.
|
||||
|
||||
- 1: Initial version, nothing special. (removed in 26.11)
|
||||
- 2: [Ensure consistent permissions](https://github.com/NixOS/nixpkgs/pull/422975) (removed in 26.11)
|
||||
- 1: Initial version, nothing special.
|
||||
- 2: [Ensure consistent permissions](https://github.com/NixOS/nixpkgs/pull/422975)
|
||||
- 3: [Build a reproducible tarball](https://github.com/NixOS/nixpkgs/pull/469950)
|
||||
- 4: [Dump SQLite database to an SQL file](https://github.com/NixOS/nixpkgs/pull/522703)
|
||||
|
||||
|
||||
@@ -162,14 +162,6 @@ the package `luarocks-packages-updater`:
|
||||
nix-shell -p luarocks-packages-updater --run luarocks-packages-updater
|
||||
```
|
||||
|
||||
To add a new package without updating all packages, run
|
||||
|
||||
```sh
|
||||
|
||||
nix-shell -p luarocks-packages-updater
|
||||
luarocks-packages-updater add <package-name>
|
||||
```
|
||||
|
||||
[luarocks2nix](https://github.com/nix-community/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock).
|
||||
The automation only goes so far though and some packages need to be customized.
|
||||
These customizations go in [pkgs/development/lua-modules/overrides.nix](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/lua-modules/overrides.nix).
|
||||
@@ -240,7 +232,7 @@ The following is an example:
|
||||
vyp
|
||||
lblasc
|
||||
];
|
||||
license = lib.licenses.mit;
|
||||
license.fullName = "MIT/X11";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -174,59 +174,6 @@ To make sure that your package does not add extra manual effort when upgrading M
|
||||
</plugin>
|
||||
```
|
||||
|
||||
## Maven 4 {#maven-4}
|
||||
|
||||
Alongside the default `maven` package (the latest Maven 3 release), nixpkgs ships `maven_4`, which packages the [Maven 4](https://maven.apache.org/whatsnewinmaven4.html) release line.
|
||||
|
||||
`maven_4` is a standalone derivation and can be used as a drop-in replacement wherever `maven` is used, for example to build a project with the latest Maven 4:
|
||||
|
||||
```nix
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
jre,
|
||||
makeWrapper,
|
||||
maven_4,
|
||||
}:
|
||||
|
||||
maven_4.buildMavenPackage (finalAttrs: {
|
||||
pname = "jd-cli";
|
||||
version = "1.2.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "intoolswetrust";
|
||||
repo = "jd-cli";
|
||||
tag = "jd-cli-${finalAttrs.version}";
|
||||
hash = "sha256-rRttA5H0A0c44loBzbKH7Waoted3IsOgxGCD2VM0U/Q=";
|
||||
};
|
||||
|
||||
mvnHash = "";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin $out/share/jd-cli
|
||||
install -Dm644 jd-cli/target/jd-cli.jar $out/share/jd-cli
|
||||
|
||||
makeWrapper ${jre}/bin/java $out/bin/jd-cli \
|
||||
--add-flags "-jar $out/share/jd-cli/jd-cli.jar"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Simple command line wrapper around JD Core Java Decompiler project";
|
||||
homepage = "https://github.com/intoolswetrust/jd-cli";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
maintainers = with lib.maintainers; [ majiir ];
|
||||
};
|
||||
})
|
||||
```
|
||||
|
||||
`maven_4` exposes the same `buildMavenPackage` helper as `maven` (see [](#maven-buildmavenpackage)), so all of the patterns documented above apply equally. Note that the Maven dependencies resolved by Maven 4 differ from those resolved by Maven 3, so `mvnHash` must be recomputed when switching between the two.
|
||||
|
||||
## Manually using `mvn2nix` {#maven-mvn2nix}
|
||||
::: {.warning}
|
||||
This way is no longer recommended; see [](#maven-buildmavenpackage) for the simpler and preferred way.
|
||||
@@ -341,7 +288,7 @@ The double invocation is a _simple_ way to get around the problem that `nix-buil
|
||||
|
||||
It treats the entire Maven repository as a single source to be downloaded, relying on Maven's dependency resolution to satisfy the output hash. This is similar to fetchers like `fetchgit`, except it has to run a Maven build to determine what to download.
|
||||
|
||||
The first step will be to build the Maven project as a fixed-output derivation to collect the Maven repository -- below is an [example](https://github.com/fzakaria/nixos-maven-example/blob/main/double-invocation-repository.nix).
|
||||
The first step will be to build the Maven project as a fixed-output derivation in order to collect the Maven repository -- below is an [example](https://github.com/fzakaria/nixos-maven-example/blob/main/double-invocation-repository.nix).
|
||||
|
||||
::: {.note}
|
||||
Traditionally the Maven repository is at `~/.m2/repository`. We will override this to be the `$out` directory.
|
||||
@@ -469,7 +416,7 @@ The previous example builds a `jar` file but that's not a file one can run.
|
||||
|
||||
You need to use it with `java -jar $out/share/java/output.jar` and make sure to provide the required dependencies on the classpath.
|
||||
|
||||
The following explains how to use `makeWrapper` to make the derivation produce an executable that will run the JAR file you created.
|
||||
The following explains how to use `makeWrapper` in order to make the derivation produce an executable that will run the JAR file you created.
|
||||
|
||||
We will use the same repository we built above (either _double invocation_ or _buildMaven_) to setup a CLASSPATH for our JAR.
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ neovim.override {
|
||||
withRuby = false;
|
||||
configure = {
|
||||
customRC = ''
|
||||
" here your custom viml configuration goes!
|
||||
# here your custom viml configuration goes!
|
||||
'';
|
||||
packages.myVimPackage = with pkgs.vimPlugins; {
|
||||
# See examples below on how to use custom packages.
|
||||
@@ -47,7 +47,7 @@ neovim-qt.override {
|
||||
neovim = neovim.override {
|
||||
configure = {
|
||||
customRC = ''
|
||||
" your custom viml configuration
|
||||
# your custom viml configuration
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -64,14 +64,11 @@ For instance, `sqlite-lua` needs `g:sqlite_clib_path` to be set to work. Nixpkgs
|
||||
- `wrapRc`: Nix, not being able to write in your `$HOME`, loads the
|
||||
generated Neovim configuration via the `$VIMINIT` environment variable, i.e. : `export VIMINIT='lua dofile("/nix/store/…-init.lua")'`. This has side effects like preventing Neovim from sourcing your `init.lua` in `$XDG_CONFIG_HOME/nvim` (see bullet 7 of [`:help startup`](https://neovim.io/doc/user/starting.html#startup) in Neovim). Disable it if you want to generate your own wrapper. You can still reuse the generated vimscript init code via `neovim.passthru.initRc`.
|
||||
- `plugins`: A list of plugins to add to the wrapper.
|
||||
- `extraLuaPackages`: A function passed on to `lua.withPackages`.
|
||||
- `extraPython3Packages`: A function passed on to `python3.withPackages`.
|
||||
- `withPython3`, `withNodeJs`, `withRuby`, `withPerl` control when to enable neovim
|
||||
- `extraLuaPackages`: A function passed on to `lua.withPackages`
|
||||
- `withPython3`, `withNodeJs`, `withRuby` control when to enable neovim
|
||||
providers (see `:h provider`).
|
||||
- `vimAlias` and `viAlias` control whether to symlink the `vim` and `vi` binaries to `nvim` respectively.
|
||||
- `extraName` is a string appended to the package name and derivation name.
|
||||
|
||||
```nix
|
||||
```
|
||||
wrapNeovimUnstable neovim-unwrapped {
|
||||
autoconfigure = true;
|
||||
autowrapRuntimeDeps = true;
|
||||
@@ -83,8 +80,7 @@ wrapNeovimUnstable neovim-unwrapped {
|
||||
vim.opt.colorcolumn = { 100 }
|
||||
vim.opt.termguicolors = true
|
||||
'';
|
||||
# plugins accepts a list of either plugins or attribute sets containing:
|
||||
# { plugin = ...; config = ...; type = "viml"|"lua"; } (type defaults to "viml")
|
||||
# plugins accepts a list of either plugins or { plugin = ...; config = ..vimscript.. };
|
||||
plugins = with vimPlugins; [
|
||||
{
|
||||
plugin = vim-obsession;
|
||||
@@ -92,19 +88,7 @@ wrapNeovimUnstable neovim-unwrapped {
|
||||
map <Leader>$ <Cmd>Obsession<CR>
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = grug-far-nvim;
|
||||
type = "lua";
|
||||
config = ''
|
||||
require('grug-far').setup({
|
||||
startInInsertMode = false,
|
||||
})
|
||||
'';
|
||||
}
|
||||
(nvim-treesitter.withPlugins (p: [
|
||||
p.nix
|
||||
p.python
|
||||
]))
|
||||
(nvim-treesitter.withPlugins (p: [ p.nix p.python ]))
|
||||
hex-nvim
|
||||
];
|
||||
extraLuaPackages = lp: [ lp.mpack ];
|
||||
@@ -114,12 +98,12 @@ wrapNeovimUnstable neovim-unwrapped {
|
||||
}
|
||||
```
|
||||
|
||||
You can explore the configuration with `nix repl` to discover these options and
|
||||
You can explore the configuration with`nix repl` to discover these options and
|
||||
override them. For instance:
|
||||
```nix
|
||||
neovim.override {
|
||||
neovim.overrideAttrs (oldAttrs: {
|
||||
autowrapRuntimeDeps = false;
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Specificities for some plugins {#neovim-plugin-specificities}
|
||||
@@ -152,7 +136,7 @@ For example, if upstream documents that a plugin uses the Vim license but GitHub
|
||||
|
||||
## LuaRocks based plugins {#neovim-luarocks-based-plugins}
|
||||
|
||||
To automatically handle plugin dependencies, several Neovim plugins
|
||||
In order to automatically handle plugin dependencies, several Neovim plugins
|
||||
upload their package to [LuaRocks](https://www.luarocks.org). This means less work for nixpkgs maintainers in the long term as dependencies get updated automatically.
|
||||
This means several Neovim plugins are first packaged as nixpkgs [lua
|
||||
packages](#packaging-a-library-on-luarocks), and converted via `buildNeovimPlugin` in
|
||||
@@ -167,8 +151,6 @@ For instance:
|
||||
```
|
||||
To update these packages, you should use the lua updater rather than vim's.
|
||||
|
||||
To add a lua package to the `vimPlugins` set, add it to the `luarocksPackageNames` list in [luaPackagePlugins.nix](https://github.com/nixos/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/luaPackagePlugins.nix).
|
||||
|
||||
## Treesitter {#neovim-plugin-treesitter}
|
||||
|
||||
[Treesitter](https://tree-sitter.github.io/) provides syntax parsing for Neovim, enabling features like:
|
||||
@@ -264,43 +246,6 @@ You can install the standalone parsers and queries directly without installing `
|
||||
})
|
||||
```
|
||||
|
||||
### Treesitter setup using WASM parsers and queries {#neovim-plugin-treesitter-wasm}
|
||||
|
||||
Neovim can load WASM parsers when it is built with Wasmtime support.
|
||||
In nixpkgs, WASM parser plugins are available from the `wasi32` cross package set:
|
||||
|
||||
```nix
|
||||
(pkgs.wrapNeovim (pkgs.neovim-unwrapped.override { wasmSupport = true; }) {
|
||||
configure = {
|
||||
packages.myPlugins =
|
||||
with pkgs.pkgsCross.wasi32.vimPlugins;
|
||||
let
|
||||
# Select the grammars you need
|
||||
treesitter-grammars = with nvim-treesitter-parsers; [
|
||||
nix
|
||||
python
|
||||
];
|
||||
# Queries are needed for treesitter based syntax highlighting and folds.
|
||||
treesitter-queries = map (p: p.associatedQuery) treesitter-grammars;
|
||||
in
|
||||
{
|
||||
start = [
|
||||
# regular plugins
|
||||
]
|
||||
++ treesitter-grammars
|
||||
++ treesitter-queries;
|
||||
};
|
||||
};
|
||||
})
|
||||
```
|
||||
|
||||
Do not install both native and WASM parsers for the same language.
|
||||
For example, installing both `pkgs.vimPlugins.nvim-treesitter-parsers.nix` and
|
||||
`pkgs.pkgsCross.wasi32.vimPlugins.nvim-treesitter-parsers.nix` is invalid because Neovim
|
||||
loads the first `parser/nix.*` found on `runtimepath`.
|
||||
|
||||
Use `:checkhealth vim.treesitter` to verify Nix-managed WASM parsers.
|
||||
|
||||
You can enable treesitter features for installed grammars in a `FileType` autocommand
|
||||
or in an `ftplugin/<language>.lua` script, e.g.
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ Based on the packages defined in `pkgs/top-level/python-packages.nix` an
|
||||
attribute set is created for each available Python interpreter. The available
|
||||
sets are
|
||||
|
||||
* `pkgs.python27Packages`
|
||||
* `pkgs.python3Packages`
|
||||
* `pkgs.python311Packages`
|
||||
* `pkgs.python312Packages`
|
||||
@@ -59,7 +60,9 @@ sets are
|
||||
|
||||
and the aliases
|
||||
|
||||
* `pkgs.python2Packages` pointing to `pkgs.python27Packages`
|
||||
* `pkgs.python3Packages` pointing to `pkgs.python313Packages`
|
||||
* `pkgs.pythonPackages` pointing to `pkgs.python2Packages`
|
||||
* `pkgs.pypy2Packages` pointing to `pkgs.pypy27Packages`
|
||||
* `pkgs.pypy3Packages` pointing to `pkgs.pypy310Packages`
|
||||
* `pkgs.pypyPackages` pointing to `pkgs.pypy2Packages`
|
||||
@@ -204,9 +207,25 @@ following are specific to `buildPythonPackage`:
|
||||
* `setupPyGlobalFlags ? []`: List of flags passed to `setup.py` command.
|
||||
* `setupPyBuildFlags ? []`: List of flags passed to `setup.py build_ext` command.
|
||||
|
||||
##### Writing override-compatible packages {#buildpythonpackage-fixed-point-arguments}
|
||||
##### Using fixed-point arguments {#buildpythonpackage-fixed-point-arguments}
|
||||
|
||||
Use `finalAttrs` to make a package easy to update and override:
|
||||
Both `buildPythonPackage` and `buildPythonApplication` support [fixed-point arguments](#chap-build-helpers-finalAttrs), similar to `stdenv.mkDerivation`.
|
||||
This allows you to reference the final attributes of the derivation.
|
||||
|
||||
Instead of using `rec`:
|
||||
|
||||
```nix
|
||||
buildPythonPackage rec {
|
||||
pname = "pyspread";
|
||||
version = "2.4";
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-...";
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
You can use the `finalAttrs` pattern:
|
||||
|
||||
```nix
|
||||
buildPythonPackage (finalAttrs: {
|
||||
@@ -220,9 +239,7 @@ buildPythonPackage (finalAttrs: {
|
||||
})
|
||||
```
|
||||
|
||||
When a downstream callsite *overrides* `version` the override becomes visible as `finalAttrs.version`.
|
||||
|
||||
Both `buildPythonPackage` and `buildPythonApplication` support [fixed-point arguments](#chap-build-helpers-finalAttrs), similar to `stdenv.mkDerivation`.
|
||||
See the [general documentation on fixed-point arguments](#chap-build-helpers-finalAttrs) for more details on the benefits of this pattern.
|
||||
|
||||
::: {.note}
|
||||
|
||||
@@ -270,27 +287,29 @@ because their behaviour is different:
|
||||
The `buildPythonPackage` function has a `overridePythonAttrs` method that can be
|
||||
used to override the package. In the following example we create an environment
|
||||
where we have the `blaze` package using an older version of `pandas`. We
|
||||
first override the Python package set, then instantiate an interpreter with
|
||||
that package set.
|
||||
override first the Python interpreter and pass `packageOverrides` which contains
|
||||
the overrides for packages in the package set.
|
||||
|
||||
```nix
|
||||
with import <nixpkgs> { };
|
||||
|
||||
let
|
||||
pythonPackages = python3Packages.overrideScope (
|
||||
final: prev: {
|
||||
pandas = prev.pandas.overridePythonAttrs (old: rec {
|
||||
version = "0.19.1";
|
||||
src = fetchPypi {
|
||||
pname = "pandas";
|
||||
inherit version;
|
||||
hash = "sha256-JQn+rtpy/OA2deLszSKEuxyttqBzcAil50H+JDHUdCE=";
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
python = pkgs.python3.override {
|
||||
packageOverrides = self: super: {
|
||||
pandas = super.pandas.overridePythonAttrs (
|
||||
finalAttrs: prevAttrs: {
|
||||
version = "0.19.1";
|
||||
src = fetchPypi {
|
||||
pname = "pandas";
|
||||
inherit (finalAttrs) version;
|
||||
hash = "sha256-JQn+rtpy/OA2deLszSKEuxyttqBzcAil50H+JDHUdCE=";
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
in
|
||||
(pythonPackages.python.withPackages (ps: [ ps.blaze ])).env
|
||||
(python.withPackages (ps: [ ps.blaze ])).env
|
||||
```
|
||||
|
||||
The next example shows a non trivial overriding of the `blas` implementation to
|
||||
@@ -298,16 +317,15 @@ be used through out all of the Python package set:
|
||||
|
||||
```nix
|
||||
{
|
||||
python3PackagesWithBlas = python3Packages.overrideScope (
|
||||
final: prev: {
|
||||
python3MyBlas = pkgs.python3.override {
|
||||
packageOverrides = self: super: {
|
||||
# We need toPythonModule for the package set to evaluate this
|
||||
blas = final.toPythonModule (prev.blas.override { blasProvider = final.mkl; });
|
||||
lapack = final.toPythonModule (prev.lapack.override { lapackProvider = final.mkl; });
|
||||
}
|
||||
);
|
||||
blas = super.toPythonModule (super.pkgs.blas.override { blasProvider = super.pkgs.mkl; });
|
||||
lapack = super.toPythonModule (super.pkgs.lapack.override { lapackProvider = super.pkgs.mkl; });
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
This will create a new Python package set with the blas and lapack implementation set to Intel MKL.
|
||||
|
||||
This is particularly useful for numpy and scipy users who want to gain speed with other blas implementations.
|
||||
Note that using `scipy = super.scipy.override { blas = super.pkgs.mkl; };` will likely result in
|
||||
@@ -439,10 +457,11 @@ Note that overriding packages deeper in the dependency graph _can_ work, but it'
|
||||
let
|
||||
pyproject = pkgs.lib.importTOML ./pyproject.toml;
|
||||
|
||||
myPython3Packages = pkgs.python3Packages.overrideScope (
|
||||
final: _: {
|
||||
myPython = pkgs.python.override {
|
||||
self = myPython;
|
||||
packageOverrides = pyfinal: pyprev: {
|
||||
# An editable package with a script that loads our mutable location
|
||||
my-editable = final.mkPythonEditablePackage {
|
||||
my-editable = pyfinal.mkPythonEditablePackage {
|
||||
# Inherit project metadata from pyproject.toml
|
||||
pname = pyproject.project.name;
|
||||
inherit (pyproject.project) version;
|
||||
@@ -453,10 +472,10 @@ let
|
||||
# Inject a script (other PEP-621 entrypoints are also accepted)
|
||||
inherit (pyproject.project) scripts;
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
pythonEnv = myPython3Packages.python.withPackages (ps: [ ps.my-editable ]);
|
||||
pythonEnv = myPython.withPackages (ps: [ ps.my-editable ]);
|
||||
|
||||
in
|
||||
pkgs.mkShell { packages = [ pythonEnv ]; }
|
||||
@@ -556,6 +575,9 @@ In contrast to [`python.buildEnv`](#python.buildenv-function), [`python.withPack
|
||||
more advanced options such as `ignoreCollisions = true` or `postBuild`. If you
|
||||
need them, you have to use [`python.buildEnv`](#python.buildenv-function).
|
||||
|
||||
Python 2 namespace packages may provide `__init__.py` that collide. In that case
|
||||
[`python.buildEnv`](#python.buildenv-function) should be used with `ignoreCollisions = true`.
|
||||
|
||||
#### Setup hooks {#setup-hooks}
|
||||
|
||||
The following are setup hooks specifically for Python packages. Most of these
|
||||
@@ -607,9 +629,10 @@ buildPythonPackage.override { stdenv = customStdenv; } {
|
||||
|
||||
Several versions of the Python interpreter are available on Nix, as well as a
|
||||
high amount of packages. The attribute `python3` refers to the default
|
||||
interpreter, which is currently CPython 3.13. It is also possible to refer to
|
||||
specific versions, e.g., `python313` refers to CPython 3.13, and `pypy` refers
|
||||
to the default PyPy interpreter.
|
||||
interpreter, which is currently CPython 3.13. The attribute `python` refers to
|
||||
CPython 2.7 for backwards compatibility. It is also possible to refer to
|
||||
specific versions, e.g., `python313` refers to CPython 3.13, and `pypy` refers to
|
||||
the default PyPy interpreter.
|
||||
|
||||
Python is used a lot, and in different ways. This affects also how it is
|
||||
packaged. In the case of Python on Nix, an important distinction is made between
|
||||
@@ -621,6 +644,14 @@ In the Nixpkgs tree Python applications can be found throughout, depending on
|
||||
what they do, and are called from the main package set. Python libraries,
|
||||
however, are in separate sets, with one set per interpreter version.
|
||||
|
||||
The interpreters have several common attributes. One of these attributes is
|
||||
`pkgs`, which is a package set of Python libraries for this specific
|
||||
interpreter. E.g., the `toolz` package corresponding to the default interpreter
|
||||
is `python3.pkgs.toolz`, and the CPython 3.13 version is `python313.pkgs.toolz`.
|
||||
The main package set contains aliases to these package sets, e.g.
|
||||
`pythonPackages` refers to `python.pkgs` and `python313Packages` to
|
||||
`python313.pkgs`.
|
||||
|
||||
#### Installing Python and packages {#installing-python-and-packages}
|
||||
|
||||
The Nix and NixOS manuals explain how packages are generally installed. In the
|
||||
@@ -990,7 +1021,7 @@ information. The output of the function is a derivation.
|
||||
|
||||
An expression for `toolz` can be found in the Nixpkgs repository. As explained
|
||||
in the introduction of this Python section, a derivation of `toolz` is available
|
||||
for each interpreter version, e.g. `python313Packages.toolz` refers to the `toolz`
|
||||
for each interpreter version, e.g. `python313.pkgs.toolz` refers to the `toolz`
|
||||
derivation corresponding to the CPython 3.13 interpreter.
|
||||
|
||||
The above example works when you're directly working on
|
||||
@@ -1005,7 +1036,7 @@ with import <nixpkgs> { };
|
||||
|
||||
(
|
||||
let
|
||||
my_toolz = python313Packages.buildPythonPackage (finalAttrs: {
|
||||
my_toolz = python313.pkgs.buildPythonPackage (finalAttrs: {
|
||||
pname = "toolz";
|
||||
version = "0.10.0";
|
||||
pyproject = true;
|
||||
@@ -1015,7 +1046,7 @@ with import <nixpkgs> { };
|
||||
hash = "sha256-CP3V73yWSArRHBLUct4hrNMjWZlvaaUlkpm1QP66RWA=";
|
||||
};
|
||||
|
||||
build-system = [ python313Packages.setuptools ];
|
||||
build-system = [ python313.pkgs.setuptools ];
|
||||
|
||||
# has no tests
|
||||
doCheck = false;
|
||||
@@ -1028,7 +1059,7 @@ with import <nixpkgs> { };
|
||||
});
|
||||
|
||||
in
|
||||
python313Packages.python.withPackages (
|
||||
python313.withPackages (
|
||||
ps: with ps; [
|
||||
numpy
|
||||
my_toolz
|
||||
@@ -1049,11 +1080,6 @@ of [`withPackages`](#python.withpackages-function) we used a `let` expression. Y
|
||||
`toolz` from the Nixpkgs package set this time, but instead took our own version
|
||||
that we introduced with the `let` expression.
|
||||
|
||||
There is also a legacy API that can be accessed via `python3.pkgs`, which will also give access to
|
||||
the Python package set for a given interpreter. This API is not recommended to be used anymore
|
||||
because the package set at `python3.pkgs` is not spliced, while the package set at `python3Packages`
|
||||
is. This can lead to strange errors during cross-compilation, or if Python is used at build time.
|
||||
|
||||
#### Handling dependencies {#handling-dependencies}
|
||||
|
||||
Our example, `toolz`, does not have any dependencies on other Python packages or system libraries.
|
||||
@@ -1614,7 +1640,7 @@ looked at how you can create environments in which specified packages are
|
||||
available.
|
||||
|
||||
At some point you'll likely have multiple packages which you would
|
||||
like to be able to use in different projects. To minimise unnecessary
|
||||
like to be able to use in different projects. In order to minimise unnecessary
|
||||
duplication we now look at how you can maintain a repository with your
|
||||
own packages. The important functions here are `import` and `callPackage`.
|
||||
|
||||
@@ -1691,22 +1717,27 @@ should also be done when packaging `A`.
|
||||
|
||||
### How to override a Python package? {#how-to-override-a-python-package}
|
||||
|
||||
We can override the Python package set, then instantiate an interpreter with it.
|
||||
In the following example we rename the `pandas` package and build it.
|
||||
We can override the interpreter and pass `packageOverrides`. In the following
|
||||
example we rename the `pandas` package and build it.
|
||||
|
||||
```nix
|
||||
with import <nixpkgs> { };
|
||||
|
||||
let
|
||||
pythonPackages = python3Packages.overrideScope (
|
||||
final: prev: {
|
||||
pandas = prev.pandas.overridePythonAttrs {
|
||||
name = "foo";
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
(pythonPackages.python.withPackages (ps: [ ps.pandas ])).env
|
||||
(
|
||||
let
|
||||
python =
|
||||
let
|
||||
packageOverrides = self: super: {
|
||||
pandas = super.pandas.overridePythonAttrs (old: {
|
||||
name = "foo";
|
||||
});
|
||||
};
|
||||
in
|
||||
pkgs.python313.override { inherit packageOverrides; };
|
||||
|
||||
in
|
||||
python.withPackages (ps: [ ps.pandas ])
|
||||
).env
|
||||
```
|
||||
|
||||
Using `nix-build` on this expression will build an environment that contains the
|
||||
@@ -1722,10 +1753,12 @@ the updated `scipy` version.
|
||||
```nix
|
||||
with import <nixpkgs> { };
|
||||
|
||||
let
|
||||
pythonPackages = python313Packages.overrideScope (_: prev: { scipy = prev.scipy_0_17; });
|
||||
in
|
||||
(pythonPackages.python.withPackages (ps: [ ps.blaze ])).env
|
||||
(
|
||||
let
|
||||
packageOverrides = self: super: { scipy = super.scipy_0_17; };
|
||||
in
|
||||
(pkgs.python313.override { inherit packageOverrides; }).withPackages (ps: [ ps.blaze ])
|
||||
).env
|
||||
```
|
||||
|
||||
The requested package `blaze` depends on `pandas` which itself depends on `scipy`.
|
||||
@@ -1739,16 +1772,14 @@ let
|
||||
pkgs = import <nixpkgs> { };
|
||||
newpkgs = import pkgs.path {
|
||||
overlays = [
|
||||
(_: prev: {
|
||||
(self: super: {
|
||||
python313 =
|
||||
let
|
||||
pythonPackages = prev.python313Packages.overrideScope (
|
||||
_: prev: {
|
||||
numpy = prev.numpy_1_18;
|
||||
}
|
||||
);
|
||||
packageOverrides = python-self: python-super: {
|
||||
numpy = python-super.numpy_1_18;
|
||||
};
|
||||
in
|
||||
pythonPackages.python3;
|
||||
super.python313.override { inherit packageOverrides; };
|
||||
})
|
||||
];
|
||||
};
|
||||
@@ -1861,7 +1892,7 @@ pkgs.mkShell rec {
|
||||
pythonPackages.numpy
|
||||
pythonPackages.requests
|
||||
|
||||
# In this particular example, to compile any binary extensions they may
|
||||
# In this particular example, in order to compile any binary extensions they may
|
||||
# require, the Python modules listed in the hypothetical requirements.txt need
|
||||
# the following packages to be installed locally:
|
||||
taglib
|
||||
@@ -1889,8 +1920,9 @@ pkgs.mkShell rec {
|
||||
}
|
||||
```
|
||||
|
||||
In case the supplied venvShellHook is insufficient, you can define your own
|
||||
shell hook and adapt to your needs like in the following example:
|
||||
In case the supplied venvShellHook is insufficient, or when Python 2 support is
|
||||
needed, you can define your own shell hook and adapt to your needs like in the
|
||||
following example:
|
||||
|
||||
```nix
|
||||
with import <nixpkgs> { };
|
||||
@@ -1903,6 +1935,8 @@ pkgs.mkShell rec {
|
||||
name = "impurePythonEnv";
|
||||
buildInputs = [
|
||||
pythonPackages.python
|
||||
# Needed when using python 2.7
|
||||
# pythonPackages.virtualenv
|
||||
# ...
|
||||
];
|
||||
|
||||
@@ -1915,6 +1949,8 @@ pkgs.mkShell rec {
|
||||
echo "Skipping venv creation, '${venvDir}' already exists"
|
||||
else
|
||||
echo "Creating new venv environment in path: '${venvDir}'"
|
||||
# Note that the module venv was only introduced in python 3, so for 2.7
|
||||
# this needs to be replaced with a call to virtualenv
|
||||
${pythonPackages.python.interpreter} -m venv "${venvDir}"
|
||||
fi
|
||||
|
||||
@@ -1941,17 +1977,19 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
|
||||
|
||||
```nix
|
||||
{
|
||||
nixpkgs.config.packageOverrides = final: _: {
|
||||
python3Packages = super.python3Packages.overrideScope (pySuper: {
|
||||
twisted = pySuper.twisted.overridePythonAttrs {
|
||||
src = final.fetchPypi {
|
||||
pname = "Twisted";
|
||||
version = "19.10.0";
|
||||
hash = "sha256-c5S6fycq5yKnTz2Wnc9Zm8TvCTvDkgOHSKSQ8XJKUV0=";
|
||||
extension = "tar.bz2";
|
||||
};
|
||||
nixpkgs.config.packageOverrides = super: {
|
||||
python3 = super.python3.override {
|
||||
packageOverrides = python-self: python-super: {
|
||||
twisted = python-super.twisted.overridePythonAttrs (oldAttrs: {
|
||||
src = super.fetchPypi {
|
||||
pname = "Twisted";
|
||||
version = "19.10.0";
|
||||
hash = "sha256-c5S6fycq5yKnTz2Wnc9Zm8TvCTvDkgOHSKSQ8XJKUV0=";
|
||||
extension = "tar.bz2";
|
||||
};
|
||||
});
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
@@ -1967,7 +2005,7 @@ this snippet:
|
||||
|
||||
```nix
|
||||
{
|
||||
myPythonPackages = python3Packages.overrideScope (final: super: { twisted = <...>; });
|
||||
myPythonPackages = python3Packages.override { overrides = self: super: { twisted = <...>; }; };
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1976,17 +2014,19 @@ this snippet:
|
||||
Use the following overlay template:
|
||||
|
||||
```nix
|
||||
self: _: {
|
||||
python3Packages = super.python3Packages.overrideScope (pySuper: {
|
||||
twisted = pySuper.twisted.overrideAttrs {
|
||||
src = final.fetchPypi {
|
||||
pname = "Twisted";
|
||||
version = "19.10.0";
|
||||
hash = "sha256-c5S6fycq5yKnTz2Wnc9Zm8TvCTvDkgOHSKSQ8XJKUV0=";
|
||||
extension = "tar.bz2";
|
||||
};
|
||||
self: super: {
|
||||
python = super.python.override {
|
||||
packageOverrides = python-self: python-super: {
|
||||
twisted = python-super.twisted.overrideAttrs (oldAttrs: {
|
||||
src = super.fetchPypi {
|
||||
pname = "Twisted";
|
||||
version = "19.10.0";
|
||||
hash = "sha256-c5S6fycq5yKnTz2Wnc9Zm8TvCTvDkgOHSKSQ8XJKUV0=";
|
||||
extension = "tar.bz2";
|
||||
};
|
||||
});
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
@@ -2092,7 +2132,7 @@ See also [contributing section](#contributing).
|
||||
### Are Python interpreters built deterministically? {#deterministic-builds}
|
||||
|
||||
The Python interpreters are now built deterministically. Minor modifications had
|
||||
to be made to the interpreters to generate deterministic bytecode. This
|
||||
to be made to the interpreters in order to generate deterministic bytecode. This
|
||||
has security implications and is relevant for those using Python in a
|
||||
`nix-shell`.
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ The recommended way of defining a derivation for a Rocq library, is to use the `
|
||||
* if it is a string of the form `owner:branch` then it tries to download the `branch` of owner `owner` for a project of the same name using the same vcs, and the `version` attribute of the resulting derivation is set to `"dev"`, additionally if the owner is not provided (i.e. if the `owner:` prefix is missing), it defaults to the original owner of the package (see below),
|
||||
* if it is a string of the form `"#N"`, and the domain is github, then it tries to download the current head of the pull request `#N` from github,
|
||||
* `defaultVersion` (optional). Rocq libraries may be compatible with some specific versions of Rocq only. The `defaultVersion` attribute is used when no `version` is provided (or if `version = null`) to select the version of the library to use by default, depending on the context. This selection will mainly depend on a `rocq-core` version number but also possibly on other packages versions (e.g. `mathcomp`). If its value ends up to be `null`, the package is marked for removal in end-user `rocqPackages` attribute set.
|
||||
* `release` (optional, defaults to `{}`), lists all the known releases of the library and for each of them provides an attribute set with at least a `hash` attribute (you may put the empty string `""` to automatically insert a fake hash, this will trigger an error which will allow you to find the correct hash), each attribute set of the list of releases also takes optional overloading arguments for the fetcher as below (i.e.`domain`, `owner`, `repo`, `rev`, `artifact` assuming the default fetcher is used) and optional overrides for the result of the fetcher (i.e. `version` and `src`).
|
||||
* `release` (optional, defaults to `{}`), lists all the known releases of the library and for each of them provides an attribute set with at least a `hash` attribute (you may put the empty string `""` in order to automatically insert a fake hash, this will trigger an error which will allow you to find the correct hash), each attribute set of the list of releases also takes optional overloading arguments for the fetcher as below (i.e.`domain`, `owner`, `repo`, `rev`, `artifact` assuming the default fetcher is used) and optional overrides for the result of the fetcher (i.e. `version` and `src`).
|
||||
* `fetcher` (optional, defaults to a generic fetching mechanism supporting github or gitlab based infrastructures), is a function that takes at least an `owner`, a `repo`, a `rev`, and a `hash` and returns an attribute set with a `version` and `src`.
|
||||
* `repo` (optional, defaults to the value of `pname`),
|
||||
* `owner` (optional, defaults to `"rocq-community"`).
|
||||
@@ -74,8 +74,6 @@ The recommended way of defining a derivation for a Rocq library, is to use the `
|
||||
* `enableParallelBuilding` (optional, defaults to `true`), since it is activated by default, we provide a way to disable it.
|
||||
* `extraInstallFlags` (optional), allows to extend `installFlags` which initializes the variables `COQLIBINSTALL` and `COQPLUGININSTALL` so as to install in the proper subdirectory. Indeed Rocq libraries should be installed in `$(out)/lib/coq/${rocq-core.rocq-version}/user-contrib/`. Such directories are automatically added to the `$ROCQPATH` environment variable by the hook defined in the Rocq derivation.
|
||||
* `setROCQBIN` (optional, defaults to `true`), by default, the environment variable `$ROCQBIN` is set to the current Rocq's binary, but one can disable this behavior by setting it to `false`,
|
||||
* `useCoq` (optional, defaults to `false`), adds the Coq compatibility binaries to the build environment, which is necessary for some packages that still depend on them and sets `COQBIN` to the path of the `coqc` binary (if `setROCQBIN` is also set to `true`). A wrapper `mkCoqDerivation` is provided that sets this option to `true`.
|
||||
* `useCoqifVersion` (optional, defaults to `(x: false)`), adds the Coq compatibility binaries to the build environment if the provided predicate evaluates to true on the version. This can be useful for supporting old package versions that need the Coq compatibility binaries, while newer versions do not.
|
||||
* `useMelquiondRemake` (optional, default to `null`) is an attribute set, which, if given, overloads the `preConfigurePhases`, `configureFlags`, `buildPhase`, and `installPhase` attributes of the derivation for a specific use in libraries using `remake` as set up by Guillaume Melquiond for `flocq`, `gappalib`, `interval`, and `coquelicot` (see the corresponding derivation for concrete examples of use of this option). For backward compatibility, the attribute `useMelquiondRemake.logpath` must be set to the logical root of the library (otherwise, one can pass `useMelquiondRemake = {}` to activate this without backward compatibility).
|
||||
* `dropAttrs`, `keepAttrs`, `dropDerivationAttrs` are all optional and allow to tune which attribute is added or removed from the final call to `mkDerivation`.
|
||||
|
||||
@@ -155,7 +153,7 @@ For example, assuming you have a special `mathcomp` dependency you want to use,
|
||||
multinomials.override { mathcomp = my-special-mathcomp; }
|
||||
```
|
||||
|
||||
In Nixpkgs, all Rocq derivations take a `version` argument. This can be overridden to easily use a different version:
|
||||
In Nixpkgs, all Rocq derivations take a `version` argument. This can be overridden in order to easily use a different version:
|
||||
|
||||
```nix
|
||||
rocqPackages.multinomials.override { version = "1.5.1"; }
|
||||
|
||||
@@ -125,7 +125,7 @@ With this file in your directory, you can run `nix-shell` to build and use the g
|
||||
|
||||
The `bundlerEnv` is a wrapper over all the gems in your gemset. This means that all the `/lib` and `/bin` directories will be available, and the executables of all gems (even of indirect dependencies) will end up in your `$PATH`. The `wrappedRuby` provides you with all executables that come with Ruby itself, but wrapped so they can easily find the gems in your gemset.
|
||||
|
||||
One common issue that you might have is that you have Ruby, but also `bundler` in your gemset. That leads to a conflict for `/bin/bundle` and `/bin/bundler`. You can resolve this by wrapping either your Ruby or your gems in a `lowPrio` call. So to give the `bundler` from your gemset priority, it would be used like this:
|
||||
One common issue that you might have is that you have Ruby, but also `bundler` in your gemset. That leads to a conflict for `/bin/bundle` and `/bin/bundler`. You can resolve this by wrapping either your Ruby or your gems in a `lowPrio` call. So in order to give the `bundler` from your gemset priority, it would be used like this:
|
||||
|
||||
```nix
|
||||
# ...
|
||||
@@ -265,7 +265,7 @@ Now that you know how to get a working Ruby environment with Nix, it's time to g
|
||||
|
||||
All gems in the standard set are automatically generated from a single `Gemfile`. The dependency resolution is done with `bundler` and makes it more likely that all gems are compatible with each other.
|
||||
|
||||
To add a new gem to nixpkgs, you can put it into the `/pkgs/development/ruby-modules/with-packages/Gemfile` and run `./maintainers/scripts/update-ruby-packages`.
|
||||
In order to add a new gem to nixpkgs, you can put it into the `/pkgs/development/ruby-modules/with-packages/Gemfile` and run `./maintainers/scripts/update-ruby-packages`.
|
||||
|
||||
To test that it works, you can then try using the gem with:
|
||||
|
||||
|
||||
@@ -885,7 +885,8 @@ general. A number of other parameters can be overridden:
|
||||
empty, or `"forbid"` (no cap) when `lints` is set. Because `rustc`
|
||||
only honours the first `--cap-lints` it receives, this cannot be
|
||||
changed via `extraRustcOpts`; use this attribute instead. Useful
|
||||
with `useClippy`, since clippy lints are also capped by this flag:
|
||||
when overriding the `rust` attribute to point at `clippy-driver`,
|
||||
since clippy lints are also capped by this flag:
|
||||
|
||||
```nix
|
||||
(hello { }).override { capLints = "warn"; }
|
||||
@@ -911,34 +912,6 @@ general. A number of other parameters can be overridden:
|
||||
}
|
||||
```
|
||||
|
||||
- Whether to compile the crate with `clippy-driver` instead of `rustc`.
|
||||
Build scripts (`build.rs`) keep plain `rustc`. The default `capLints`
|
||||
of `"allow"` suppresses all lints including clippy's, so this is
|
||||
usually paired with `capLints` and lint flags via `extraRustcOpts`:
|
||||
|
||||
```nix
|
||||
(hello { }).override {
|
||||
useClippy = true;
|
||||
capLints = "warn";
|
||||
extraRustcOpts = [
|
||||
"-Dwarnings"
|
||||
"-Wclippy::all"
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
When using a Rust toolchain that bundles its own `clippy-driver`
|
||||
(rust-overlay, Fenix), pass it via `clippy` so the sysroot matches:
|
||||
|
||||
```nix
|
||||
(hello { }).override {
|
||||
rust = myToolchain;
|
||||
clippy = myToolchain;
|
||||
useClippy = true;
|
||||
capLints = "warn";
|
||||
}
|
||||
```
|
||||
|
||||
- Phases, just like in any other derivation, can be specified using
|
||||
the following attributes: `preUnpack`, `postUnpack`, `prePatch`,
|
||||
`patches`, `postPatch`, `preConfigure` (in the case of a Rust crate,
|
||||
|
||||
@@ -160,7 +160,7 @@ This essentially runs: `swift test -c release`
|
||||
|
||||
In some cases, it may be necessary to patch a SwiftPM dependency. SwiftPM
|
||||
dependencies are located in `.build/checkouts`, but the `swiftpm2nix` helper
|
||||
provides these as symlinks to read-only `/nix/store` paths. To patch
|
||||
provides these as symlinks to read-only `/nix/store` paths. In order to patch
|
||||
them, we need to make them writable.
|
||||
|
||||
A special function `swiftpmMakeMutable` is available to replace the symlink
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
There is a TeX Live packaging that lives entirely under attribute `texlive`.
|
||||
|
||||
## User's guide {#sec-language-texlive-user-guide}
|
||||
## User's guide (experimental new interface) {#sec-language-texlive-user-guide-experimental}
|
||||
|
||||
Release 23.11 ships with a new interface that will eventually replace `texlive.combine`.
|
||||
|
||||
- For basic usage, use some of the prebuilt environments available at the top level, such as `texliveBasic`, `texliveSmall`. For the full list of prebuilt environments, inspect `texlive.schemes`.
|
||||
|
||||
@@ -22,7 +24,7 @@ There is a TeX Live packaging that lives entirely under attribute `texlive`.
|
||||
|
||||
- `texlive.withPackages` uses the same logic as `buildEnv`. Only parts of a package are installed in an environment: its 'runtime' files (`tex` output), binaries (`out` output), and support files (`tlpkg` output). Moreover, man and info pages are assembled into separate `man` and `info` outputs. To add only the TeX files of a package, or its documentation (`texdoc` output), just specify the outputs:
|
||||
```nix
|
||||
texliveBasic.withPackages (
|
||||
texlive.withPackages (
|
||||
ps: with ps; [
|
||||
texdoc # recommended package to navigate the documentation
|
||||
perlPackages.LaTeXML.tex # tex files of LaTeXML, omit binaries
|
||||
@@ -32,19 +34,64 @@ There is a TeX Live packaging that lives entirely under attribute `texlive`.
|
||||
)
|
||||
```
|
||||
|
||||
- To add the documentation for all packages in the environment, use
|
||||
```nix
|
||||
texliveSmall.overrideAttrs { withDocs = true; }
|
||||
```
|
||||
This can be applied before or after calling `withPackages`. The parameter `withSources` adds all source containers.
|
||||
|
||||
- All packages distributed by TeX Live, which contains most of CTAN, are available and can be found under `texlive.pkgs`:
|
||||
```ShellSession
|
||||
$ nix repl
|
||||
nix-repl> :l <nixpkgs>
|
||||
nix-repl> texlive.pkgs.[TAB]
|
||||
```
|
||||
These are derivations with outputs `out`, `tex`, `texdoc`, `texsource`, `tlpkg`, `man`, `info`. They cannot be installed outside of `texlive.withPackages` but are available for other uses. To repackage a font, for instance, use
|
||||
Note that the packages in `texlive.pkgs` are only provided for search purposes and must not be used directly.
|
||||
|
||||
- **Experimental and subject to change without notice:** to add the documentation for all packages in the environment, use
|
||||
```nix
|
||||
texliveSmall.__overrideTeXConfig { withDocs = true; }
|
||||
```
|
||||
This can be applied before or after calling `withPackages`.
|
||||
|
||||
The function currently supports the parameters `withDocs`, `withSources`, and `requireTeXPackages`.
|
||||
|
||||
## User's guide {#sec-language-texlive-user-guide}
|
||||
|
||||
- For basic usage just pull `texlive.combined.scheme-basic` for an environment with basic LaTeX support.
|
||||
|
||||
- It typically won't work to use separately installed packages together. Instead, you can build a custom set of packages like this. Most CTAN packages should be available:
|
||||
|
||||
```nix
|
||||
texlive.combine {
|
||||
inherit (texlive)
|
||||
scheme-small
|
||||
collection-langkorean
|
||||
algorithms
|
||||
cm-super
|
||||
;
|
||||
}
|
||||
```
|
||||
|
||||
- There are all the schemes, collections and a few thousand packages, as defined upstream (perhaps with tiny differences).
|
||||
|
||||
- By default you only get executables and files needed during runtime, and a little documentation for the core packages. To change that, you need to add `pkgFilter` function to `combine`.
|
||||
|
||||
```nix
|
||||
texlive.combine {
|
||||
# inherit (texlive) whatever-you-want;
|
||||
pkgFilter =
|
||||
pkg: pkg.tlType == "run" || pkg.tlType == "bin" || pkg.hasManpages || pkg.pname == "cm-super";
|
||||
# elem tlType [ "run" "bin" "doc" "source" ]
|
||||
# there are also other attributes: version, name
|
||||
}
|
||||
```
|
||||
|
||||
- You can list packages e.g. by `nix repl`.
|
||||
|
||||
```ShellSession
|
||||
$ nix repl
|
||||
nix-repl> :l <nixpkgs>
|
||||
nix-repl> texlive.collection-[TAB]
|
||||
```
|
||||
|
||||
- Note that the wrapper assumes that the result has a chance to be useful. For example, the core executables should be present, as well as some core data files. The supported way of ensuring this is by including some scheme, for example, `scheme-basic`, into the combination.
|
||||
|
||||
- TeX Live packages are also available under `texlive.pkgs` as derivations with outputs `out`, `tex`, `texdoc`, `texsource`, `tlpkg`, `man`, `info`. They cannot be installed outside of `texlive.combine` but are available for other uses. To repackage a font, for instance, use
|
||||
|
||||
```nix
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
@@ -65,9 +112,9 @@ There is a TeX Live packaging that lives entirely under attribute `texlive`.
|
||||
|
||||
## Custom packages {#sec-language-texlive-custom-packages}
|
||||
|
||||
You may find that you need to use an external TeX package. A derivation for such package has to provide the contents of the "texmf" directory in its `"tex"` output, according to the [TeX Directory Structure](https://tug.ctan.org/tds/tds.html). Dependencies on other TeX packages can be listed in the attribute `passthru.tlDeps`, which is a function taking a package set and returning a list of packages.
|
||||
You may find that you need to use an external TeX package. A derivation for such package has to provide the contents of the "texmf" directory in its `"tex"` output, according to the [TeX Directory Structure](https://tug.ctan.org/tds/tds.html). Dependencies on other TeX packages can be listed in the attribute `tlDeps`.
|
||||
|
||||
The function `texlive.withPackages` recognise the following outputs:
|
||||
The functions `texlive.combine` and `texlive.withPackages` recognise the following outputs:
|
||||
|
||||
- `"out"`: contents are linked in the TeX Live environment, and binaries in the `$out/bin` folder are wrapped;
|
||||
- `"tex"`: linked in `$TEXMFDIST`; files should follow the TDS (for instance `$tex/tex/latex/foiltex/foiltex.cls`);
|
||||
@@ -75,6 +122,8 @@ The function `texlive.withPackages` recognise the following outputs:
|
||||
- `"tlpkg"`: linked in `$TEXMFROOT/tlpkg`;
|
||||
- `"man"`, `"info"`, ...: the other outputs are combined into separate outputs.
|
||||
|
||||
When using `pkgFilter`, `texlive.combine` will assign `tlType` respectively `"bin"`, `"run"`, `"doc"`, `"source"`, `"tlpkg"` to the above outputs.
|
||||
|
||||
Here is a (very verbose) example. See also the packages `auctex`, `eukleides`, `mftrace` for more examples.
|
||||
|
||||
```nix
|
||||
@@ -89,7 +138,7 @@ let
|
||||
"tex"
|
||||
"texdoc"
|
||||
];
|
||||
passthru.tlDeps = ps: [ ps.latex ];
|
||||
passthru.tlDeps = with texlive; [ latex ];
|
||||
|
||||
srcs = [
|
||||
(fetchurl {
|
||||
@@ -120,14 +169,13 @@ let
|
||||
latexmk
|
||||
]
|
||||
))
|
||||
# multiple-outputs.sh fails if $out is not defined
|
||||
(writeShellScript "force-tex-output.sh" ''
|
||||
out="''${tex-}"
|
||||
'')
|
||||
writableTmpDirAsHomeHook # Need a writable $HOME for latexmk
|
||||
];
|
||||
|
||||
# multiple-outputs.sh fails if $out is not defined
|
||||
preHook = ''
|
||||
out="''${tex-}"
|
||||
'';
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
buildPhase = ''
|
||||
|
||||
@@ -153,7 +153,7 @@ Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plu
|
||||
|
||||
When the vim updater detects an nvim-treesitter update, it also runs [`nvim-treesitter/update.py $(nix-build -A vimPlugins.nvim-treesitter)`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/utils/update.py) to update the tree sitter grammars for `nvim-treesitter`.
|
||||
|
||||
Some plugins require overrides to function properly. Overrides are placed in [overrides.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/overrides.nix). Overrides are most often required when a plugin requires some dependencies, or extra steps are required during the build process. For example `deoplete-fish` requires both `deoplete-nvim` and `vim-fish`, and so the following override was added:
|
||||
Some plugins require overrides in order to function properly. Overrides are placed in [overrides.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/overrides.nix). Overrides are most often required when a plugin requires some dependencies, or extra steps are required during the build process. For example `deoplete-fish` requires both `deoplete-nvim` and `vim-fish`, and so the following override was added:
|
||||
|
||||
```nix
|
||||
{
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# Nixpkgs Manual {#nixpkgs-manual}
|
||||
# Nixpkgs Reference Manual {#nixpkgs-manual}
|
||||
## Version @MANUAL_VERSION@
|
||||
|
||||
```{=include=} chapters
|
||||
preface.chapter.md
|
||||
first-package.chapter.md
|
||||
```
|
||||
|
||||
```{=include=} parts
|
||||
@@ -18,10 +17,6 @@ contributing.md
|
||||
interoperability.md
|
||||
```
|
||||
|
||||
```{=include=} chapters
|
||||
languages-frameworks/index.md
|
||||
```
|
||||
|
||||
```{=include=} appendix html:into-file=//release-notes.html
|
||||
release-notes/release-notes.md
|
||||
```
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"open": []
|
||||
}
|
||||
@@ -10,7 +10,7 @@ The tarball archive needs to be downloaded manually, as the license agreements o
|
||||
|
||||
The [self-service](https://support.citrix.com/article/CTX200337) is an application for managing Citrix desktops and applications. Please note that this feature only works with at least `citrix_workspace_20_06_0` and later versions.
|
||||
|
||||
To set this up, you first have to [download the `.cr` file from the Netscaler Gateway](https://its.uiowa.edu/support/article/102186). After that, you can configure the `selfservice` like this:
|
||||
In order to set this up, you first have to [download the `.cr` file from the Netscaler Gateway](https://its.uiowa.edu/support/article/102186). After that, you can configure the `selfservice` like this:
|
||||
|
||||
```ShellSession
|
||||
$ storebrowse -C ~/Downloads/receiverconfig.cr
|
||||
@@ -19,7 +19,7 @@ $ selfservice
|
||||
|
||||
## Custom certificates {#sec-citrix-custom-certs}
|
||||
|
||||
The `Citrix Workspace App` in `nixpkgs` trusts several certificates [from the Mozilla database](https://curl.haxx.se/docs/caextract.html) by default. However, several companies using Citrix might require their own corporate certificate. On distros with imperative packaging, these certs can be stored easily in [`$ICAROOT`](https://citrix.github.io/receiver-for-linux-command-reference/), however, this directory is a store path in `nixpkgs`. To work around this issue, the package provides a simple mechanism to add custom certificates without rebuilding the entire package using `symlinkJoin`:
|
||||
The `Citrix Workspace App` in `nixpkgs` trusts several certificates [from the Mozilla database](https://curl.haxx.se/docs/caextract.html) by default. However, several companies using Citrix might require their own corporate certificate. On distros with imperative packaging, these certs can be stored easily in [`$ICAROOT`](https://citrix.github.io/receiver-for-linux-command-reference/), however, this directory is a store path in `nixpkgs`. In order to work around this issue, the package provides a simple mechanism to add custom certificates without rebuilding the entire package using `symlinkJoin`:
|
||||
|
||||
```nix
|
||||
with import <nixpkgs> { config.allowUnfree = true; };
|
||||
|
||||
@@ -89,7 +89,7 @@ Note that if the builder is running and you have created the above ssh conf file
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-22.11-darwin";
|
||||
darwin.url = "github:nix-darwin/nix-darwin/master";
|
||||
darwin.url = "github:lnl7/nix-darwin/master";
|
||||
darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ The Emacs package comes with some extra helpers to make it easier to configure.
|
||||
}
|
||||
```
|
||||
|
||||
You can install it like any other package via `nix-env -iA myEmacs`. However, this will only install those packages. It will not `configure` them for us. To do this, we need to provide a configuration file. Luckily, it is possible to do this from within Nix! By modifying the above example, we can make Emacs load a custom config file. The key is to create a package that provides a `default.el` file in `/share/emacs/site-start/`. Emacs knows to load this file automatically when it starts. Similarly, for `early-init.el`, you can create a package that provides an `early-default.el` file in `/share/emacs/site-start/`.
|
||||
You can install it like any other package via `nix-env -iA myEmacs`. However, this will only install those packages. It will not `configure` them for us. To do this, we need to provide a configuration file. Luckily, it is possible to do this from within Nix! By modifying the above example, we can make Emacs load a custom config file. The key is to create a package that provides a `default.el` file in `/share/emacs/site-start/`. Emacs knows to load this file automatically when it starts.
|
||||
|
||||
```nix
|
||||
{
|
||||
|
||||
@@ -25,7 +25,6 @@ etc-files.section.md
|
||||
nginx.section.md
|
||||
nrfutil.section.md
|
||||
opengl.section.md
|
||||
packer.section.md
|
||||
shell-helpers.section.md
|
||||
python-tree-sitter.section.md
|
||||
treefmt.section.md
|
||||
|
||||
@@ -119,10 +119,11 @@ $ pkgs/os-specific/linux/kernel/update.sh
|
||||
The change gets submitted like this:
|
||||
|
||||
* File a PR against `staging-nixos`.
|
||||
* Add a `backport staging-nixos-XX.XX` label for an automated backport.
|
||||
* Add a `backport release-XX.XX` label for an automated backport.
|
||||
We don't expect many other changes on that branch to require a backport, hence there's no such branch for stable.
|
||||
By using an additional PR, we get the automatic backport against stable without manual cherry-picks.
|
||||
* Merge into `staging-nixos` or `staging-nixos-XX.XX`.
|
||||
* File as PR from `staging-nixos` against `master` or `staging-nixos-XX.XX` against `release-xx.xx`.
|
||||
* Merge into `staging-nixos`.
|
||||
* File as PR from `staging-nixos` against `master`.
|
||||
* When all status checks are green, merge.
|
||||
|
||||
### Add a new (major) version of the Linux kernel {#sec-linux-add-new-kernel-version}
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
# Packer {#sec-packer}
|
||||
|
||||
[Packer](https://www.packer.io) is a tool for creating identical machine images
|
||||
for multiple platforms from a single source configuration.
|
||||
|
||||
## Using Packer with plugins {#sec-packer-with-plugins}
|
||||
|
||||
Packer's functionality is extended through
|
||||
[plugins](https://developer.hashicorp.com/packer/docs/plugins). Rather than
|
||||
letting Packer download plugins at runtime, you can build a Packer wrapper that
|
||||
bundles the plugins you need with `packer.withPlugins`.
|
||||
|
||||
`packer.withPlugins` takes a function that receives the set of available plugins
|
||||
and returns the list of plugins to include:
|
||||
|
||||
```nix
|
||||
packer.withPlugins (ps: [ ps.docker ])
|
||||
```
|
||||
|
||||
This produces a `packer` executable wrapped with the `PACKER_PLUGIN_PATH`
|
||||
environment variable set, so the selected plugins are available without a
|
||||
separate `packer plugins install` step.
|
||||
|
||||
For example, to get a development shell with Packer and the Docker plugin:
|
||||
|
||||
```nix
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
}:
|
||||
|
||||
pkgs.mkShell {
|
||||
packages = [
|
||||
(pkgs.packer.withPlugins (ps: [ ps.docker ]))
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
Multiple plugins can be selected at once:
|
||||
|
||||
```nix
|
||||
packer.withPlugins (ps: [
|
||||
ps.docker
|
||||
ps.qemu
|
||||
])
|
||||
```
|
||||
|
||||
## Listing available plugins {#sec-packer-list-plugins}
|
||||
|
||||
The packaged plugins are exposed as the `packer.plugins` attribute set. To list
|
||||
every plugin available in your version of Nixpkgs, query its attribute names:
|
||||
|
||||
```ShellSession
|
||||
$ nix eval nixpkgs#packer.plugins --apply builtins.attrNames
|
||||
[ "docker" "qemu" ]
|
||||
```
|
||||
|
||||
Without flakes:
|
||||
|
||||
```ShellSession
|
||||
$ nix-env -f '<nixpkgs>' -qaP -A packer.plugins
|
||||
packer.plugins.docker packer-plugin-docker-1.1.2
|
||||
packer.plugins.qemu packer-plugin-qemu-1.1.4
|
||||
```
|
||||
|
||||
The attribute name (for example `docker` or `qemu`) is what you pass to
|
||||
`packer.withPlugins`.
|
||||
|
||||
Notes:
|
||||
|
||||
- `mkPackerPlugin` currently only supports `fetchFromGitHub` as the fetcher.
|
||||
@@ -22,7 +22,7 @@ rxvt-unicode.override {
|
||||
|
||||
If the `configure` function returns an attrset without the `plugins` attribute, `availablePlugins` will be used automatically.
|
||||
|
||||
To add plugins but also keep all default plugins installed, it is possible to use the following method:
|
||||
In order to add plugins but also keep all default plugins installed, it is possible to use the following method:
|
||||
|
||||
```nix
|
||||
rxvt-unicode.override {
|
||||
|
||||
@@ -39,7 +39,7 @@ weechat.override {
|
||||
}
|
||||
```
|
||||
|
||||
To also keep all default plugins installed, it is possible to use the following method:
|
||||
In order to also keep all default plugins installed, it is possible to use the following method:
|
||||
|
||||
```nix
|
||||
weechat.override {
|
||||
|
||||
@@ -42,7 +42,7 @@ shows the status of tests for the `nixpkgs-unstable` channel.
|
||||
|
||||
The tests are conducted by a cluster called [Hydra](https://nixos.org/hydra/),
|
||||
which also builds binary packages from the Nix expressions in Nixpkgs for
|
||||
`x86_64-linux`, `aarch64-linux`, and `aarch64-darwin`.
|
||||
`x86_64-linux`, `aarch64-linux`, `x86_64-darwin` and `aarch64-darwin`.
|
||||
The binaries are made available via a [binary cache](https://cache.nixos.org).
|
||||
|
||||
The current Nix expressions of the channels are available in the
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
"chap-build-helpers-finalAttrs": [
|
||||
"index.html#chap-build-helpers-finalAttrs"
|
||||
],
|
||||
"chap-first-package": [
|
||||
"index.html#chap-first-package"
|
||||
],
|
||||
"chap-release-notes": [
|
||||
"release-notes.html#chap-release-notes"
|
||||
],
|
||||
@@ -108,15 +105,6 @@
|
||||
"ex-build-helpers-extendMkDerivation": [
|
||||
"index.html#ex-build-helpers-extendMkDerivation"
|
||||
],
|
||||
"ex-build-helpers-extendMkDerivation-transformDrv-wrapper": [
|
||||
"index.html#ex-build-helpers-extendMkDerivation-transformDrv-wrapper"
|
||||
],
|
||||
"ex-first-package-go": [
|
||||
"index.html#ex-first-package-go"
|
||||
],
|
||||
"ex-modularServiceCompliance-nixos": [
|
||||
"index.html#ex-modularServiceCompliance-nixos"
|
||||
],
|
||||
"ex-pkgs-replace-vars": [
|
||||
"index.html#ex-pkgs-replace-vars",
|
||||
"index.html#ex-pkgs-substituteAll",
|
||||
@@ -125,9 +113,6 @@
|
||||
"ex-pkgs-replace-vars-with": [
|
||||
"index.html#ex-pkgs-replace-vars-with"
|
||||
],
|
||||
"ex-pnpm-build-hook": [
|
||||
"index.html#ex-pnpm-build-hook"
|
||||
],
|
||||
"ex-shfmt": [
|
||||
"index.html#ex-shfmt"
|
||||
],
|
||||
@@ -140,9 +125,6 @@
|
||||
"ex-writeShellApplication": [
|
||||
"index.html#ex-writeShellApplication"
|
||||
],
|
||||
"first-package-go": [
|
||||
"index.html#first-package-go"
|
||||
],
|
||||
"friction-graphics": [
|
||||
"index.html#friction-graphics"
|
||||
],
|
||||
@@ -236,9 +218,6 @@
|
||||
"neovim-luarocks-based-plugins": [
|
||||
"index.html#neovim-luarocks-based-plugins"
|
||||
],
|
||||
"neovim-plugin-treesitter-wasm": [
|
||||
"index.html#neovim-plugin-treesitter-wasm"
|
||||
],
|
||||
"nixpkgs-manual": [
|
||||
"index.html#nixpkgs-manual"
|
||||
],
|
||||
@@ -367,33 +346,6 @@
|
||||
"pkgs.treefmt.withConfig": [
|
||||
"index.html#pkgs.treefmt.withConfig"
|
||||
],
|
||||
"pnpm-build-hook": [
|
||||
"index.html#pnpm-build-hook"
|
||||
],
|
||||
"pnpm-build-hook-build-flags": [
|
||||
"index.html#pnpm-build-hook-build-flags"
|
||||
],
|
||||
"pnpm-build-hook-code-snippet": [
|
||||
"index.html#pnpm-build-hook-code-snippet"
|
||||
],
|
||||
"pnpm-build-hook-dont": [
|
||||
"index.html#pnpm-build-hook-dont"
|
||||
],
|
||||
"pnpm-build-hook-exclusive-variables": [
|
||||
"index.html#pnpm-build-hook-exclusive-variables"
|
||||
],
|
||||
"pnpm-build-hook-flags": [
|
||||
"index.html#pnpm-build-hook-flags"
|
||||
],
|
||||
"pnpm-build-hook-script": [
|
||||
"index.html#pnpm-build-hook-script"
|
||||
],
|
||||
"pnpm-build-hook-variables": [
|
||||
"index.html#pnpm-build-hook-variables"
|
||||
],
|
||||
"pnpm-build-hook-honored-variables": [
|
||||
"index.html#pnpm-build-hook-honored-variables"
|
||||
],
|
||||
"preface": [
|
||||
"index.html#preface"
|
||||
],
|
||||
@@ -460,9 +412,6 @@
|
||||
"sec-meta-identifiers-cpe": [
|
||||
"index.html#sec-meta-identifiers-cpe"
|
||||
],
|
||||
"sec-meta-identifiers-purl": [
|
||||
"index.html#sec-meta-identifiers-purl"
|
||||
],
|
||||
"sec-modify-via-packageOverrides": [
|
||||
"index.html#sec-modify-via-packageOverrides"
|
||||
],
|
||||
@@ -484,30 +433,6 @@
|
||||
"chap-overlays": [
|
||||
"index.html#chap-overlays"
|
||||
],
|
||||
"sec-nixpkgs-release-26.11": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.11"
|
||||
],
|
||||
"sec-nixpkgs-release-26.11-highlights": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.11-highlights"
|
||||
],
|
||||
"sec-nixpkgs-release-26.11-incompatibilities": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.11-incompatibilities"
|
||||
],
|
||||
"sec-nixpkgs-release-26.11-lib": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.11-lib"
|
||||
],
|
||||
"sec-nixpkgs-release-26.11-lib-breaking": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.11-lib-breaking"
|
||||
],
|
||||
"sec-nixpkgs-release-26.11-lib-deprecations": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.11-lib-deprecations"
|
||||
],
|
||||
"sec-nixpkgs-release-26.11-lib-additions-improvements": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.11-lib-additions-improvements"
|
||||
],
|
||||
"sec-nixpkgs-release-26.11-notable-changes": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.11-notable-changes"
|
||||
],
|
||||
"sec-nixpkgs-release-26.05": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.05"
|
||||
],
|
||||
@@ -638,15 +563,6 @@
|
||||
"chap-overrides": [
|
||||
"index.html#chap-overrides"
|
||||
],
|
||||
"sec-packer": [
|
||||
"index.html#sec-packer"
|
||||
],
|
||||
"sec-packer-list-plugins": [
|
||||
"index.html#sec-packer-list-plugins"
|
||||
],
|
||||
"sec-packer-with-plugins": [
|
||||
"index.html#sec-packer-with-plugins"
|
||||
],
|
||||
"sec-pkg-override": [
|
||||
"index.html#sec-pkg-override"
|
||||
],
|
||||
@@ -929,18 +845,6 @@
|
||||
"glibcxxassertions": [
|
||||
"index.html#glibcxxassertions"
|
||||
],
|
||||
"tester-modularServiceCompliance": [
|
||||
"index.html#tester-modularServiceCompliance"
|
||||
],
|
||||
"tester-modularServiceCompliance-inputs": [
|
||||
"index.html#tester-modularServiceCompliance-inputs"
|
||||
],
|
||||
"tester-modularServiceCompliance-manual": [
|
||||
"index.html#tester-modularServiceCompliance-manual"
|
||||
],
|
||||
"tester-modularServiceCompliance-return": [
|
||||
"index.html#tester-modularServiceCompliance-return"
|
||||
],
|
||||
"tester-shfmt": [
|
||||
"index.html#tester-shfmt"
|
||||
],
|
||||
@@ -995,9 +899,6 @@
|
||||
"var-go-buildTestBinaries": [
|
||||
"index.html#var-go-buildTestBinaries"
|
||||
],
|
||||
"var-meta-donationPage": [
|
||||
"index.html#var-meta-donationPage"
|
||||
],
|
||||
"var-meta-identifiers-cpe": [
|
||||
"index.html#var-meta-identifiers-cpe"
|
||||
],
|
||||
@@ -1007,15 +908,6 @@
|
||||
"var-meta-identifiers-possibleCPEs": [
|
||||
"index.html#var-meta-identifiers-possibleCPEs"
|
||||
],
|
||||
"var-meta-identifiers-purl": [
|
||||
"index.html#var-meta-identifiers-purl"
|
||||
],
|
||||
"var-meta-identifiers-purlParts": [
|
||||
"index.html#var-meta-identifiers-purlParts"
|
||||
],
|
||||
"var-meta-identifiers-purls": [
|
||||
"index.html#var-meta-identifiers-purls"
|
||||
],
|
||||
"var-meta-teams": [
|
||||
"index.html#var-meta-teams"
|
||||
],
|
||||
@@ -1124,15 +1016,9 @@
|
||||
"tar-files": [
|
||||
"index.html#tar-files"
|
||||
],
|
||||
"writableTmpDirAsHomeHook": [
|
||||
"index.html#writableTmpDirAsHomeHook"
|
||||
],
|
||||
"x86_64-darwin-26.05": [
|
||||
"release-notes.html#x86_64-darwin-26.05"
|
||||
],
|
||||
"x86_64-darwin-26.11": [
|
||||
"release-notes.html#x86_64-darwin-26.11"
|
||||
],
|
||||
"zip-files": [
|
||||
"index.html#zip-files"
|
||||
],
|
||||
@@ -2920,10 +2806,6 @@
|
||||
"setup-hook-mpi-check": [
|
||||
"index.html#setup-hook-mpi-check"
|
||||
],
|
||||
"setup-hook-check-phase-thread-limit": [
|
||||
"index.html#setup-hook-check-phase-thread-limit",
|
||||
"index.html#setup-hook-omp-check"
|
||||
],
|
||||
"ninja": [
|
||||
"index.html#ninja"
|
||||
],
|
||||
@@ -3167,28 +3049,19 @@
|
||||
"available-versions-and-deprecations-schedule": [
|
||||
"index.html#available-versions-and-deprecations-schedule"
|
||||
],
|
||||
"erlang": [
|
||||
"index.html#erlang"
|
||||
],
|
||||
"elixir": [
|
||||
"index.html#elixir"
|
||||
],
|
||||
"beam-structure": [
|
||||
"index.html#beam-structure"
|
||||
],
|
||||
"beam-build-tools": [
|
||||
"index.html#beam-build-tools",
|
||||
"build-tools": [
|
||||
"index.html#build-tools"
|
||||
],
|
||||
"beam-build-tools-rebar3": [
|
||||
"index.html#beam-build-tools-rebar3",
|
||||
"build-tools-rebar3": [
|
||||
"index.html#build-tools-rebar3"
|
||||
],
|
||||
"beam-build-tools-erlangmk": [
|
||||
"index.html#beam-build-tools-erlangmk"
|
||||
],
|
||||
"beam-build-tools-mix": [
|
||||
"index.html#beam-build-tools-mix",
|
||||
"build-tools-other": [
|
||||
"index.html#build-tools-other"
|
||||
],
|
||||
"how-to-install-beam-packages": [
|
||||
@@ -3206,9 +3079,6 @@
|
||||
"packaging-erlang-applications": [
|
||||
"index.html#packaging-erlang-applications"
|
||||
],
|
||||
"packaging-elixir-applications": [
|
||||
"index.html#packaging-elixir-applications"
|
||||
],
|
||||
"rebar3-packages": [
|
||||
"index.html#rebar3-packages"
|
||||
],
|
||||
@@ -4018,9 +3888,6 @@
|
||||
"maven": [
|
||||
"index.html#maven"
|
||||
],
|
||||
"maven-4": [
|
||||
"index.html#maven-4"
|
||||
],
|
||||
"maven-buildmavenpackage": [
|
||||
"index.html#maven-buildmavenpackage"
|
||||
],
|
||||
@@ -4561,10 +4428,12 @@
|
||||
"sec-language-texlive": [
|
||||
"index.html#sec-language-texlive"
|
||||
],
|
||||
"sec-language-texlive-user-guide": [
|
||||
"index.html#sec-language-texlive-user-guide",
|
||||
"sec-language-texlive-user-guide-experimental": [
|
||||
"index.html#sec-language-texlive-user-guide-experimental"
|
||||
],
|
||||
"sec-language-texlive-user-guide": [
|
||||
"index.html#sec-language-texlive-user-guide"
|
||||
],
|
||||
"sec-language-texlive-custom-packages": [
|
||||
"index.html#sec-language-texlive-custom-packages"
|
||||
],
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
This section lists the release notes for each stable version of Nixpkgs and the current unstable revision.
|
||||
|
||||
```{=include=} sections
|
||||
rl-2611.section.md
|
||||
rl-2605.section.md
|
||||
rl-2511.section.md
|
||||
rl-2505.section.md
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
- `base16-builder` node package has been removed due to lack of upstream maintenance.
|
||||
|
||||
- `budgie-desktop` has been updated to [10.9.4](https://github.com/BuddiesOfBudgie/budgie-desktop/releases/tag/v10.9.4). This changes `XDG_CURRENT_DESKTOP` from `Budgie:GNOME` to `Budgie` and contains ABI bumps for libpeas2 migration.
|
||||
- `budgie-desktop` has been updated [10.9.4](https://github.com/BuddiesOfBudgie/budgie-desktop/releases/tag/v10.9.4). This changes `XDG_CURRENT_DESKTOP` from `Budgie:GNOME` to `Budgie` and contains ABI bumps for libpeas2 migration.
|
||||
|
||||
- `buildGoModule` removes the compatibility layer of `CGO_ENABLED` not specified via `env`.
|
||||
Specifying `CGO_ENABLED` directly now results in an error.
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
- `cardboard` has been removed due to the package having been broken since at least November 2024.
|
||||
|
||||
- `carla` no longer supports `gtk2` override.
|
||||
- `carla` no longer support `gtk2` override.
|
||||
|
||||
- `chatgpt-retrieval-plugin` has been removed due to the package having been broken since at least November 2024.
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
|
||||
- `linux` and all other Linux kernel packages have moved all in-tree kernel modules into a new `modules` output.
|
||||
|
||||
- `lxde` scope has been removed, and its packages have been moved to the top-level.
|
||||
- `lxde` scope has been removed, and its packages have been moved the top-level.
|
||||
|
||||
- `mariadb` now defaults to `mariadb_114` instead of `mariadb_1011`, meaning the default version was upgraded from 10.11.x to 11.4.x. See the [upgrade notes](https://mariadb.com/kb/en/upgrading-from-mariadb-10-11-to-mariadb-11-4/) for potential issues.
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
- `pcp` has been removed because the upstream repo was archived and it hasn't been updated since 2021.
|
||||
|
||||
- `podofo` has been updated from `0.9.8` to `1.0.0`. These releases are by nature very incompatible due to major API changes. The legacy versions can be found under `podofo_0_10` and `podofo_0_9`.
|
||||
Changelog: <https://github.com/podofo/podofo/blob/1.0.0/CHANGELOG.md>, API-Migration-Guide: <https://github.com/podofo/podofo/blob/1.0.0/API-MIGRATION.md>.
|
||||
Changelog: https://github.com/podofo/podofo/blob/1.0.0/CHANGELOG.md, API-Migration-Guide: https://github.com/podofo/podofo/blob/1.0.0/API-MIGRATION.md.
|
||||
|
||||
- `privatebin` has been updated to `2.0.0`. This release changes configuration defaults including switching the template and removing legacy features. See the [v2.0.0 changelog entry](https://github.com/PrivateBin/PrivateBin/releases/tag/2.0.0) for details on how to upgrade.
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
|
||||
- `sublime-music` has been removed because upstream has announced it is no longer maintained. Upstream suggests using `supersonic` instead.
|
||||
|
||||
- Support for bootstrapping native GHC compilers on 32‐bit ARM and little‐endian 64-bit PowerPC has been dropped.
|
||||
- Support for bootstrapping native GHC compilers on 32‐bit ARM and little‐endian 64‐bit PowerPC has been dropped.
|
||||
The latter was probably broken anyway.
|
||||
If there is interest in restoring support for these architectures, it should be possible to cross‐compile a bootstrap GHC binary.
|
||||
|
||||
@@ -359,7 +359,7 @@ and [release notes for v18](https://goteleport.com/docs/changelog/#1800-070325).
|
||||
|
||||
- `ffmpeg_8`, `ffmpeg_8-headless`, and `ffmpeg_8-full` have been added. The default version of FFmpeg is now `ffmpeg_8`. You can install previous versions from package attributes such as `ffmpeg_7`.
|
||||
|
||||
- `forgejo-runner` has been upgraded to version 11, which brings a license change from MIT to GPLv3-or-later.
|
||||
- `forgejo-runner` upgrading to version 11 brings a license change from MIT to GPLv3-or-later.
|
||||
|
||||
- GIMP now defaults to version 3. Use `gimp2` for the old version.
|
||||
|
||||
@@ -405,6 +405,8 @@ and [release notes for v18](https://goteleport.com/docs/changelog/#1800-070325).
|
||||
|
||||
- `prl-tools` has been moved out of `linuxPackages` because Parallels Guest Tools become driverless since 26.1.0.
|
||||
|
||||
- `searx` was updated to use `envsubst` instead of `sed` for parsing secrets from environment variables.
|
||||
|
||||
- `sftpman` has been updated to version 2, a rewrite in Rust which is mostly backward compatible but does include some changes to the CLI.
|
||||
For more information, [check the project's README](https://github.com/spantaleev/sftpman-rs#is-sftpman-v2-compatible-with-sftpman-v1).
|
||||
|
||||
@@ -429,7 +431,7 @@ and [release notes for v18](https://goteleport.com/docs/changelog/#1800-070325).
|
||||
|
||||
- The `dockerTools.streamLayeredImage` builder now uses a better algorithm for generating layered docker images, such that much more sharing is possible when the number of store paths exceeds the layer limit. It gives each of the largest store paths its own layer and adds dependencies to those layers when they aren't used elsewhere.
|
||||
|
||||
- The `open-webui` package's postgres support has been moved to optional dependencies to comply with upstream changes in 0.6.26.
|
||||
- The `open-webui` package's postgres support have been moved to optional dependencies to comply with upstream changes in 0.6.26.
|
||||
|
||||
- The systemd initrd will now respect `x-systemd.wants` and `x-systemd.requires` for reliably unlocking multi-disk bcachefs volumes.
|
||||
|
||||
@@ -438,8 +440,6 @@ and [release notes for v18](https://goteleport.com/docs/changelog/#1800-070325).
|
||||
- Packages using `versionCheckHook` that previously relied solely on `pname` to locate the program used to version check, but have a differing `meta.mainProgram` entry, might now fail.
|
||||
|
||||
- `waydroid-nftables` is a new variant of `waydroid` that supports nftables instead of iptables.
|
||||
|
||||
- `searx` was updated to use `envsubst` instead of `sed` for parsing secrets from environment variables.
|
||||
If your previous configuration included a secret reference like `server.secret_key = "@SEARX_SECRET_KEY@"`, you must migrate to the new envsubst syntax: `server.secret_key = "$SEARX_SECRET_KEY"`.
|
||||
|
||||
## Nixpkgs Library {#sec-nixpkgs-release-25.11-lib}
|
||||
@@ -470,7 +470,7 @@ and [release notes for v18](https://goteleport.com/docs/changelog/#1800-070325).
|
||||
|
||||
- `lib.sources.pathType`, `lib.sources.pathIsDirectory` and `lib.sources.pathIsRegularFile` have been replaced by `lib.filesystem.pathType`, `lib.filesystem.pathIsDirectory` and `lib.filesystem.pathIsRegularFile` respectively.
|
||||
|
||||
- `lib.strings.isCoercibleToString` has been replaced in favor of either `lib.strings.isStringLike` or `lib.strings.isConvertibleWithToString`. Only use the latter if it needs to return true for null, numbers, booleans, or a list of those.
|
||||
- `lib.strings.isCoercibleToString` has been in favor of either `lib.strings.isStringLike` or `lib.strings.isConvertibleWithToString`. Only use the latter if it needs to return true for null, numbers, booleans, or a list of those.
|
||||
|
||||
- `lib.types.string` has been removed. See [this pull request](https://github.com/NixOS/nixpkgs/pull/66346) for better alternative types like `lib.types.str`.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Nixpkgs 26.05 ("Yarara", 2026.05/30) {#sec-nixpkgs-release-26.05}
|
||||
# Nixpkgs 26.05 ("Yarara", 2026.05/??) {#sec-nixpkgs-release-26.05}
|
||||
|
||||
## Highlights {#sec-nixpkgs-release-26.05-highlights}
|
||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||
@@ -6,44 +6,6 @@
|
||||
- GCC has been updated from GCC 14 to GCC 15.
|
||||
This introduces some backwards incompatible changes; Refer to the [upstream porting guide](https://gcc.gnu.org/gcc-15/porting_to.html) for details.
|
||||
|
||||
- `glibc` has been updated to version 2.42.
|
||||
|
||||
This version no longer makes the stack executable when a shared library requires this. A symptom
|
||||
is an error like
|
||||
|
||||
> cannot enable executable stack as shared object requires: Invalid argument
|
||||
|
||||
This is usually a bug. Please consider reporting it to the software maintainers.
|
||||
|
||||
In a lot of cases, the library requires the execstack by mistake only. The following workarounds exist:
|
||||
|
||||
* When building the shared library in question from source, use the following linker flags to force turning off the
|
||||
executable flag:
|
||||
|
||||
```nix
|
||||
mkDerivation {
|
||||
# …
|
||||
|
||||
env.NIX_LDFLAGS = "-z,noexecstack";
|
||||
}
|
||||
```
|
||||
|
||||
* If the sources are not available, the execstack-flag can be cleared with `patchelf`:
|
||||
|
||||
```
|
||||
patchelf --clear-execstack binary-only.so
|
||||
```
|
||||
|
||||
* If the shared library to be loaded actually requires an executable stack and it isn't turned
|
||||
on by the application loading it, you may force allowing that behavior by setting the
|
||||
following environment variable:
|
||||
|
||||
```
|
||||
GLIBC_TUNABLES=glibc.rtld.execstack=2
|
||||
```
|
||||
|
||||
**Do not set this globally!** This makes your setup inherently less secure.
|
||||
|
||||
- Node.js default version has been updated from 22 LTS to 24 LTS.
|
||||
This introduces some breaking changes; Refer to the [upstream migration article](https://nodejs.org/en/blog/migrations/v22-to-v24) for details.
|
||||
|
||||
@@ -112,8 +74,6 @@
|
||||
|
||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||
|
||||
- `mdbook-linkcheck` has been removed as it is unmaintained and incompatible with the latest version of `mdbook`. Users can instead migrate to `mdbook-linkcheck2`.
|
||||
|
||||
- The `nodePackages` package set has been removed entirely from nixpkgs. This package set was created to ease the maintenance burden of maintaining lots of
|
||||
NodeJS-based packages within nixpkgs, but became a burden itself. Over the past several releases, there has been a focus on removing it in favor of the more modern nixpkgs packaging strategies.
|
||||
After a long time, this package set has been deprecated and removed. If you are using its package set in your own config, please use the top-level packages instead.(i.e `pkgs.package-name` instead of `pkgs.nodePackages.package-name`).
|
||||
@@ -129,7 +89,7 @@
|
||||
|
||||
- `yarn2nix`/`yarn2nix-moretea` and its tooling(`mkYarnPackage`, `mkYarnModules`, and `fixup_yarn_lock`) have been removed as they were unmaintainable in nixpkgs. If you want to build with Yarn V1 going forward, use the hooks instead(`yarnBuildHook`, `yarnConfigHook`, and `yarnInstallHook`). See the yarn v1 documentation in the nixpkgs manual for more details.
|
||||
|
||||
- `albert` has been updated to version 34.0.5. This release redesigns the query system to support stateful asynchronous handlers and infinite scrolling, and adds internationalized tokenization.
|
||||
- `albert` has been updated to the version 34.0.5. This release redesigns the query system to support stateful asynchronous handlers and infinite scrolling, and adds internationalized tokenization.
|
||||
This update introduces several breaking changes: the Python plugin interface is now v5.0, the `PATH` plugin has been renamed to `Commandline`, and the QStylesheets-based widgets box model frontend has been removed.
|
||||
For more information read the [changelog for 34.0.0](https://albertlauncher.github.io/2026/01/19/albert-v34.0.0-released/).
|
||||
|
||||
@@ -145,34 +105,17 @@
|
||||
|
||||
- `spoof` has been removed, as there are many issues upstream with it working on modern OS versions, and it appears to be unmaintained.
|
||||
|
||||
- `duckstation` package has been removed, as it was requested by upstream and build sources were changed to be incompatible with NixOS.
|
||||
- `duckstation` package has been removed, as it was requested by upstream and build source were changed to be incompatible with NixOS.
|
||||
|
||||
- `nodePackages.coc-go` and `nodePackages.coc-tsserver`, along with their vim plugins, have been removed from nixpkgs due to being unmaintained.
|
||||
|
||||
- `nodePackages.wavedrom-cli` has been removed, as it was unmaintained within nixpkgs.
|
||||
|
||||
- MATE packages have been moved to top level (e.g. if you previously added `pkgs.mate.caja` to `environment.systemPackages`, you will need to change it to `pkgs.caja`).
|
||||
|
||||
- `kratos` has been updated from 1.3.1 to [25.4.0](https://github.com/ory/kratos/releases/tag/v25.4.0). Upstream switched to a new versioning scheme (year.major.minor). Notable breaking changes:
|
||||
|
||||
- The `migrate sql` CLI command is now `migrate sql up`
|
||||
- OIDC registration validation errors are now placed in the `default` node group instead of `oidc`
|
||||
- Failed OIDC account linking returns HTTP 400 instead of 200
|
||||
|
||||
- `pdns` has been updated to version [v5.0.x](https://doc.powerdns.com/authoritative/changelog/5.0.html), which introduces breaking changes. Check out the [Upgrade Notes](https://doc.powerdns.com/authoritative/upgrading.html#to-5-0-0) for details.
|
||||
|
||||
- `geph` package's built-in GUI `geph5-client-gui` has been [removed](https://github.com/geph-official/geph5/commit/f2221fb8386312daf2cef05483ebb353ff48bdb4) by the upstream. All users who wish to continue using the GUI should install the `gephgui-wry`, which is consistent with the official release version.
|
||||
|
||||
- `xfsprogs` was updated to version 6.18.0, which enables parent pointers and exchange-range by default. Upstream recommends not to use these features with kernels older than 6.18.
|
||||
GRUB2 is likely unable to boot from filesystems with these features enabled.
|
||||
|
||||
- `lunarvim` package has been removed, as it was abandoned upstream and relied on an old version of `neovim` to work properly.
|
||||
|
||||
- `requireFile` now treats any `message` or `url` argument as a literal string, rather than subjecting it to Bash here-doc expansion. This allows including strings like `$PWD` in the message without needing to know about and handle the undocumented Bash expansion.
|
||||
|
||||
- `nodePackages.browserify` has been removed, as it was unmaintained within nixpkgs.
|
||||
|
||||
- `command-not-found` package will be enabled by default if the source of nixpkgs contains the file `programs.sqlite`. This is the case if a nixpkgs tarball from <https://channels.nixos.org> is used. This usage will also make the database of `command-not-found` stateless.
|
||||
- `command-not-found` package will be enabled by default if the source of nixpkgs contains the file `programs.sqlite`. This is the case if a nixpkgs tarball from https://channels.nixos.org is used. This usage will also make the database of `command-not-found` stateless.
|
||||
|
||||
- `nodePackages.sass` has been removed, as it was unmaintained within nixpkgs.
|
||||
|
||||
@@ -183,7 +126,9 @@
|
||||
- `kanata` now requires `karabiner-dk` version 6.0+ or later.
|
||||
The package has been updated to use the new `karabiner-dk` package and the `darwinDriver` output stays at the version defined in the package.
|
||||
|
||||
- Keycloak has been updated to 26.6.X, bringing a lot of new features like federated client authentication, JWT authorization grants, workflows and the ability to do
|
||||
- Reloading or restarting systemd units from the NixOS activation script is deprecated, and will be removed in NixOS 26.11. This deprecation is part of a bigger effort to deprecate activation scripts altogether, which will take place over several releases. There are no in-tree usages of the now-deprecated reload/restart functionality.
|
||||
|
||||
- Keycloak has been updated to 26.6.X, bringing a lot new features like federated client authentication, JWT authorization grants, workflows and the ability to do
|
||||
zero-downtime patch releases. Read more about [all the exciting new capabilities in keycloak 26.6 here](https://github.com/keycloak/keycloak/releases/tag/26.6.0)
|
||||
and [consult the migration guide to 26.6](https://www.keycloak.org/docs/latest/upgrading/index.html#migrating-to-26-6-0) to find out whether this is a breaking
|
||||
change for your keycloak instance.
|
||||
@@ -212,19 +157,21 @@
|
||||
This release contains breaking changes, see [Upgrading to Vinyl Cache 9.0](https://vinyl-cache.org/docs/9.0/whats-new/upgrading-9.0.html).
|
||||
The `varnish-modules` project is currently not packaged for Vinyl Cache, as it is incompatible.
|
||||
|
||||
- `eslint` has been updated from version 9 to version 10. Please see <https://eslint.org/blog/2026/02/eslint-v10.0.0-released/> for details about the breaking changes included in the update.
|
||||
- `eslint` has been updated from version 9 to version 10. Please see https://eslint.org/blog/2026/02/eslint-v10.0.0-released/ for details about the breaking changes included in the update.
|
||||
|
||||
- `minio` has been abandoned by upstream and security issues won't be fixed. `minio_legacy_fs` has also been removed. Both are scheduled for full removal in 26.11. Users should migrate to alternatives such as Garage, SeaweedFS, or Ceph. S3-compatible clients such as rclone can be used to move data.
|
||||
- `minio` has been abandoned by upstream and security issues won't be fixed. It is scheduled to be removed for 26.11. Users should migrate to alternatives such as Garage, SeaweedFS, or Ceph. S3-compatible clients such as rclone can be used to move data.
|
||||
|
||||
- `mercure` has been updated to `0.21.4` (or later). Version [0.21.0](https://github.com/dunglas/mercure/releases/v0.21.0) and [0.21.2](https://github.com/dunglas/mercure/releases/tag/v0.21.2) introduce breaking changes to the package.
|
||||
`minio_legacy_fs` has been removed. Users should migrate to alternatives such as Garage, SeaweedFS, or Ceph. S3-compatible clients such as rclone can be used to move data.
|
||||
|
||||
- `mozc` and `mozc-ut` no longer contain the IBus front-end, which is now provided by `ibus-engines.mozc` and `ibus-engines.mozc-ut`.
|
||||
- `mercure` has been update to `0.21.4` (or later). Version [0.21.0](https://github.com/dunglas/mercure/releases/v0.21.0) and [0.21.2](https://github.com/dunglas/mercure/releases/tag/v0.21.2) introduce breaking changes to the package.
|
||||
|
||||
- `mozc` and `mozc-ut` no longer contains the IBus front-end, which are now provided by `ibus-engines.mozc` and `ibus-engines.mozc-ut`.
|
||||
|
||||
- `nemorosa` has been updated from `0.4.3` to `0.5.0`. Version [0.5.0](https://github.com/KyokoMiki/nemorosa/releases/tag/0.5.0) introduced breaking changes to the package configuration.
|
||||
|
||||
- `n8n` has been updated to version 2. You can find the breaking changes here: <https://docs.n8n.io/2-0-breaking-changes/>.
|
||||
- `n8n` has been updated to version 2. You can find the breaking changes here: https://docs.n8n.io/2-0-breaking-changes/.
|
||||
|
||||
- `nomad` has been updated to v1.11. Refer to the [release note](https://developer.hashicorp.com/nomad/docs/release-notes/nomad/v1-11-x) for more details. Once a new Nomad version has started and upgraded its data directory, it generally cannot be downgraded to the previous version.
|
||||
- `nomad` has been updated to v1.11. Refer to the [release note](https://developer.hashicorp.com/nomad/docs/release-notes/nomad/v1-11-x) for more details. Once a new Nomad version has started and upgraded it's data directory, it generally cannot be downgraded to the previous version.
|
||||
|
||||
- The default NVIDIA drivers no longer support Maxwell (GTX 1xxx) or older GPUs. Pin the nvidia package to ` config.boot.kernelPackages.nvidiaPackages.legacy_580` for continued support.
|
||||
|
||||
@@ -232,26 +179,24 @@
|
||||
|
||||
- `iroh` has been removed and split up into `iroh-dns-server` and `iroh-relay`.
|
||||
|
||||
- The `xorg` package set has been deprecated, packages have moved to the top level.
|
||||
- the `xorg` package set has been deprecated, packages have moved to the top level.
|
||||
|
||||
- `python3Packages.buildPythonPackage` and `python3Packages.buildPythonApplication` now throw errors in the presence of `pytestFlagsArray`.
|
||||
Please use [`pytestFlags` and `(enabled|disabled)(TestPaths|Tests|TestMarks)`](#using-pytestcheckhook) instead.
|
||||
If modifying the Nix expression is not feasible, users can remediate the error by overriding `pytestFlagsArray` with `null` or `[ ]`.
|
||||
|
||||
- `python3Packages.pygame` has been renamed to `python3Packages.pygame-original`, the attribute `python3Packages.pygame` will from python 3.14 default to the more actively maintained `python3Packages.pygame-ce`.
|
||||
- `python3Packages.pygame` has been been renamed to `python3Packages.pygame-original`, the attribute `python3Packages.pygame` will from python 3.14 default to the more actively maintained `python3Packages.pygame-ce`
|
||||
|
||||
- `fastly` has been updated to major version 14. For more information, you can check the [release notes](https://github.com/fastly/cli/releases/tag/v14.0.0).
|
||||
- `fastly` has been updated to major version 14. For more information, you can check the [release notes](https://github.com/fastly/cli/releases/tag/v14.0.0)
|
||||
|
||||
- `peertube` has been updated from `7.3.0` to `8.0.2`, introducing several breaking changes.
|
||||
Some notable new features include channel collaboration and video player redesign with a new theme.
|
||||
For details on how to upgrade, see the `IMPORTANT NOTES` section of the [v8.0.0 CHANGELOG entry](https://docs.joinpeertube.org/CHANGELOG#v8-0-0).
|
||||
|
||||
- `python3Packages.gradio` has been updated to version 6. See upstream's migration guide at <https://www.gradio.app/main/guides/gradio-6-migration-guide>.
|
||||
- `python3Packages.gradio` has been updated to version 6. See upstream's migration guide at https://www.gradio.app/main/guides/gradio-6-migration-guide.
|
||||
|
||||
- `python3Packages.pikepdf` no longer builds with mupdf support by default, which may be nice in Jupyter and iPython. Build with `withMupdf = true` if this is required.
|
||||
|
||||
- `olive-editor` has been dropped as upstream development ceased and no longer builds.
|
||||
|
||||
- `python3Packages.django-mdeditor` has been removed, as it was unmaintained upstream and the latest release was vulnerable to a [critical security vulnerability](https://github.com/NixOS/nixpkgs/issues/515462).
|
||||
|
||||
- `vicinae` has been updated to v0.20. This includes, among several other breaking changes, a complete overhaul of the configuration system. For update instructions, see the [upstream configuration documentation](https://docs.vicinae.com/config#migration-from-v0-16-x-to-v0-17-x).
|
||||
@@ -269,12 +214,23 @@
|
||||
- `jetbrains.plugins.addPlugins` no longer supports plugin names or ID strings.
|
||||
You can still use `addPlugins` with plugin derivations, such as plugins packaged outside of Nixpkgs.
|
||||
|
||||
- The `programs.captive-browser` module no longer falls back on a setcap wrapper around udhcpc to discover your network's DNS server due to [GHSA-wc3r-c66x-8xmc](https://github.com/NixOS/nixpkgs/security/advisories/GHSA-wc3r-c66x-8xmc) (CVE-2026-25740). If you're using this module, you must either configure `programs.captive-browser.dhcp-dns` manually or enable one of NetworkManager, dhcpcd, or systemd-networkd.
|
||||
|
||||
- NetBox was updated to `>= 4.5.5`. Have a look at the breaking changes
|
||||
of the [4.5 release](https://github.com/netbox-community/netbox/releases/tag/v4.5.0),
|
||||
make the required changes to your database, if needed, then upgrade by setting `services.netbox.package = pkgs.netbox_4_5;` in your configuration.
|
||||
|
||||
- The `services.yggdrasil` module has been refactored with the following breaking changes:
|
||||
- The `services.yggdrasil.configFile` option has been removed. Configuration should now be specified directly via `services.yggdrasil.settings`.
|
||||
- The `services.yggdrasil.persistentKeys` option has been removed. To maintain persistent keys and IPv6 addresses across reboots, use `services.yggdrasil.settings.PrivateKeyPath` to securely load your private key from a file via systemd credentials. The private key must be in PEM format (PKCS #8).
|
||||
- Storing `PrivateKey` directly in `settings` is now explicitly forbidden to prevent keys from being stored world-readable in the Nix store.
|
||||
- If you previously used `configFile`, migrate your configuration to the `settings` option and extract the private key to a separate file referenced by `PrivateKeyPath`.
|
||||
- If you previously used `persistentKeys`, convert your keys to PEM format and store them in a secure location accessible only to root, then reference them via `PrivateKeyPath`.
|
||||
|
||||
- `pocket-id` has been updated to version 2 that contains [breaking changes](https://pocket-id.org/docs/setup/major-releases/migrate-v2).
|
||||
|
||||
- `services.xserver` will now throw an error if an X11 driver specified in `videoDriver(s)` cannot be found. Previously, unknown drivers would be silently ignored.
|
||||
|
||||
- `asio` (standalone version of `boost::asio`) has been updated from 1.24.0 to 1.36.0. Some breaking changes were introduced between these
|
||||
two versions, and the one affected most was the removal of `asio::io_service` in favor of `asio::io_context` in 1.33.0. `asio_1_32_0` is
|
||||
retained for packages that have not completed migration. `asio_1_10` has been removed as no packages depend on it anymore.
|
||||
@@ -297,6 +253,8 @@
|
||||
|
||||
- Ethercalc and its associated module have been removed, as the package is unmaintained and cannot be installed from source with npm now.
|
||||
|
||||
- The `services.avahi.wideArea` option now defaults to `false` as a mitigation against [`CVE-2024-52615`/`GHSA-x6vp-f33h-h32g`](https://github.com/avahi/avahi/security/advisories/GHSA-x6vp-f33h-h32g).
|
||||
|
||||
- `coreth` has been removed, as upstream has moved it into `avalanchego`.
|
||||
|
||||
- `nodePackages.prebuild-install` was removed because it appeared to be unmaintained upstream.
|
||||
@@ -314,7 +272,7 @@
|
||||
IMAP_CERTIFICATE_VALIDATION=false
|
||||
```
|
||||
|
||||
- `python3Packages.pillow-avif-plugin` has been removed as the functionality is included in `python3Packages.pillow` directly since version 11.3.
|
||||
- `python3packages.pillow-avif-plugin` has been removed as the functionality is included in `python3packages.pillow` directly since version 11.3.
|
||||
|
||||
- `wasistlos` (previously known as `whatsapp-for-linux`) has been removed because it was unmaintained and archived upstream.
|
||||
Multiple alternatives exist: `karere`, `whatsie` and `zapzap` among others.
|
||||
@@ -326,6 +284,8 @@
|
||||
|
||||
- `shisho` has been removed because it's archived. `semgrep`, `opengrep`, and `ast-grep` provide similar functionality.
|
||||
|
||||
- `services.openssh.settings.AcceptEnv` now explicitly defined as an option that takes a list of strings, to facilitate option merging. Setting it to a string value is no longer supported.
|
||||
|
||||
- All Xfce packages have been moved to top level (e.g. if you previously added `pkgs.xfce.xfce4-whiskermenu-plugin` to `environment.systemPackages`, you will need to change it to `pkgs.xfce4-whiskermenu-plugin`). The `xfce` scope will be removed in NixOS 26.11.
|
||||
|
||||
- The Dovecot IMAP server has been updated to version 2.4, with the `dovecot` attribute now referring to this backwards-incompatible version. The attribute `dovecot_2_3` refers to the previous version. The Pigeonhole plugin has been similarly updated to 2.4, with the version compatible with Dovecot 2.3 being at `dovecot_pigeonhole_0_5`. See <https://doc.dovecot.org/latest/installation/upgrade/2.3-to-2.4.html> for more information on how to upgrade.
|
||||
@@ -336,8 +296,12 @@
|
||||
|
||||
- `vimPlugins.nvim-treesitter` has been updated to `main` branch, which is a full and incompatible rewrite. If you can't or don't want to update, you should use `vimPlugins.nvim-treesitter-legacy`.
|
||||
|
||||
- `services.taskchampion-sync-server` module have been added an option `services.taskchampion-sync-server.dynamicUser` to use systemd's DynamicUser feature. This is enabled by default when stateVersion is at least 26.05, and disabled otherwise. If you need this feature, you need to set `services.taskchampion-sync-server.dynamicUser` to `true` and migrate `/var/lib/taskchampion-sync-server` to `/var/lib/private/taskchampion-sync-server`.
|
||||
|
||||
- Package `jellyseerr` has been renamed to `seerr` following the upstream rename.
|
||||
|
||||
- The default packages in `services.jenkins.packages` have been dropped, since not every Jenkins installation needs any package at all. It's more reasonable to leave it empty and let users configure what they need.
|
||||
|
||||
- The `pie` hardening flag has been removed and will now error, after being deprecated in 25.11. Compilers are expected to enable PIE by default, as has been common practice since 2016 outside of Nixpkgs. If a package needs `pie` disabled pass `-no-pie` in `CFLAGS`. It is unlikely this will be necessary in many cases; due to the prevalence of default PIE toolchains, most packages incompatible with PIE already pass `-no-pie`.
|
||||
|
||||
- `pqos-wrapper` was removed as it has been unmaintained since 2022 and not widely used.
|
||||
@@ -350,8 +314,6 @@
|
||||
|
||||
- `linuxPackages.nvidiaPackages` now follows NVIDIA's official release branches by exposing `production`, `new_feature`, and `beta`. The convenience aliases `latest` (newer of `production` and `new_feature`) and `bleeding_edge` (newer of `latest` and `beta`) are provided; note that `beta` now refers strictly to the beta branch.
|
||||
|
||||
- `stestrCheckHook` was added: This test hook runs `stestr run`. You can disable tests with `disabledTests` and `disabledTestsRegex`.
|
||||
|
||||
- `balatro` now supports the Google Play and Xbox PC versions of the game. Pass the `apk` or `Assets.zip` as `balatro.override { src = "…" }`.
|
||||
|
||||
- `uptime-kuma` has been updated to v2, which requires an automated migration that can take a few hours. **A backup is highly recommended.**
|
||||
@@ -362,25 +324,17 @@
|
||||
|
||||
- The `libcxxhardeningextensive` hardening flag has been **disabled** by default. Enabling it by default in 25.11 was unintentional and may have had a negative effect on performance in some cases. `libcxxhardeningfast` remains enabled by default.
|
||||
|
||||
- Wine has been updated to the 11.0 branch. Please check the [upstream announcement](https://gitlab.winehq.org/wine/wine/-/releases/wine-11.0) for more details.
|
||||
|
||||
- Cinnamon has been updated to 6.6, please check the [upstream announcement](https://www.linuxmint.com/rel_zena_whatsnew.php) for more details.
|
||||
|
||||
- `rspamd` has been updated to 4.0. Please check the upstream [migration](https://docs.rspamd.com/tutorials/migration/#migration-to-rspamd-400) documentation, especially if you run a sharded Redis deployment.
|
||||
|
||||
- `hyphen` now supports over 40 language variants through `hyphenDicts` and now allows to enable all supported languages through `hyphenDicts.all`.
|
||||
|
||||
- `budgie` has been updated to 10.10, please check the [upstream announcement](https://buddiesofbudgie.org/blog/budgie-10-10-released) for more details.
|
||||
|
||||
- The packages `ibtool`, `actool` and `re-plistbuddy` have been added, providing reimplementations of the corresponding proprietary Apple tools. They are more compatible with the originals than the previously existing `xcbuild` package, and should enable more darwin software to be built from source.
|
||||
|
||||
- Switch inhibitors were introduced, which add a pre-switch check that compares a list of strings between the previous and the new generation, and refuses to switch into the new generation when there is a difference between the two lists. This allows to avoid switching into a system when for instance the systemd version changed by adding `config.systemd.package.version` to the switch inhibitors for your system. You can still forcefully switch into any generation by setting `NIXOS_NO_CHECK=1`.
|
||||
|
||||
- GNU Taler has been updated to version 1.3.
|
||||
This release focuses on getting everything ready for a deployment of GNU Taler by Magnet bank.
|
||||
For more details, see the [upstream release notes](https://www.taler.net/en/news/2025-13.html).
|
||||
|
||||
- `collabora-desktop` The desktop version of Collabora Office is now available, package version `25.05.9.2-2`.
|
||||
- The `services.nextcloud-spreed-signaling` NixOS module has been added to facilitate declarative management of a standalone Spreed signaling server ("High Performance Backend" for Nextcloud Talk).
|
||||
|
||||
- The `services.geoserver` NixOS module has been added to allow running [Geoserver](https://geoserver.org/) as a service.
|
||||
- `collabora-desktop` The desktop version of Collabora Office is now available, package version `25.05.9.2-2`.
|
||||
|
||||
- `fetchPnpmDeps` and `pnpmConfigHook` were added as top-level attributes, replacing the now deprecated `pnpm.fetchDeps` and `pnpm.configHook` attributes.
|
||||
|
||||
@@ -395,7 +349,7 @@
|
||||
|
||||
- Added `dell-bios-fan-control` package and service.
|
||||
|
||||
- Added `lovr` package, a Lua-based game engine for VR and XR applications.
|
||||
- Added `lovr` package, a LUA-based game engine for VR and XR applications.
|
||||
|
||||
- Updated `wsjtx` from 2.7.0 to 3.0.0 for amateur radio hobbyists who use FT8 and other related digital modes.
|
||||
See the [release notes](https://wsjt.sourceforge.io/Release_Notes.txt) for the changelog.
|
||||
@@ -405,14 +359,14 @@
|
||||
|
||||
- `wrapNeovimUnstable` now sets provider-related configuration in its generated config rather than as wrapper arguments. It should not affect configuration unless you set `wrapRc` to false or are using the `legacyWrapper`.
|
||||
|
||||
- Neovim Lua dependencies are now set in the generated init.lua instead of
|
||||
- neovim lua dependencies are now set in the generated init.lua instead of
|
||||
modifying LUA_PATH in the wrapper. Commands run pre-vimrc via `nvim --cmd
|
||||
"require'LUA_MODULE'"` may
|
||||
not find their lua dependencies anymore. Use `nvim -c "lua require'LUA_MODULE'"` instead to run these commands after loading `init.lua`. If you use `wrapNeovim` with `wrapRc` set to `false`, you may lose the lua dependencies if you are not loading the generated `init.lua`.
|
||||
|
||||
- We now use the upstream wrapper script for Gradle, supporting both the `JAVA_HOME` and `GRADLE_OPTS` environment variables.
|
||||
|
||||
- Updated `gonic` to 0.21.0. A full ("slow") scan is recommended after upgrading to v0.21.0 to pick up the newly scanned fields (contributors, ISRCs, record labels, per-track years, ARTIST_CREDIT).
|
||||
- the `autossh-ng` NixOS module was introduced as a simpler alternative to the existing `autossh` module.
|
||||
|
||||
- Added `haskell.packages.microhs`, a set of Haskell packages built with MicroHs.
|
||||
|
||||
@@ -432,6 +386,8 @@ gnuradioMinimal.override {
|
||||
}
|
||||
```
|
||||
|
||||
- Added `headplane` and `headplane-agent` packages, and `services.headplane` service.
|
||||
|
||||
## Nixpkgs Library {#sec-nixpkgs-release-26.05-lib}
|
||||
|
||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||
@@ -444,7 +400,7 @@ gnuradioMinimal.override {
|
||||
|
||||
- `nodejs` is now a simple wrapper for `nodejs-slim`+`nodejs-slim.npm`+`nodejs-slim.corepack`, meaning it is no longer possible to reference or override its attributes or outputs (e.g. `nodejs.libv8` must be replaced with `nodejs-slim.libv8`, `nodejs.nativeBuildInputs` with `nodejs-slim.nativeBuildInputs`, etc.).
|
||||
|
||||
- `navidrome` has removed the built-in Spotify integration. See [v0.61.0](https://github.com/navidrome/navidrome/releases/tag/v0.61.0) for details on optional replacements.
|
||||
- `navidrome` has removed the built-in Spotify integration https://github.com/navidrome/navidrome/releases/tag/v0.61.0 has details on optional replacements
|
||||
|
||||
- `mold` is now wrapped by default.
|
||||
|
||||
@@ -464,3 +420,4 @@ gnuradioMinimal.override {
|
||||
|
||||
- The builder `php.buildComposerProject2` for PHP applications has been improved for better reliability and stability.
|
||||
|
||||
- The `services.drupal` module has a few improvements aimed at making it better for installing custom Drupal instances, namely a new `webRoot` option for identifying custom webroots in source code, a new `configRoot` option for identifying and synchronizing config yamls onto NixOS, and a some new settings for managing variable content and filepaths.
|
||||
|
||||
@@ -1,145 +1,22 @@
|
||||
# Nixpkgs 26.11 ("Zokor", 2026.11/??) {#sec-nixpkgs-release-26.11}
|
||||
# Nixpkgs 26.11 (2026.11/??) {#sec-nixpkgs-release-26.11}
|
||||
|
||||
## Highlights {#sec-nixpkgs-release-26.11-highlights}
|
||||
|
||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||
|
||||
- The {file}`nixexprs.tar.xz` tarball will be discontinued together with Nixpkgs
|
||||
27.05 after 2027-12-31. Migrate to the {file}`nixexprs.tar.zst` tarball
|
||||
instead.
|
||||
|
||||
This affects for example users who pull Nixpkgs as a flake input from
|
||||
https://channels.nixos.org:
|
||||
|
||||
```diff
|
||||
-nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz";
|
||||
+nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst";
|
||||
```
|
||||
- Create the first release note entry in this section!
|
||||
|
||||
## Backward Incompatibilities {#sec-nixpkgs-release-26.11-incompatibilities}
|
||||
|
||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||
|
||||
- []{#x86_64-darwin-26.11}
|
||||
|
||||
Support for `x86_64-darwin` has been dropped, due to Apple’s deprecation of the platform and limited build infrastructure and developer time.
|
||||
We will no longer build packages for the platform or support building them from source.
|
||||
|
||||
The Nixpkgs 26.05 stable branch will still maintain platform support and binaries will be built until it goes out of support at the end of 2026.
|
||||
Users of `x86_64-darwin` will receive an error message explaining how to switch to 26.05.
|
||||
|
||||
By the time of this release, Homebrew will offer only limited [Tier 3](https://docs.brew.sh/Support-Tiers#tier-3) support for the platform, but MacPorts will likely continue to support it for a long time.
|
||||
We also recommend users consider installing NixOS, which should continue to run on essentially all Intel Macs, especially after Apple stops security support for macOS 26 in 2028.
|
||||
|
||||
- `bundlerApp` now sets `__structuredAttrs = true` for its result package.
|
||||
Out-of-tree packages passing `postBuild` to `bundlerApp` should examine if their `postBuild` commands are compatible with structured attributes.
|
||||
|
||||
- `databricks-cli` has been updated from `0.290.2` to `1.x.x`, the first major release. OAuth tokens for interactive logins (`auth_type = databricks-cli`) are now stored in the OS-native secure store by default (Secret Service on Linux) instead of `~/.databricks/token-cache.json`; cached tokens from older versions are not migrated, so run `databricks auth login` once per profile after upgrading. To keep the previous file-backed storage, set `DATABRICKS_AUTH_STORAGE=plaintext` or add `auth_storage = plaintext` under `[__settings__]` in `~/.databrickscfg`. Additionally, the `vector_search_endpoints` DABs resource renamed `min_qps` to `target_qps` (and the `vector-search-endpoints` command renamed `--min-qps` to `--target-qps`). See the [upstream changelog](https://github.com/databricks/cli/blob/main/CHANGELOG.md) for details.
|
||||
|
||||
- `hurl` has been updated to `8.x.x` which has some breaking changes. See [upstream changelog](https://github.com/Orange-OpenSource/hurl/releases/tag/8.0.0) for details.
|
||||
|
||||
- `gotosocial` has been updated to 0.22.0. This release contains a very long database migration, which should not be cancelled or interrupted under any circumstances.
|
||||
- Postgres users: Following the migration, if you encounter slowdown on Postgres specifically (ie., timing out while loading timelines) you may need to run some manual database maintenance steps. Please check https://docs.gotosocial.org/en/stable/admin/database_maintenance/#postgres.
|
||||
|
||||
- `xsecurelock` no longer supports authentication via htaccess files (`~/.xsecurelock.pw`) or via the `pamtester` program by default. Only the recommended PAM module is supported unless rebuilt with `withHtaccess` or `withPamtester`.
|
||||
|
||||
- `python3Packages.django-health-check` has been updated to major version 4. See its [migration guide](https://codingjoe.dev/django-health-check/migrate-to-v4/) and [changelog](https://github.com/codingjoe/django-health-check/releases/tag/4.0.0) for breaking changes.
|
||||
|
||||
- `libgdata` has been removed, as it was archived upstream and relied on the insecure libsoup 2.4.
|
||||
|
||||
- `mcphost` has been removed, as it was archived upstream and declared unmaintained.
|
||||
|
||||
- `services.mysql` now sets `root@localhost` authentication to `auth_socket` when used with `mysql` or `percona-server`.
|
||||
Existing deployments will also be adjusted if possible. See the [security advisory GHSA-6qxx-6rg8-c4p8](https://github.com/NixOS/nixpkgs/security/advisories/GHSA-6qxx-6rg8-c4p8) for more information.
|
||||
|
||||
- `zerofs` has been updated from `1.x` to `2.x` which is a breaking change. Volumes created by earlier releases are refused at open with a clear error. There is no migration tool; older volumes remain readable and writable by the release that created them.
|
||||
|
||||
- `keycloak.plugins.keycloak-metrics-spi` has been removed. Keycloak exposes Prometheus metrics natively on its management interface; enable them with the `metrics-enabled` setting (and `event-metrics-user-enabled` for login and event counters). See [Gaining insights with metrics](https://www.keycloak.org/observability/configuration-metrics).
|
||||
|
||||
- `alps` has been rewritten upstream, see [upstream repository](https://github.com/migadu/alps) for documentation.
|
||||
|
||||
- `uhttpmock` providing 0.0 ABI was removed. `uhttpmock_1_0` providing 1.0 ABI was renamed to `uhttpmock` and `uhttpmock_1_0` was kept as an alias.
|
||||
|
||||
- `nix-serve-ng` (and `haskellPackages.nix-serve-ng`) is now built against Lix instead of CppNix, following upstream which has switched to Lix as its supported Nix implementation.
|
||||
|
||||
- Linux kernel configuration has been moved out of the `linux-kernel` field of the platform structure into the kernel builders:
|
||||
- `linux-kernel.name` has been removed.
|
||||
- `linux-kernel.target` is available as the `target` parameter and passthru attribute on the kernel builders.
|
||||
- `linux-kernel.installTarget` has been removed, as it should not be necessary to customize.
|
||||
- `linux-kernel.DTB` is available as the `buildDTBs` parameter and passthru attribute on the kernel builders.
|
||||
- `linux-kernel.{autoModules,preferBuiltin,extraConfig}` were already available as kernel builder parameters.
|
||||
|
||||
- The `img` argument of `vmTools` has been renamed to `kernelImage`, as it collided with the top-level `img` package.
|
||||
Additionally, the kernel module tree used inside the VM has been split out of the `kernel` argument into a new `kernelModules` argument (defaulting to `kernel`).
|
||||
Callers that overrode `kernel` with a module tree (e.g. from `pkgs.aggregateModules`) to make extra modules available must now pass it via `kernelModules` instead, keeping `kernel` pointing at a bootable kernel derivation.
|
||||
|
||||
- The ARMv5 Linux kernel build now uses a standard configuration and generates a standard compressed image instead of the deprecated legacy U‐Boot image format.
|
||||
`lib.systems.{examples,platforms}.{sheevaplug,pogoplug4}` have been unified into `lib.systems.examples.armv5tel-multiplatform`.
|
||||
Note that there is no official support for ARMv5 and it is not possible to build even a simple NixOS configuration out of the box.
|
||||
|
||||
- `pdns` has been updated from `5.0.x` to `5.1.x`. Please be sure to review the [Upgrade Notes](https://doc.powerdns.com/authoritative/upgrading.html#to-5-1-0) before upgrading. Namely LUA record updates are no longer allowed by default, and the embedded webserver no longer includes a `access-control-allow-origin: *` header by default.
|
||||
|
||||
- Support for the legacy U‐Boot image format has been removed from the Linux kernel builders, as it is deprecated upstream and no longer used by any platform in Nixpkgs.
|
||||
|
||||
- `etcd_3_4` package was dropped, as it's gone EOL. Please upgrade to either 3.5 or 3.6. See [migration notes](https://etcd.io/docs/v3.6/upgrades/upgrade_3_6/) for incompatibilities and upgrade procedure.
|
||||
|
||||
- `rke2` retires ingress-nginx and transitions to Traefik starting in `rke2_1_36`. Because ingress-nginx was retired upstream as of March 2026, Traefik is now the default
|
||||
for new clusters starting in v1.36 (existing clusters will keep their current ingress upon upgrade to avoid breakage). This transition brings the following structural changes:
|
||||
- Airgapped Environments: The rke2-images-core tarball now contains Traefik images instead of ingress-nginx. The standalone rke2-images-traefik tarball has been removed.
|
||||
Users who must continue using ingress-nginx will now need to manually provide the rke2-images-ingress-nginx tarball.
|
||||
- Future Removal: The ingress-nginx chart will not receive any additional updates and will be completely removed in v1.37 for community users.
|
||||
|
||||
- `buildFHSEnvChroot` has been removed after deprecation in 23.05.
|
||||
|
||||
- `gh-actions-cache` has been removed since its functionality has been integrated directly into `gh` (`gh cache`). See [upstream readme](https://github.com/actions/gh-actions-cache).
|
||||
|
||||
- `requireFile` now sets `meta.license = lib.licenses.unfree` by default. Users of `requireFile`-based derivations that preserve this default will need to explicitly allow their evaluation as described in [](#sec-allow-unfree).
|
||||
|
||||
- `texlive.combine` is deprecated and scheduled for removal in 27.05. Please migrate to `texliveSmall.withPackages` (see [](#sec-language-texlive-user-guide)).
|
||||
|
||||
- `keycloak` was updated to >= 26.7.0 and includes some breaking internal (API) changes. See the [upstream migration guide](https://www.keycloak.org/docs/latest/upgrading/#migrating-to-26-7-0) for more information.
|
||||
|
||||
- `librest` providing 0.7 ABI was removed. `librest_1_0` providing 1.0 ABI was renamed to `librest` and `librest_1_0` was kept as an alias.
|
||||
|
||||
- `pnpm_10` was upgraded to version 10.34.1+, which introduced stricter integrity checks. If you encounter `ERR_PNPM_MISSING_TARBALL_INTEGRITY`, you can fall back to the older `pnpm_10_34_0`.
|
||||
|
||||
- `fetchPnpmDeps`' `fetcherVersion = 1` and `fetcherVersion = 2` have been
|
||||
removed, as announced in the 26.05 release. Packages still using them now
|
||||
throw an evaluation error and must migrate to `fetcherVersion = 3` (or later)
|
||||
and regenerate their hashes. See the
|
||||
[pnpm `fetcherVersion` section](#javascript-pnpm-fetcherVersion) of the manual
|
||||
for details.
|
||||
|
||||
- `rebuilderd` has been updated to 0.27.0 introducing breaking changes. See upstream changelog for details: [0.26.0](https://github.com/kpcyrd/rebuilderd/releases/tag/v0.26.0), [0.27.0](https://github.com/kpcyrd/rebuilderd/releases/tag/v0.27.0)
|
||||
|
||||
- Starting with v14, `flameshot` will primarily utilise xdg-desktop-portal calls for screenshotting. This will directly affect users on X11 window managers due to the lack of a compatible portal with Screenshot feature. See [upstream changelog](https://github.com/flameshot-org/flameshot/releases/tag/v14.0.0) or [NixOS Flameshot](https://wiki.nixos.org/wiki/Flameshot) wiki page for workarounds.
|
||||
- `nim1` and respective aliases have been removed due to entering EOL; please migrate to `nim` or `nim-unwrapped` (nim 2).
|
||||
- `nim-2_0` & `nim-2_2` and respective aliases have been removed; please migrate to `nim` or `nim-unwrapped` (nim 2.2.10).
|
||||
- `domoticz` has been updated from `2024.7` to `2026.x`, breaking third party applications and scripts using the old RType calls. Review the [release notes](https://github.com/domoticz/domoticz/blob/2026.2/History.txt#L398) for more information.
|
||||
|
||||
- `vimacs` has been removed, as it has not been maintained in 10 years and was built for an old version of vim (6.0).
|
||||
- Create the first release note entry in this section!
|
||||
|
||||
## Other Notable Changes {#sec-nixpkgs-release-26.11-notable-changes}
|
||||
|
||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||
|
||||
- `super-productivity` has been updated. The binary has been renamed from `super-productivity` to `superproductivity`. A symlink from the old name is provided for backward compatibility.
|
||||
|
||||
- Package-URL (PURL, https://github.com/package-url/purl-spec) metadata identifier has been added for `fetchgit`, `fetchpypi` and `fetchFromGithub` fetchers.
|
||||
`mkDerivation` has been adjusted to reuse this information.
|
||||
Package-URLs allow reliably identifying and locating software packages.
|
||||
Maintainers of derivations using the adapted fetchers should rely on the `drv.src.meta.identifiers.v1.purl` default identifier and can enhance their `drv.meta.identifiers.v1.purls` list once they would like to have additional identifiers.
|
||||
Maintainers using `fetchurl` for `drv.src` are urged to adapt their `drv.meta.identifiers.purlParts` for proper identification.
|
||||
|
||||
- Emacs loads the `early-default` library after `early-init.el`.
|
||||
Users can add `early-init.el` via `emacs.pkgs.withPackages`
|
||||
by packaging `early-init.el` into a library named `early-default`.
|
||||
To prevent loading the `early-default` library,
|
||||
set `inhibit-early-default-init` in `early-init.el`.
|
||||
|
||||
- `services.ceph` enabled the generation of Ceph log files at `/var/log/ceph/`.
|
||||
They were missing before because Ceph omitted logs when this directory was missing.
|
||||
Ceph logs can grow large, so you may want to configure rotation of these logs.
|
||||
- Create the first release note entry in this section!
|
||||
|
||||
## Nixpkgs Library {#sec-nixpkgs-release-26.11-lib}
|
||||
|
||||
@@ -152,11 +29,10 @@
|
||||
|
||||
### Deprecations {#sec-nixpkgs-release-26.11-lib-deprecations}
|
||||
|
||||
- Setting `config.allowBrokenPredicate` is deprecated in favor of
|
||||
using `config.problems.handlers.PackageName.broken = "warn"` (or `=
|
||||
"ignore"`). For more information see [](#sec-allow-broken).
|
||||
- Create the first release note entry in this section!
|
||||
|
||||
|
||||
### Additions and Improvements {#sec-nixpkgs-release-26.11-lib-additions-improvements}
|
||||
|
||||
- Create the first release note entry in this section!
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ The exact schema these fields follow is a bit ill-defined due to a long and conv
|
||||
|
||||
`system`
|
||||
|
||||
: This is a two-component shorthand for the platform. Examples of this would be "aarch64-darwin" and "i686-linux"; see `lib.systems.doubles` for more. The first component corresponds to the CPU architecture of the platform and the second to the operating system of the platform (`[cpu]-[os]`). This format has built-in support in Nix, such as the `builtins.currentSystem` impure string.
|
||||
: This is a two-component shorthand for the platform. Examples of this would be "x86_64-darwin" and "i686-linux"; see `lib.systems.doubles` for more. The first component corresponds to the CPU architecture of the platform and the second to the operating system of the platform (`[cpu]-[os]`). This format has built-in support in Nix, such as the `builtins.currentSystem` impure string.
|
||||
|
||||
`config`
|
||||
|
||||
|
||||
@@ -61,12 +61,6 @@ Release branch. Used to specify that a package is not going to receive updates t
|
||||
|
||||
The package’s homepage. Example: `https://www.gnu.org/software/hello/manual/`
|
||||
|
||||
### `donationPage` {#var-meta-donationPage}
|
||||
|
||||
The package or project's donation page, if it exists. Example: `https://neovim.io/sponsors/`
|
||||
|
||||
Authoritative project URLs are preferred.
|
||||
|
||||
### `downloadPage` {#var-meta-downloadPage}
|
||||
|
||||
The page where a link to the current version can be found. Example: `https://ftp.gnu.org/gnu/hello/`
|
||||
@@ -77,7 +71,7 @@ A link or a list of links to the location of Changelog for a package. A link may
|
||||
|
||||
### `license` {#var-meta-license}
|
||||
|
||||
The license, or licenses, for the package. One from the attribute set defined in [`nixpkgs/lib/licenses/licenses.nix`](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses/licenses.nix). At this moment using both a list of licenses and a single license is valid. If the license field is in the form of a list representation, then it means that parts of the package are licensed differently. Each license should preferably be referenced by their attribute. The non-list attribute value can also be a space delimited string representation of the contained attribute `shortNames` or `spdxIds`. The following are all valid examples:
|
||||
The license, or licenses, for the package. One from the attribute set defined in [`nixpkgs/lib/licenses.nix`](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix). At this moment using both a list of licenses and a single license is valid. If the license field is in the form of a list representation, then it means that parts of the package are licensed differently. Each license should preferably be referenced by their attribute. The non-list attribute value can also be a space delimited string representation of the contained attribute `shortNames` or `spdxIds`. The following are all valid examples:
|
||||
|
||||
- Single license referenced by attribute (preferred) `lib.licenses.gpl3Only`.
|
||||
- Single license referenced by its attribute shortName (frowned upon) `"gpl3Only"`.
|
||||
@@ -157,8 +151,6 @@ The list of Nix platform types for which the [Hydra](https://github.com/nixos/hy
|
||||
}
|
||||
```
|
||||
|
||||
Note that this does not affect whether reverse dependencies of the package are built on Hydra.
|
||||
|
||||
### `broken` {#var-meta-broken}
|
||||
|
||||
If set to `true`, the package is marked as "broken", meaning that it won’t show up in [search.nixos.org](https://search.nixos.org/packages), and cannot be built or installed unless [explicitly allowed](#sec-allow-broken).
|
||||
@@ -216,7 +208,7 @@ If this list is not empty, the package is marked as "insecure", meaning that it
|
||||
|
||||
## Licenses {#sec-meta-license}
|
||||
|
||||
The `meta.license` attribute should preferably contain a value from `lib.licenses` defined in [`nixpkgs/lib/licenses/licenses.nix`](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses/licenses.nix), or in-place license description of the same format if the license is unlikely to be useful in another expression.
|
||||
The `meta.license` attribute should preferably contain a value from `lib.licenses` defined in [`nixpkgs/lib/licenses.nix`](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix), or in-place license description of the same format if the license is unlikely to be useful in another expression.
|
||||
|
||||
Although it’s typically better to indicate the specific license, a few generic options are available:
|
||||
|
||||
@@ -342,30 +334,3 @@ A readonly attribute that concatenates all CPE parts in one string.
|
||||
#### `meta.identifiers.possibleCPEs` {#var-meta-identifiers-possibleCPEs}
|
||||
|
||||
A readonly attribute containing the list of guesses for what CPE for this package can look like. It includes all variants of version handling mentioned above. Each item is an attrset with attributes `cpeParts` and `cpe` for each guess.
|
||||
|
||||
### Package URL {#sec-meta-identifiers-purl}
|
||||
|
||||
[Package-URL](https://github.com/package-url/purl-spec) (PURL) is a specification to reliably identify and locate software packages.
|
||||
Through identification of software packages, additional (non-major) use cases are e.g. software license cross-verification via third party databases or initial vulnerability response management.
|
||||
Package-URLs shall default to the `mkDerivation.src`, as the original consumed software package is the single source of truth.
|
||||
|
||||
#### `meta.identifiers.purlParts` {#var-meta-identifiers-purlParts}
|
||||
|
||||
This attribute contains an attribute set of all parts of the PURL for this package.
|
||||
|
||||
* `type` mandatory [type](https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/docs/standard/summary.md) which needs to be provided
|
||||
* `spec` specify the PURL in accordance with the [purl-spec](https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/purl-specification.md)
|
||||
|
||||
#### `meta.identifiers.purl` {#var-meta-identifiers-purl}
|
||||
|
||||
An extendable attribute which is built based on `purlParts`.
|
||||
This is the main identifier of the software package.
|
||||
For handling edge cases, consider using the list interface [`meta.identifiers.purls`](#var-meta-identifiers-purls).
|
||||
|
||||
#### `meta.identifiers.purls` {#var-meta-identifiers-purls}
|
||||
|
||||
An extendable list attribute which defaults to a single element equal to [`meta.identifiers.purl`](#var-meta-identifiers-purl).
|
||||
It provides an interface for additional identifiers of `mkDerivation.src` or for identifiers of vendored dependencies inside `mkDerivation.src`, which maintainers may carefully consider to specify as well.
|
||||
|
||||
Additional identifiers are generally not recommended, as they might cause maintenance overhead or diverge.
|
||||
For example, a source distribution `pkg:github` may be hard to keep correctly aligned with the corresponding binary distribution `pkg:pypi`.
|
||||
|
||||
@@ -776,7 +776,7 @@ By default, the flag `--disable-dependency-tracking` is added to the configure f
|
||||
|
||||
##### `dontFixLibtool` {#var-stdenv-dontFixLibtool}
|
||||
|
||||
By default, the configure phase applies some special hackery to all files called `ltmain.sh` before running the configure script to improve the purity of Libtool-based packages [^footnote-stdenv-sys-lib-search-path] . If this is undesirable, set this variable to true.
|
||||
By default, the configure phase applies some special hackery to all files called `ltmain.sh` before running the configure script in order to improve the purity of Libtool-based packages [^footnote-stdenv-sys-lib-search-path] . If this is undesirable, set this variable to true.
|
||||
|
||||
##### `dontDisableStatic` {#var-stdenv-dontDisableStatic}
|
||||
|
||||
@@ -939,7 +939,7 @@ The fixup phase performs (Nix-specific) post-processing actions on the files ins
|
||||
|
||||
- It moves the `man/`, `doc/` and `info/` subdirectories of `$out` to `share/`.
|
||||
- It strips libraries and executables of debug information.
|
||||
- On Linux, it applies the `patchelf` command to ELF executables and libraries to remove unused directories from the `RPATH` to prevent unnecessary runtime dependencies.
|
||||
- On Linux, it applies the `patchelf` command to ELF executables and libraries to remove unused directories from the `RPATH` in order to prevent unnecessary runtime dependencies.
|
||||
- It rewrites the interpreter paths of shell scripts to paths found in `PATH`. E.g., `/usr/bin/perl` will be rewritten to `/nix/store/some-perl/bin/perl` found in `PATH`. See [](#patch-shebangs.sh) for details.
|
||||
|
||||
#### Variables controlling the fixup phase {#variables-controlling-the-fixup-phase}
|
||||
@@ -1345,7 +1345,7 @@ $ echo $configureFlags
|
||||
|
||||
Nix itself considers a build-time dependency as merely something that should previously be built and accessible at build time—packages themselves are on their own to perform any additional setup. In most cases, that is fine, and the downstream derivation can deal with its own dependencies. But for a few common tasks, that would result in almost every package doing the same sort of setup work—depending not on the package itself, but entirely on which dependencies were used.
|
||||
|
||||
To alleviate this burden, the setup hook mechanism was written, where any package can include a shell script that \[by convention rather than enforcement by Nix\], any downstream reverse-dependency will source as part of its build process. That allows the downstream dependency to merely specify its dependencies, and lets those dependencies effectively initialize themselves. No boilerplate mirroring the list of dependencies is needed.
|
||||
In order to alleviate this burden, the setup hook mechanism was written, where any package can include a shell script that \[by convention rather than enforcement by Nix\], any downstream reverse-dependency will source as part of its build process. That allows the downstream dependency to merely specify its dependencies, and lets those dependencies effectively initialize themselves. No boilerplate mirroring the list of dependencies is needed.
|
||||
|
||||
The setup hook mechanism is a bit of a sledgehammer though: a powerful feature with a broad and indiscriminate area of effect. The combination of its power and implicit use may be expedient, but isn’t without costs. Nix itself is unchanged, but the spirit of added dependencies being effect-free is violated even if the latter isn’t. For example, if a derivation path is mentioned more than once, Nix itself doesn’t care and makes sure the dependency derivation is already built just the same—depending is just needing something to exist, and needing is idempotent. However, a dependency specified twice will have its setup hook run twice, and that could easily change the build environment (though a well-written setup hook will therefore strive to be idempotent so this is in fact not observable). More broadly, setup hooks are anti-modular in that multiple dependencies, whether the same or different, should not interfere and yet their setup hooks may well do so.
|
||||
|
||||
|
||||
436
doc/style.css
436
doc/style.css
@@ -23,17 +23,21 @@ body {
|
||||
@media screen and (min-width: 992px) {
|
||||
.book,
|
||||
.appendix {
|
||||
max-width: 55rem;
|
||||
max-width: 60rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1200px) {
|
||||
.book,
|
||||
.appendix {
|
||||
max-width: 55rem;
|
||||
max-width: 73rem;
|
||||
}
|
||||
}
|
||||
|
||||
.book .list-of-examples {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
@@ -114,7 +118,7 @@ html {
|
||||
body {
|
||||
font-size: 1rem;
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-weight: 400;
|
||||
font-weight: 300;
|
||||
color: var(--main-text-color);
|
||||
background-color: var(--background);
|
||||
min-height: 100vh;
|
||||
@@ -127,32 +131,6 @@ body {
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
/*
|
||||
See: https://developer.mozilla.org/en-US/docs/Web/API/Popover_API
|
||||
|
||||
- :popover-open pseudo-class matches a popover element when it is in the showing state
|
||||
- ::backdrop full-screen element placed directly behind popover
|
||||
*/
|
||||
nav.toc-sidebar:popover-open {
|
||||
position: fixed;
|
||||
inset: 0 auto 0 0;
|
||||
width: min(20rem, 85vw);
|
||||
height: 100dvh;
|
||||
max-height: none;
|
||||
margin: 0;
|
||||
padding: 1rem;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
background: var(--background);
|
||||
border: 0;
|
||||
border-right: 0.0625rem solid #d8d8d8;
|
||||
box-shadow: 0 0 1.5rem rgb(0 0 0 / 0.35);
|
||||
}
|
||||
|
||||
nav.toc-sidebar::backdrop {
|
||||
background: rgb(0 0 0 / 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
@@ -184,52 +162,63 @@ hr {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-weight: 800;
|
||||
line-height: 1.1;
|
||||
margin: 1.5rem 0 0.5rem;
|
||||
}
|
||||
|
||||
/*
|
||||
Major-second scale see: https://typescale.com/
|
||||
rounded to .025rem (0.4px)
|
||||
*/
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
font-weight: 800;
|
||||
line-height: 110%;
|
||||
font-size: 200%;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--heading-color);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.8rem;
|
||||
font-weight: 800;
|
||||
line-height: 110%;
|
||||
font-size: 170%;
|
||||
margin-bottom: 0.625rem;
|
||||
color: var(--heading-color);
|
||||
}
|
||||
|
||||
h2:not(:first-child) {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.6rem;
|
||||
font-weight: 800;
|
||||
line-height: 110%;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 150%;
|
||||
color: var(--heading-color);
|
||||
}
|
||||
|
||||
.note h3,
|
||||
.tip h3,
|
||||
.warning h3,
|
||||
.caution h3,
|
||||
.important h3 {
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1.425rem;
|
||||
font-weight: 800;
|
||||
line-height: 110%;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 140%;
|
||||
color: var(--heading-color);
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 1.275rem;
|
||||
font-weight: 800;
|
||||
line-height: 110%;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 130%;
|
||||
color: var(--small-heading-color);
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
|
||||
:is(.note, .tip, .warning, .caution, .important) h3 {
|
||||
font-size: 1.425rem;
|
||||
font-weight: 800;
|
||||
line-height: 110%;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
strong {
|
||||
@@ -257,9 +246,13 @@ code {
|
||||
}
|
||||
|
||||
code {
|
||||
padding: 0.2em 0.4em;
|
||||
background: var(--inline-code-background);
|
||||
border-radius: 0.375rem;
|
||||
color: #ff8657;
|
||||
background: #f4f4f4;
|
||||
display: inline-block;
|
||||
padding: 0 0.5rem;
|
||||
border: 1px solid #d8d8d8;
|
||||
border-radius: 0.5rem;
|
||||
line-height: 1.57777778;
|
||||
}
|
||||
|
||||
div.book .programlisting,
|
||||
@@ -271,7 +264,16 @@ div.appendix .programlisting {
|
||||
color: var(--codeblock-text-color);
|
||||
}
|
||||
|
||||
:is(.note, .tip, .warning, .caution, .important) {
|
||||
div.book .note,
|
||||
div.book .tip,
|
||||
div.book .warning,
|
||||
div.book .caution,
|
||||
div.book .important,
|
||||
div.appendix .note,
|
||||
div.appendix .tip,
|
||||
div.appendix .warning,
|
||||
div.appendix .caution,
|
||||
div.appendix .important {
|
||||
margin-bottom: 1rem;
|
||||
border-radius: 0.5rem;
|
||||
padding: 1.5rem;
|
||||
@@ -279,44 +281,69 @@ div.appendix .programlisting {
|
||||
background: #f4f4f4;
|
||||
}
|
||||
|
||||
:is(.note, .tip, .warning, .caution, .important) > .title {
|
||||
div.book .note > .title,
|
||||
div.book .tip > .title,
|
||||
div.book .warning > .title,
|
||||
div.book .caution > .title,
|
||||
div.book .important > .title,
|
||||
div.appendix .note > .title,
|
||||
div.appendix .tip > .title,
|
||||
div.appendix .warning > .title,
|
||||
div.appendix .caution > .title,
|
||||
div.appendix .important > .title {
|
||||
font-weight: 800;
|
||||
line-height: 110%;
|
||||
color: inherit;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:is(.note, .tip, .warning, .caution, .important) > :first-child {
|
||||
div.book .note > :first-child,
|
||||
div.book .tip > :first-child,
|
||||
div.book .warning > :first-child,
|
||||
div.book .caution > :first-child,
|
||||
div.book .important > :first-child,
|
||||
div.appendix .note > :first-child,
|
||||
div.appendix .tip > :first-child,
|
||||
div.appendix .warning > :first-child,
|
||||
div.appendix .caution > :first-child,
|
||||
div.appendix .important > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
:is(.note, .tip, .warning, .caution, .important) > :last-child {
|
||||
div.book .note > :last-child,
|
||||
div.book .tip > :last-child,
|
||||
div.book .warning > :last-child,
|
||||
div.book .caution > :last-child,
|
||||
div.book .important > :last-child,
|
||||
div.appendix .note > :last-child,
|
||||
div.appendix .tip > :last-child,
|
||||
div.appendix .warning > :last-child,
|
||||
div.appendix .caution > :last-child,
|
||||
div.appendix .important > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.note {
|
||||
div.book .note,
|
||||
div.book .tip,
|
||||
div.book .important,
|
||||
div.appendix .note,
|
||||
div.appendix .tip,
|
||||
div.appendix .important {
|
||||
color: var(--note-text-color);
|
||||
background: var(--note-background);
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: var(--tip-text-color);
|
||||
background: var(--tip-background);
|
||||
}
|
||||
|
||||
.important {
|
||||
color: var(--important-text-color);
|
||||
background: var(--important-background);
|
||||
}
|
||||
|
||||
.warning {
|
||||
div.book .warning,
|
||||
div.book .caution,
|
||||
div.appendix .warning,
|
||||
div.appendix .caution {
|
||||
color: var(--warning-text-color);
|
||||
background: var(--warning-background);
|
||||
background-color: var(--warning-background);
|
||||
}
|
||||
|
||||
.caution {
|
||||
color: var(--caution-text-color);
|
||||
background: var(--caution-background);
|
||||
div.book .section,
|
||||
div.appendix .section {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
div.book div.example,
|
||||
@@ -360,13 +387,39 @@ div.appendix dt {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
div.book .toc dt,
|
||||
div.appendix .toc dt {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
div.book .list-of-examples dt,
|
||||
div.appendix .list-of-examples dt {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
div.book code,
|
||||
div.appendix code {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background-color: inherit;
|
||||
color: inherit;
|
||||
font-size: 100%;
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
div.book div.toc,
|
||||
div.appendix div.toc {
|
||||
margin-bottom: 3em;
|
||||
border-bottom: 0.0625rem solid #d8d8d8;
|
||||
}
|
||||
|
||||
div.book div.toc dd,
|
||||
div.appendix div.toc dd {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
div.book span.command,
|
||||
div.appendix span.command {
|
||||
font-family: monospace;
|
||||
@@ -397,31 +450,17 @@ div.appendix .variablelist .term {
|
||||
}
|
||||
|
||||
:root {
|
||||
--sidebar-width: 20rem;
|
||||
--header-height: 3rem;
|
||||
--background: #fff;
|
||||
--main-text-color: #000;
|
||||
--link-color: #405d99;
|
||||
--heading-color: #6586c8;
|
||||
--small-heading-color: #6a6a6a;
|
||||
/* NOTE */
|
||||
--note-text-color: #0065d2;
|
||||
--note-background: #e4f5ff;
|
||||
/* TIP */
|
||||
--tip-text-color: #188000;
|
||||
--tip-background: #e8fae3;
|
||||
/* IMPORTANT */
|
||||
--important-text-color: #8a3db8;
|
||||
--important-background: #fbedff;
|
||||
/* WARNING */
|
||||
--warning-text-color: #aa4a00;
|
||||
--warning-background: #fff0db;
|
||||
/* CAUTION */
|
||||
--caution-text-color: #be222a;
|
||||
--caution-background: #ffebe8;
|
||||
--note-text-color: #5277c3;
|
||||
--note-background: #f2f8fd;
|
||||
--warning-text-color: #cc3900;
|
||||
--warning-background: #fff5e1;
|
||||
--codeblock-background: #f2f8fd;
|
||||
--codeblock-text-color: #000;
|
||||
--inline-code-background: #818b981f;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
@@ -430,27 +469,20 @@ div.appendix .variablelist .term {
|
||||
--main-text-color: #fff;
|
||||
--link-color: #6586c8;
|
||||
--small-heading-color: #fff;
|
||||
/* NOTE */
|
||||
--note-text-color: #66c6ff;
|
||||
--note-background: #1e2f44;
|
||||
/* TIP */
|
||||
--tip-text-color: #80e05f;
|
||||
--tip-background: #22331d;
|
||||
/* IMPORTANT */
|
||||
--important-text-color: #ea9dff;
|
||||
--important-background: #35273f;
|
||||
/* WARNING */
|
||||
--warning-text-color: #ffaa00;
|
||||
--warning-background: #3c2a13;
|
||||
/* CAUTION */
|
||||
--caution-text-color: #ff8c84;
|
||||
--caution-background: #422522;
|
||||
--note-background: none;
|
||||
--warning-background: none;
|
||||
--codeblock-background: #393939;
|
||||
--codeblock-text-color: #fff;
|
||||
--inline-code-background: #656c7633;
|
||||
}
|
||||
|
||||
:is(.note, .tip, .warning, .caution, .important) {
|
||||
div.book .note,
|
||||
div.book .tip,
|
||||
div.appendix .note,
|
||||
div.appendix .tip,
|
||||
div.book .warning,
|
||||
div.book .caution,
|
||||
div.appendix .warning,
|
||||
div.appendix .caution {
|
||||
border: 2px solid;
|
||||
font-weight: 400;
|
||||
}
|
||||
@@ -458,187 +490,9 @@ div.appendix .variablelist .term {
|
||||
|
||||
@font-face {
|
||||
font-family: Roboto;
|
||||
src:
|
||||
url(Roboto.ttf) format("truetype") tech(variations),
|
||||
url(Roboto.ttf) format("truetype-variations");
|
||||
font-weight: 100 900;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
src: url(Roboto.ttf);
|
||||
}
|
||||
|
||||
.chapter {
|
||||
content-visibility: auto;
|
||||
}
|
||||
|
||||
.navheader {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
background-color: var(--background);
|
||||
}
|
||||
|
||||
nav.toc-sidebar {
|
||||
height: 100%;
|
||||
padding: 0 1rem 2rem;
|
||||
}
|
||||
|
||||
/* menu button, shown on mobile, hidden on desktop */
|
||||
.toc-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin: 0.75rem 0 0;
|
||||
padding: 0.4rem 0.8rem;
|
||||
border: 0.0625rem solid #d8d8d8;
|
||||
border-radius: 0.25rem;
|
||||
background: var(--background);
|
||||
color: var(--main-text-color);
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
position: fixed;
|
||||
top: 0.5rem;
|
||||
left: 0.8rem;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
nav.toc-sidebar .toc {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
nav.toc-sidebar ol.toc,
|
||||
nav.toc-sidebar ol.toc ol {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
nav.toc-sidebar ol.toc ol {
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
nav.toc-sidebar li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
nav.toc-sidebar summary {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
body {
|
||||
height: 100vh;
|
||||
min-height: 0;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-rows: var(--header-height) auto minmax(0, 1fr);
|
||||
}
|
||||
|
||||
body:has(> nav.toc-sidebar) {
|
||||
grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.navheader {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
nav.toc-sidebar {
|
||||
/* un-pop the drawer */
|
||||
display: block;
|
||||
position: static;
|
||||
inset: auto;
|
||||
/* */
|
||||
margin: 0;
|
||||
grid-column: 1;
|
||||
grid-row: 3;
|
||||
max-height: none;
|
||||
overflow-y: auto;
|
||||
border: none;
|
||||
border-right: 0.0625rem solid #d8d8d8;
|
||||
}
|
||||
|
||||
/* Hide the toggle button on desktop */
|
||||
.toc-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
main.content {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 3;
|
||||
overflow-y: auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
body:has(> nav.toc-sidebar) main.content {
|
||||
grid-column: 2;
|
||||
}
|
||||
}
|
||||
|
||||
.manual-header {
|
||||
background-color: var(--background);
|
||||
border-bottom: 0.0625rem solid #d8d8d8;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.manual-header--title {
|
||||
order: -1;
|
||||
padding: 0.5rem 1rem 0;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--small-heading-color);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.manual-header--tabs {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
justify-content: space-around;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.manual-header--tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 1rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--main-text-color);
|
||||
text-decoration: none;
|
||||
border-bottom: 0.1875rem solid transparent;
|
||||
border-top: 0.1875rem solid transparent;
|
||||
transition: border-bottom-color 0.15s ease;
|
||||
}
|
||||
|
||||
.manual-header--tab:hover {
|
||||
border-bottom-color: var(--heading-color);
|
||||
color: var(--main-text-color);
|
||||
}
|
||||
|
||||
.manual-header--tab-active {
|
||||
border-bottom-color: var(--heading-color);
|
||||
color: var(--heading-color);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.manual-header {
|
||||
height: var(--header-height);
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 1;
|
||||
}
|
||||
|
||||
.manual-header--title {
|
||||
order: 0;
|
||||
margin-left: auto;
|
||||
padding: 0 1rem;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.manual-header--tabs {
|
||||
justify-content: flex-start;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,420 +0,0 @@
|
||||
# Styleguide
|
||||
|
||||
## Writing Principles
|
||||
|
||||
A consistent style greatly increases the usability of all documentation and communication.
|
||||
|
||||
Use this page as a reference and style guide for our internal and external documentation.
|
||||
|
||||
### Knowledge Expectations
|
||||
|
||||
**Assume competence, not familiarity.**
|
||||
|
||||
Write for someone who knows a great deal — up to but not including this project.
|
||||
|
||||
**What readers know:**
|
||||
|
||||
- Basic computer operation
|
||||
- Command line familiarity
|
||||
- General interest in systems configuration
|
||||
|
||||
**What readers don't know:**
|
||||
|
||||
- NixOS-specific concepts
|
||||
- NixOS ecosystem details or grammar
|
||||
- NixOS workflows
|
||||
|
||||
If specific knowledge is required, mention it at the start of the page.
|
||||
|
||||
#### Show, Don't Tell
|
||||
|
||||
The fastest path to understanding is a working example.
|
||||
People learn by doing, not by reading about doing.
|
||||
|
||||
**Recommended structure:**
|
||||
|
||||
- Start with the minimal working code or command
|
||||
- Briefly explain what it does
|
||||
- Cover edge cases or variations
|
||||
- Link to further information instead of including it
|
||||
|
||||
#### Grammar and Style
|
||||
|
||||
**Sentence structure:**
|
||||
|
||||
- Use simple, direct sentences
|
||||
- Break complex ideas into multiple short sentences
|
||||
- Avoid nested clauses
|
||||
|
||||
**Bad:**
|
||||
|
||||
> The following command, which utilizes nixos-generate-config to produce a comprehensive hardware configuration, will write the results back into the respective configuration directory located on your local machine.
|
||||
|
||||
What the user does is hidden in the middle.
|
||||
`nixos-generate-config` is a leaked implementation detail.
|
||||
Users care about *detecting hardware*, not *the tool that does it*.
|
||||
|
||||
**Good:**
|
||||
|
||||
> This command detects your hardware and saves the configuration.
|
||||
|
||||
#### Content Organization
|
||||
|
||||
Lead with value. State what the reader will accomplish before explaining how.
|
||||
|
||||
**Bad:**
|
||||
|
||||
> To create a new NixOS configuration that you can later use as a webserver, first navigate to your project directory, then add a new host configuration file with the desired machine name.
|
||||
|
||||
**Good:**
|
||||
|
||||
Add a webserver configuration to your NixOS setup:
|
||||
|
||||
```nix
|
||||
# hosts/webserver/configuration.nix
|
||||
{ ... }:
|
||||
{
|
||||
services.nginx.enable = true;
|
||||
}
|
||||
```
|
||||
|
||||
Use **progressive disclosure**. Introduce concepts only when needed.
|
||||
|
||||
**Recommended structure:**
|
||||
|
||||
1. State the goal (one sentence)
|
||||
2. Show the simplest working example
|
||||
3. Explain concepts if needed
|
||||
4. Provide advanced options separately or link to the reference
|
||||
|
||||
#### No Meta-commentary
|
||||
|
||||
Don't describe what the documentation does. Just do it.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> This section explains how to configure networking.
|
||||
> The following guide walks you through setting up a web server.
|
||||
|
||||
**Do:**
|
||||
|
||||
> Configure networking by setting:
|
||||
> Set up a web server:
|
||||
|
||||
#### Code Examples
|
||||
|
||||
**Keep examples focused:**
|
||||
|
||||
- Show one concept at a time
|
||||
- Use realistic but simple scenarios
|
||||
- Avoid dependencies on other examples
|
||||
|
||||
**Minimal comments**
|
||||
|
||||
Let the code speak for itself.
|
||||
Paste code examples directly and without further alteration.
|
||||
|
||||
**Bad:**
|
||||
|
||||
```nix
|
||||
# This sets the hostname for the machine
|
||||
{
|
||||
networking.hostName = "webserver"; # Change this to your machine's hostname
|
||||
# This enables SSH access
|
||||
services.openssh.enable = true; # Required for remote deployment
|
||||
}
|
||||
```
|
||||
|
||||
**Good:**
|
||||
|
||||
```nix
|
||||
{
|
||||
networking.hostName = "webserver";
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
```
|
||||
|
||||
#### Lead with Practical Examples
|
||||
|
||||
Don't front-load theory. Readers want to accomplish something first, then understand why it works.
|
||||
|
||||
- Show configuration as *what you want*, not *how the module system works*
|
||||
- Introduce Nix-specific concepts only when they are needed to complete the task
|
||||
- Defer language mechanics to reference pages or `nix.dev`
|
||||
|
||||
**Bad:**
|
||||
|
||||
> Before adding a service, you need to understand the NixOS module system and attribute set merging.
|
||||
|
||||
**Good:**
|
||||
|
||||
Enable nginx:
|
||||
|
||||
```nix
|
||||
{ services.nginx.enable = true; }
|
||||
```
|
||||
|
||||
This adds nginx to your system configuration. Rebuild to apply:
|
||||
|
||||
```bash
|
||||
sudo nixos-rebuild switch
|
||||
```
|
||||
|
||||
#### Teach Nix through examples, not theory
|
||||
|
||||
|
||||
Users learn the NixOS module system by seeing patterns first.
|
||||
|
||||
- Start with a working example
|
||||
- Explanation follows the code
|
||||
- Link deeper concepts instead of inlining them
|
||||
- Link to `nix.dev` for optional learning
|
||||
|
||||
#### General Rules
|
||||
|
||||
- Abbreviate keys like `ssh-ed25519 AAAAC3NzaC…`
|
||||
- Abbreviate IP addresses like `192.168.XXX.XXX`
|
||||
- Variables are capitalized and start with `$`, e.g. `$YOUR_HOSTNAME`
|
||||
- Variables should be directly usable during copy-paste
|
||||
- Do **not** describe missing code parts (`#elided`, `#omitted`)
|
||||
- **Machine vs Host**: use "machine" for the NixOS system identity, "host" for the physical or virtual hardware
|
||||
|
||||
#### Capitalization
|
||||
|
||||
- GB / RAM / HDD
|
||||
- bootable USB drive
|
||||
- Wi-Fi / DHCP / DNS
|
||||
- macOS / NixOS / Nix / Linux
|
||||
- Flakes
|
||||
- git
|
||||
|
||||
#### Headings
|
||||
|
||||
Use sentence case. A reader scanning only headings should understand the page.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> Getting Started
|
||||
> Overview
|
||||
> Configure The Database
|
||||
|
||||
**Do:**
|
||||
|
||||
> Set up a PostgreSQL database
|
||||
> Configure networking
|
||||
> Add a user to the system
|
||||
|
||||
#### Imperative Mood, Voice, and Person
|
||||
|
||||
Use imperative mood for instructions. Address the reader as "you", not "the user". Use active voice; in other words, make the subject do the action.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> The user should run the following command.
|
||||
> The configuration will need to be updated.
|
||||
> The key is generated by the system.
|
||||
|
||||
**Do:**
|
||||
|
||||
> Run the command.
|
||||
> Update the configuration.
|
||||
> The system generates the key.
|
||||
|
||||
#### Tense
|
||||
|
||||
Use present tense for descriptions. Future tense makes documentation feel tentative.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> This will create a new folder.
|
||||
> Running this command will install the package.
|
||||
|
||||
**Do:**
|
||||
|
||||
> This creates a new folder.
|
||||
> Running this command installs the package.
|
||||
|
||||
#### Be Confident
|
||||
|
||||
State facts. Don't hedge with "should," "might," "typically," or "usually" unless the behavior genuinely varies.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> This should create the configuration file.
|
||||
> The service will usually start automatically.
|
||||
|
||||
**Do:**
|
||||
|
||||
> This creates the configuration file.
|
||||
> The service starts automatically.
|
||||
|
||||
#### Avoid Nominalizations
|
||||
|
||||
A nominalization is a verb turned into a noun, often by adding *-tion*, *-meant*, or *-ance* (e.g. "explanation", "selection"). The fix: find the hidden verb and use it directly.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> Make a selection from the list.
|
||||
> Provide an explanation of the error.
|
||||
|
||||
**Do:**
|
||||
|
||||
> Select from the list.
|
||||
> Explain the error.
|
||||
|
||||
#### Plain Words
|
||||
|
||||
Technical precision for technical terms; plain language for everything else.
|
||||
|
||||
- "use" not "utilize"
|
||||
- "start" not "initiate"
|
||||
- "end" not "terminate"
|
||||
- "help" not "facilitate"
|
||||
- "send" not "transmit"
|
||||
- "set up" not "establish"
|
||||
- "find out" not "ascertain"
|
||||
|
||||
#### Filler Words and Weak Phrases
|
||||
|
||||
Cut words and phrases that add length without meaning.
|
||||
|
||||
Delete on sight:
|
||||
|
||||
- "simply", "just", "easily", "basically", "obviously"
|
||||
- "in order to" → use "to"
|
||||
- "allows you to" → use the verb directly
|
||||
- "it's worth noting that" → just say the thing
|
||||
- no exclamation marks in technical prose
|
||||
|
||||
**Don't:**
|
||||
|
||||
> Simply run `nixos-rebuild switch`.
|
||||
> In order to deploy, you first need to run the command, which allows you to push the config.
|
||||
> It's worth noting that this requires root access.
|
||||
|
||||
**Do:**
|
||||
|
||||
> Run `nixos-rebuild switch`.
|
||||
> To deploy, run:
|
||||
> This requires root access.
|
||||
|
||||
Every word must earn its place.
|
||||
|
||||
#### Writing Procedures
|
||||
|
||||
One instruction per sentence. Don't pack multiple actions into one sentence.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> Navigate to your project directory and run the command, then check the output.
|
||||
|
||||
**Do:**
|
||||
|
||||
1. Navigate to your project directory.
|
||||
2. Run the command.
|
||||
3. Check the output.
|
||||
|
||||
Don't bury the negative. Key limitations should be prominent, not a footnote after a positive description.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> This service supports multiple roles, integrates with existing modules, and works great for most setups (note that multiple instances are not supported).
|
||||
|
||||
**Do:**
|
||||
|
||||
> This service does not support multiple instances.
|
||||
|
||||
#### Consistent Terminology
|
||||
|
||||
Pick a term and stick to it. Don't swap synonyms to avoid repetition. In technical documentation, repetition is clarity.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> Create a machine... configure the host... deploy the node.
|
||||
|
||||
**Do:**
|
||||
|
||||
> Create a machine... configure the machine... deploy the machine.
|
||||
|
||||
#### Links
|
||||
|
||||
Use descriptive link text. Never use "click here" or "this link."
|
||||
|
||||
**Don't:**
|
||||
|
||||
> For more information, see `[this page](url)`.
|
||||
> Click `[here](url)` to read the reference.
|
||||
|
||||
**Do:**
|
||||
|
||||
> See the `[NixOS options reference](url)` for details.
|
||||
> Read the `[NixOS module system guide](url)`.
|
||||
|
||||
Only link when the destination is directly relevant, not for generic background context (sometimes known as "Wikipedia-style links"). Readers feel obligated to click links, fearing they'll miss something important. Don't send them to a generic article about a technology when they're looking for how *your* system uses it.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> Our software uses [SQLite](https://sqlite.org/) for storage.
|
||||
> *(Reader clicks expecting schema details — finds a generic product page instead.)*
|
||||
|
||||
(Note that in the above example, the SQLite link is the SQLite home page, which is likely not pertinent.)
|
||||
|
||||
**Do:**
|
||||
|
||||
> See `[database schema](url)` for the full table structure.
|
||||
|
||||
#### UI Language
|
||||
|
||||
Match UI element names exactly: wording, casing, and spacing (even if a label seems oddly worded).
|
||||
|
||||
**Don't:**
|
||||
|
||||
> Click the generator button.
|
||||
> Select the save option.
|
||||
|
||||
**Do:**
|
||||
|
||||
> Click **Generate a Key**.
|
||||
> Click **Save Changes**.
|
||||
|
||||
Someone will go looking for a button labeled "generator." They will not find it. They will be frustrated.
|
||||
|
||||
Consistency between documentation and interface builds confidence. Words are part of the interface.
|
||||
|
||||
:::{.tip}
|
||||
This can be tricky as UI changes; we don't yet have a policy in place for how to handle this. We welcome comments and suggestions.
|
||||
:::
|
||||
|
||||
#### Clean system discipline
|
||||
|
||||
Your machine has things new users don't: cached credentials, installed tools, environment variables, existing configuration. When writing or updating documentation:
|
||||
|
||||
**Don't:**
|
||||
|
||||
> Write steps from memory on your development machine, assuming what works there will work everywhere.
|
||||
|
||||
**Do:**
|
||||
|
||||
> - Start on a clean system — a fresh VM or new user account
|
||||
> - Take notes in real time as you work through the steps
|
||||
> - Document every warning, prompt, or unexpected output the system shows
|
||||
|
||||
Also think in combinations: WSL vs native Linux, with and without existing keys. You don't need to test every matrix square — but you need to know which ones diverge.
|
||||
|
||||
#### Never type code — always copy-paste
|
||||
|
||||
Always copy commands and code from a terminal where you just ran them successfully. Never retype from memory.
|
||||
|
||||
**Don't:**
|
||||
|
||||
> Retype a command from memory into the documentation.
|
||||
> Retype code into a code-block from memory
|
||||
|
||||
**Do:**
|
||||
|
||||
> Paste commands directly from the shell or IDE.
|
||||
> Paste code that has been successfully validated with nix-instantiate or nix-build
|
||||
|
||||
Replace sensitive values with placeholders: `<YOUR-KEY>`, `<YOUR-HOST>`, `<YOUR-TOKEN>`.
|
||||
|
||||
Typed-from-memory commands introduce subtle errors. Even the most experienced software developers have occasional typos.
|
||||
@@ -152,7 +152,7 @@ There are several ways to tweak how Nix handles a package which has been marked
|
||||
|
||||
Note that `allowlistedLicenses` only applies to unfree licenses unless `allowUnfree` is enabled. It is not a generic allowlist for all types of licenses. `blocklistedLicenses` applies to all licenses.
|
||||
|
||||
A complete list of licenses can be found in the file [`nixpkgs/lib/licenses/licenses.nix`](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses/licenses.nix) of the nixpkgs tree.
|
||||
A complete list of licenses can be found in the file `lib/licenses.nix` of the nixpkgs tree.
|
||||
|
||||
## Installing insecure packages {#sec-allow-insecure}
|
||||
|
||||
|
||||
@@ -29,7 +29,8 @@ Platform Tiers [4 through 7](https://github.com/NixOS/rfcs/blob/master/rfcs/0046
|
||||
| `x86_64-unknown-linux-musl` | [Tier 3](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-3) | None | Limited | ❌ | ✔️ | ✔️ |
|
||||
| `aarch64-unknown-linux-musl` | [Tier 3](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-3) | None | Limited | ❌ | ✔️ | ✔️ |
|
||||
| `x86_64-unknown-unknown-freebsd` | [Tier 3](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-3) | None | ❌ | ❌ | ✔️ | ✔️ |
|
||||
| `arm64-apple-darwin` | [Tier 2](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-2) | Some | ✔️ | ✔️ | ✔️ | ❌ |
|
||||
| `arm64-apple-darwin` | [Tier 2](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-2) | Some | ✔️ | ✔️ | ✔️ | ❌\* |
|
||||
| `x86_64-apple-darwin` | [Tier 2](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-2) | Some | ✔️ | ✔️ | ✔️ | ❌\* |
|
||||
| `i686-unknown-linux-gnu` | [Tier 3](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-3) | None | Limited | ❌ | ✔️ | ✔️ |
|
||||
| `riscv32-unknown-linux-gnu` | [Tier 4](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-4) | None | ❌ | ❌ | ❌ | ✔️ |
|
||||
| `riscv64-unknown-linux-gnu` | [Tier 3](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-3) | None | ❌ | ❌ | ✔️ | ✔️ |
|
||||
@@ -44,3 +45,5 @@ Platform Tiers [4 through 7](https://github.com/NixOS/rfcs/blob/master/rfcs/0046
|
||||
| `powerpc64-unknown-linux-gnuabielfv2` | [Tier 3](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-3) | None | ❌ | ❌ | ✔️ | ✔️ |
|
||||
| `powerpc64le-unknown-linux-gnu` | [Tier 3](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-3) | None | ❌ | ❌ | ✔️ | ✔️ |
|
||||
| `s390x-unknown-linux-gnu` | [Tier 3](https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md#tier-3) | None | ❌ | ❌ | ✔️ | ✔️ |
|
||||
|
||||
\* - Cross compiling is only supported on Darwin hosts.
|
||||
|
||||
30
flake.nix
30
flake.nix
@@ -220,25 +220,17 @@
|
||||
evaluation. Evaluating the attribute value tends to require a significant
|
||||
amount of computation, even considering lazy evaluation.
|
||||
*/
|
||||
legacyPackages =
|
||||
let
|
||||
# We include `x86_64-darwin` here to ensure that users get a
|
||||
# good error message for the 26.11 deprecation of the platform,
|
||||
# while excluding it from `lib.systems.flakeExposed` so that we
|
||||
# don’t break `nix flake check` for downstream users.
|
||||
forAllSystems' = lib.genAttrs (lib.systems.flakeExposed ++ [ "x86_64-darwin" ]);
|
||||
in
|
||||
forAllSystems' (
|
||||
system:
|
||||
(import ./. {
|
||||
inherit system;
|
||||
overlays = import ./pkgs/top-level/impure-overlays.nix ++ [
|
||||
(final: prev: {
|
||||
lib = prev.lib.extend libVersionInfoOverlay;
|
||||
})
|
||||
];
|
||||
})
|
||||
);
|
||||
legacyPackages = forAllSystems (
|
||||
system:
|
||||
(import ./. {
|
||||
inherit system;
|
||||
overlays = import ./pkgs/top-level/impure-overlays.nix ++ [
|
||||
(final: prev: {
|
||||
lib = prev.lib.extend libVersionInfoOverlay;
|
||||
})
|
||||
];
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
Optional modules that can be imported into a NixOS configuration.
|
||||
|
||||
@@ -1 +1 @@
|
||||
26.11
|
||||
26.05
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
let
|
||||
inherit (builtins) head length;
|
||||
inherit (lib.trivial) mergeAttrs;
|
||||
inherit (lib.strings)
|
||||
concatStringsSep
|
||||
concatMapStringsSep
|
||||
@@ -12,18 +13,16 @@ let
|
||||
sanitizeDerivationName
|
||||
;
|
||||
inherit (lib.lists)
|
||||
all
|
||||
concatLists
|
||||
filter
|
||||
foldr
|
||||
foldl'
|
||||
concatMap
|
||||
elemAt
|
||||
filter
|
||||
foldl
|
||||
foldl'
|
||||
foldr
|
||||
groupBy
|
||||
all
|
||||
partition
|
||||
reverseList
|
||||
groupBy
|
||||
take
|
||||
foldl
|
||||
;
|
||||
in
|
||||
|
||||
@@ -371,11 +370,7 @@ rec {
|
||||
|
||||
:::
|
||||
*/
|
||||
concatMapAttrs =
|
||||
f: v:
|
||||
listToAttrs (
|
||||
concatLists (reverseList (mapAttrsToList (name: value: attrsToList (f name value)) v))
|
||||
);
|
||||
concatMapAttrs = f: v: foldl' mergeAttrs { } (attrValues (mapAttrs f v));
|
||||
|
||||
/**
|
||||
Update or set specific paths of an attribute set.
|
||||
@@ -1617,15 +1612,13 @@ rec {
|
||||
binaryMerge =
|
||||
start: end:
|
||||
# assert start < end; # Invariant
|
||||
if end - start == 1 then
|
||||
# Base case - there will be exactly 1 element due to the invariant, in
|
||||
# which case we just return it directly
|
||||
elemAt list start
|
||||
else
|
||||
if end - start >= 2 then
|
||||
# If there's at least 2 elements, split the range in two, recurse on each part and merge the result
|
||||
# Relies on floor for odd results
|
||||
# The invariant is satisfied because each half will have at least 1 element
|
||||
binaryMerge start ((start + end) / 2) // binaryMerge ((start + end) / 2) end;
|
||||
binaryMerge start (start + (end - start) / 2) // binaryMerge (start + (end - start) / 2) end
|
||||
else
|
||||
# Otherwise there will be exactly 1 element due to the invariant, in which case we just return it directly
|
||||
elemAt list start;
|
||||
in
|
||||
if list == [ ] then
|
||||
# Calling binaryMerge as below would not satisfy its invariant
|
||||
@@ -1805,28 +1798,22 @@ rec {
|
||||
:::
|
||||
*/
|
||||
matchAttrs =
|
||||
let
|
||||
recurse =
|
||||
pattern: attrs:
|
||||
all (
|
||||
# Compare equality between `pattern` & `attrs`.
|
||||
attr:
|
||||
# Missing attr, not equal.
|
||||
attrs ? ${attr}
|
||||
&& (
|
||||
let
|
||||
lhs = pattern.${attr};
|
||||
rhs = attrs.${attr};
|
||||
in
|
||||
# Simple equality check is primarily for non-attrsets, but we run it
|
||||
# on attrsets too, since it may let us avoid recursing
|
||||
lhs == rhs || isAttrs lhs && isAttrs rhs && recurse lhs rhs
|
||||
)
|
||||
) (attrNames pattern);
|
||||
in
|
||||
pattern:
|
||||
pattern: attrs:
|
||||
assert isAttrs pattern;
|
||||
recurse pattern;
|
||||
all (
|
||||
# Compare equality between `pattern` & `attrs`.
|
||||
attr:
|
||||
# Missing attr, not equal.
|
||||
attrs ? ${attr}
|
||||
&& (
|
||||
let
|
||||
lhs = pattern.${attr};
|
||||
rhs = attrs.${attr};
|
||||
in
|
||||
# If attrset check recursively
|
||||
if isAttrs lhs then isAttrs rhs && matchAttrs lhs rhs else lhs == rhs
|
||||
)
|
||||
) (attrNames pattern);
|
||||
|
||||
/**
|
||||
Override only the attributes that are already present in the old set
|
||||
|
||||
66
lib/cli.nix
66
lib/cli.nix
@@ -1,22 +1,6 @@
|
||||
{ lib }:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
concatLists
|
||||
concatMap
|
||||
escapeShellArgs
|
||||
isBool
|
||||
isList
|
||||
mapAttrsToList
|
||||
oldestSupportedReleaseIsAtLeast
|
||||
optional
|
||||
stringLength
|
||||
warnIf
|
||||
;
|
||||
inherit (lib.generators) mkValueStringDefault;
|
||||
mkValueString = mkValueStringDefault { };
|
||||
in
|
||||
rec {
|
||||
{
|
||||
/**
|
||||
Automatically convert an attribute set to command-line options.
|
||||
|
||||
@@ -56,9 +40,9 @@ rec {
|
||||
:::
|
||||
*/
|
||||
toGNUCommandLineShell =
|
||||
warnIf (oldestSupportedReleaseIsAtLeast 2511)
|
||||
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2511)
|
||||
"lib.cli.toGNUCommandLineShell is deprecated, please use lib.cli.toCommandLineShell or lib.cli.toCommandLineShellGNU instead."
|
||||
(options: attrs: escapeShellArgs (toGNUCommandLine options attrs));
|
||||
(options: attrs: lib.escapeShellArgs (lib.cli.toGNUCommandLine options attrs));
|
||||
|
||||
/**
|
||||
Automatically convert an attribute set to a list of command-line options.
|
||||
@@ -132,15 +116,15 @@ rec {
|
||||
:::
|
||||
*/
|
||||
toGNUCommandLine =
|
||||
warnIf (oldestSupportedReleaseIsAtLeast 2511)
|
||||
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2511)
|
||||
"lib.cli.toGNUCommandLine is deprecated, please use lib.cli.toCommandLine or lib.cli.toCommandLineShellGNU instead."
|
||||
(
|
||||
{
|
||||
mkOptionName ? k: if stringLength k == 1 then "-${k}" else "--${k}",
|
||||
mkOptionName ? k: if builtins.stringLength k == 1 then "-${k}" else "--${k}",
|
||||
|
||||
mkBool ? k: v: optional v (mkOptionName k),
|
||||
mkBool ? k: v: lib.optional v (mkOptionName k),
|
||||
|
||||
mkList ? k: concatMap (mkOption k),
|
||||
mkList ? k: v: lib.concatMap (mkOption k) v,
|
||||
|
||||
mkOption ?
|
||||
k: v:
|
||||
@@ -149,24 +133,26 @@ rec {
|
||||
else if optionValueSeparator == null then
|
||||
[
|
||||
(mkOptionName k)
|
||||
(mkValueString v)
|
||||
(lib.generators.mkValueStringDefault { } v)
|
||||
]
|
||||
else
|
||||
[ "${mkOptionName k}${optionValueSeparator}${mkValueString v}" ],
|
||||
[ "${mkOptionName k}${optionValueSeparator}${lib.generators.mkValueStringDefault { } v}" ],
|
||||
|
||||
optionValueSeparator ? null,
|
||||
}:
|
||||
options:
|
||||
let
|
||||
render =
|
||||
k: v:
|
||||
if isBool v then
|
||||
if builtins.isBool v then
|
||||
mkBool k v
|
||||
else if isList v then
|
||||
else if builtins.isList v then
|
||||
mkList k v
|
||||
else
|
||||
mkOption k v;
|
||||
|
||||
in
|
||||
options: concatLists (mapAttrsToList render options)
|
||||
builtins.concatLists (lib.mapAttrsToList render options)
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -177,7 +163,8 @@ rec {
|
||||
For further reference see:
|
||||
[`lib.cli.toCommandLineGNU`](#function-library-lib.cli.toCommandLineGNU)
|
||||
*/
|
||||
toCommandLineShellGNU = options: attrs: escapeShellArgs (toCommandLineGNU options attrs);
|
||||
toCommandLineShellGNU =
|
||||
options: attrs: lib.escapeShellArgs (lib.cli.toCommandLineGNU options attrs);
|
||||
|
||||
/**
|
||||
Converts an attribute set into a list of GNU-style command-line arguments.
|
||||
@@ -240,9 +227,9 @@ rec {
|
||||
*/
|
||||
toCommandLineGNU =
|
||||
{
|
||||
isLong ? optionName: stringLength optionName > 1,
|
||||
isLong ? optionName: builtins.stringLength optionName > 1,
|
||||
explicitBool ? false,
|
||||
formatArg ? mkValueString,
|
||||
formatArg ? lib.generators.mkValueStringDefault { },
|
||||
}:
|
||||
let
|
||||
optionFormat = optionName: {
|
||||
@@ -251,7 +238,7 @@ rec {
|
||||
inherit explicitBool formatArg;
|
||||
};
|
||||
in
|
||||
toCommandLine optionFormat;
|
||||
lib.cli.toCommandLine optionFormat;
|
||||
|
||||
/**
|
||||
Converts the given attributes into a single shell-escaped command-line
|
||||
@@ -261,7 +248,8 @@ rec {
|
||||
For further reference see:
|
||||
[`lib.cli.toCommandLine`](#function-library-lib.cli.toCommandLine)
|
||||
*/
|
||||
toCommandLineShell = optionFormat: attrs: escapeShellArgs (toCommandLine optionFormat attrs);
|
||||
toCommandLineShell =
|
||||
optionFormat: attrs: lib.escapeShellArgs (lib.cli.toCommandLine optionFormat attrs);
|
||||
|
||||
/**
|
||||
Converts an attribute set into a list of command-line arguments.
|
||||
@@ -433,14 +421,14 @@ rec {
|
||||
- `lib.cli.toCommandLineShellGNU`
|
||||
*/
|
||||
toCommandLine =
|
||||
optionFormat:
|
||||
optionFormat: attrs:
|
||||
let
|
||||
handlePair =
|
||||
k: v:
|
||||
if k == "" then
|
||||
throw "lib.cli.toCommandLine only accepts non-empty option names."
|
||||
else if isList v then
|
||||
concatMap (handleOption k) v
|
||||
lib.throw "lib.cli.toCommandLine only accepts non-empty option names."
|
||||
else if builtins.isList v then
|
||||
builtins.concatMap (handleOption k) v
|
||||
else
|
||||
handleOption k v;
|
||||
|
||||
@@ -451,7 +439,7 @@ rec {
|
||||
option,
|
||||
sep,
|
||||
explicitBool,
|
||||
formatArg ? mkValueString,
|
||||
formatArg ? lib.generators.mkValueStringDefault { },
|
||||
}:
|
||||
k: v:
|
||||
if v == null || (!explicitBool && v == false) then
|
||||
@@ -470,5 +458,5 @@ rec {
|
||||
arg
|
||||
];
|
||||
in
|
||||
attrs: concatLists (mapAttrsToList handlePair attrs);
|
||||
builtins.concatLists (lib.mapAttrsToList handlePair attrs);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user