summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yaml10
-rw-r--r--flake/ci.nix50
2 files changed, 34 insertions, 26 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 069fd0b..1da4534 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -18,6 +18,9 @@ jobs:
runs-on: ${{ matrix.os }}
+ env:
+ SYSTEM: ${{ matrix.system }}
+
steps:
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
- name: Clear disk space
@@ -42,16 +45,13 @@ jobs:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Run build
- env:
- SYSTEM: ${{ matrix.system }}
run: |
- nix run \
+ nix run --inputs-from . \
github:Mic92/nix-fast-build -- \
--no-nom \
--skip-cached \
- --systems "$SYSTEM" \
--option allow-import-from-derivation false \
- --flake '.#hydraJobs'
+ --flake ".#hydraJobs.$SYSTEM"
build-gate:
name: Build gate
diff --git a/flake/ci.nix b/flake/ci.nix
index cd1857f..e8a1373 100644
--- a/flake/ci.nix
+++ b/flake/ci.nix
@@ -1,4 +1,5 @@
{
+ config,
lib,
withSystem,
self,
@@ -41,32 +42,39 @@
};
};
- flake = {
- hydraJobs =
+ flake.hydraJobs =
- let
- # Architecture of "main" CI machine
- ciSystem = "x86_64-linux";
+ let
+ # Architecture of "main" CI machine
+ ciSystem = "x86_64-linux";
- derivFromCfg = deriv: deriv.config.system.build.toplevel or deriv.activationPackage;
- mapCfgsToDerivs = lib.mapAttrs (lib.const derivFromCfg);
- in
+ derivFromCfg = deriv: deriv.config.system.build.toplevel or deriv.activationPackage;
+ mapCfgsToDerivs = lib.mapAttrs (lib.const derivFromCfg);
+ in
- withSystem ciSystem (
- { pkgs, self', ... }:
+ lib.genAttrs config.systems (
+ lib.flip withSystem (
+ {
+ system,
+ self',
+ ...
+ }:
+
+ let
+ mapCfgsForSystem =
+ cfgs: lib.filterAttrs (lib.const (deriv: deriv.system == system)) (mapCfgsToDerivs cfgs);
+ in
{
- # I don't care to run these for each system, as they should be the same
- # and don't need to be cached
+ darwinConfigurations = mapCfgsForSystem self.darwinConfigurations;
+ homeConfigurations = mapCfgsForSystem self.homeConfigurations;
+ nixosConfigurations = mapCfgsForSystem self.nixosConfigurations;
+ }
+ # I don't care to run these for each system, as they should be the same
+ # and don't need to be cached
+ // lib.optionalAttrs (system == ciSystem) {
inherit (self') checks devShells;
-
- darwinConfigurations = mapCfgsToDerivs self.darwinConfigurations;
- homeConfigurations = mapCfgsToDerivs self.homeConfigurations;
- nixosConfigurations = mapCfgsToDerivs self.nixosConfigurations // {
- # please add aarch64 runners github...please...
- atlas = lib.deepSeq (derivFromCfg self.nixosConfigurations.atlas).drvPath pkgs.emptyFile;
- };
}
- );
- };
+ )
+ );
}