diff --git a/.config/filegen-manifest.json b/.config/filegen-manifest.json new file mode 100644 index 0000000..5a4fc9e --- /dev/null +++ b/.config/filegen-manifest.json @@ -0,0 +1,33 @@ +{ + "clobber-by-default": true, + "files": [ + { + "clobber": null, + "deactivate": null, + "ignore-modification": null, + "permissions": "600", + "source": "/nix/store/i9wgm4ljangrsv39rjdqyq9j96hj29zm-pre-commit-config.yaml", + "target": "./.pre-commit-config.yaml", + "type": "copy" + }, + { + "clobber": null, + "deactivate": null, + "ignore-modification": null, + "permissions": "600", + "source": "/nix/store/yw3vsh26id80w6bivi9v4x3b835b4r5j-check-pre-commit-hooks.yml", + "target": "./.github/workflows/check-pre-commit-hooks.yml", + "type": "copy" + }, + { + "clobber": null, + "deactivate": null, + "ignore-modification": null, + "permissions": "600", + "source": "/nix/store/mv9zlzz043051izx92fxk6ibz6fn21yd-gitattributes", + "target": ".gitattributes", + "type": "copy" + } + ], + "version": 3 +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5daa663 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +.pre-commit-config.yaml linguist-generated +.github/workflows/check-pre-commit-hooks.yml linguist-generated +.gitattributes linguist-generated +.config/filegen-manifest.json linguist-generated diff --git a/.github/workflows/check-pre-commit-hooks.yml b/.github/workflows/check-pre-commit-hooks.yml new file mode 100644 index 0000000..f5477fd --- /dev/null +++ b/.github/workflows/check-pre-commit-hooks.yml @@ -0,0 +1,24 @@ +# This file is automatically generated from Nix configuration. Do not edit directly. + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} +jobs: + prek: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 + - uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 + - name: Run pre-commit hooks + run: prek --all-files --show-diff-on-failure + shell: nix develop .#standards --command bash {0} +name: Make sure all pre-commit hooks pass +"on": + pull_request: + branches: + - '**' + types: + - opened + - reopened + - synchronize + - ready_for_review diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f0a3d2..40030cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,38 +1,40 @@ -# SPDX-FileCopyrightText: 2025 Famedly GmbH (info@famedly.com) -# -# SPDX-License-Identifier: Apache-2.0 -# SPDX-License-Identifier: CC0-1.0 - repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 - hooks: - - id: check-byte-order-marker - - id: check-case-conflict - - id: check-merge-conflict - - id: check-symlinks - - id: check-yaml - - id: check-toml - - id: check-json - - id: end-of-file-fixer - - id: mixed-line-ending - - id: trailing-whitespace - - repo: git@github.com:famedly/backend-pre-commit-templates.git - rev: 123eb7487cf81a3d2ac036f73a084a41b3df54d9 - hooks: - - id: fmt - - id: clippy - - repo: https://github.com/crate-ci/typos - rev: v1 - hooks: - - id: typos - - repo: local - hooks: - - id: config-schema-gen - name: JSON schema for config - language: script - entry: ./gen-config-schema.sh - - repo: https://github.com/fsfe/reuse-tool - rev: v5.0.2 - hooks: - - id: reuse +- hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-illegal-windows-names + - id: end-of-file-fixer + - id: fix-byte-order-marker + - id: check-json + - id: check-json5 + - id: check-toml + - id: check-vcs-permalinks + - id: check-xml + - args: + - --fix=lf + id: mixed-line-ending + - id: check-symlinks + - id: destroyed-symlinks + - id: check-merge-conflict + - id: detect-private-key + - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs + repo: builtin +- hooks: + - args: + - --write-changes + - --force-exclude + description: Check the repository for spelling mistakes + entry: typos + id: typos + language: system + name: typos + types: + - text + - description: Ensure that files set up with the filegen module are up-to-date + entry: filegen-apply-script + id: filegen + language: system + name: filegen + pass_filenames: false + repo: local diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 0000000..b0d1dcb --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2025 BWI GmbH +# +# SPDX-License-Identifier: CC0-1.0 + +version = 1 + +# Files autogenerated by engineering-standards +# Quite unlikely to be actually copyrightable, but we might as well try +[[annotations]] +SPDX-FileCopyrightText = "2026 Famedly GmbH" +SPDX-License-Identifier = "Apache-2.0" +path = ".gitattributes" +[[annotations]] +SPDX-FileCopyrightText = "2026 Famedly GmbH" +SPDX-License-Identifier = "Apache-2.0" +path = ".config/filegen-manifest.json" +[[annotations]] +SPDX-FileCopyrightText = "2026 Famedly GmbH" +SPDX-License-Identifier = "Apache-2.0" +path = ".github/workflows/check-pre-commit-hooks.yml" +[[annotations]] +SPDX-FileCopyrightText = "2026 Famedly GmbH" +SPDX-License-Identifier = "Apache-2.0" +path = ".pre-commit-config.yaml" diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f05257b --- /dev/null +++ b/flake.lock @@ -0,0 +1,176 @@ +{ + "nodes": { + "devshell": { + "inputs": { + "nixpkgs": [ + "famedly-engineering-standards", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768818222, + "narHash": "sha256-460jc0+CZfyaO8+w8JNtlClB2n4ui1RbHfPTLkpwhU8=", + "owner": "numtide", + "repo": "devshell", + "rev": "255a2b1725a20d060f566e4755dbf571bbbb5f76", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "famedly-engineering-standards": { + "inputs": { + "devshell": "devshell", + "flake-parts": "flake-parts", + "github-actions-nix": "github-actions-nix", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay", + "wrappers": "wrappers" + }, + "locked": { + "lastModified": 1781559938, + "narHash": "sha256-vb0triMbrih+SNoWRBH4lWSCsjo7bCL26TrZwNrBTHs=", + "owner": "famedly", + "repo": "engineering-standards", + "rev": "290c8d41a96f2ae17e6fa2569b61eaba5a1141b9", + "type": "github" + }, + "original": { + "owner": "famedly", + "repo": "engineering-standards", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1778716662, + "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "github-actions-nix": { + "inputs": { + "flake-parts": [ + "famedly-engineering-standards", + "flake-parts" + ], + "nixpkgs": [ + "famedly-engineering-standards", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1773808042, + "narHash": "sha256-97K9g40SdtDVWslJG8ytpiC3+qgeQzftsZheGQ8qoGY=", + "owner": "synapdeck", + "repo": "github-actions-nix", + "rev": "805a4f69856e0f3d0bcd8ae916f1625f22b0578c", + "type": "github" + }, + "original": { + "owner": "synapdeck", + "repo": "github-actions-nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1779622335, + "narHash": "sha256-6lZN0CPBbeK9UVgFQ8EV4t2qSVQPhhlerFBGZRiz73Y=", + "rev": "705e9929918b43bd7b715dc0a878ac870449bb03", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/26.05/nixos-26.05beta1.705e9929918b/nixexprs.tar.xz?lastModified=1779622335&rev=705e9929918b43bd7b715dc0a878ac870449bb03" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1777168982, + "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "famedly-engineering-standards": "famedly-engineering-standards", + "flake-parts": [ + "famedly-engineering-standards", + "flake-parts" + ], + "nixpkgs": [ + "famedly-engineering-standards", + "nixpkgs" + ] + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "famedly-engineering-standards", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1779851998, + "narHash": "sha256-UkkMh3bX9QW4Luqkm98nUaOqKWrU6i65mUnph3WeSSw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "6cddd512fa2bf7231f098d3a2f92f6e4cff71e0a", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "wrappers": { + "inputs": { + "nixpkgs": [ + "famedly-engineering-standards", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1780661205, + "narHash": "sha256-3F5DixT3Gk91lBI9E+TGMm0ko5HrRbDiL23di16TJGA=", + "owner": "BirdeeHub", + "repo": "nix-wrapper-modules", + "rev": "8dd304c3582ddd339217e1cc5fb53f50acb63c2d", + "type": "github" + }, + "original": { + "owner": "BirdeeHub", + "repo": "nix-wrapper-modules", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.lock.license b/flake.lock.license new file mode 100644 index 0000000..9f28482 --- /dev/null +++ b/flake.lock.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2025 BWI GmbH + +SPDX-License-Identifier: CC0-1.0 diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a851905 --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +## SPDX-FileCopyrightText: 2026 Famedly GmbH +## +## SPDX-License-Identifier: Apache-2.0 +{ + inputs = { + famedly-engineering-standards.url = "github:famedly/engineering-standards"; + + nixpkgs.follows = "famedly-engineering-standards/nixpkgs"; + flake-parts.follows = "famedly-engineering-standards/flake-parts"; + }; + + outputs = + { flake-parts, ... }@inputs: + flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + inputs.famedly-engineering-standards.flakeModules.default + ]; + + systems = inputs.famedly-engineering-standards.lib.famedlySystems; + + perSystem = + { inputs', ... }: + { + devShells.default = inputs'.famedly-engineering-standards.devShells.rust; + }; + }; +}