idiosyn/lib/removePackages.nix
Mikael Voss f9a715c71e
Some checks are pending
nix flake check / check (aarch64-linux) (push) Waiting to run
nix flake check / check (x86_64-linux) (push) Waiting to run
lib/removePackages: Handle null packages
2024-10-26 23:35:16 +02:00

10 lines
287 B
Nix

{ nixpkgs, ... }:
let
inherit (builtins) match filter foldl';
inherit (nixpkgs.lib.strings) getName;
fold = name: acc: regex:
if acc == false then false
else match regex name == null;
in regexList: filter (pkg: pkg != null -> foldl' (getName pkg |> fold) true regexList)