Skip to content
Snippets Groups Projects
Commit 6994585d authored by Jens Nolte's avatar Jens Nolte
Browse files

Allow layers to be directories instead of .nix files

parent 4f9bbcb4
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,12 @@
let
installResult = builtins.fromJSON (builtins.readFile (path + "/install-result.json"));
dotfilesConfig = import (path + "/dotfiles.nix");
layerImports = map (l: ./layers + "/${l}.nix") dotfilesConfig.layers;
layerPath = layerName: let
filePath = ./layers + "/${layerName}.nix";
dirPath = ./layers + "/${layerName}";
in
if builtins.pathExists filePath then filePath else dirPath;
layerImports = map layerPath dotfilesConfig.layers;
in
({
imports = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment