configuration.nix/modules/lib.nix
Jalil David Salamé Messina 917d131cde
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
refactor(modules/nixos): move stuff around
This makes the module a bit clearer and easier to extend.
2025-03-21 18:45:47 +01:00

27 lines
555 B
Nix

{ lib }:
let
inherit (lib) types;
in
{
# Like mkEnableOption but defaults to true
mkDisableOption =
option:
(lib.mkEnableOption option)
// {
default = true;
example = false;
};
# A option that accepts an image (and shows it in the docs)
mkImageOption =
{
description,
url,
sha256 ? "",
}:
lib.mkOption {
inherit description;
type = types.path;
default = builtins.fetchurl { inherit url sha256; };
defaultText = lib.literalMD "![${description}](${url})";
};
}