Create nixfiles lib and define flake type

This commit is contained in:
NullBite 2024-03-14 20:42:15 +00:00
parent 89f7debf17
commit 4a1b0a5502
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
2 changed files with 20 additions and 0 deletions

7
lib/nixfiles/default.nix Normal file
View File

@ -0,0 +1,7 @@
pkgs:
let
inherit (pkgs) lib;
in
{
types = (import ./types.nix) pkgs;
}

13
lib/nixfiles/types.nix Normal file
View File

@ -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"); };
}