Skip to content

Commit

Permalink
build: added nix flake to pin node + env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
AlansCodeLog committed May 19, 2024
1 parent 873ba57 commit f8ab715
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake .
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ docs
coverage

dist
.direnv
!flake.lock

60 changes: 60 additions & 0 deletions flake.lock

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

42 changes: 42 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -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`"
'';
};
});
}

0 comments on commit f8ab715

Please sign in to comment.