Skip to content

Set license to Apache-2.0, and make REUSE compliant - #66

Open
RasmusRendal wants to merge 2 commits into
mainfrom
RasmusRendal/apache2
Open

Set license to Apache-2.0, and make REUSE compliant#66
RasmusRendal wants to merge 2 commits into
mainfrom
RasmusRendal/apache2

Conversation

@RasmusRendal

@RasmusRendal RasmusRendal commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The interesting part involves making sure that all our auto-generated
files have a REUSE header, or at least generate a .license file next to it.

Otherwise, we just set up a pre-commit hook that runs reuse lint-file on changed files.

I've tested it with rust-telemetry, and it works flawlessly there.

My favourite part of this PR is no longer having to add all files generated by ES to the REUSE.toml of all downstream projects.

@RasmusRendal
RasmusRendal force-pushed the RasmusRendal/apache2 branch 4 times, most recently from 568fa1c to add7c42 Compare August 6, 2026 08:54
@RasmusRendal
RasmusRendal marked this pull request as ready for review August 6, 2026 09:14
@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Licensing and tooling-only: SPDX headers plus a REUSE pre-commit check. Downstream repos may see generated-file churn and a new lint failure mode, but runtime/security behavior is unchanged.

Overview
Declares Apache-2.0 for the repository and makes it REUSE-compliant so downstream projects no longer need to list engineering-standards–generated files in their own REUSE.toml.

Adds SPDX copyright/license headers across source and config, plus LICENSES/Apache-2.0.txt. New reuse.nix installs a reuse lint-file pre-commit hook and auto-emits .yml.license sidecars for generated GitHub workflows.

Introduces add-header.nix and uses it (plus similar header injection) so filegen output—treefmt.toml, .pre-commit-config.yaml, rustfmt.toml, .gitattributes, Dart analysis/dependency configs—ships with SPDX headers by default.

Reviewed by Cursor Bugbot for commit 00da54d. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Generated files lack REUSE headers
    • Added SPDX REUSE headers to the rustfmt.toml, dart_dependency_validator.yaml, and analysis_options.standards.yaml generators to match treefmt.toml / workflows.

Create PR

Or push these changes by commenting:

@cursor push 447ddeec75
Preview (447ddeec75)
diff --git a/.editorconfig b/.editorconfig
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # managed-by: engineering-standards — do not edit manually.
 #
 # Regenerate with `nix run .#filegen-activate`.

diff --git a/.gitattributes b/.gitattributes
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,6 +1,15 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
+# managed-by: engineering-standards — do not edit manually.
+#
+# Regenerate with `nix run .#filegen-activate`.
+
 .pre-commit-config.yaml linguist-generated
 .github/workflows/check-pre-commit-hooks.yml linguist-generated
 .gitattributes linguist-generated
 .editorconfig linguist-generated
 treefmt.toml linguist-generated
 .taplo.toml linguist-generated
+.github/workflows/check-pre-commit-hooks.yml.license linguist-generated

diff --git a/.github/workflows/check-pre-commit-hooks.yml.license b/.github/workflows/check-pre-commit-hooks.yml.license
new file mode 100644
--- /dev/null
+++ b/.github/workflows/check-pre-commit-hooks.yml.license
@@ -1,0 +1,3 @@
+SPDX-FileCopyrightText: 2026 Famedly GmbH
+
+SPDX-License-Identifier: Apache-2.0

diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 .devenv/
 result/

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 repos:
 - hooks:
   - id: check-added-large-files
@@ -79,3 +83,13 @@
     pass_filenames: false
     stages: []
   repo: local
+- hooks:
+  - args:
+    - lint-file
+    description: Ensure compliance with REUSE recommendations
+    entry: reuse
+    id: reuse
+    language: system
+    name: reuse
+    stages: []
+  repo: local

diff --git a/.taplo.toml b/.taplo.toml
--- a/.taplo.toml
+++ b/.taplo.toml
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 exclude = ["target-analyzer/**", "target/**"]
 
 [formatting]

