Skip to content

Commit 7a3c211

Browse files
authored
Merge pull request #4 from negatethis/master
Add buildFlags to default.nix
2 parents b23a63c + 022ca30 commit 7a3c211

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ bun2nix.mkBunDerivation {
100100
101101
bunNix = ./bun.nix;
102102
103+
buildFlags = [
104+
"--compile"
105+
"--minify"
106+
"--sourcemap"
107+
"--bytecode"
108+
];
109+
103110
index = ./index.ts;
104111
}
105112
```

default.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ in {
5353
version,
5454
src,
5555
bunNix,
56+
buildFlags ? [
57+
"--compile"
58+
"--minify"
59+
"--sourcemap"
60+
"--bytecode"
61+
],
5662
...
5763
} @ args: let
5864
bunDeps = callPackage bunNix {};
@@ -86,13 +92,7 @@ in {
8692
runHook preBuild
8793
8894
# Create a bun binary with all the highest compile time optimizations enabled
89-
bun build \
90-
--compile \
91-
--minify \
92-
--sourcemap \
93-
--bytecode \
94-
${args.index} \
95-
--outfile ${name}
95+
bun build ${lib.concatStringsSep " " buildFlags} ${args.index} --outfile ${name}
9696
9797
runHook postBuild
9898
'';

0 commit comments

Comments
 (0)