diff --git a/Documentation/BuildInstructionsOther.md b/Documentation/BuildInstructionsOther.md index 357cf351d06..8cb9ad558ae 100644 --- a/Documentation/BuildInstructionsOther.md +++ b/Documentation/BuildInstructionsOther.md @@ -26,46 +26,11 @@ apt-get install curl cmake libmpc-devel gmp-devel e2fsprogs libmpfr-devel ninja- ## NixOS -You can use a `nix-shell` script like the following to set up the correct environment: - -myshell.nix: +You can use the `nix-shell` script [`Toolchain/serenity.nix`](../Toolchain/serenity.nix) to set up the environment: +```console +nix-shell Toolchain/serenity.nix ``` -with import {}; - -stdenv.mkDerivation { - name = "cpp-env"; - nativeBuildInputs = [ - gcc11 - curl - cmake - mpfr - ninja - gmp - libmpc - e2fsprogs - patch - ccache - rsync - unzip - - # Example Build-time Additional Dependencies - pkgconfig - ]; - buildInputs = [ - # Example Run-time Additional Dependencies - openssl - x11 - qemu - # glibc - ]; - hardeningDisable = [ "format" "fortify" ]; -} -``` - -Then use this script: `nix-shell myshell.nix`. - -Once you're in nix-shell, you should be able to follow the build directions. ## Alpine Linux diff --git a/Toolchain/serenity.nix b/Toolchain/serenity.nix new file mode 100644 index 00000000000..3f70aab34f2 --- /dev/null +++ b/Toolchain/serenity.nix @@ -0,0 +1,31 @@ +{ pkgs ? import { } }: +with pkgs; + +stdenv.mkDerivation { + name = "cpp-env"; + nativeBuildInputs = [ + gcc11 + curl + cmake + mpfr + ninja + gmp + libmpc + e2fsprogs + patch + ccache + rsync + unzip + + # Example Build-time Additional Dependencies + pkgconfig + ]; + buildInputs = [ + # Example Run-time Additional Dependencies + openssl + x11 + qemu + # glibc + ]; + hardeningDisable = [ "format" "fortify" ]; +}