From c7c2d45d00202c064dfa5b81402c1fd7797eaada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 19 Nov 2023 11:18:44 +0100 Subject: [PATCH] make everything build with nix flake check --- flake.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 58c20dd..249d1d8 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,7 @@ }; outputs = inputs@{ flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: { + flake-parts.lib.mkFlake { inherit inputs; } ({ self, lib, ... }: { systems = [ "aarch64-linux" "x86_64-linux" @@ -36,7 +36,7 @@ ./modules/flake-module.nix ./checks/flake-module.nix ]; - perSystem = { config, pkgs, ... }: { + perSystem = { config, self', system, pkgs, ... }: { treefmt = { projectRootFile = "flake.nix"; programs.hclfmt.enable = true; @@ -56,6 +56,14 @@ ])) ]; }; + + checks = + let + nixosMachines = lib.mapAttrs' (name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations); + packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages; + devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells; + in + nixosMachines // packages // devShells; }; }); }