This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

pkgs: drop tryEval, filter by meta.platforms only

+29 -28
+7 -14
pkgs/flake-module.nix
··· 14 14 # its agents (pkgs.orca is the GNOME screen reader, not this one). 15 15 callPackage = pkgs.newScope { llm-agents = inputs'.llm-agents.packages; }; 16 16 17 - # Wrapper that handles platform-incompatible packages by: 18 - # 1. Catching eval errors during callPackage 19 - # 2. Filtering based on meta.platforms 20 - platformAwareCallPackage = 21 - path: args: 22 - let 23 - result = builtins.tryEval (callPackage path args); 24 - pkg = result.value; 25 - isSupported = result.success && lib.meta.availableOn pkgs.stdenv.hostPlatform pkg; 26 - in 27 - if isSupported then pkg else null; 28 - 29 17 allPackages = lib.packagesFromDirectoryRecursive { 30 - callPackage = platformAwareCallPackage; 18 + inherit callPackage; 31 19 directory = ./.; 32 20 }; 33 21 in 34 - lib.filterAttrs (name: pkg: name != "flake-module" && pkg != null) allPackages; 22 + # Packages for other platforms are left out via meta.platforms, so a 23 + # package's meta must evaluate on every system, also on the ones it 24 + # does not support; a package that throws breaks the evaluation. 25 + lib.filterAttrs ( 26 + name: pkg: name != "flake-module" && lib.meta.availableOn pkgs.stdenv.hostPlatform pkg 27 + ) allPackages; 35 28 36 29 # Fails the build (not the evaluation) once llm-agents moves past the 37 30 # releases stablyai deleted, so the pin in pkgs/orca gets dropped. An
+22 -14
pkgs/nm-dmenu/package.nix
··· 1 1 { pkgs, lib, ... }: 2 2 3 - (pkgs.writers.writeDashBin "nm-dmenu" '' 4 - export PATH=$PATH:${ 5 - lib.makeBinPath [ 6 - (pkgs.writers.writeDashBin "dmenu" '' 7 - exec ${lib.getExe pkgs.rofi} -dmenu "$@" 8 - '') 9 - pkgs.networkmanagerapplet 10 - pkgs.procps 11 - ] 12 - } 13 - exec ${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu "$@" 14 - '') 15 - // { 3 + let 16 4 meta.platforms = lib.platforms.linux; 17 - } 5 + in 6 + # The writer forces the script at eval time and rofi & co. refuse to evaluate 7 + # off Linux, so reference them only there and keep meta readable elsewhere. 8 + if pkgs.stdenv.hostPlatform.isLinux then 9 + (pkgs.writers.writeDashBin "nm-dmenu" '' 10 + export PATH=$PATH:${ 11 + lib.makeBinPath [ 12 + (pkgs.writers.writeDashBin "dmenu" '' 13 + exec ${lib.getExe pkgs.rofi} -dmenu "$@" 14 + '') 15 + pkgs.networkmanagerapplet 16 + pkgs.procps 17 + ] 18 + } 19 + exec ${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu "$@" 20 + '') 21 + // { 22 + inherit meta; 23 + } 24 + else 25 + pkgs.runCommand "nm-dmenu" { inherit meta; } ""