Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci_zig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ jobs:
git clean -fdx
git reset --hard HEAD
nix develop ./src/ -c zig build && zig build snapshot && zig build test

- name: Test Nix package
if: ${{ runner.os == 'Linux' || (runner.os == 'macOS' && runner.arch != 'X64') }}
uses: ./.github/actions/flaky-retry
with:
command: |
nix build ./src#roc
result/bin/roc check src/PROFILING/bench_repeated_check.roc
error_string_contains: TemporaryNameServerFailure
retry_count: 3

zig-cross-compile:
needs: check-once
Expand Down
21 changes: 21 additions & 0 deletions src/flake.lock

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

30 changes: 29 additions & 1 deletion src/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@

# to easily make configs for multiple architectures
flake-utils.url = "github:numtide/flake-utils";

gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, flake-utils, ... }@inputs:
outputs = { self, nixpkgs, flake-utils, gitignore,... }@inputs:
let
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
Expand Down Expand Up @@ -48,6 +53,29 @@
'';

in {
packages = {
default = self.packages.${system}.roc;
roc = pkgs.stdenv.mkDerivation {
name = "roc";
src = gitignore.lib.gitignoreSource ../.;
nativeBuildInputs = [ pkgs.zig.hook ];
zigBuildFlags = [ "-Dfuzz" "-Dsystem-afl=false" "-Doptimize=ReleaseFast" ];
zigCheckFlags = [ ];
zigInstallFlags = [ ];
};
};

apps = {
default = self.apps.${system}.roc;
roc = {
type = "app";
program = "${self.packages.${system}.roc}/bin/roc";
meta = {
description = "Roc CLI";
mainProgram = "roc";
};
};
};

devShell = pkgs.mkShell {
buildInputs = dependencies;
Expand Down
Loading