Skip to content

treewide: avoid using singleton lists for licenses - #535754

Merged
jopejoe1 merged 3 commits into
NixOS:masterfrom
llakala:no-singleton-license-lists
Jul 15, 2026
Merged

jopejoe1 merged 3 commits into
NixOS:masterfrom
llakala:no-singleton-license-lists

Conversation

@llakala

@llakala llakala commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

These are all no-ops, as when licenses are a list, it just checks if any of them match the given condition. Licenses as lists is also a bit of an antifeature (see https://discourse.nixos.org/t/compound-licenses/78532).

Generated with:

rg 'license = \[ ' --files-with-matches | xargs sed -i 's/license = \[ \([^]]*\) \];/license = \1;/g'
rg 'license = with lib.licenses; \[ ' --files-with-matches | xargs sed -i 's/license = with lib.licenses; \[ \([^ ]*\) \];/license = lib.licenses.\1;/g'

And then a little manual cleanup. This doesn't really matter - but it's nice to have things done sanely where it's trivial.

Things done

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: qt/kde Object-oriented framework for GUI creation 6.topic: cinnamon Desktop environment 6.topic: mate The MATE Desktop Environment 6.topic: vscode A free and versatile code editor that supports almost every major programming language. labels Jun 26, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Jun 26, 2026
@Sigmanificient

Sigmanificient commented Jun 26, 2026 •

Copy link
Copy Markdown
Member

@llakala Some like a nice pr :D

I did ran a small test script of my own, and found over 1893 affected packages (13188 non-unique attrpaths) that have singleton list for license tho :o

Some of them may be generated, but we sadly dont have a way to filter them out (yet? #513818 :D)

@llakala
llakala force-pushed the no-singleton-license-lists branch 2 times, most recently from d54c827 to 9235b24 Compare June 26, 2026 20:58
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. 6.topic: ocaml OCaml is a general-purpose, high-level, multi-paradigm programming language. 6.topic: TeX Issues regarding texlive and TeX in general 6.topic: Enlightenment DE The Enlightenment Desktop Environment 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: rocm ROCm is an Advanced Micro Devices software stack for graphics processing unit programming. 6.topic: php PHP is a general-purpose scripting language geared towards web development. 6.topic: tree-sitter Tree-sitter is a parser generator tool and an incremental parsing library. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jun 26, 2026
@llakala
llakala force-pushed the no-singleton-license-lists branch from 9235b24 to 42545e7 Compare June 26, 2026 21:07
@nixpkgs-ci nixpkgs-ci Bot removed the 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. label Jun 26, 2026
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 6.topic: TeX Issues regarding texlive and TeX in general labels Jun 26, 2026
@llakala llakala closed this Jun 28, 2026
@llakala llakala reopened this Jun 28, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 7, 2026

@jopejoe1 jopejoe1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, but needs a rebase.

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jul 11, 2026

@eveeifyeve eveeifyeve left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, It would be good include other cases like with lib.licences; * ++ [ * ]; in a future pr.

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 2 This PR was reviewed and approved by two persons. labels Jul 11, 2026
@llakala
llakala force-pushed the no-singleton-license-lists branch from 42545e7 to ff094f6 Compare July 15, 2026 18:05
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 15, 2026

@jopejoe1 jopejoe1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work

@jopejoe1
jopejoe1 added this pull request to the merge queue Jul 15, 2026
Merged via the queue into NixOS:master with commit 134518c Jul 15, 2026
25 checks passed
@jlesquembre jlesquembre mentioned this pull request Jul 16, 2026
4 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cinnamon Desktop environment 6.topic: Enlightenment DE The Enlightenment Desktop Environment 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: mate The MATE Desktop Environment 6.topic: ocaml OCaml is a general-purpose, high-level, multi-paradigm programming language. 6.topic: php PHP is a general-purpose scripting language geared towards web development. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: qt/kde Object-oriented framework for GUI creation 6.topic: rocm ROCm is an Advanced Micro Devices software stack for graphics processing unit programming. 6.topic: tree-sitter Tree-sitter is a parser generator tool and an incremental parsing library. 6.topic: vscode A free and versatile code editor that supports almost every major programming language. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 3+ This PR was reviewed and approved by three or more persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants