diff --git a/experimental/dsh-everything-edition/flake.nix b/experimental/dsh-everything-edition/flake.nix index a2d440a..5b542b9 100644 --- a/experimental/dsh-everything-edition/flake.nix +++ b/experimental/dsh-everything-edition/flake.nix @@ -132,6 +132,21 @@ description = "dsh web preloaded with this checkout's dsh-plugins/plugins.cordis.yml"; }; }; + + # dsh-main with `--port 0`, so a second run gets an OS-assigned free + # port instead of colliding on 3080. A user-supplied `--port` still + # wins, because it lands after this one on the composed command line. + dsh-main-any-port = pkgs.writeShellApplication { + name = "dsh-main-any-port"; + runtimeInputs = [ dsh-main ]; + text = '' + exec dsh-main --port 0 "$@" + ''; + meta = { + mainProgram = "dsh-main-any-port"; + description = "dsh-main on an OS-assigned free port"; + }; + }; in { # `nix run .#dsh-vanilla-with-pnpm`: plain dsh with pnpm + node on PATH. @@ -140,6 +155,9 @@ # `nix run` (or `nix run .#main`): dsh web with this checkout's plugins loaded. default = dsh-main; main = dsh-main; + + # `nix run .#main-any-port`: `#main`, but on an OS-assigned free port. + main-any-port = dsh-main-any-port; } ); };