You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
License of package versus license of source/project and propagation of licenses #106471
Describe the bug
In the meta.license of a package we typically state the licenses that apply to the source, not the licenses that apply to the built project.
Additional context
The actual licenses that apply to the built package can be different. Exactly which apply is difficult to say as it depends entirely on the licenses of the source, as well as other (native) build inputs. This makes it impossible to reason about at evaluation time and near impossible by inspecting build artifacts.
Even so, it is possible to take a cautious approach by propagating licenses. This allows for example organizations to block software that may be GPL-licensed.
In my opinion meta.licenses as we have now should be part of the src derivation, and meta.license of a package should be taken from there by default. Additionally, I think we could have a config.meta.propagateLicenses to propagate licenses of all build inputs. I think there could be an additional switch for native build inputs.
I imagine this could need an RFC.
Notify maintainers
Note I have no need for this myself and merely wrote this because it again came up on IRC.
propagating licenses may impact evaluation severely
not propagating licenses of build tools will encourage the users of this feature to fix separation of native versus non-native inputs which is also good for cross-compilation
Reacted by peelz, Matthew Croughan, Markus Kowalewski, Cosima Neidahl, Linus Heckemann, midchildan, Atemu, Dennis Gosnell, Jonathan Ringer, Else, Someone and 2 more
If we're going in that direction: I think it would also be good to have some sort of tagging not only in the expressions that define a package, but to propagate this info to the outputs instead. I'm not sure if we need modifications to nix for that or if putting a file in $out/nix-support would be sufficient for this…
It'd probably be best to not propagate a certain license but license properties: i.e. unfree or GPLInfected, thus creating a new cumulative "license" for the entire closure.
Reacted by Frederik Rietdijk, Jonathan Ringer, Else, Someone, Yueh-Shun Li, Maximilian Bosch and Jo
Starting to think we should also add meta.license to src derivations and make it so that we have the license be about what is contained in the derivation output.
Activity
markuskowa commentedon Dec 10, 2020
Are there examples of other distributions that have attempted to deal with this type of problem?
lheckemann commentedon Dec 12, 2020
If we're going in that direction: I think it would also be good to have some sort of tagging not only in the expressions that define a package, but to propagate this info to the outputs instead. I'm not sure if we need modifications to nix for that or if putting a file in $out/nix-support would be sufficient for this…
stale commentedon Jun 10, 2021
I marked this as stale due to inactivity. → More info
nixos-discourse commentedon Jul 16, 2021
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/generating-software-bill-of-materials-from-derivation/14089/2
Atemu commentedon Jul 20, 2021
It'd probably be best to not propagate a certain license but license properties: i.e.
unfreeorGPLInfected, thus creating a new cumulative "license" for the entire closure.nixos-discourse commentedon Feb 4, 2022
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/petition-to-build-and-cache-unfree-packages-on-cache-nixos-org/17440/12
Atemu commentedon Jan 25, 2024
Related: #283706
jopejoe1 commentedon Sep 11, 2026
Starting to think we should also add
meta.licenseto src derivations and make it so that we have the license be about what is contained in the derivation output.