diff --git a/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt
new file mode 100644
--- /dev/null
+++ b/LICENSES/Apache-2.0.txt
@@ -1,0 +1,73 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+     (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+     (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+     (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+     (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+     You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,3 +1,9 @@
+<!--
+SPDX-FileCopyrightText: 2026 Famedly GmbH
+
+SPDX-License-Identifier: Apache-2.0
+-->
+
 # Famedly engineering standards
 
 This repository serves as the central definition for all developer

diff --git a/flake.lock.license b/flake.lock.license
new file mode 100644
--- /dev/null
+++ b/flake.lock.license
@@ -1,0 +1,3 @@
+SPDX-FileCopyrightText: 2026 Famedly GmbH
+
+SPDX-License-Identifier: Apache-2.0

diff --git a/flake.nix b/flake.nix
--- a/flake.nix
+++ b/flake.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   description = "Famedly Engineering Standards — Nix-first standards distribution";
 

diff --git a/nix/dart/default.nix b/nix/dart/default.nix
--- a/nix/dart/default.nix
+++ b/nix/dart/default.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   flake-parts-lib,
   lib,

diff --git a/nix/dart/dependencies.nix b/nix/dart/dependencies.nix
--- a/nix/dart/dependencies.nix
+++ b/nix/dart/dependencies.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # `dependency_validator` holds a project's manifest against what its code
 # actually imports: a dependency nobody imports, and an import nobody declared.
 #
@@ -76,6 +80,10 @@
           settings.ignore = lib.unique (linters ++ projectConfig.checks.dependencies.ignore);
 
           header = pkgs.writeText "dart_dependency_validator.yaml.header" ''
+            ## SPDX-FileCopyrightText: 2026 Famedly GmbH
+            ##
+            ## SPDX-License-Identifier: Apache-2.0
+
             # managed-by: engineering-standards — do not edit manually.
             #
             # Regenerate with `nix run .#filegen-activate`. Further entries belong in

diff --git a/nix/dart/devshell.nix b/nix/dart/devshell.nix
--- a/nix/dart/devshell.nix
+++ b/nix/dart/devshell.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { lib, ... }:
 importingFlake: {
   config.perSystem =

diff --git a/nix/dart/formatting.nix b/nix/dart/formatting.nix
--- a/nix/dart/formatting.nix
+++ b/nix/dart/formatting.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { lib, ... }:
 importingFlake: {
   config.perSystem =

diff --git a/nix/dart/image.nix b/nix/dart/image.nix
--- a/nix/dart/image.nix
+++ b/nix/dart/image.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # Images are assembled from nixpkgs rather than from a distro base image.
 # Artefacts compiled in the devshell carry nix store paths — `dart compile exe`
 # copies the SDK's `dartaotruntime`, so the binary inherits the loader nixpkgs

diff --git a/nix/dart/linting.nix b/nix/dart/linting.nix
--- a/nix/dart/linting.nix
+++ b/nix/dart/linting.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { lib, flake-parts-lib, ... }:
 importingFlake: {
   options.perSystem = flake-parts-lib.mkPerSystemOption ({
@@ -232,6 +235,10 @@
 
           header = pkgs.writeText "analysis_options.standards.yaml.header" (
             ''
+              ## SPDX-FileCopyrightText: 2026 Famedly GmbH
+              ##
+              ## SPDX-License-Identifier: Apache-2.0
+
               # managed-by: engineering-standards — do not edit manually.
               #
               # Regenerate with `nix run .#filegen-activate`. Put repository-specific

diff --git a/nix/dart/packages/dart-sdk.nix b/nix/dart/packages/dart-sdk.nix
--- a/nix/dart/packages/dart-sdk.nix
+++ b/nix/dart/packages/dart-sdk.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   fetchurl,
   lib,

diff --git a/nix/dart/packages/flutter-sdk-data.json.license b/nix/dart/packages/flutter-sdk-data.json.license
new file mode 100644
--- /dev/null
+++ b/nix/dart/packages/flutter-sdk-data.json.license
@@ -1,0 +1,3 @@
+SPDX-FileCopyrightText: 2026 Famedly GmbH
+
+SPDX-License-Identifier: Apache-2.0

diff --git a/nix/dart/packages/flutter-sdk.nix b/nix/dart/packages/flutter-sdk.nix
--- a/nix/dart/packages/flutter-sdk.nix
+++ b/nix/dart/packages/flutter-sdk.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { flutterPackages, lib }:
 
 let

diff --git a/nix/dart/pre-commit-hooks.nix b/nix/dart/pre-commit-hooks.nix
--- a/nix/dart/pre-commit-hooks.nix
+++ b/nix/dart/pre-commit-hooks.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { lib, ... }:
 {
   config.perSystem =

diff --git a/nix/dart/runtime.nix b/nix/dart/runtime.nix
--- a/nix/dart/runtime.nix
+++ b/nix/dart/runtime.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { lib, flake-parts-lib, ... }:
 {
   options.perSystem = flake-parts-lib.mkPerSystemOption (

diff --git a/nix/dart/sdk.nix b/nix/dart/sdk.nix
--- a/nix/dart/sdk.nix
+++ b/nix/dart/sdk.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { ... }:
 importingFlake: {
   perSystem =

diff --git a/nix/dart/toolchain.nix b/nix/dart/toolchain.nix
--- a/nix/dart/toolchain.nix
+++ b/nix/dart/toolchain.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # The devshell and the formatter both need a Dart SDK, and it has to be the same
 # one: `dart format` output depends on the SDK version, so a formatter that
 # differs from the `dart` on `PATH` would have the two rewrite each other's

diff --git a/nix/dart/vodozemac/default.nix b/nix/dart/vodozemac/default.nix
--- a/nix/dart/vodozemac/default.nix
+++ b/nix/dart/vodozemac/default.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 { lib, flake-parts-lib, ... }:
 importingFlake: {
   options.perSystem = flake-parts-lib.mkPerSystemOption (

diff --git a/nix/dart/vodozemac/native.nix b/nix/dart/vodozemac/native.nix
--- a/nix/dart/vodozemac/native.nix
+++ b/nix/dart/vodozemac/native.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 {
   callPackage,
   lib,

diff --git a/nix/dart/vodozemac/source.nix b/nix/dart/vodozemac/source.nix
--- a/nix/dart/vodozemac/source.nix
+++ b/nix/dart/vodozemac/source.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # The source the bindings are built from, named once for both targets: the
 # native library and the WebAssembly module are the same crate compiled twice,
 # and a version that drifted between them fails at the first call and not

diff --git a/nix/dart/vodozemac/web.nix b/nix/dart/vodozemac/web.nix
--- a/nix/dart/vodozemac/web.nix
+++ b/nix/dart/vodozemac/web.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # The bindings compiled for the browser, a different artefact from the native
 # library rather than a variant of it.
 #

diff --git a/nix/dart/web/assets.nix b/nix/dart/web/assets.nix
--- a/nix/dart/web/assets.nix
+++ b/nix/dart/web/assets.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # The files a web build needs in `web/` before it starts: the vodozemac
 # WebAssembly module, and the worker that encrypts media frames. Both are
 # compiled artefacts of dependencies, so a checked-in copy would silently age.

diff --git a/nix/dart/web/default.nix b/nix/dart/web/default.nix
--- a/nix/dart/web/default.nix
+++ b/nix/dart/web/default.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # A Flutter project's web target: built once, then handed to every destination
 # that is enabled for it — a container image, GitHub Pages, a review app.
 #

diff --git a/nix/dart/web/image.nix b/nix/dart/web/image.nix
--- a/nix/dart/web/image.nix
+++ b/nix/dart/web/image.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # Images are assembled from nixpkgs rather than from a distro base image, so
 # that everything in them is derivable from the repository's lockfile.
 #

diff --git a/nix/dart/web/workflow-ids.nix b/nix/dart/web/workflow-ids.nix
--- a/nix/dart/web/workflow-ids.nix
+++ b/nix/dart/web/workflow-ids.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # The workflow and the artefact that carry a project's web target are named in
 # one place, since the build job and every destination job have to agree on both
 # and a rename would otherwise break the wiring silently.

diff --git a/nix/dart/web/workflows/build.nix b/nix/dart/web/workflows/build.nix
--- a/nix/dart/web/workflows/build.nix
+++ b/nix/dart/web/workflows/build.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { config, lib, ... }:
 let
   allowed-actions = config.famedly.standards.allowed-action-versions;

diff --git a/nix/dart/web/workflows/github-pages.nix b/nix/dart/web/workflows/github-pages.nix
--- a/nix/dart/web/workflows/github-pages.nix
+++ b/nix/dart/web/workflows/github-pages.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   config,
   lib,

diff --git a/nix/dart/web/workflows/image.nix b/nix/dart/web/workflows/image.nix
--- a/nix/dart/web/workflows/image.nix
+++ b/nix/dart/web/workflows/image.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   config,
   lib,

diff --git a/nix/dart/web/workflows/review-app.nix b/nix/dart/web/workflows/review-app.nix
--- a/nix/dart/web/workflows/review-app.nix
+++ b/nix/dart/web/workflows/review-app.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   config,
   lib,

diff --git a/nix/dart/workflows/checks.nix b/nix/dart/workflows/checks.nix
--- a/nix/dart/workflows/checks.nix
+++ b/nix/dart/workflows/checks.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   config,
   lib,

diff --git a/nix/dart/workflows/image.nix b/nix/dart/workflows/image.nix
--- a/nix/dart/workflows/image.nix
+++ b/nix/dart/workflows/image.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   config,
   lib,

diff --git a/nix/default.nix b/nix/default.nix
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   flakeModules,
   inputs,

diff --git a/nix/general/action-versions.nix b/nix/general/action-versions.nix
--- a/nix/general/action-versions.nix
+++ b/nix/general/action-versions.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { lib, ... }:
 let
   inherit (lib) types;

diff --git a/nix/general/default.nix b/nix/general/default.nix
--- a/nix/general/default.nix
+++ b/nix/general/default.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   flake-parts-lib,
   lib,
@@ -11,6 +14,7 @@
     ./editorconfig.nix
     ./formatting.nix
     (importApply ./pre-commit-hooks.nix args)
+    ./reuse.nix
 
     ./workflows/ci-steps.nix
     ./workflows/check-commit-messages.nix

diff --git a/nix/general/devshell.nix b/nix/general/devshell.nix
--- a/nix/general/devshell.nix
+++ b/nix/general/devshell.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   flakeModules,
   inputs,

diff --git a/nix/general/editorconfig.nix b/nix/general/editorconfig.nix
--- a/nix/general/editorconfig.nix
+++ b/nix/general/editorconfig.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   perSystem = {
     filegen.settings.files = [

diff --git a/nix/general/formatting.nix b/nix/general/formatting.nix
--- a/nix/general/formatting.nix
+++ b/nix/general/formatting.nix
@@ -1,6 +1,9 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   perSystem =
-    { config, ... }:
+    { config, pkgs, ... }:
     {
       treefmt = {
         # `prek` is in charge of running these kinds of checks, we don't
@@ -37,7 +40,15 @@
         {
           type = "copy";
           target = "treefmt.toml";
-          source = config.treefmt.build.configFile;
+          source = import ../lib/add-header.nix {
+            inherit pkgs;
+            header = ''
+              ## SPDX-FileCopyrightText: 2026 Famedly GmbH
+              ##
+              ## SPDX-License-Identifier: Apache-2.0
+            '';
+            file = config.treefmt.build.configFile;
+          };
         }
         {
           type = "copy";

diff --git a/nix/general/pre-commit-hooks.nix b/nix/general/pre-commit-hooks.nix
--- a/nix/general/pre-commit-hooks.nix
+++ b/nix/general/pre-commit-hooks.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   flakeModules,
   inputs,

diff --git a/nix/general/reuse.nix b/nix/general/reuse.nix
new file mode 100644
--- /dev/null
+++ b/nix/general/reuse.nix
@@ -1,0 +1,37 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+{
+  config.perSystem =
+    { config, pkgs, ... }:
+    {
+      prek-pre-commit = {
+        package.runtimePkgs = [ pkgs.reuse ];
+        workspaces.".".repos = [
+          {
+            repo = "local";
+
+            hooks = [
+              {
+                id = "reuse";
+                name = "reuse";
+                description = "Ensure compliance with REUSE recommendations";
+
+                entry = "reuse";
+                args = [ "lint-file" ];
+
+                language = "system";
+              }
+            ];
+          }
+        ];
+
+      };
+
+      filegen.settings.files = pkgs.lib.mapAttrsToList (name: value: {
+        type = "copy";
+        target = ".github/workflows/${name}.yml.license";
+        source = ../../flake.lock.license;
+      }) config.githubActions.workflows;
+    };
+}

diff --git a/nix/general/taplo.toml b/nix/general/taplo.toml
--- a/nix/general/taplo.toml
+++ b/nix/general/taplo.toml
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 exclude = ["target-analyzer/**", "target/**"]
 
 [formatting]

diff --git a/nix/general/workflows/check-commit-messages.nix b/nix/general/workflows/check-commit-messages.nix
--- a/nix/general/workflows/check-commit-messages.nix
+++ b/nix/general/workflows/check-commit-messages.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 {
   config,
   lib,

diff --git a/nix/general/workflows/check-pre-commit-hooks.nix b/nix/general/workflows/check-pre-commit-hooks.nix
--- a/nix/general/workflows/check-pre-commit-hooks.nix
+++ b/nix/general/workflows/check-pre-commit-hooks.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { config, ... }:
 let
   inherit (config.famedly.standards.ci) steps;

diff --git a/nix/general/workflows/ci-steps.nix b/nix/general/workflows/ci-steps.nix
--- a/nix/general/workflows/ci-steps.nix
+++ b/nix/general/workflows/ci-steps.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
 { config, lib, ... }:
 let
   allowed-actions = config.famedly.standards.allowed-action-versions;

diff --git a/nix/general/workflows/release.nix b/nix/general/workflows/release.nix
--- a/nix/general/workflows/release.nix
+++ b/nix/general/workflows/release.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 {
   config,
   lib,

diff --git a/nix/lib/add-header.nix b/nix/lib/add-header.nix
new file mode 100644
--- /dev/null
+++ b/nix/lib/add-header.nix
@@ -1,0 +1,15 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
+# Prepends some header to a file
+{
+  pkgs,
+  header,
+  file,
+}:
+pkgs.runCommand "get-treefmt-toml" { } ''
+  cat <<EOF | cat - ${file} > $out
+  ${header}
+  EOF
+''

diff --git a/nix/lib/compose-script.nix b/nix/lib/compose-script.nix
--- a/nix/lib/compose-script.nix
+++ b/nix/lib/compose-script.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # Composes shell blocks into one script without the blank lines that
 # interpolating them into a surrounding string would leave behind — which is
 # what otherwise turns a generated `run:` into a `|+` block with trailing

diff --git a/nix/lib/image-output.nix b/nix/lib/image-output.nix
--- a/nix/lib/image-output.nix
+++ b/nix/lib/image-output.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # An image here is a function, not a derivation: the artefact it wraps — a
 # compiled binary, a built site — exists only once CI has produced it, because
 # resolving our private dependencies needs credentials a build sandbox does not

diff --git a/nix/lib/project-paths.nix b/nix/lib/project-paths.nix
--- a/nix/lib/project-paths.nix
+++ b/nix/lib/project-paths.nix
@@ -1,3 +1,7 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
+
 # Helpers for the keys of the `famedly.standards.*.projects` options, which are
 # paths relative to the repository root: `.` for a repository that is one
 # project, `./packages/foo` for one that holds several.

diff --git a/nix/modules/filegen.nix b/nix/modules/filegen.nix
--- a/nix/modules/filegen.nix
+++ b/nix/modules/filegen.nix
@@ -1,3 +1,6 @@
+## SPDX-FileCopyrightText: 2026 Famedly GmbH
+##
+## SPDX-License-Identifier: Apache-2.0
... diff truncated: showing 800 of 1022 lines

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit add7c42. Configure here.

Comment thread nix/rust/formatting.nix
@RasmusRendal
RasmusRendal force-pushed the RasmusRendal/apache2 branch from add7c42 to f7aa1d7 Compare August 6, 2026 09:21
Comment thread nix/general/reuse.nix
source = ../../flake.lock.license;
}) config.githubActions.workflows;
};
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Will this be mandatory for all projects that use ES?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the PR in its current state would require all repositories which use Engineering Standards to be REUSE compliant.

The interesting part involves making sure that all our auto-generated
files have a REUSE header, or at least generate a .license file next to it.
It simply runs reuse lint-file on changed files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants