NixOSConfig/lib/utils/try-files.nix

9 lines
160 B
Nix

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