From 092fa16f779b6c801646b5a7d94f196b725bea37 Mon Sep 17 00:00:00 2001 From: Nico Jensch Date: Tue, 7 Nov 2023 18:14:07 +0100 Subject: [PATCH] fix: run flake checks on Gitlab CI with org-wide runner - GitHub runners were hitting limits easily --- .github/workflows/flake_check.yml | 27 --------------------------- .gitlab-ci.yml | 10 ++++++++++ .gitlab/CODEOWNERS | 1 + README.md | 5 +++-- 4 files changed, 14 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/flake_check.yml create mode 100644 .gitlab-ci.yml create mode 100644 .gitlab/CODEOWNERS diff --git a/.github/workflows/flake_check.yml b/.github/workflows/flake_check.yml deleted file mode 100644 index 6a3fd6a..0000000 --- a/.github/workflows/flake_check.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Run nix flake check -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: true -on: - push: - branches: [main] - paths: [home-manager, nixos, overlays, flake.lock, flake.nix] -jobs: - flake-check: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - name: Install Nix 📦 - uses: cachix/install-nix-action@6a9a9e84a173d90b3ffb42c5ddaf9ea033fad011 # v23 - with: - extra_nix_config: | - accept-flake-config = true - system-features = big-parallel kvm - github_access_token: ${{ secrets.GITHUB_TOKEN }} - nix_path: nixpkgs=channel:nixos-unstable - - name: Supply dummy buildtime.json to let nix flake check pass 🧐 - run: sed -i 's&../secrets/secrets.json&../../assets/dummy.json&g' ./nixos/modules/garuda-lib.nix - - name: Check flake 📝 - run: nix flake check diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d1edd12 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,10 @@ +--- +stages: [check] +check: + stage: check + image: nixpkgs/nix-flakes:latest + script: + - sed -i 's&../secrets/secrets.json&../../assets/dummy.json&g' ./nixos/modules/garuda-lib.nix + - nix flake check + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS new file mode 100644 index 0000000..4c0d1b5 --- /dev/null +++ b/.gitlab/CODEOWNERS @@ -0,0 +1 @@ +* @garuda-linux \ No newline at end of file diff --git a/README.md b/README.md index ff386b9..56cab8a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Garuda Linux server configurations -[![built with nix](https://img.shields.io/static/v1?logo=nixos&logoColor=white&label=&message=Built%20with%20Nix&color=41439a)](https://builtwithnix.org) [![run nix flake check](https://github.com/garuda-linux/infrastructure-nix/actions/workflows/flake_check.yml/badge.svg?branch=main)](https://github.com/garuda-linux/infrastructure-nix/actions/workflows/flake_check.yml) [![deploy docs](https://github.com/garuda-linux/infrastructure-nix/actions/workflows/pages.yml/badge.svg)](https://github.com/garuda-linux/infrastructure-nix/actions/workflows/pages.yml) +[![built with nix](https://img.shields.io/static/v1?logo=nixos&logoColor=white&label=&message=Built%20with%20Nix&color=41439a)](https://builtwithnix.org) [![deploy docs](https://github.com/garuda-linux/infrastructure-nix/actions/workflows/pages.yml/badge.svg)](https://github.com/garuda-linux/infrastructure-nix/actions/workflows/pages.yml) ## General information @@ -8,7 +8,8 @@ - The only other server not being contained in this dedicated server is our mail server. - Both servers are being backed up to Hetzner storage boxes via [Borg](https://www.borgbackup.org/). - After multiple different setups, we settled on [NixOS](https://nixos.org/) as our main OS as it provides reproducible and atomically updated system states -- Most (sub)domains are protected by Cloudflare while also making use of its caching feature. Exemptions are services such as our mail server and parts violating Cloudflares rules such as proxying Piped content. +- Most (sub)domains are protected by Cloudflare while also making use of its caching feature. + Exemptions are services such as our mail server and parts violating Cloudflares rules such as proxying Piped content. ## Quick links