2023-08-27 07:48:57 +02:00
|
|
|
# flakelight -- Framework for simplifying flake setup
|
2023-08-25 06:14:55 +02:00
|
|
|
# Copyright (C) 2023 Archit Gupta <archit@accelbread.com>
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2024-01-15 04:17:50 +01:00
|
|
|
{ config, lib, flakelight, moduleArgs, ... }:
|
2023-08-25 06:14:55 +02:00
|
|
|
let
|
2023-08-27 08:46:37 +02:00
|
|
|
inherit (lib) mkMerge mkOption mkIf;
|
|
|
|
inherit (lib.types) lazyAttrsOf nullOr;
|
2024-01-15 04:17:50 +01:00
|
|
|
inherit (flakelight.types) optCallWith overlay;
|
2023-08-25 06:14:55 +02:00
|
|
|
in
|
|
|
|
{
|
2023-08-27 08:46:37 +02:00
|
|
|
options = {
|
|
|
|
overlay = mkOption {
|
|
|
|
type = nullOr overlay;
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
|
|
|
|
overlays = mkOption {
|
2024-01-15 04:17:50 +01:00
|
|
|
type = optCallWith moduleArgs (lazyAttrsOf overlay);
|
2023-08-27 08:46:37 +02:00
|
|
|
default = { };
|
|
|
|
};
|
2023-08-25 06:14:55 +02:00
|
|
|
};
|
|
|
|
|
2023-08-27 08:46:37 +02:00
|
|
|
config = mkMerge [
|
|
|
|
(mkIf (config.overlay != null) {
|
|
|
|
overlays.default = config.overlay;
|
|
|
|
})
|
|
|
|
|
|
|
|
(mkIf (config.overlays != { }) {
|
|
|
|
outputs = { inherit (config) overlays; };
|
|
|
|
})
|
|
|
|
];
|
2023-08-25 06:14:55 +02:00
|
|
|
}
|