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
|
|
|
|
|
2023-08-27 07:48:57 +02:00
|
|
|
{ config, lib, flakelight, ... }:
|
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;
|
2023-08-27 07:48:57 +02:00
|
|
|
inherit (flakelight.types) 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 {
|
|
|
|
type = lazyAttrsOf overlay;
|
|
|
|
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
|
|
|
}
|