forked from extern/flakelight
Add lib option
This commit is contained in:
parent
53f35dc91c
commit
712a66158c
19
builtinModules/lib.nix
Normal file
19
builtinModules/lib.nix
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# flakelight -- Framework for simplifying flake setup
|
||||||
|
# Copyright (C) 2023 Archit Gupta <archit@accelbread.com>
|
||||||
|
# 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;
|
||||||
|
};
|
||||||
|
}
|
@ -9,7 +9,7 @@
|
|||||||
outputs = { nixpkgs, ... }:
|
outputs = { nixpkgs, ... }:
|
||||||
let lib = import ./. nixpkgs; in
|
let lib = import ./. nixpkgs; in
|
||||||
lib.mkFlake ./. {
|
lib.mkFlake ./. {
|
||||||
outputs = { inherit lib; };
|
inherit lib;
|
||||||
functor = _: lib.mkFlake;
|
functor = _: lib.mkFlake;
|
||||||
templates = import ./templates;
|
templates = import ./templates;
|
||||||
checks.statix = pkgs: "${pkgs.statix}/bin/statix check";
|
checks.statix = pkgs: "${pkgs.statix}/bin/statix check";
|
||||||
|
Loading…
Reference in New Issue
Block a user