{ inputs = { nixpkgs = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; }; utils.url = "github:numtide/flake-utils"; }; outputs = inputs: inputs.utils.lib.eachDefaultSystem ( system: let pkgs = import inputs.nixpkgs { localSystem = system; overlays = [ (final: prev: { bluespec-docs = prev.callPackage ( { stdenv, zola, git, }: stdenv.mkDerivation ({ pname = "bluespec-docs"; version = "0.1.0"; src = inputs.self; nativeBuildInputs = [ zola git ]; buildPhase = '' zola build ''; installPhase = '' mkdir -p $out cp -r public $out ''; }) ) { }; serve-site = prev.writers.writeBashBin "serve-site" '' ${prev.lib.getExe prev.zola} build --base-url "" ${prev.lib.getExe prev.python3} -m http.server --bind 127.0.0.1 8081 --directory ./public ''; }) ]; }; in { packages = { default = inputs.self.packages."${system}".bluespec-docs; bluespec-docs = pkgs.bluespec-docs; }; apps = { # `nix run` will run this default = { type = "app"; program = "${pkgs.serve-site}/bin/serve-site"; }; }; devShells.default = with pkgs; mkShell { inputsFrom = [ bluespec-docs ]; }; } ); }