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;
|
systems = builtins.mapAttrs (name: value: defaultMachine // value) machines;
|
||||||
tryFiles = files: default:
|
tryFiles = import ./lib/utils/try-files.nix { inherit lib; };
|
||||||
lib.lists.foldr
|
|
||||||
(a: b:
|
|
||||||
if (a != null) && (builtins.pathExists a)
|
|
||||||
then a
|
|
||||||
else b)
|
|
||||||
default
|
|
||||||
files;
|
|
||||||
in
|
in
|
||||||
flake-utils.lib.eachDefaultSystem (
|
flake-utils.lib.eachDefaultSystem (
|
||||||
system:
|
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