Skip to content

Commit

Permalink
build: using nix
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBorde authored Jan 24, 2025
2 parents 963dd7b + 091fac5 commit 00b5d41
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 11 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'

- run: npm install
- run: npm test
- uses: cachix/install-nix-action@v27
- run: nix develop --command npm install
- run: nix develop --command npm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
build
*.log
.envrc
.direnv
61 changes: 61 additions & 0 deletions flake.lock

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

19 changes: 19 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
description = "js-config";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in {
devShell = pkgs.mkShell {
packages = with pkgs; [ nodejs_20 ];
};
}
);
}
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,5 @@
},
"jest": {
"preset": "ts-jest"
},
"volta": {
"node": "20.12.0",
"npm": "10.2.4"
}
}

0 comments on commit 00b5d41

Please sign in to comment.