From d6b0351bf783695bb14a1cb089d5092a760bf2dc Mon Sep 17 00:00:00 2001 From: Jo Date: Fri, 23 May 2025 01:09:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20flake=20validation=20workf?= =?UTF-8?q?low=20and=20update=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODEOWNERS | 2 ++ .github/workflows/validate.yaml | 30 ++++++++++++++++++++++++++++++ README.md | 31 ++++++++++++++++++++++++++++--- 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/validate.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..53913e2 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Me, myself and I! +* @jokiller230 diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..0a209c0 --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,30 @@ +name: "Nix: validate flake" + +on: + workflow_dispatch: + push: + paths: + - "**.nix" + - "**.lock" + - ".github/workflows/**.yml" + +jobs: + check-flake: + name: Validate x86_64-linux + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + persist-credentials: false + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + experimental-features = flakes nix-command recursive-nix pipe-operator + + - name: Validate Flake + run: nix flake check --option allow-import-from-derivation false diff --git a/README.md b/README.md index 90e679b..e637ba8 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,13 @@ All the basic functionality of v2 should be working correctly, including: - Creating users in your systems through ${self.namespace}.users, automatically maps home-manager configurations from the `homes` directory to their corresponding users. -Nonetheless, one should still consider this implementation experimental, -once I start using this on my laptop, -I'll aim for production grade stability. +Since I am actively using this configuration on my main workstation, things are evolving quickly, +leftover issues are actively being resolved and the list of modules is ever-growing. +Nonetheless, one should still consider this implementation experimental. + +My next goal is to setup an attic binary cache, +with a build/release workflow that runs in regular intervals. +(similar to isabelroses's workflow setup) ## 🚀 Deployment To deploy a system run the following command in your terminal of choice. @@ -66,6 +70,27 @@ Lastly, when adding new systems, make sure to update any required secret files w nix-shell -p sops --run "sops updatekeys secrets/example.yaml" ``` +## 👷 CI/CD coverage +Currently, this repository houses 2 workflows, which are executed when pushing to the v2 branch. + +#### ↪️ `Nix: check for unused code` +This workflow can be found in `.github/workflows/deadnix.yaml`, +and should be pretty self-explanatory. + +Here's what it does: +1. Checks out current branch +2. Finds any unused variables/imports etc... +3. Creates a new commit, instantly removing any unused code + +#### ↪️ `Nix: validate flake` +This workflow can be found in `.github/workflows/validate.yaml`. +It simply validates a flake using `nix flake check`. + +To be specific, it does the following: +1. Checks out current branch +2. Installs nix with some experimental features (flakes, nix-command, recursive-nix, pipe-operator) +3. Runs `nix flake check` on the codebase + ## 📝 Goals and improvements The main goals of this rewritten flake are: