File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 55 {
66 packages =
77 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+
822 allPackages = lib . packagesFromDirectoryRecursive {
9- inherit ( pkgs ) callPackage ;
23+ callPackage = platformAwareCallPackage ;
1024 directory = ./. ;
1125 } ;
1226 in
13- lib . filterAttrs (
14- name : pkg : name != "flake-module" && lib . meta . availableOn pkgs . stdenv . hostPlatform pkg
15- ) allPackages ;
27+ lib . filterAttrs ( name : pkg : name != "flake-module" && pkg != null ) allPackages ;
1628 } ;
1729}
Original file line number Diff line number Diff line change 11{ pkgs , lib , ... } :
22
3- pkgs . writers . writeDashBin "nm-dmenu" ''
3+ ( pkgs . writers . writeDashBin "nm-dmenu" ''
44 export PATH=$PATH:${
55 lib . makeBinPath [
66 ( pkgs . writers . writeDashBin "dmenu" ''
@@ -11,4 +11,7 @@ pkgs.writers.writeDashBin "nm-dmenu" ''
1111 ]
1212 }
1313 exec ${ pkgs . networkmanager_dmenu } /bin/networkmanager_dmenu "$@"
14- ''
14+ '' )
15+ // {
16+ meta . platforms = lib . platforms . linux ;
17+ }
You can’t perform that action at this time.
0 commit comments