Files
nhost/flake.nix
robertkasza e515e71c8b chore: upgrade nodejs and pnpm version in nix config (#3152)
### **PR Type**
Enhancement


___

### **Description**
- Upgrade Node.js from v18 to v20

- Update PNPM from nodePackages.pnpm to pnpm_9

- Modify nix configuration files for dependencies


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>flake.nix</strong><dd><code>Update PNPM version in
build inputs and dev shells</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

flake.nix

<li>Replace <code>nodePackages.pnpm</code> with <code>pnpm_9</code> in
nativeBuildInputs<br> <li> Update devShells to use <code>pnpm_9</code>
instead of <code>nodePackages.pnpm</code>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3152/files#diff-206b9ce276ab5971a2489d75eb1b12999d4bf3843b7988cbe8d687cfde61dea0">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>overlay.nix</strong><dd><code>Upgrade Node.js version
in Nix overlay</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

nix/overlay.nix

- Upgrade Node.js from `nodejs-18_x` to `nodejs_20`


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3152/files#diff-0f31c68216d617b465827b69d5b5cd4c2c0c4489008cd14ee0e88b9887d15295">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-01-23 15:04:31 +01:00

149 lines
4.9 KiB
Nix

{
inputs = {
nixops.url = "github:nhost/nixops";
nixpkgs.follows = "nixops/nixpkgs";
flake-utils.follows = "nixops/flake-utils";
nix-filter.follows = "nixops/nix-filter";
};
outputs = { self, nixops, nixpkgs, flake-utils, nix-filter }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
nixops.overlays.default
(import ./nix/overlay.nix)
];
};
nix-src = nix-filter.lib.filter {
root = ./.;
include = [
(nix-filter.lib.matchExt "nix")
];
};
buildInputs = with pkgs; [
];
nativeBuildInputs = with pkgs; [
];
node_modules = pkgs.stdenv.mkDerivation {
version = "0.0.0-dev";
pname = "node_modules";
nativeBuildInputs = with pkgs; [
pnpm_9
cacert
nodejs
];
src = nix-filter.lib.filter {
root = ./.;
include = [
./.npmrc
./pnpm-workspace.yaml
# find . -name package.json | grep -v node_modules
./docs/package.json
./dashboard/package.json
./integrations/stripe-graphql-js/package.json
./integrations/google-translation/package.json
./integrations/react-urql/package.json
./integrations/react-apollo/package.json
./integrations/apollo/package.json
./package.json
./examples/react-gqty/package.json
./examples/cli/package.json
./examples/vue-quickstart/package.json
./examples/serverless-functions/package.json
./examples/vue-apollo/package.json
./examples/codegen-react-urql/package.json
./examples/react-apollo/package.json
./examples/multi-tenant-one-to-many/package.json
./examples/node-storage/package.json
./examples/nextjs/package.json
./examples/codegen-react-query/package.json
./examples/docker-compose/package.json
./examples/docker-compose/functions/package.json
./examples/seed-data-storage/package.json
./examples/codegen-react-apollo/package.json
./examples/quickstarts/nhost-backend/functions/package.json
./examples/quickstarts/nextjs-server-components/package.json
./examples/quickstarts/sveltekit/package.json
./packages/graphql-js/package.json
./packages/nhost-js/package.json
./packages/nhost-js/functions/package.json
./packages/vue/package.json
./packages/hasura-storage-js/package.json
./packages/hasura-storage-js/functions/package.json
./packages/sync-versions/package.json
./packages/nextjs/package.json
./packages/docgen/package.json
./packages/hasura-auth-js/package.json
./packages/hasura-auth-js/functions/package.json
./packages/react/package.json
#find . -name pnpm-lock.yaml | grep -v node_modules
./pnpm-lock.yaml
./examples/cli/pnpm-lock.yaml
./examples/vue-apollo/pnpm-lock.yaml
./examples/react-apollo/pnpm-lock.yaml
./examples/node-storage/pnpm-lock.yaml
./examples/nextjs/pnpm-lock.yaml
./examples/quickstarts/nhost-backend/functions/pnpm-lock.yaml
./examples/quickstarts/sveltekit/pnpm-lock.yaml
./packages/nhost-js/functions/pnpm-lock.yaml
./packages/hasura-storage-js/functions/pnpm-lock.yaml
./packages/hasura-auth-js/functions/pnpm-lock.yaml
];
};
buildPhase = ''
pnpm --version
pnpm install --frozen-lockfile
'';
installPhase = ''
mkdir -p $out
cp -r node_modules $out
'';
};
in
{
checks = {
nixpkgs-fmt = pkgs.runCommand "check-nixpkgs-fmt"
{
nativeBuildInputs = with pkgs;
[
nixpkgs-fmt
];
}
''
mkdir $out
nixpkgs-fmt --check ${nix-src}
'';
};
devShells = flake-utils.lib.flattenTree rec {
default = pkgs.mkShell {
buildInputs = with pkgs; [
nhost-cli
nodejs
pnpm_9
go
golangci-lint
] ++ buildInputs ++ nativeBuildInputs;
# shellHook = ''
# rm -rf node_modules
# ln -sf ${node_modules}/node_modules/ node_modules
# '';
};
};
}
);
}