From 41df846ad36f64bca11350a70aedce1e8f2653db Mon Sep 17 00:00:00 2001 From: Matt Schreiber Date: Tue, 27 Feb 2024 08:40:46 -0500 Subject: [PATCH 1/4] chore(ci): use `v4` of `actions/checkout` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d1b61c..e1ad020 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: container: image: ${{ matrix.image }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install testing dependencies run: | { apk add --no-cache ansible sudo ; } || : From bcf88ee0e557e47f749ccb96c37da1fbdb1c6d5c Mon Sep 17 00:00:00 2001 From: Matt Schreiber Date: Tue, 27 Feb 2024 08:41:45 -0500 Subject: [PATCH 2/4] feat(flake): make the devshell the default package in order to do something sensible for `nix build`. --- flake.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flake.nix b/flake.nix index 4773b45..b9abc3f 100644 --- a/flake.nix +++ b/flake.nix @@ -93,6 +93,8 @@ ]; }; in { + inherit (config.devShells) default; + rpi4-initrd = rpi4.config.system.build.initialRamdisk; rpi4-kernel = rpi4.config.system.build.kernel; From 9e8f7f94378b7a3ffb5dbc4019c6b23879fc7e90 Mon Sep 17 00:00:00 2001 From: Matt Schreiber Date: Tue, 27 Feb 2024 08:43:27 -0500 Subject: [PATCH 3/4] feat(ci): add job for `nix flake check` and `nix build`. --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1ad020..102c954 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,3 +38,15 @@ jobs: # OpenRC under Alpine Linux) in a container. run: | ansible-playbook -vv --become -c local -i localhost, -e kodi_service_enabled=false ./tests/test.yml + nix: + name: Run Nix actions + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v8 + - name: Set up Nix cache + uses: DeterminateSystems/magic-nix-cache-action@v3 + - name: Run Nix flake checks + run: | + nix flake check -L From 4f746845534ad02029124c9f7f4c8e62773eb307 Mon Sep 17 00:00:00 2001 From: Matt Schreiber Date: Tue, 27 Feb 2024 08:43:59 -0500 Subject: [PATCH 4/4] feat(flake): support `nix run` via making the devshell's `flakeApp` attribute the default flake application. It is now possible to do (say) `nix run '.#'-- vagrant up` and spin up this project's Vagrant environment without first entering a devshell with `nix develop`. --- flake.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flake.nix b/flake.nix index b9abc3f..02a3232 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,9 @@ system, ... }: { + # `nix run '.#' -- ` + apps.default = config.devShells.default.flakeApp; + devshells.default = { commands = [ # Local GitHub actions runner. Run `act -j native` to execute the