clipboard: fix bad list type vim.o

This commit is contained in:
Ching Pei Yang 2025-06-27 14:23:26 +02:00
commit ef53c20678
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -4,9 +4,10 @@
lib,
...
}: let
inherit (builtins) typeOf concatStringsSep;
inherit (lib.modules) mkIf;
inherit (lib.options) mkOption mkEnableOption mkPackageOption;
inherit (lib.types) nullOr either str listOf submodule;
inherit (lib.types) either str listOf submodule;
inherit (lib.attrsets) mapAttrs mapAttrsToList filterAttrs;
cfg = config.vim.clipboard;
in {
@ -71,7 +72,10 @@ in {
config = mkIf cfg.enable {
vim = {
options.clipboard = cfg.registers;
options.clipboard =
if typeOf cfg.registers == "list"
then concatStringsSep "," cfg.registers
else cfg.registers;
extraPackages = mapAttrsToList (_: v: v.package) (
filterAttrs (_: v: v.enable && v.package != null) cfg.providers
);