From fdb086372a0e6572289415ddb215f16c946ddfc2 Mon Sep 17 00:00:00 2001 From: pyrotek45 Date: Wed, 15 May 2024 17:48:26 -0400 Subject: [PATCH] added default.nix to install on nix systems --- README.md | 19 +++++++++++++++++++ default.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 default.nix diff --git a/README.md b/README.md index c456c2ea..6abf620b 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,25 @@ 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). +## 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 +``` + ## Executing your first code (hello_world.gw): This assumes you have successfully compiled gwion. To build follow [these steps](#build) . To check, if the build was successfully run diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..2fb40a47 --- /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"; + }; +} -- 2.43.0