diff --git a/.github/workflows/ci_zig.yml b/.github/workflows/ci_zig.yml index c1653116cf..c18c8b11b8 100644 --- a/.github/workflows/ci_zig.yml +++ b/.github/workflows/ci_zig.yml @@ -231,6 +231,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 diff --git a/src/flake.nix b/src/flake.nix index de7629441b..a683f8ee98 100644 --- a/src/flake.nix +++ b/src/flake.nix @@ -48,6 +48,27 @@ ''; in { + packages = { + default = self.packages.${system}.roc; + roc = pkgs.stdenv.mkDerivation { + name = "roc"; + src = ../.; + nativeBuildInputs = [ pkgs.zig.hook pkgs.pkg-config ]; + zigBuildFlags = [ ]; + }; + }; + + 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;