From 3c515ba2f08637147e5c52d93c949562af6af6de Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 8 Apr 2024 17:43:11 +0100 Subject: [PATCH] Move bookmark building command into separate nix file Copy bookmark stylesheet to out directory as well --- system/bookmarks/default.nix | 10 ++++++++++ system/firefox.nix | 6 +----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 system/bookmarks/default.nix diff --git a/system/bookmarks/default.nix b/system/bookmarks/default.nix new file mode 100644 index 00000000..749cee0b --- /dev/null +++ b/system/bookmarks/default.nix @@ -0,0 +1,10 @@ +{ + runCommand, + emacs, +}: +runCommand "bookmarks" {} '' + mkdir $out + cp ${./default.org} $out/bookmarks.org + cp ${./stylesheet.css} $out/stylesheet.css + ${emacs}/bin/emacs -Q $out/bookmarks.org --batch --eval="(cd \"$out\")" -f pwd -f org-html-export-to-html --kill +'' diff --git a/system/firefox.nix b/system/firefox.nix index 372800b0..45de3b36 100644 --- a/system/firefox.nix +++ b/system/firefox.nix @@ -81,11 +81,7 @@ Homepage = { Locked = true; StartPage = "homepage-locked"; - URL = "file://${pkgs.runCommand "bookmarks" {} '' - mkdir $out - cp ${./bookmarks/default.org} $out/bookmarks.org - ${pkgs.emacs}/bin/emacs -Q $out/bookmarks.org --batch --eval="(cd \"$out\")" -f pwd -f org-html-export-to-html --kill - ''}/bookmarks.html"; + URL = "file://${(pkgs.callPackage ./bookmarks/default.nix {})}/bookmarks.html"; }; NewTabPage = true; NoDefaultBookmarks = true;