From 5f31ceb087b02de214cd7c1d22f530af0308894c Mon Sep 17 00:00:00 2001 From: Midka Date: Thu, 20 Oct 2022 14:33:13 +0300 Subject: [PATCH] add: nixos development stuff --- .envrc | 1 + .gitignore | 3 +++ flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.nix | 27 +++++++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000000..8392d159f2 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1b7a904ba0..d58af5885d 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,6 @@ yarn-error.log* # turbo .turbo + +# nixos stuff +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000..0c0978fa78 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1666258539, + "narHash": "sha256-27S33jxi19ugYjwi0GntcaEjaTkLBYMl1WiDDxlUdGo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d0a606b5d8d98047e295b50bc0df1d15831b2448", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000..2ad408ab9e --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + description = "A prisma test project"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/master"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShell = pkgs.mkShell { + nativeBuildInputs = [ pkgs.bashInteractive ]; + buildInputs = with pkgs; [ + nodePackages.prisma + nodePackages.pnpm + ]; + shellHook = with pkgs; '' + export PRISMA_MIGRATION_ENGINE_BINARY="${prisma-engines}/bin/migration-engine" + export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine" + export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node" + export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine" + export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt" + ''; + }; + }); +}