From 3bec7b12a7431b2a9881755ec2243acbca5c6f81 Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Mon, 17 Nov 2025 10:08:38 -0800 Subject: [PATCH 1/5] biome: Add support for v2.2.5 --- programs/biome.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/programs/biome.nix b/programs/biome.nix index dea4de57..10277562 100644 --- a/programs/biome.nix +++ b/programs/biome.nix @@ -14,10 +14,20 @@ let cfg = config.programs.biome; opts = options.programs.biome; - biomeVersion = if builtins.match "^1\\." pkgs.biome.version != null then "1.9.4" else "2.1.2"; + biomeVersion = + let + v = pkgs.biome.version; + in + if builtins.match "^1\\." v != null then + "1.9.4" + else if builtins.match "^2\\.1\\." v != null then + "2.1.2" + else + "2.2.5"; schemaHashes = { "1.9.4" = "sha256-SkkULLRk4CQzk+j0h8PAqOY6vGOrdG5ja7Z/tSAAKnY="; "2.1.2" = "sha256-n4Y16J7g34e0VdQzRItu/P7n5oppkY4Vm4P1pQxOILU="; + "2.2.5" = "sha256-no7jIazvyEp+hdwmuArQ/yRgnWrAw/NEM5qRInMRuaE="; }; ext.js = [ From 297ea6895e3eb4c89639840b63a4cc212c2bffcb Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Mon, 17 Nov 2025 10:13:21 -0800 Subject: [PATCH 2/5] biome: Add support for v2.3.5 --- programs/biome.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/programs/biome.nix b/programs/biome.nix index 10277562..3137dd2e 100644 --- a/programs/biome.nix +++ b/programs/biome.nix @@ -20,14 +20,17 @@ let in if builtins.match "^1\\." v != null then "1.9.4" - else if builtins.match "^2\\.1\\." v != null then - "2.1.2" + else if builtins.match "^2\\.2\\." v != null then + "2.2.5" + else if builtins.match "^2\\.3\\." v != null then + "2.3.5" else - "2.2.5"; + "2.1.2"; schemaHashes = { "1.9.4" = "sha256-SkkULLRk4CQzk+j0h8PAqOY6vGOrdG5ja7Z/tSAAKnY="; "2.1.2" = "sha256-n4Y16J7g34e0VdQzRItu/P7n5oppkY4Vm4P1pQxOILU="; "2.2.5" = "sha256-no7jIazvyEp+hdwmuArQ/yRgnWrAw/NEM5qRInMRuaE="; + "2.3.5" = "sha256-8O59CmHaP7/XuGs9BteOTcltddYSTxEIM/64dLfbLk0="; }; ext.js = [ From 338540e9b924710b57b7f2d6031bdccde5186a1a Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Wed, 26 Nov 2025 15:20:53 -0800 Subject: [PATCH 3/5] feat(biome): allow overriding config path --- programs/biome.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/programs/biome.nix b/programs/biome.nix index 3137dd2e..d43e300c 100644 --- a/programs/biome.nix +++ b/programs/biome.nix @@ -91,6 +91,12 @@ in description = "Allows to format a document that has unsafe fixes."; default = false; }; + configPath = l.mkOption { + type = t.stringOrNull; + description = "Path to a Biome configuration file."; + default = null; + example = "/path/to/biome.json"; + }; settings = l.mkOption { inherit (json) type; description = "Raw Biome configuration (must conform to Biome JSON schema)"; @@ -164,7 +170,12 @@ in cp "$json" $out ''; in - [ + [ ] + ++ l.optional (cfg.configPath != null) [ + "--config-path" + "${cfg.configPath}" + ] + ++ l.optional (cfg.configPath == null) [ "--config-path" "${if cfg.validate.enable then validatedConfig else jsonFile}" ] From 56a05fab146ed767958cd94ba0027c35fc011703 Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Wed, 26 Nov 2025 15:26:40 -0800 Subject: [PATCH 4/5] fix typo --- programs/biome.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/biome.nix b/programs/biome.nix index d43e300c..24e256d4 100644 --- a/programs/biome.nix +++ b/programs/biome.nix @@ -92,7 +92,7 @@ in default = false; }; configPath = l.mkOption { - type = t.stringOrNull; + type = t.nullOr t.str; description = "Path to a Biome configuration file."; default = null; example = "/path/to/biome.json"; From f94b3ec22387ee1a3cd5670164f88c79d092a749 Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Wed, 26 Nov 2025 15:29:56 -0800 Subject: [PATCH 5/5] fix accidental nesting --- programs/biome.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/biome.nix b/programs/biome.nix index 24e256d4..5aa7bd46 100644 --- a/programs/biome.nix +++ b/programs/biome.nix @@ -171,11 +171,11 @@ in ''; in [ ] - ++ l.optional (cfg.configPath != null) [ + ++ l.optionals (cfg.configPath != null) [ "--config-path" "${cfg.configPath}" ] - ++ l.optional (cfg.configPath == null) [ + ++ l.optionals (cfg.configPath == null) [ "--config-path" "${if cfg.validate.enable then validatedConfig else jsonFile}" ]