-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from Second-Last/nixify
Add Nix flakes and development setup instructions
- Loading branch information
Showing
7 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
This document provides instructions on how to setup your environment to | ||
develop/hack on ATS-Xanadu. | ||
|
||
## Prerequisites | ||
|
||
- The [`nix`](https://nixos.org/download/) package manager. | ||
|
||
That's it! The hard job of setting up dependencies and configuring environment | ||
variables are offloaded to Nix | ||
([flakes](https://zero-to-nix.com/concepts/flakes/)), all while making sure | ||
these changes are isolated for this project only and will not affect your | ||
system. | ||
|
||
## Steps | ||
|
||
> [!WARNING] | ||
> For advanced Make users: do **NOT** add `-j` flag to build in parallel. There | ||
are still issues regarding the way compiler outputs are merged together. | ||
The build is quick and shouldn't take more than 10 minutes to complete | ||
even when building with one core. | ||
|
||
1. Run `nix develop`. You will be dropped into a bash shell that contains all | ||
the dependencies and environment variables configured for you. | ||
|
||
The first run may take a while, because Nix needs to fetch dependencies. | ||
Subsequent `nix develop` runs are much faster due to caching. | ||
|
||
2. Run `make -f Makefile_overall`. | ||
|
||
3. Now you have a working ATS3 compiler! Checkout the `PGROUND` for examples. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
description = "ATS-Xanadu"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { nixpkgs, flake-utils, self }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
in | ||
{ | ||
devShells = { | ||
default = with pkgs; mkShell { | ||
buildInputs = [ | ||
ats2 | ||
boehmgc | ||
bun | ||
nodejs | ||
]; | ||
|
||
shellHook = '' | ||
export XATSHOME=$PWD | ||
''; | ||
}; | ||
}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.