From 3cad5880ae17741332a212f45b8fb8488bc6ef4a Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Sat, 14 Mar 2026 23:33:23 +0200 Subject: [PATCH] flake.nix: add watch-blog Signed-off-by: Anirudh Oppiliappan --- .air/blog.toml | 12 ++++++++++++ .gitignore | 1 + flake.nix | 9 +++++++++ 3 files changed, 22 insertions(+) create mode 100644 .air/blog.toml diff --git a/.air/blog.toml b/.air/blog.toml new file mode 100644 index 00000000..b92507c2 --- /dev/null +++ b/.air/blog.toml @@ -0,0 +1,12 @@ +root = "." +tmp_dir = "out" + +[build] +cmd = "go build -o out/blog.out cmd/blog/main.go" +bin = "out/blog.out" +args_bin = ["serve"] + +include_ext = ["go", "html", "md"] +include_dir = ["cmd/blog", "blog"] +exclude_dir = ["nix", "tmp", "out"] +stop_on_error = true diff --git a/.gitignore b/.gitignore index 0abcfad1..a19ee22c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ sites/.wrangler/ # Created if following hacking.md genjwks.out /nix/vm-data +blog/build/ diff --git a/flake.nix b/flake.nix index 4e02e531..b932cb79 100644 --- a/flake.nix +++ b/flake.nix @@ -254,6 +254,15 @@ type = "app"; program = ''${air-watcher "spindle" ""}/bin/run''; }; + watch-blog = { + type = "app"; + program = toString (pkgs.writeShellScript "watch-blog" '' + echo "copying static files to appview/pages/static..." + mkdir -p appview/pages/static + ${pkgs.coreutils}/bin/cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static + ${air-watcher "blog" "serve"}/bin/run + ''); + }; watch-tailwind = { type = "app"; program = ''${tailwind-watcher}/bin/run''; -- 2.51.2