From 34c0bf9616eff3e16141241d9bc9d49f1f173f78 Mon Sep 17 00:00:00 2001 From: servius Date: Tue, 13 Jan 2026 11:40:18 +0530 Subject: [PATCH] feat(Justfile): Add comments and update ast-grep pattern for program addition --- justfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 14b02db9..d5f54e58 100644 --- a/justfile +++ b/justfile @@ -34,8 +34,9 @@ rollback: add program: echo '{pkgs, ...}: { home.packages = [pkgs.{{program}}];}' > home/programs/{{program}}.nix + # https://ast-grep.github.io/advanced/pattern-parse.html#incomplete-pattern-code + # Since the imports doesn't match the whole pattern we need to use the selector binding and the attr expression to match it properly. ast-grep run -p '{ imports = [$$$ITEMS] }' --selector binding --rewrite 'imports = [$$$ITEMS ./{{program}}.nix ]' home/programs/default.nix -i alejandra fmt home/programs/{{program}}.nix home/programs/default.nix git add home/programs/{{program}}.nix -