Commit Graph

12 Commits

Author SHA1 Message Date
Stefan Frijters
1357901208 removeReferencesTo: rewrite using replaceVarsWith 2026-01-28 18:59:15 +01:00
Stefan Frijters
011ac8ec95 removeReferencesTo: use replaceVars instead of substituteAll
Also match up flags to nukeReferences
2026-01-28 17:50:04 +01:00
Emily
1620104ec6 {nukeReferences,removeReferencesTo}: simplify and fix quoting 2025-08-03 22:41:42 +01:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Winter
262532f409 removeReferencesTo: unbreak when __structuredAttrs is enabled
When `__structuredAttrs` is enabled, the `remove-references-to` script
ends up being built with a shebang of `#!@shell@` (among other, Darwin-
specific, breakages), as `$shell` isn't defined.

A small interlude: the eagle-eyed stdenv knowers reading this may be
thinking to themselves, "Doesn't stdenv set `$shell` if it's not
defined?" This is true... *but* consider the state of this file before
this change: it had `shell` as an argument to `mkDerivation`, and
arguments to `mkDerivation` get defined as *Bash variables*. So, when
stdenv was checking to see if `$shell` was defined, it was looking at
the *Bash variable* and not the environment variable.
2025-05-11 00:39:10 -04:00
Silvan Mosberger
667d42c00d treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev 57b193d8dd
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:27:17 +01:00
stuebinm
ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00
Weijia Wang
6b456c252b Merge pull request #162447 from thefloweringash/remove-references-to-region
removeReferencesTo: correct region reference in fixupHook
2023-05-17 12:34:28 +03:00
Naïm Favier
3c697db972 removeReferencesTo: kill lone hashes
Nix counts any occurrence of a store path's *hash* as a reference, even
without a store directory prefix. The current version only kills
references of the form `/nix/store/<hash>-`, which can fail e.g. for
compressed files.
2022-08-25 17:25:58 +02:00
Andrew Childs
44886930e2 removeReferencesTo: correct region reference in fixupHook
This was causing some regions to escape the fixupHook. As a concrete
example, pkgconf's signature on aarch64-darwin was not valid because
the library was not fixed up.
2022-03-05 15:48:46 +09:00
Andrew Childs
f067102afe removeReferencesTo: fix code signatures on aarch64-darwin 2021-05-17 00:27:03 +09:00
Linus Heckemann
603b799bcb Add removeReferencesTo for removing specific refs
This allows for a less blanket approach than nuke-refs, targetting specific
references that we know we don't want rather than all references that we don't
know we want.
2017-03-09 12:01:55 +00:00