From b95e7772e77ce41a883d2a6ebf80a1de925bb72f Mon Sep 17 00:00:00 2001 From: networkException Date: Mon, 4 Dec 2023 02:13:55 +0100 Subject: [PATCH] Documentation: Improve nix related commands This patch fixes `nix develop` commands not using proper paths, uses the serenity root directory as an assumption for all commands and adds variants of nix commands to use a custom entry point, for example a shell. --- Documentation/BuildInstructionsLadybird.md | 19 ++++++++++++++----- Documentation/BuildInstructionsOther.md | 10 ++++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Documentation/BuildInstructionsLadybird.md b/Documentation/BuildInstructionsLadybird.md index 05fec2e2a0..08deb16fab 100644 --- a/Documentation/BuildInstructionsLadybird.md +++ b/Documentation/BuildInstructionsLadybird.md @@ -34,13 +34,22 @@ On openSUSE: sudo zypper install cmake libglvnd-devel ninja qt6-base-devel qt6-multimedia-devel qt6-tools-devel qt6-wayland-devel ccache ``` -On Nix/NixOS: -``` -nix-shell ladybird.nix +On Nix/NixOS (using your host nixpkgs): +```bash +# From /path/to/serenity +nix-shell Ladybird/ladybird.nix + +# With a custom entrypoint, for example your favorite shell +nix-shell --command bash Ladybird/ladybird.nix ``` + You can also use the nix flake in `Toolchain`: -``` -nix develop Toolchain/#ladybird +```bash +# From /path/to/serenity +nix develop ./Toolchain#ladybird + +# With a custom entrypoint, for example your favorite shell +nix develop ./Toolchain#ladybird --command bash ``` On macOS: diff --git a/Documentation/BuildInstructionsOther.md b/Documentation/BuildInstructionsOther.md index b5a779dd6f..06c36208b0 100644 --- a/Documentation/BuildInstructionsOther.md +++ b/Documentation/BuildInstructionsOther.md @@ -27,16 +27,22 @@ apt-get install curl cmake libmpc-devel gmp-devel e2fsprogs libmpfr-devel ninja- ## NixOS -You can use the `nix-shell` script [`Toolchain/serenity.nix`](../Toolchain/serenity.nix) to set up the environment: +You can use the `nix-shell` script [`Toolchain/serenity.nix`](../Toolchain/serenity.nix) to set up the environment (using your host nixpkgs): ```console nix-shell Toolchain/serenity.nix + +# With a custom entrypoint, for example your favorite shell +nix-shell --command bash Toolchain/serenity.nix ``` or you can use the nix flake [`Toolchain/flake.nix`](../Toolchain/flake.nix) instead: ```console -nix develop Toolchain +nix develop ./Toolchain# + +# With a custom entrypoint, for example your favorite shell +nix develop ./Toolchain# --command bash ``` You can also save this environment to a profile: