From 6ec7434bb4efdfbd854e5e764a7cba54b4331c30 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Wed, 10 Dec 2025 07:23:50 -0600 Subject: [PATCH] Try what the docs said --- checks.nix | 23 +++++------------------ flake.nix | 5 ++--- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/checks.nix b/checks.nix index 2e5f702..e68b680 100644 --- a/checks.nix +++ b/checks.nix @@ -1,27 +1,14 @@ { lib, + self', system, top, - writeShellApplication, ... }: let - meta = import ./hosts/metadata.nix; + nixos = lib.mapAttrs' (n: v: lib.nameValuePair "nixos-${n}" v.config.system.build.toplevel) ( + lib.filterAttrs (_: v: v.pkgs.stdenv.hostPlatform.system == system) top.self.nixosConfigurations + ); in -# Pulls all hosts down to be a check -(builtins.mapAttrs - ( - n: v: - writeShellApplication { - name = "build-${n}"; - runtimeInputs = [ ]; - text = '' - nix build ".#${v.config.system.build.toplevel}" - ''; - } - ) - (lib.filterAttrs (n: _v: builtins.any (a: a == system) meta.${n}.arch) top.self.nixosConfigurations) -) -# Adds all packages as a check -// (top.self.packages.${system}) +nixos // self'.packages diff --git a/flake.nix b/flake.nix index 3553596..9924383 100644 --- a/flake.nix +++ b/flake.nix @@ -105,9 +105,8 @@ packages = (import ./pkgs { inherit pkgs top; }) // (import ./vms { inherit top; }); checks = import ./checks.nix { - inherit system top; - inherit (top) hooks; - inherit (pkgs) lib writeShellApplication; + inherit system top self'; + inherit (pkgs) lib; }; devShells = import ./shells.nix {