From b294b83325678bc87ba431d50201652916a74833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 4 Apr 2023 22:49:47 +0200 Subject: [PATCH] flake: filter source directory to only contain directories and nix files and not potential patch files which would be tried to be interpreted as nix code --- flake.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 29213fd..517d46f 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,8 @@ outputs = { self, nixpkgs-lib, ... }: let inherit (nixpkgs-lib) lib; - ls = dir: lib.attrNames (builtins.readDir (./. + "/${dir}")); + src = builtins.filterSource (path: type: type == "directory" || lib.hasSuffix ".nix" (baseNameOf path)) ./.; + ls = dir: lib.attrNames (builtins.readDir (src + "/${dir}")); fileList = dir: map (file: ./. + "/${dir}/${file}") (ls dir); importDirToKey = dir: args: lib.listToAttrs (map (file: {