Add a separate file for the try-files
function
This commit is contained in:
parent
0d399b63b9
commit
742b1d2029
2 changed files with 10 additions and 8 deletions
|
@ -30,14 +30,7 @@
|
|||
};
|
||||
|
||||
systems = builtins.mapAttrs (name: value: defaultMachine // value) machines;
|
||||
tryFiles = files: default:
|
||||
lib.lists.foldr
|
||||
(a: b:
|
||||
if (a != null) && (builtins.pathExists a)
|
||||
then a
|
||||
else b)
|
||||
default
|
||||
files;
|
||||
tryFiles = import ./lib/utils/try-files.nix { inherit lib; };
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
|
|
9
lib/utils/try-files.nix
Normal file
9
lib/utils/try-files.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ lib, ... }:
|
||||
files: default:
|
||||
lib.lists.foldr
|
||||
(a: b:
|
||||
if (a != null) && (builtins.pathExists a)
|
||||
then a
|
||||
else b)
|
||||
default
|
||||
files
|
Loading…
Reference in a new issue