expose lib in flake
This commit is contained in:
parent
7cd935026e
commit
278a02cc87
2 changed files with 6 additions and 4 deletions
|
@ -5,7 +5,10 @@
|
|||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
{
|
||||
lib = import ./lib.nix;
|
||||
}
|
||||
// flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
|
|
5
lib.nix
5
lib.nix
|
@ -24,7 +24,7 @@ let
|
|||
else if isFloat val || isInt val then toString val
|
||||
else if isBool val then toLuaBool val
|
||||
else if isNull val then null
|
||||
else null;
|
||||
else throw "[nix2lua] Value '${toString val}' is not supported";
|
||||
|
||||
toLuaList = val:
|
||||
wrapObj (excludeNull (map toLua val));
|
||||
|
@ -43,8 +43,7 @@ let
|
|||
|
||||
validString = value:
|
||||
if isString value then value
|
||||
else throw "Value '${toString value}' is not a valid string";
|
||||
|
||||
else throw "[nix2lua] Value '${toString value}' is not a valid string";
|
||||
in
|
||||
{
|
||||
inherit toLua;
|
||||
|
|
Loading…
Reference in a new issue