diff --git a/modules/scripts/preview.nix b/modules/scripts/preview.nix new file mode 100644 index 00000000..7a77187b --- /dev/null +++ b/modules/scripts/preview.nix @@ -0,0 +1,24 @@ +{ + flake.modules.homeManager.base = + { pkgs, ... }: + { + home.packages = [ + (pkgs.writeShellApplication { + name = "preview"; + + runtimeInputs = with pkgs.nodePackages; [ browser-sync ]; + + text = '' + # Based on https://github.com/rwxrob/dot/blob/main/scripts/preview. + + browser-sync start \ + --ignore '**/.*' \ + --no-notify \ + --no-open \ + --no-ui \ + -sw + ''; + }) + ]; + }; +}