Skip to content

Commit

Permalink
Add nix flakes support for development
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Zhao <gavinz@brown.edu>
  • Loading branch information
Second-Last committed Jan 12, 2025
1 parent 797605d commit a3642e4
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ srcgen/xint/BUILD/*
srcgen/xint/xinterp
srcgen/xint/BUILD/*

result

###### end of [.gitignore] ######
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions flake.nix
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
'';
};
};
}
);
}
2 changes: 2 additions & 0 deletions srcgen1/Makefile_patsopt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ PATSOPT=$(PATSHOME)/bin/patsopt
#
NIXATS2=nix-shell -p ats2 --run
#
ifndef IN_NIX_SHELL
PATSOPT=\
nix --extra-experimental-features nix-command --extra-experimental-features flakes run github:githwxi/ATS-Postiats\#patsopt --
endif
######
#
CFLAGS=
Expand Down
2 changes: 2 additions & 0 deletions srcgen1/xats2js/srcgen1/Makefile_patsopt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ PATSOPT=$(PATSHOME)/bin/patsopt
#
NIXATS2=nix-shell -p ats2 --run
#
ifndef IN_NIX_SHELL
PATSOPT=\
nix --extra-experimental-features nix-command --extra-experimental-features flakes run github:githwxi/ATS-Postiats\#patsopt --
endif
#
######
#
Expand Down
Binary file added srcgen1/xats2js/srcgen1/bin/xats2js
Binary file not shown.

0 comments on commit a3642e4

Please sign in to comment.