From 6994585d29a3c6e2a9415824c7e5e859efd7c630 Mon Sep 17 00:00:00 2001 From: Jens Nolte <jens@nightmarestudio.de> Date: Mon, 10 Aug 2020 14:49:43 +0200 Subject: [PATCH] Allow layers to be directories instead of .nix files --- configuration.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index f824f93..76097d3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -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 = [ -- GitLab