diff --git a/builtinModules/lib.nix b/builtinModules/lib.nix new file mode 100644 index 0000000..a25c2f4 --- /dev/null +++ b/builtinModules/lib.nix @@ -0,0 +1,19 @@ +# flakelight -- Framework for simplifying flake setup +# Copyright (C) 2023 Archit Gupta +# SPDX-License-Identifier: MIT + +{ config, lib, ... }: +let + inherit (lib) mkOption mkIf; + inherit (lib.types) attrsOf raw; +in +{ + options.lib = mkOption { + type = attrsOf raw; + default = { }; + }; + + config.outputs = mkIf (config.lib != { }) { + inherit (config) lib; + }; +} diff --git a/flake.nix b/flake.nix index 958b644..5eb3d97 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,7 @@ outputs = { nixpkgs, ... }: let lib = import ./. nixpkgs; in lib.mkFlake ./. { - outputs = { inherit lib; }; + inherit lib; functor = _: lib.mkFlake; templates = import ./templates; checks.statix = pkgs: "${pkgs.statix}/bin/statix check";