Fixes for Health for Watch
This commit is contained in:
parent
6780fbfd90
commit
89d1c2e4f0
5 changed files with 73 additions and 37 deletions
32
flake.nix
32
flake.nix
|
|
@ -5,9 +5,35 @@
|
|||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = {self, ...} @ inputs: let
|
||||
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
}: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
packages.x86_64-linux.website = pkgs.callPackage ./package.nix {};
|
||||
packages.${system} = {
|
||||
website = pkgs.callPackage ./package.nix {};
|
||||
serve = pkgs.writeShellScriptBin "serveSite" ''
|
||||
echo "Running server: visit http://localhost:8000/index.html"
|
||||
exec ${pkgs.webfs}/bin/webfsd -F -p 8000 -r ${self.packages.${system}.website}
|
||||
'';
|
||||
};
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
packages = [
|
||||
pkgs.watchexec
|
||||
pkgs.nix
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo "Starting auto-reload dev shell..."
|
||||
echo "Watching for file changes in $(pwd)"
|
||||
echo "When something changes, we'll restart: nix run .#serve"
|
||||
|
||||
watchexec -r -e nix,html,css,js,org -- nix run .#serve
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue