NixOS/nixfmt

Simplify copyright and licensing

Closed this issue · 8 comments

Currently CI enforces REUSE 3.0, which enforces each file to have copyright and licensing information. This is a bit tedious and I'd rather avoid it if we can.

@Sereja313 also mentioned on Matrix:

This is definitely not necessary.

Currently master has these copyright lines throughout the codebase:

All files use MPL-2.0, the Mozilla Public License 2.0.

I don't think there's a need to relicense, and the license is already inlined in LICENSE.

So we just need to union the copyright lines and put that in e.g. the README:

I'm not sure about merging existing copyright notices. While there are no strict requirements for adding new copyright notices, MPL-2.0 appears to prohibit the removal or modification of existing ones:

3.4. Notices

You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.

I guess it should be

I'm pretty sure it should be fine like this because we're not substantially altering the copyright. This is what the copyright would look like if it was specified in a single file from the start.

@Sereja313 If you could just double-check with Serokell and give us the go that would be great. Would also like to have a go by @Lucus16 and @piegamesde.

I see three reasons for enforcing REUSE 3.0:

  1. Different files may have different license terms, particularly if you copy-paste a piece of code from another place (copy-paste is not the best practice, but sometimes you end up doing it for a good reason). If someone copies a piece of code licensed with e. g. the MIT license, it will be needed to specify to which files the MPL-2.0 license applies and to which files the MIT license applies. REUSE 3.0 defines a reasonable way how to do that. That being said, this argument is not applicable to nixfmt as of now, because indeed all files use MPL-2.0 (checked by doing reuse spdx | grep LicenseInfoInFile).
  2. It ensures that if someone copies a piece of code from another place, this person will have to think about the license, and increases the chances that the person will copy the corresponding license text and copyright, as many licenses require. Without REUSE 3.0 if I copy an MIT-licensed file from elsewhere, I may likely forget to copy the copyright, which will be, strictly speaking, a violation of the MIT license terms. With reuse check on CI I will be forced to think about it.
  3. If someone copies something from nixfmt somewhere else, this person will likely see the header and pay attention to the license terms.

If you could just double-check with Serokell and give us the go that would be great.

While I see good reasons for REUSE 3.0 as mentioned above, I consider them quite minor, so if they don't look convincing to anybody, I'm fine with the change 🙂

(discussed in the team meeting today:)

General agreement that we can stop using REUSE 3.0, let's have a single file with all the copyrights

We also discussed a related but orthogonal question: #169

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/formatting-team-meeting-2024-03-19/41845/1

Implementation: #171

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/code-attribution-policy/50445/9