diff --git a/lib/nixfiles/default.nix b/lib/nixfiles/default.nix new file mode 100644 index 0000000..3551628 --- /dev/null +++ b/lib/nixfiles/default.nix @@ -0,0 +1,7 @@ +pkgs: +let + inherit (pkgs) lib; +in +{ + types = (import ./types.nix) pkgs; +} diff --git a/lib/nixfiles/types.nix b/lib/nixfiles/types.nix new file mode 100644 index 0000000..263d457 --- /dev/null +++ b/lib/nixfiles/types.nix @@ -0,0 +1,13 @@ +pkgs: +let + inherit (pkgs) lib; + inherit (lib.types) mkOptionType; + inherit (lib.options) mergeEqualOption; +in +{ + flake = mkOptionType { + name="flake"; + description="Nix flake"; + descriptionClass = "noun"; + merge = mergeEqualOption; check = (value: value._type or "" == "flake"); }; +}