Replace nixpkgs nullOr type with custom type

`nullOr`'s merge function requires definitions to all be null or all be
non-null. It was being used where the intent was that null be used as a
value representing unset, and as such the merge should return null if
all definitions are null and ignore nulls otherwise. This adds a type
with that merge semantics.
This commit is contained in:
Archit Gupta
2024-02-07 00:54:03 -08:00
parent 9fe4cb1994
commit 543e3aaa4d
15 changed files with 74 additions and 50 deletions

View File

@ -5,13 +5,13 @@
{ config, lib, flakelight, moduleArgs, ... }:
let
inherit (lib) mkOption mkIf mkMerge;
inherit (lib.types) lazyAttrsOf nullOr;
inherit (flakelight.types) module optCallWith;
inherit (lib.types) lazyAttrsOf;
inherit (flakelight.types) module nullable optCallWith;
in
{
options = {
nixosModule = mkOption {
type = nullOr module;
type = nullable module;
default = null;
};