diff options
| author | Preston Pan <ret2pop@nullring.xyz> | 2026-03-03 22:05:26 -0800 |
|---|---|---|
| committer | Preston Pan <ret2pop@nullring.xyz> | 2026-03-03 22:05:26 -0800 |
| commit | 4dc487e777f2b7900bd4e4d57205a1a4829c3401 (patch) | |
| tree | 5a841ceaa06a0af37deef44893005810ad214f26 /flake.nix | |
| parent | c082f1c0a92ba6212f664ee425dfcb2dd5cc5e38 (diff) | |
fix remaining links; try publish-org-roam-ui
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 74 |
1 files changed, 73 insertions, 1 deletions
@@ -8,9 +8,18 @@ inputs.nixpkgs.follows = "nixpkgs"; }; hyprnixmacs.url = "git://nullring.xyz/hyprnixmacs.git"; + + publish-org-roam-ui = { + url = "git://nullring.xyz/publish-org-roam-ui.git"; + flake = false; + }; + org-roam-ui = { + url = "github:ikoamu/org-roam-ui/publish-org-roam-ui"; + flake = false; + }; }; - outputs = { nixpkgs, git-hooks, hyprnixmacs, self, ... }: + outputs = { nixpkgs, git-hooks, hyprnixmacs, self, publish-org-roam-ui, org-roam-ui, ... }: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; }; @@ -35,6 +44,41 @@ fi }; }; }; + publish-deps = pkgs.stdenv.mkDerivation { + name = "publish-scripts-node-modules"; + src = publish-org-roam-ui; # <-- Changed this line + nativeBuildInputs = [ pkgs.nodejs ]; + buildPhase = '' + export HOME=$TMPDIR + npm install + npm install fuse.js + ''; + installPhase = '' + mkdir -p $out + cp -r node_modules $out/ + ''; + outputHashMode = "recursive"; + outputHashAlgo = "sha256"; + outputHash = pkgs.lib.fakeHash; + }; + + org-roam-ui-deps = pkgs.stdenv.mkDerivation { + name = "org-roam-ui-node-modules"; + src = org-roam-ui; + nativeBuildInputs = [ pkgs.yarn pkgs.nodejs ]; + buildPhase = '' + export HOME=$TMPDIR + yarn config set cache-folder $TMPDIR/.yarn-cache + yarn install + ''; + installPhase = '' + mkdir -p $out + cp -r node_modules $out/ + ''; + outputHashMode = "recursive"; + outputHashAlgo = "sha256"; + outputHash = pkgs.lib.fakeHash; # We will update this after the first run! + }; emacsPackages = import "${hyprnixmacs}/modules/home/emacs-packages.nix"; ci-emacs = pkgs.emacs-nox.pkgs.withPackages emacsPackages; @@ -49,6 +93,7 @@ fi pkgs.sqlite pkgs.ghostscript pkgs.imagemagick + pkgs.jq (pkgs.texlive.combine { inherit (pkgs.texlive) scheme-full @@ -123,6 +168,33 @@ emacs -q --batch \ --eval '(add-hook (quote org-publish-after-export-hook) (lambda (file) (font-lock-ensure)))' \ --eval '(org-publish-all t)' \ --eval '(org-publish-all nil)' || (echo "FAIL:" && cat /build/*.log && exit 1) + +echo "Setting up Org-Roam-UI..." +export NIX_ENV=1 +export ROAM_DB_PATH=$HOME/.emacs.d/org-roam.db +export ROAM_IMG_PATH=$HOME/monorepo/mindmap/img +export ROAM_PATH=$HOME/monorepo/mindmap +export UI_SRC=${org-roam-ui} + +cp -r ${publish-org-roam-ui} $HOME/publish-script +chmod -R +w $HOME/publish-script +cd $HOME/publish-script + +# Inject NPM modules safely +cp -r ${publish-deps}/node_modules ./node_modules +chmod -R +w ./node_modules + +# Run the patched local.sh +bash local.sh || echo "Graph script hit a non-fatal error" + +# Inject Yarn modules safely +cp -r ${org-roam-ui-deps}/node_modules ./org-roam-ui/node_modules +chmod -R +w ./org-roam-ui/node_modules + +cd org-roam-ui/standalone +bash build-standalone-server.sh ../.. + +cp -r ../../out $HOME/website_html/graph_view ''; installPhase = '' |
