diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/.gitignore b/.gitignore index 0373000..d0388a9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ docs coverage dist +.direnv +!flake.lock + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f3289d5 --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716147721, + "narHash": "sha256-BZTNA1d/T32DPb3uzLO/i3nsiq6r3tgRKj0pYM2ByAM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f5f7da678b272065982db9e3d1b0f7b2339bf7fd", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6b4e9c9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + description = ""; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { self + , nixpkgs + , flake-utils + } @inputs: + flake-utils.lib.eachDefaultSystem + (system: + let + inherit (nixpkgs) lib; + distDir = ".dist"; + pkgs = import nixpkgs + { + inherit system; + config = { }; + overlays = [ ]; + }; + cwd = (builtins.toString ./.); + in + { + + devShells.default = pkgs.mkShell { + packages = with pkgs;[ + nodejs_22 + nodejs_22.pkgs.pnpm + ]; + shellHook = '' + export NPM_TOKEN=$(cat $SECRETS_DIR/NPM_TOKEN) + export GH_TOKEN=$(cat $SECRETS_DIR/GH_TOKEN) + echo "node `${pkgs.nodejs}/bin/node --version`" + echo "pnpm `${pkgs.nodePackages.pnpm}/bin/pnpm --version`" + ''; + }; + }); +}