This repository has no description
1.1 kB
29 lines
1{ ... }:
2{
3 perSystem =
4 { lib, pkgs, ... }:
5 {
6 packages =
7 let
8 # Wrapper that handles platform-incompatible packages by catching eval errors.
9 # This breaks laziness (evaluates all packages upfront) but ensures:
10 # - Platform-incompatible packages are filtered out for `nix flake check`
11 # - Real errors in package definitions are still caught and reported
12 #
13 # Note: tryEval catches both platform errors AND real errors. However, real errors
14 # will still surface when the package is evaluated on platforms where dependencies exist.
15 platformAwareCallPackage =
16 path: args:
17 let
18 result = builtins.tryEval (pkgs.callPackage path args);
19 in
20 if result.success then result.value else null;
21
22 allPackages = lib.packagesFromDirectoryRecursive {
23 callPackage = platformAwareCallPackage;
24 directory = ./.;
25 };
26 in
27 lib.filterAttrs (name: pkg: name != "flake-module" && pkg != null) allPackages;
28 };
29}