diff --git a/README.md b/README.md index c456c2ea5..1a9900350 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,34 @@ make ``` > Besides developer options, you migth want to check *USE_DOUBLE*, in util/config.mk, which set the floating point size (float or double). -> Note that the option you choose must match how you built your soundpipe library (more on soundpipe later). +> Note that the option you choose must match how you built your soundpipe library (more on soundpipe later). + +## Nix - Install + +To get started with Gwion, use the provided default.nix file. + +Navigate to the main Gwion repository. +Enter the following command: + +```bash +nix-env -if default.nix +``` + +This should install Gwion. + +Afterwards, you can run the Gwion Interpreter with the following command: + +```bash +gwion +``` + +The default.nix file includes a fixed commit hash. If you prefer to utilize the latest version, you'll need to update the commit hash accordingly. Here's how: + +- Go to the Gwion repository on GitHub. +- Locate the commit hash of the latest version you want to use. +- Update the commit hash in the default.nix file to match the desired version. +- Save the changes. +- Re-run the installation command mentioned earlier to install the updated version of Gwion. ## Executing your first code (hello_world.gw): diff --git a/default.nix b/default.nix new file mode 100644 index 000000000..2fb40a476 --- /dev/null +++ b/default.nix @@ -0,0 +1,29 @@ +{ pkgs ? import {} }: pkgs.stdenv.mkDerivation rec { + pname = "gwion"; + version = "0.1"; + + src = pkgs.fetchFromGitHub { + owner = "Gwion"; + repo = "Gwion"; + rev = "9dad0ff596eeafaf1a928deb8e0a6888e303b1cc"; + sha256 = "sha256-8qZzegpxMzGBuKwF0YyqOleATEmavf+ZzAV/GIx5FfE="; + fetchSubmodules = true; + }; + + nativeBuildInputs = with pkgs; [ + git + ]; + + installPhase = '' + mkdir -p $out/bin + cp gwion $out/bin + ''; + + meta = with pkgs.lib; { + description = "programming lang"; + homepage = "https://github.com/Gwion/Gwion"; + license = licenses.gpl3Plus; + maintainers = ["pyrotek"]; + mainProgram = "gwion"; + }; +}