Skip to content

Commit 626104f

Browse files
committed
Add Nix package to new Zig compiler
1 parent 9243fcd commit 626104f

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

src/flake.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/flake.nix

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@
99

1010
# to easily make configs for multiple architectures
1111
flake-utils.url = "github:numtide/flake-utils";
12+
13+
gitignore = {
14+
url = "github:hercules-ci/gitignore.nix";
15+
inputs.nixpkgs.follows = "nixpkgs";
16+
};
1217
};
1318

14-
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
19+
outputs = { self, nixpkgs, flake-utils, gitignore,... }@inputs:
1520
let
1621
supportedSystems =
1722
[ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
@@ -48,6 +53,29 @@
4853
'';
4954

5055
in {
56+
packages = {
57+
default = self.packages.${system}.roc;
58+
roc = pkgs.stdenv.mkDerivation {
59+
name = "roc";
60+
src = gitignore.lib.gitignoreSource ../.;
61+
nativeBuildInputs = [ pkgs.zig.hook ];
62+
zigBuildFlags = [ "-Dfuzz" "-Dsystem-afl=false" "-Doptimize=ReleaseFast" ];
63+
zigCheckFlags = [ ];
64+
zigInstallFlags = [ ];
65+
};
66+
};
67+
68+
apps = {
69+
default = self.apps.${system}.roc;
70+
roc = {
71+
type = "app";
72+
program = "${self.packages.${system}.roc}/bin/roc";
73+
meta = {
74+
description = "Roc CLI";
75+
mainProgram = "roc";
76+
};
77+
};
78+
};
5179

5280
devShell = pkgs.mkShell {
5381
buildInputs = dependencies;

0 commit comments

Comments
 (0)