Skip to content

License of package versus license of source/project and propagation of licenses #106471

Open

Description

@FRidh

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.

Related issues

Considerations

  • 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

Activity

  1. added
    0.kind: bug
    9.needs: community feedback
    on Dec 9, 2020
  2. markuskowa commented on Dec 10, 2020

    @markuskowa
    Member

    Are there examples of other distributions that have attempted to deal with this type of problem?

  3. lheckemann commented on Dec 12, 2020

    @lheckemann
    Member

    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…

  4. stale commented on Jun 10, 2021

    @stale

    I marked this as stale due to inactivity. → More info

  5. added
    2.status: stale
    on Jun 10, 2021
  6. nixos-discourse commented on Jul 16, 2021

    @nixos-discourse
  7. removed
    2.status: stale
    on Jul 16, 2021
  8. Atemu commented on Jul 20, 2021

    @Atemu
    Member

    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.

  9. nixos-discourse commented on Feb 4, 2022

    @nixos-discourse
  10. added
    6.topic: cuda
    on Jan 2, 2024
  11. Atemu commented on Jan 25, 2024

    @Atemu
    Member

    Related: #283706

  12. added
    2.status: stale
    on Jul 3, 2025
  13. jopejoe1 commented on Sep 11, 2026

    @jopejoe1
    Member

    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.

  14. removed
    2.status: stale
    on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug6.topic: cuda9.needs: community feedback

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions