2023-09-14 06:00:14 +02:00
|
|
|
# flakelight -- Framework for simplifying flake setup
|
|
|
|
# Copyright (C) 2023 Archit Gupta <archit@accelbread.com>
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2024-02-07 09:54:03 +01:00
|
|
|
{ config, lib, flakelight, ... }:
|
2023-09-14 06:00:14 +02:00
|
|
|
let
|
|
|
|
inherit (lib) mkOption mkIf;
|
2024-02-07 09:54:03 +01:00
|
|
|
inherit (lib.types) functionTo raw uniq;
|
|
|
|
inherit (flakelight.types) nullable;
|
2023-09-14 06:00:14 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.functor = mkOption {
|
2024-02-07 09:54:03 +01:00
|
|
|
type = nullable (uniq (functionTo (functionTo raw)));
|
2023-09-14 06:00:14 +02:00
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
|
2024-01-15 04:10:17 +01:00
|
|
|
config.outputs = mkIf (config.functor != null) (_: {
|
2023-09-14 06:00:14 +02:00
|
|
|
__functor = config.functor;
|
2024-01-15 04:10:17 +01:00
|
|
|
});
|
2023-09-14 06:00:14 +02:00
|
|
|
}
|