diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 5d69dfe4e071..2ae77cf01421 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -7,7 +7,7 @@ name: "Label PR" on: schedule: - - cron: '37 * * * *' + - cron: '07,17,27,37,47,57 * * * *' workflow_call: workflow_dispatch: inputs: @@ -36,10 +36,15 @@ jobs: labels: name: label-pr runs-on: ubuntu-24.04-arm - if: "!contains(github.event.pull_request.title, '[skip treewide]')" + if: github.event_name != 'schedule' || github.repository_owner == 'NixOS' steps: - name: Install dependencies - run: npm install @actions/artifact + run: npm install @actions/artifact bottleneck + + - name: Log current API rate limits + env: + GH_TOKEN: ${{ github.token }} + run: gh api /rate_limit | jq - name: Labels from API data and Eval results uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 @@ -47,12 +52,41 @@ jobs: UPDATED_WITHIN: ${{ inputs.updatedWithin }} with: script: | + const Bottleneck = require('bottleneck') const path = require('node:path') const { DefaultArtifactClient } = require('@actions/artifact') const { readFile } = require('node:fs/promises') const artifactClient = new DefaultArtifactClient() + const stats = { + prs: 0, + requests: 0, + artifacts: 0 + } + + // Rate-Limiting and Throttling, see for details: + // https://github.com/octokit/octokit.js/issues/1069#throttling + // https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api + const allLimits = new Bottleneck({ + // Avoid concurrent requests + maxConcurrent: 1, + // Hourly limit is at 5000, but other jobs need some, too! + // https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api + reservoir: 1000, + reservoirRefreshAmount: 1000, + reservoirRefreshInterval: 60 * 60 * 1000 + }) + // Pause between mutative requests + const writeLimits = new Bottleneck({ minTime: 1000 }).chain(allLimits) + github.hook.wrap('request', async (request, options) => { + stats.requests++ + if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(options.method)) + return writeLimits.schedule(request.bind(null, options)) + else + return allLimits.schedule(request.bind(null, options)) + }) + if (process.env.UPDATED_WITHIN && !/^\d+$/.test(process.env.UPDATED_WITHIN)) throw new Error('Please enter "updated within" as integer in hours.') @@ -90,7 +124,7 @@ jobs: base: context.payload.pull_request.base.ref } - await github.paginate( + const prs = await github.paginate( github.rest.pulls.list, { ...context.repo, @@ -99,12 +133,17 @@ jobs: direction: 'desc', ...prEventCondition }, - async (response, done) => (await Promise.allSettled(response.data.map(async (pull_request) => { + (response, done) => response.data.map(async (pull_request) => { try { - const log = (k,v) => core.info(`PR #${pull_request.number} - ${k}: ${v}`) + const log = (k,v,skip) => { + core.info(`PR #${pull_request.number} - ${k}: ${v}` + (skip ? ' (skipped)' : '')) + return skip + } - log('Last updated at', pull_request.updated_at) - if (new Date(pull_request.updated_at) < cutoff) return done() + if (log('Last updated at', pull_request.updated_at, new Date(pull_request.updated_at) < cutoff)) + return done() + stats.prs++ + log('URL', pull_request.html_url) const run_id = (await github.rest.actions.listWorkflowRuns({ ...context.repo, @@ -118,8 +157,8 @@ jobs: // Newer PRs might not have run Eval to completion, yet. We can skip them, because this // job will be run as part of that Eval run anyway. - log('Last eval run', run_id) - if (!run_id) return; + if (log('Last eval run', run_id ?? '', !run_id)) + return; const artifact = (await github.rest.actions.listWorkflowRunArtifacts({ ...context.repo, @@ -129,8 +168,12 @@ jobs: // Instead of checking the boolean artifact.expired, we will give us a minute to // actually download the artifact in the next step and avoid that race condition. - log('Artifact expires at', artifact.expires_at) - if (new Date(artifact.expires_at) < new Date(new Date().getTime() + 60 * 1000)) return; + // Older PRs, where the workflow run was already eval.yml, but the artifact was not + // called "comparison", yet, will be skipped as well. + const expired = new Date(artifact?.expires_at ?? 0) < new Date(new Date().getTime() + 60 * 1000) + if (log('Artifact expires at', artifact?.expires_at ?? '', expired)) + return; + stats.artifacts++ await artifactClient.downloadArtifact(artifact.id, { findBy: { @@ -163,7 +206,7 @@ jobs: const maintainers = new Set(Object.keys( JSON.parse(await readFile(`${pull_request.number}/maintainers.json`, 'utf-8')) - )) + ).map(m => Number.parseInt(m, 10))) // And the labels that should be there const after = JSON.parse(await readFile(`${pull_request.number}/changed-paths.json`, 'utf-8')).labels @@ -192,10 +235,14 @@ jobs: } catch (cause) { throw new Error(`Labeling PR #${pull_request.number} failed.`, { cause }) } - }))) + }) + ); + + (await Promise.allSettled(prs.flat())) .filter(({ status }) => status == 'rejected') .map(({ reason }) => core.setFailed(`${reason.message}\n${reason.cause.stack}`)) - ) + + core.notice(`Processed ${stats.prs} PRs, made ${stats.requests + stats.artifacts} API requests and downloaded ${stats.artifacts} artifacts.`) - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 name: Labels from touched files diff --git a/doc/hooks/installShellFiles.section.md b/doc/hooks/installShellFiles.section.md index edaea5895a3b..223c47f2e684 100644 --- a/doc/hooks/installShellFiles.section.md +++ b/doc/hooks/installShellFiles.section.md @@ -84,7 +84,7 @@ zsh). } ``` -The path may also be a fifo or named fd (such as produced by `<(cmd)`), in which +The path may also be the result of process substitution (e.g. `<(cmd)`), in which case the shell and name must be provided (see below). If the destination shell completion file is not actually present or consists of @@ -100,7 +100,7 @@ failure. To prevent this, guard the completion generation commands. { nativeBuildInputs = [ installShellFiles ]; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - # using named fd + # using process substitution installShellCompletion --cmd foobar \ --bash <($out/bin/foobar --bash-completion) \ --fish <($out/bin/foobar --fish-completion) \ diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index 91d2ee0d551a..e327eb43ea40 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -879,399 +879,6 @@ stdenv.mkDerivation (finalAttrs: { }) ``` -### buildDenoPackage {#javascript-buildDenoPackage} - -`buildDenoPackage` allows you to package [Deno](https://deno.com/) projects in Nixpkgs without the use of an auto-generated dependencies file (as used in [node2nix](#javascript-node2nix)). -It works by utilizing Deno's cache functionality -- creating a reproducible cache that contains the dependencies of a project, and pointing Deno to it. - -#### buildDenoDeps {#javascript-buildDenoPackage-buildDenoDeps} - -For every `buildDenoPackage`, first, a [fixed output derivation](https://nix.dev/manual/nix/2.18/language/advanced-attributes.html#adv-attr-outputHash) is -created with all the dependencies mentioned in the `deno.lock`. -This works as follows: -1. They are installed using `deno install`. -1. All non-reproducible data is pruned. -1. The directories `.deno`, `node_modules` and `vendor` are copied to `$out`. -1. The output of the FOD is checked against the `denoDepsHash`. -1. The output is copied into the build of `buildDenoPackage`, which is not an FOD. -1. The dependencies are installed again using `deno install`, this time from the local cache only. - -The `buildDenoDeps` derivation is in `passthru`, so it can be accessed from a `buildDenoPackage` derivation with `.denoDeps` - -Related options: - -*`denoDepsHash`* (String) - -: The output hash of the `buildDenoDeps` fixed output derivation. - -*`denoInstallFlags`* (Array of strings; optional) - -: The Flags passed to `deno install`. - -: _Default:_ `[ "--allow-scripts" "--frozen" "--cached-only" ]` for `buildDenoPackage` -: _Default:_ `[ "--allow-scripts" "--frozen" ]` for `buildDenoDeps` (`"--cached-only"` is filtered out) - -::: {.tip} -If you receive errors like these: - -``` -error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it. -``` - -or - -``` -error: Import '' failed. - 0: error sending request for url (): client error (Connect): dns error: failed to lookup address information: Temporary failure in name resolution: failed to lookup address information:Temporary failure in name resolution - 1: client error (Connect) - 2: dns error: failed to lookup address information: Temporary failure in name resolution - 3: failed to lookup address information: Temporary failure in name resolution - at file:///build/source/src/lib/helpers/verifyRequest.ts:2:21 -build for failed in buildPhase with exit code 1 -``` - -or - -``` -error: Specifier not found in cache: "", --cached-only is specified. - -ERROR: deno failed to install dependencies -``` - -This can happen due to the `deno install` command deducing different packages than what the actual package needs. - -To fix this, add the entrypoint to the install flags: - -```nix -{ buildDenoPackage, nix-gitignore }: -buildDenoPackage { - pname = "myPackage"; - version = "0.1.0"; - denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - src = nix-gitignore.gitignoreSource [ ] ./.; - binaryEntrypointPath = "main.ts"; - denoInstallFlags = [ - "--allow-scripts" - "--frozen" - "--cached-only" - "--entrypoint" - "" - ]; -} -``` - -::: - -#### Private registries {#javascript-buildDenoPackage-private-registries} -There are currently 2 options, which enable the use of private registries in a `buildDenoPackage` derivation. - -*`denoDepsImpureEnvVars`* (Array of strings; optional) - -: Names of impure environment variables passed to the `buildDenoDeps` derivation. They are forwarded to `deno install`. - -: _Example:_ `[ "NPM_TOKEN" ]` - -: It can be used to set tokens for private NPM registries (in a `.npmrc` file). - -: In a single-user installation of Nix, you can put the variables into the environment, when running the nix build. - -: In multi-user installations of Nix, it's necessary to set the environment variables in the nix-daemon, probably with systemd. - -:::{.example} - -##### configure nix-daemon {#javascript-buildDenoPackage-private-registries-daemon-example} -In NixOS: - -```nix -# configuration.nix -{ - config, - lib, - pkgs, - ... -}: -{ - systemd.services.nix-daemon.environment.NPM_TOKEN = ""; -} -``` - -In other Linux distributions use - -``` -$ sudo systemctl edit nix-daemon -$ sudo systemctl cat nix-daemon -$ sudo systemctl restart nix-daemon -``` - -::: - -*`denoDepsInjectedEnvVars`* (Attrset; optional) - -: Environment variables as key value pairs. They are forwarded to `deno install`. - -: _Example:_ `{ "NPM_TOKEN" = ""; }` - -: It can be used to set tokens for private NPM registries (in a `.npmrc` file). -You could pass these tokens from the Nix CLI with `--arg`, -however this can hurt the reproducibility of your builds and such an injected -token will also need to be injected in every build that depends on this build. - -:::{.example} - -##### example `.npmrc` {#javascript-buildDenoPackage-private-registries-npmrc-example} - -```ini -@:registry=https:/// -///:_authToken=${NPM_TOKEN} -``` - -::: - -::: {.caution} - -Hardcoding a token into your NixOS configuration or some other nix build, will as a consequence write that token into `/nix/store`, which is considered world readable. - -::: - -::: {.note} -Neither approach is ideal. For `buildNpmPackage`, there exists a third -option called `sourceOverrides`, which allows the user to inject Nix packages into -the output `node_modules` folder. -Since a Nix build implicitly uses the SSH keys of the machine, -this offers a third option to access private packages. -But this creates the requirement, that the imported package is packaged with nix first, -and that the source code can be retrieved with SSH. -This is possible for Deno, too, albeit it not -completely analogous to `buildNpmPackage`'s solution. -However, it has not been implemented yet. -::: - -#### Compile to binary {#javascript-buildDenoPackage-compile-to-binary} - -It's possible to compile a Deno project to a single binary using `deno compile`. -The binary will be named like the `.name` property in `deno.json`, if available, -or the `name` attribute of the derivation. - -:::{.caution} -When using packages with a `npm:` specifier, the resulting binary will not be reproducible. -See [this issue](https://github.com/denoland/deno/issues/29619) for more information. -::: - -Related options: - -*`hostPlatform`* (String; optional) - -: The [host platform](#ssec-cross-platform-parameters) the binary is built for. - -: _Default:_ `builtins.currentSystem`. - -: _Supported values:_ - - `"x86_64-darwin"` - - `"aarch64-darwin"` - - `"x86_64-linux"` - - `"aarch64-linux"` - -*`denoCompileFlags`* (Array of string; optional) - -: Flags passed to `deno compile [denoTaskFlags] ${binaryEntrypointPath} [extraCompileFlags]`. - -*`extraCompileFlags`* (Array of string; optional) - -: Flags passed to `deno compile [denoTaskFlags] ${binaryEntrypointPath} [extraCompileFlags]`. - -*`binaryEntrypointPath`* (String or null; optional) - -: If not `null`, a binary is created using the specified path as the entry point. -The binary is copied to `$out/bin` in the `installPhase`. - -: _Default:_ `null` - -: It's prefixed by `denoWorkspacePath`. - -*`denortPackage`* (Derivation; optional) - -: The package used as the Deno runtime, which is bundled with the JavaScript code to create the binary. - -: _Default:_ `pkgs.denort` - -: Don't use `pkgs.deno` for this, since that is the full Deno CLI, with all the development tooling. - -: If you're cross compiling, this needs to be the `denort` of the `hostPlatform`. - -::: {.note} -The binary will be dynamically linked and not executable on NixOS without [nix-ld](https://github.com/nix-community/nix-ld) -or [other methods](https://unix.stackexchange.com/questions/522822/different-methods-to-run-a-non-nixos-executable-on-nixos). - -```nix -# configuration.nix -{ - config, - lib, - pkgs, - ... -}: -{ - programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - glibc - gcc-unwrapped - ]; -} -``` - -::: - -:::{.example} - -##### example binary build {#javascript-buildDenoPackage-compile-to-binary-example} - -```nix -{ buildDenoPackage, nix-gitignore }: -buildDenoPackage { - pname = "myPackage"; - version = "0.1.0"; - denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - src = nix-gitignore.gitignoreSource [ ] ./.; - binaryEntrypointPath = "main.ts"; -} -``` - -::: - -#### Create artifacts in the build {#javascript-buildDenoPackage-artifacts-in-build} - -Instead of compiling to a binary, `deno task` can be executed inside the build -to produce some artifact, which can then be copied out in the `installPhase`. - -Related options: - -*`denoTaskScript`* (String; optional) - -: The task in `deno.json` that's executed with `deno task`. - -: _Default:_ `"build"` - -*`denoTaskFlags`* (Array of strings; optional) - -: The flags passed to `deno task [denoTaskFlags] ${denoTaskScript} [extraTaskFlags]`. - -*`extraTaskFlags`* (Array of strings; optional) - -: The flags passed to `deno task [denoTaskFlags] ${denoTaskScript} [extraTaskFlags]`. - -*`denoTaskPrefix`* (String; optional) - -: An unquoted string injected before `deno task`. - -*`denoTaskSuffix`* (String; optional) - -: An unquoted string injected after `deno task` and all its flags. For example to pipe stdout to a file. - -:::{.example} - -##### example artifact build {#javascript-buildDenoPackage-artifacts-in-build-example} - -`deno.json` - -```json -{ - "tasks": { - "build": "deno run --allow-all main.ts" - } -} -``` - -```nix -{ buildDenoPackage, nix-gitignore }: -buildDenoPackage { - pname = "myPackage"; - version = "0.1.0"; - denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - src = nix-gitignore.gitignoreSource [ ] ./.; - denoTaskSuffix = ">out.txt"; - installPhase = '' - cp ./out.txt $out - ''; -} -``` - -::: - -#### Workspaces {#javascript-buildDenoPackage-workspaces} - -Deno's workspaces are supported. - -To make them work, the whole project needs to be added as source, since the `deno.lock` -is always in the root of the project and contains all dependencies. - -This means a build with only the required dependencies of a workspace is not possible. -Also, the `denoDepsHash` for all workspaces is the same, since they -all share the same dependencies. - -When [running a task inside the build](#javascript-buildDenoPackage-artifacts-in-build), -`denoWorkspacePath` can be used to let the task run inside a workspace. - -When [compiling to a binary](#javascript-buildDenoPackage-compile-to-binary), -`binaryEntrypointPath` is prefixed by `denoWorkspacePath`. - -Related options: - -*`denoWorkspacePath`* (String; optional) - -: The path to a workspace. - -:::{.example} - -##### example workspaces {#javascript-buildDenoPackage-workspaces-example} - -```nix -{ buildDenoPackage, nix-gitignore }: -rec { - sub1 = buildDenoPackage { - pname = "sub1"; - version = "0.1.0"; - denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; - src = nix-gitignore.gitignoreSource [ ] ./.; - denoWorkspacePath = "./sub1"; - denoTaskFlags = [ - "--text" - "sub1" - ]; - denoTaskSuffix = ">out.txt"; - installPhase = '' - cp out.txt $out - ''; - }; - sub2 = buildDenoPackage { - # Note that we are reusing denoDeps and src, - # since they must be the same for both workspaces. - inherit (sub1) denoDeps src; - pname = "sub2"; - version = "0.1.0"; - denoWorkspacePath = "./sub2"; - binaryEntrypointPath = "./main.ts"; - }; -} -``` - -::: - -#### Other Options {#javascript-buildDenoPackage-other-options} - -*`denoDir`* (String; optional) - -: `DENO_DIR` will be set to this value for all `deno` commands. - -*`denoFlags`* (Array of string; optional) - -: The flags passed to all `deno` commands. - -*`denoPackage`* (Derivation; optional) - -: The Deno CLI used for all `deno` commands inside the build. - -: _Default:_ `pkgs.deno` - ## Outside Nixpkgs {#javascript-outside-nixpkgs} There are some other tools available, which are written in the Nix language. diff --git a/doc/redirects.json b/doc/redirects.json index 61756f44c902..7fb27ab4ced1 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -3390,42 +3390,6 @@ "javascript-nix-npm-buildpackage-pitfalls": [ "index.html#javascript-nix-npm-buildpackage-pitfalls" ], - "javascript-buildDenoPackage-workspaces-example": [ - "index.html#javascript-buildDenoPackage-workspaces-example" - ], - "javascript-buildDenoPackage-private-registries": [ - "index.html#javascript-buildDenoPackage-private-registries" - ], - "javascript-buildDenoPackage-buildDenoDeps": [ - "index.html#javascript-buildDenoPackage-buildDenoDeps" - ], - "javascript-buildDenoPackage-artifacts-in-build": [ - "index.html#javascript-buildDenoPackage-artifacts-in-build" - ], - "javascript-buildDenoPackage-artifacts-in-build-example": [ - "index.html#javascript-buildDenoPackage-artifacts-in-build-example" - ], - "javascript-buildDenoPackage-private-registries-daemon-example": [ - "index.html#javascript-buildDenoPackage-private-registries-daemon-example" - ], - "javascript-buildDenoPackage-private-registries-npmrc-example": [ - "index.html#javascript-buildDenoPackage-private-registries-npmrc-example" - ], - "javascript-buildDenoPackage-compile-to-binary-example": [ - "index.html#javascript-buildDenoPackage-compile-to-binary-example" - ], - "javascript-buildDenoPackage-workspaces": [ - "index.html#javascript-buildDenoPackage-workspaces" - ], - "javascript-buildDenoPackage": [ - "index.html#javascript-buildDenoPackage" - ], - "javascript-buildDenoPackage-other-options": [ - "index.html#javascript-buildDenoPackage-other-options" - ], - "javascript-buildDenoPackage-compile-to-binary": [ - "index.html#javascript-buildDenoPackage-compile-to-binary" - ], "language-julia": [ "index.html#language-julia" ], diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 01d952655ad5..11d54b19159f 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -551,8 +551,6 @@ - `ddclient` was updated from 3.11.2 to 4.0.0 [Release notes](https://github.com/ddclient/ddclient/releases/tag/v4.0.0) -- `buildDenoPackage` was added [see docs](https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/javascript.section.md#avascript-buildDenoPackage) for more details - ## Nixpkgs Library {#sec-nixpkgs-release-25.05-lib} ### Breaking changes {#sec-nixpkgs-release-25.05-lib-breaking} diff --git a/doc/release-notes/rl-2511.section.md b/doc/release-notes/rl-2511.section.md index 92c90acda4ae..1cd2bd89c6f7 100644 --- a/doc/release-notes/rl-2511.section.md +++ b/doc/release-notes/rl-2511.section.md @@ -18,6 +18,7 @@ - `base16-builder` node package has been removed due to lack of upstream maintenance. - `gentium` package now provides `Gentium-*.ttf` files, and not `GentiumPlus-*.ttf` files like before. The font identifiers `Gentium Plus*` are available in the `gentium-plus` package, and if you want to use the more recently updated package `gentium` [by sil](https://software.sil.org/gentium/), you should update your configuration files to use the `Gentium` font identifier. - `space-orbit` package has been removed due to lack of upstream maintenance. Debian upstream stopped tracking it in 2011. +- `command-not-found` package is now disabled by default; it works only for nix-channels based systems, and requires setup for it to work. - `gnome-keyring` no longer ships with an SSH agent anymore because it has been deprecated upstream. You should use `gcr_4` instead, which provides the same features. More information on why this was done can be found on [the relevant GCR upstream PR](https://gitlab.gnome.org/GNOME/gcr/-/merge_requests/67). diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 4ca444cecfd5..459af64996ca 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -1648,6 +1648,12 @@ github = "angaz"; githubId = 10219618; }; + angelodlfrtr = { + name = "Angelo Delefortrie"; + email = "angelo.delefortrie@gmail.com"; + github = "angelodlfrtr"; + githubId = 5405598; + }; angristan = { email = "angristan@pm.me"; github = "angristan"; @@ -3432,12 +3438,6 @@ githubId = 75451918; name = "Charlie Root"; }; - bluescreen303 = { - email = "mathijs@bluescreen303.nl"; - github = "bluescreen303"; - githubId = 16330; - name = "Mathijs Kwik"; - }; blusk = { email = "bluskript@gmail.com"; github = "bluskript"; @@ -11632,6 +11632,13 @@ githubId = 110620; name = "Jevin Maltais"; }; + jezcope = { + email = "j.cope@erambler.co.uk"; + github = "jezcope"; + githubId = 457628; + name = "Jez Cope"; + keys = [ { fingerprint = "D9DA 3E47 E8BD 377D A317 B3D0 9E42 CE07 1C45 59D1"; } ]; + }; jfchevrette = { email = "jfchevrette@gmail.com"; github = "jfchevrette"; @@ -14288,6 +14295,12 @@ githubId = 75130626; keys = [ { fingerprint = "80EE AAD8 43F9 3097 24B5 3D7E 27E9 7B91 E63A 7FF8"; } ]; }; + link00000000 = { + email = "crandall.logan@gmail.com"; + github = "link00000000"; + githubId = 9771505; + name = "Logan Crandall"; + }; link2xt = { email = "link2xt@testrun.org"; githubId = 18373967; @@ -20068,6 +20081,12 @@ githubId = 24578572; name = "Blake North"; }; + powwu = { + name = "powwu"; + email = "hello@powwu.sh"; + github = "powwu"; + githubId = 20643401; + }; poz = { name = "Jacek Poziemski"; email = "poz@poz.pet"; diff --git a/maintainers/scripts/kde/collect-missing-deps.py b/maintainers/scripts/kde/collect-missing-deps.py index d7e3ec899bb1..e3b687cba025 100755 --- a/maintainers/scripts/kde/collect-missing-deps.py +++ b/maintainers/scripts/kde/collect-missing-deps.py @@ -62,6 +62,9 @@ OK_MISSING_BY_PACKAGE = { "krfb": { "Qt6XkbCommonSupport", # not real }, + "ksystemstats": { + "Libcap", # used to call setcap at build time and nothing else + }, "kuserfeedback": { "Qt6Svg", # all used for backend console stuff we don't ship "QmlLint", @@ -75,6 +78,9 @@ OK_MISSING_BY_PACKAGE = { "display-info", # newer versions identify as libdisplay-info "Libcap", # used to call setcap at build time and nothing else }, + "kwin-x11": { + "Libcap", # used to call setcap at build time and nothing else + }, "libksysguard": { "Libcap", # used to call setcap at build time and nothing else }, @@ -84,6 +90,12 @@ OK_MISSING_BY_PACKAGE = { }, "plasma-desktop": { "scim", # upstream is dead, not packaged in Nixpkgs + "KAccounts6", # dead upstream + "AccountsQt6", # dead upstream + "signon-oauth2plugin", # dead upstream + }, + "plasma-dialer": { + "KTactileFeedback", # dead? }, "poppler-qt6": { "gobject-introspection-1.0", # we don't actually want to build the GTK variant diff --git a/nixos/modules/programs/command-not-found/command-not-found.nix b/nixos/modules/programs/command-not-found/command-not-found.nix index 47c5e0de3f8b..40ee958a0a49 100644 --- a/nixos/modules/programs/command-not-found/command-not-found.nix +++ b/nixos/modules/programs/command-not-found/command-not-found.nix @@ -33,10 +33,16 @@ in enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = '' Whether interactive shells should show which Nix package (if any) provides a missing command. + + Requires nix-channels to be set and downloaded (sudo nix-channels --update.) + + See also nix-index and nix-index-database as an alternative for flakes-based systems. + + Additionally, having the env var NIX_AUTO_RUN set will automatically run the matching package, and with NIX_AUTO_RUN_INTERACTIVE it will confirm the package before running. ''; }; @@ -54,47 +60,24 @@ in config = lib.mkIf cfg.enable { programs.bash.interactiveShellInit = '' - # This function is called whenever a command is not found. command_not_found_handle() { - local p='${commandNotFound}/bin/command-not-found' - if [ -x "$p" ] && [ -f '${cfg.dbPath}' ]; then - # Run the helper program. - "$p" "$@" - # Retry the command if we just installed it. - if [ $? = 126 ]; then - "$@" - else - return 127 - fi - else - echo "$1: command not found" >&2 - return 127 - fi + '${commandNotFound}/bin/command-not-found' "$@" } ''; programs.zsh.interactiveShellInit = '' - # This function is called whenever a command is not found. command_not_found_handler() { - local p='${commandNotFound}/bin/command-not-found' - if [ -x "$p" ] && [ -f '${cfg.dbPath}' ]; then - # Run the helper program. - "$p" "$@" - - # Retry the command if we just installed it. - if [ $? = 126 ]; then - "$@" - else - return 127 - fi - else - # Indicate than there was an error so ZSH falls back to its default handler - echo "$1: command not found" >&2 - return 127 - fi + '${commandNotFound}/bin/command-not-found' "$@" } ''; + # NOTE: Fish by itself checks for nixos command-not-found, let's instead makes it explicit. + programs.fish.interactiveShellInit = '' + function fish_command_not_found + "${commandNotFound}/bin/command-not-found" $argv + end + ''; + environment.systemPackages = [ commandNotFound ]; }; diff --git a/nixos/modules/programs/command-not-found/command-not-found.pl b/nixos/modules/programs/command-not-found/command-not-found.pl index 72e246c81ae9..64f0f1a49877 100644 --- a/nixos/modules/programs/command-not-found/command-not-found.pl +++ b/nixos/modules/programs/command-not-found/command-not-found.pl @@ -10,6 +10,24 @@ my $program = $ARGV[0]; my $dbPath = "@dbPath@"; +if (! -e $dbPath) { + print STDERR "$program: command not found\n"; + print STDERR "\n"; + print STDERR "command-not-found: Missing package database\n"; + print STDERR "command-not-found is a tool for searching for missing packages.\n"; + print STDERR "No database was found, this likely means the database hasn't been generated yet.\n"; + print STDERR "This tool requires nix-channels to generate the database for the `nixos` channel.\n"; + print STDERR "\n"; + print STDERR "If you are using nix-channels you can run:\n"; + print STDERR " sudo nix-channels --update\n"; + print STDERR "\n"; + print STDERR "If you are using flakes, see nix-index and nix-index-database.\n"; + print STDERR "\n"; + print STDERR "If you would like to disable this message you can set:\n"; + print STDERR " programs.command-not-found.enable = false;\n"; + exit 127; +} + my $dbh = DBI->connect("dbi:SQLite:dbname=$dbPath", "", "") or die "cannot open database `$dbPath'"; $dbh->{RaiseError} = 0; diff --git a/nixos/modules/services/databases/postgresql.md b/nixos/modules/services/databases/postgresql.md index e1256c9672f2..a83918efc7cc 100644 --- a/nixos/modules/services/databases/postgresql.md +++ b/nixos/modules/services/databases/postgresql.md @@ -21,7 +21,10 @@ To enable PostgreSQL, add the following to your {file}`configuration.nix`: services.postgresql.package = pkgs.postgresql_15; } ``` -Note that you are required to specify the desired version of PostgreSQL (e.g. `pkgs.postgresql_15`). Since upgrading your PostgreSQL version requires a database dump and reload (see below), NixOS cannot provide a default value for [](#opt-services.postgresql.package) such as the most recent release of PostgreSQL. + +The default PostgreSQL version is approximately the latest major version available on the NixOS release matching your [`system.stateVersion`](#opt-system.stateVersion). +This is because PostgreSQL upgrades require a manual migration process (see below). +Hence, upgrades must happen by setting [`services.postgresql.package`](#opt-services.postgresql.package) explicitly.