Skip to content

Commit

Permalink
ci(nix): try nixPreload as a strategy for faster builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Nov 27, 2023
1 parent e8e3d17 commit 1459250
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- run: corepack enable
- name: Install dependencies
run: yarn install --immutable

- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plugins:
spec: "https://raw.githubusercontent.com/stephank/yarn-plugin-nixify/main/dist/yarn-plugin-nixify.js"

# yarn-plugin-nixify options
enableNixPreload: true
generateDefaultNix: false
nixExprPath: nix/yarn-project.nix

Expand Down
23 changes: 0 additions & 23 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,6 @@
overrideAttrs = {
pname = "${pname}-builder";

# get rid of all dependencies not needed for building
preConfigure = ''
yarn remove \
@storybook/addon-essentials \
@storybook/addon-styling \
@storybook/addon-themes \
@storybook/blocks \
@storybook/react \
@storybook/react-vite \
chromatic \
husky \
json-schema-to-typescript \
node-fetch \
lint-staged \
prettier \
react \
react-dom \
shikiji \
storybook \
tsx \
vite
'';

buildPhase = ''
runHook preBuild
yarn compile
Expand Down
4 changes: 2 additions & 2 deletions nix/yarn-project.nix

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

0 comments on commit 1459250

Please sign in to comment.