diff --git a/flake.nix b/flake.nix index 43c5853..850a17f 100644 --- a/flake.nix +++ b/flake.nix @@ -65,7 +65,13 @@ source = mkOption { type = nullOr path; default = null; - description = "Path of the source file or directory"; + description = "Path of the source file"; + }; + + dir = mkOption { + type = nullOr path; + default = null; + description = "Path of directory to link"; }; executable = mkOption { @@ -134,7 +140,7 @@ n: v: let processed = - if (v.source == null) then + if (v.source == null && v.dir == null) then ( if (v.text == "") then throw "Must provide source or text for ${n}" @@ -154,13 +160,22 @@ "text" "enable" "executable" + "dir" ]; nullFiltered = lib.filterAttrs (_: v: v != null) filtered; in nullFiltered - // { - type = "symlink"; - } + // ( + if (v.dir == null) then + { + type = "symlink"; + } + else + { + source = v.dir; + type = "directory"; + } + ) ) enabled; in lib.foldlAttrs (