NixOSConfig/lib/utils/try-files.nix

10 lines
160 B
Nix

{ lib, ... }:
files: default:
lib.lists.foldr
(a: b:
if (a != null) && (builtins.pathExists a)
then a
else b)
default
files