Skip to content

Commit

Permalink
feat(flake): Update based on template to get the live helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
etu committed Oct 13, 2024
1 parent d9cc248 commit 7d111ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
22 changes: 10 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# format and copying other resources (such as images).
default = pkgs.runCommand "resume" {} ''
ln -s ${./resume.nix} resume.nix
HOME=$(mktemp -d) ${self.packages.${system}.builder}
HOME=$(mktemp -d) ${lib.getExe self.packages.${system}.builder}
mkdir $out
cp -v resume.html $out/index.html
cp -v ${./headshot.jpg} $out/headshot.jpg
Expand All @@ -46,16 +46,7 @@
# Allows to run a live preview server using "nix run .#live"
apps = {
live.type = "app";
live.program = builtins.toString (pkgs.writeShellScript "entr-reload" ''
${self.packages.${system}.builder}
${lib.getExe pkgs.nodePackages.live-server} \
--watch=resume.html --open=resume.html --wait=300 &
printf "\n%s" resume.{toml,nix,json} |
${lib.getExe pkgs.xe} -s 'test -f "$1" && echo "$1"' |
${lib.getExe pkgs.entr} -p ${self.packages.${system}.builder}
'');
live.program = lib.getExe (jsonresume-nix.lib.${system}.buildLiveServer self.packages.${system}.builder);
};
})
// {inherit inputs;};
Expand Down

0 comments on commit 7d111ea

Please # to comment.