From 498d2bf6493b6495bedbe7a9ea4a8e22de1cd287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Reyrol?= Date: Fri, 1 Dec 2023 08:54:38 +0100 Subject: [PATCH] chore: format yaml & nix files --- .github/dependabot.yml | 2 +- .github/workflows/build.yml | 38 ++++++++++++------------- .github/workflows/check.yml | 14 ++++----- .github/workflows/flakehub-publish.yml | 6 ++-- .github/workflows/flakestry-publish.yml | 16 +++++------ .github/workflows/update-flake-lock.yml | 12 ++++---- src/packages/grafana-agent/default.nix | 11 +++---- src/packages/tracetest.nix | 3 +- 8 files changed, 52 insertions(+), 50 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 65dedd3..3b4bef6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,7 @@ version: 2 updates: - package-ecosystem: github-actions - directory: "/" + directory: '/' schedule: interval: daily open-pull-requests-limit: 10 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cb50d8..9d6c278 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,48 +3,48 @@ on: pull_request: push: branches: - - "main" + - 'main' paths: - - "**.nix" - - ".github/workflows/*.yml" + - '**.nix' + - '.github/workflows/*.yml' jobs: determine-matrix: - name: Find packages + name: 'Find packages' runs-on: ubuntu-latest outputs: - packages: ${{ steps.set-packages.outputs.packages }} + packages: '${{ steps.set-packages.outputs.packages }}' steps: - - name: Set up Git repository + - name: 'Set up Git repository' uses: actions/checkout@v4 - - name: Install Nix + - name: 'Install Nix' uses: DeterminateSystems/nix-installer-action@v8 - - name: Build packages matrix + - name: 'Build packages matrix' id: set-packages run: | echo packages=$( nix flake show --json | jq '.packages["x86_64-linux"]' | jq 'keys' ) >> $GITHUB_OUTPUT build: - name: "${{ matrix.packages }} on ${{ matrix.archs.arch }}" + name: '${{ matrix.packages }} on ${{ matrix.archs.arch }}' needs: [determine-matrix] - runs-on: ${{ matrix.archs.os }} + runs-on: '${{ matrix.archs.os }}' strategy: fail-fast: false matrix: - packages: ${{fromJson(needs.determine-matrix.outputs.packages)}} + packages: '${{fromJson(needs.determine-matrix.outputs.packages)}}' archs: [{os: ubuntu-latest, arch: x86_64-linux}] steps: - - name: Set up Git repository + - name: 'Set up Git repository' uses: actions/checkout@v4 - - name: Install Nix + - name: 'Install Nix' uses: DeterminateSystems/nix-installer-action@main - - name: Run the Magic Nix Cache + - name: 'Run the Magic Nix Cache' uses: DeterminateSystems/magic-nix-cache-action@main - uses: cachix/cachix-action@v13 with: name: opentelemetry - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - - name: Build ${{ matrix.packages }} binary + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: 'Build ${{ matrix.packages }} binary' run: | nix build .#${{ matrix.packages }} -L tests-build: @@ -54,10 +54,10 @@ jobs: run: working-directory: tests steps: - - name: Set up Git repository + - name: 'Set up Git repository' uses: actions/checkout@v4 - - name: Install Nix + - name: 'Install Nix' uses: DeterminateSystems/nix-installer-action@v8 - - name: Flake Build + - name: 'Flake Build' run: | nix build -L diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 23994da..d32a715 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -7,25 +7,25 @@ jobs: name: Flake runs-on: ubuntu-latest steps: - - name: Set up Git repository + - name: 'Set up Git repository' uses: actions/checkout@v4 - - name: Install Nix + - name: 'Install Nix' uses: DeterminateSystems/nix-installer-action@v8 - - name: Flake Check + - name: 'Flake Check' run: | nix flake check -L tests-check: - name: Test Flake + name: 'Test Flake' runs-on: ubuntu-latest defaults: run: working-directory: tests steps: - - name: Set up Git repository + - name: 'Set up Git repository' uses: actions/checkout@v4 - - name: Install Nix + - name: 'Install Nix' uses: DeterminateSystems/nix-installer-action@v8 - - name: Flake Check + - name: 'Flake Check' run: | nix flake check -L diff --git a/.github/workflows/flakehub-publish.yml b/.github/workflows/flakehub-publish.yml index 238fde2..2905835 100644 --- a/.github/workflows/flakehub-publish.yml +++ b/.github/workflows/flakehub-publish.yml @@ -2,7 +2,7 @@ name: 'Publish tags to FlakeHub' on: push: tags: - - v?[0-9]+.[0-9]+.[0-9]+*' + - 'v?[0-9]+.[0-9]+.[0-9]+' workflow_dispatch: inputs: tag: @@ -11,7 +11,7 @@ on: required: true jobs: flakehub-publish: - runs-on: 'ubuntu-latest' + runs-on: ubuntu-latest permissions: id-token: write contents: read @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 with: ref: "${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}" - - name: Install Nix + - name: 'Install Nix' uses: DeterminateSystems/nix-installer-action@v8 - uses: DeterminateSystems/flakehub-push@main with: diff --git a/.github/workflows/flakestry-publish.yml b/.github/workflows/flakestry-publish.yml index 62f03a1..1591841 100644 --- a/.github/workflows/flakestry-publish.yml +++ b/.github/workflows/flakestry-publish.yml @@ -1,22 +1,22 @@ -name: "Publish a flake to flakestry" +name: 'Publish a flake to flakestry' on: push: tags: - - "v?[0-9]+.[0-9]+.[0-9]+" - - "v?[0-9]+.[0-9]+" + - 'v?[0-9]+.[0-9]+.[0-9]+' + - 'v?[0-9]+.[0-9]+' workflow_dispatch: inputs: tag: - description: "The existing tag to publish" - type: "string" + description: 'The existing tag to publish' + type: string required: true jobs: publish-flake: runs-on: ubuntu-latest permissions: - id-token: "write" - contents: "read" + id-token: write + contents: read steps: - uses: flakestry/flakestry-publish@main with: - version: "${{ inputs.tag || github.ref_name }}" + version: '${{ inputs.tag || github.ref_name }}' diff --git a/.github/workflows/update-flake-lock.yml b/.github/workflows/update-flake-lock.yml index 976bc28..358ee1c 100644 --- a/.github/workflows/update-flake-lock.yml +++ b/.github/workflows/update-flake-lock.yml @@ -1,4 +1,4 @@ -name: Update flake.lock +name: 'Update flake.lock' on: workflow_dispatch: # allows manual triggering schedule: @@ -7,15 +7,15 @@ jobs: update: runs-on: ubuntu-latest steps: - - name: Set up Git repository + - name: 'Set up Git repository' uses: actions/checkout@v4 - - name: Install the Nix package manager + - name: 'Install the Nix package manager' uses: cachix/install-nix-action@v24 - - name: Update flake.lock + - name: 'Update flake.lock' uses: DeterminateSystems/update-flake-lock@v20 with: - pr-title: "Update flake.lock" - commit-msg: "chore: update flake" + pr-title: 'Update flake.lock' + commit-msg: 'chore(flake): update lock' pr-labels: | dependencies pr-assignees: GaelReyrol diff --git a/src/packages/grafana-agent/default.nix b/src/packages/grafana-agent/default.nix index c667bc7..5de3b60 100644 --- a/src/packages/grafana-agent/default.nix +++ b/src/packages/grafana-agent/default.nix @@ -8,9 +8,9 @@ , installShellFiles }: -{ - enableBoringCrypto ? false # https://grafana.com/docs/agent/latest/about/#boringcrypto -}: let +{ enableBoringCrypto ? false # https://grafana.com/docs/agent/latest/about/#boringcrypto +}: +let pname = "grafana-agent"; version = "0.38.1"; src = fetchFromGitHub { @@ -31,7 +31,7 @@ npmPackFlags = [ "--ignore-scripts" ]; npmFlags = [ "--legacy-peer-deps" ]; - + makeCacheWritable = true; NODE_OPTIONS = "--openssl-legacy-provider"; @@ -46,7 +46,8 @@ runHook postInstall ''; }; -in buildGoModule { +in +buildGoModule { inherit pname version src; nativeBuildInputs = [ systemd.dev makeWrapper installShellFiles ]; diff --git a/src/packages/tracetest.nix b/src/packages/tracetest.nix index c37c298..021a445 100644 --- a/src/packages/tracetest.nix +++ b/src/packages/tracetest.nix @@ -33,7 +33,8 @@ let runHook postInstall ''; }; -in buildGoModule rec { +in +buildGoModule rec { inherit pname version src; vendorHash = "sha256-Zl2hpJ9NMWHCWS4fbSXjWFU1vK658Ozme/UoBH/2Cpg=";