From a18bafba09090a113927b3e3cc639ce4962e8f5c Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 10 Mar 2026 17:57:47 -0700 Subject: add hook --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e1b138..0bf6053 120000 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1 +1 @@ -/nix/store/j3mz2szdrll59q7blqhiy70j1dij3wnq-pre-commit-config.json \ No newline at end of file +/nix/store/ganmcifhn2hwk9jmmfs1fy1jg2v4a8wd-pre-commit-config.json \ No newline at end of file -- cgit v1.3 From d552d19fd22b3ec7d6122cfefcbcde4eac4dc624 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 10 Mar 2026 20:18:18 -0700 Subject: add hooks --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0bf6053..5372f74 120000 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1 +1 @@ -/nix/store/ganmcifhn2hwk9jmmfs1fy1jg2v4a8wd-pre-commit-config.json \ No newline at end of file +/nix/store/sl54l2pqgb5ysmpd1qn500hrm61zk2i7-pre-commit-config.json \ No newline at end of file -- cgit v1.3 From 4d26df871ea076e892d7691e2f6cba5068e82c99 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Wed, 11 Mar 2026 00:31:22 -0700 Subject: add hooks --- .pre-commit-config.yaml | 2 +- config/emacs.org | 25 +++++++++---------------- flake.nix | 25 +++++++++++++++++++------ 3 files changed, 29 insertions(+), 23 deletions(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5372f74..d1c0e1d 120000 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1 +1 @@ -/nix/store/sl54l2pqgb5ysmpd1qn500hrm61zk2i7-pre-commit-config.json \ No newline at end of file +/nix/store/1gjsgdiq4mwrd8i3a1kz44s7l8nw2n37-pre-commit-config.json \ No newline at end of file diff --git a/config/emacs.org b/config/emacs.org index 0b71dbe..d262138 100644 --- a/config/emacs.org +++ b/config/emacs.org @@ -107,7 +107,7 @@ Emacs is self documenting, after all! (require 'subr-x) (server-start) - ;; start wiith sane defaults + ;; start with sane defaults (pixel-scroll-precision-mode 1) (display-battery-mode 1) (display-time-mode 1) @@ -165,20 +165,20 @@ This is my org mode configuration, which also configures latex. (org-pretty-entities t "prettify org mode") (org-agenda-files (list "~/monorepo/agenda.org" "~/org/notes.org" "~/org/agenda.org") "set default org files") (org-default-notes-file (concat org-directory "/notes.org") "Notes file") - (org-html-with-latex 'html) - (org-html-mathjax-options nil) - (org-html-mathjax-template "") - (org-html-head-include-default-style nil) ; Clear Org's default CSS - (org-html-head-include-scripts nil) ; Clear Org's default JS + (org-html-with-latex 'html "let my html handler handle latex") + (org-html-mathjax-options nil "disable mathjax, use MathML") + (org-html-mathjax-template "" "disable mathjax, use MathML") + (org-html-head-include-default-style nil "use my own css for everything") + (org-html-head-include-scripts nil "use my own js for everything") (org-html-divs '((preamble "header" "preamble") (content "main" "content") - (postamble "footer" "postamble"))) + (postamble "footer" "postamble")) "semantic html exports") (org-html-head-extra (concat "\n\n\n\n\n\n\n\n\n\n\n" "")) + "") "add all these different headers for performance and compliance") (org-latex-to-html-convert-command - "printf '%%s' %i | pandoc -f latex -t html --mathml | tr -d '\\n' | sed -e 's/^

//' -e 's/<\\/p>$//'") + "printf '%%s' %i | pandoc -f latex -t html --mathml | tr -d '\\n' | sed -e 's/^

//' -e 's/<\\/p>$//'" "latex to MathML with special character handling") (org-html-viewport '((width "device-width") (initial-scale "1.0") (minimum-scale "1.0")) "Prevent zooming out past default size") @@ -408,13 +408,6 @@ Org superstar adds those nice looking utf-8 bullets: ** LSP We set up eglot, the LSP manager for emacs, now built in: #+begin_src emacs-lisp :tangle ../nix/init.el - ;; (use-package eglot - ;; :hook - ;; (prog-mode . eglot-ensure) - ;; (nix-mode . eglot-ensure) - ;; :config - ;; (add-to-list 'eglot-server-programs '(nix-mode . ("nil")))) - (use-package lsp :hook (prog-mode . lsp)) diff --git a/flake.nix b/flake.nix index 09c8ea9..a524c32 100644 --- a/flake.nix +++ b/flake.nix @@ -66,15 +66,28 @@ src = ./.; hooks = { deadnix.enable = true; - test-spontaneity-vm-with-site = { + spontaneity-smoke-test = { enable = true; - name = "spontaneity-vm"; - description = "test boot the spontaneity vm to check nginx config. Required test as we inject monorepoSelf variable."; + name = "Spontaneity smoke test"; + description = "tests if nginx is active/if the config works."; stages = [ "pre-merge-commit" ]; - entry = "${pkgs.writeShellScript "website-check" '' -nix build .#spontaneity -''}"; + entry = '' +set -e +set -o pipefail +trap "echo -e '\nHook interrupted by user. Aborting merge!'; exit 1" INT TERM + +BRANCH=$(git branch --show-current) +if [ "$BRANCH" != "main" ]; then + exit 0 +fi + +set +e +nix build .#checks.${system}.spontaneity-website-test --no-link +set -e +''; + pass_filenames = false; }; + website-build-check = { enable = true; name = "website-build"; -- cgit v1.3 From 90c57b64ed82a940dea155161e0833040f540963 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Wed, 11 Mar 2026 01:22:15 -0700 Subject: hooks --- .pre-commit-config.yaml | 2 +- flake.nix | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d1c0e1d..6fc3ea7 120000 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1 +1 @@ -/nix/store/1gjsgdiq4mwrd8i3a1kz44s7l8nw2n37-pre-commit-config.json \ No newline at end of file +/nix/store/wdcgkxxwf6dl5bbjf550ys96hpr97ibw-pre-commit-config.json \ No newline at end of file diff --git a/flake.nix b/flake.nix index 7c309c8..17ff339 100644 --- a/flake.nix +++ b/flake.nix @@ -83,7 +83,13 @@ fi set +e nix build .#checks.${system}.spontaneity-website-test --no-link +BUILD_STATUS=$? set -e + +if [ $BUILD_STATUS -neq 0 ]; then + echo "Failed to build the website with spontaneity!" + exit $BUILD_STATUS +fi ''; pass_filenames = false; }; @@ -340,7 +346,7 @@ sha256sum installer.iso > installer.iso.sha256 checks."${system}" = { build-website = website; - spontaneity-website-test = pkgs.testers.runNixOSTest { + spontaneity-website-test = nixmacs.inputs.nixpkgs.legacyPackages."${system}".testers.runNixOSTest { name = "spontaneity-website-test"; node.specialArgs = { @@ -350,7 +356,7 @@ sha256sum installer.iso > installer.iso.sha256 nodes."spontaneity" = { lib, ... }: { imports = nixmacs.lib.mkHostModules "spontaneity" ++ [ - "${nixpkgs}/nixos/modules/misc/nixpkgs/read-only.nix" + "${nixmacs.inputs.nixpkgs}/nixos/modules/misc/nixpkgs/read-only.nix" { nixpkgs.pkgs = lib.mkVMOverride self.nixosConfigurations.spontaneity.pkgs; nixpkgs.config = lib.mkForce {}; @@ -388,6 +394,7 @@ git config branch.main.mergeoptions "--no-ff" alias gprune='git branch --merged | grep -v -E "^\*|main|master|dev" | xargs -r git branch -d' alias serve='cd result; python3 -m http.server 10005' alias build='nix build .#website && ${mkNotification "CI build done!"} ' +alias check='nix flake check; ${mkNotification "flake checks done!"} ' ''; buildInputs = [ deadnix -- cgit v1.3 From e52cf6c709dff76974580c01761f3a556c7a4883 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Wed, 11 Mar 2026 14:39:51 -0700 Subject: add hook --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6fc3ea7..f1e91f2 120000 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1 +1 @@ -/nix/store/wdcgkxxwf6dl5bbjf550ys96hpr97ibw-pre-commit-config.json \ No newline at end of file +/nix/store/b6fyx6fvys0p5r1q237l8kppwwzh1868-pre-commit-config.json \ No newline at end of file -- cgit v1.3