2023-12-01 22:52:24 +00:00
|
|
|
{
|
|
|
|
description = ''
|
|
|
|
An opinionated nodejs flake.
|
|
|
|
|
|
|
|
To generate a copy of this template elsewhere, install
|
|
|
|
[bootstrap](https://github.com/jrpotter/bootstrap) and run:
|
|
|
|
```bash
|
|
|
|
$ bootstrap nodejs
|
|
|
|
```
|
|
|
|
'';
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils, ... }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
packages = {
|
|
|
|
lib = pkgs.buildNpmPackage {
|
2023-12-13 21:24:54 +00:00
|
|
|
pname = "<NAME>";
|
2023-12-01 22:52:24 +00:00
|
|
|
version = "0.1.0";
|
|
|
|
src = ./.;
|
|
|
|
npmDepsHash = "<SHA_256>";
|
2023-12-13 22:49:55 +00:00
|
|
|
# npmDepsHash = pkgs.lib.fakeHash;
|
2023-12-01 22:52:24 +00:00
|
|
|
|
2023-12-04 02:38:47 +00:00
|
|
|
# Needed to properly invoke npm run build.
|
|
|
|
nativeBuildInputs = [ pkgs.typescript ];
|
|
|
|
|
2023-12-01 22:52:24 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
cp dist/index.js $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
default = self.packages.${system}.lib;
|
|
|
|
};
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
|
|
|
nodePackages.prettier
|
|
|
|
nodePackages.typescript-language-server
|
|
|
|
nodejs
|
|
|
|
prefetch-npm-deps
|
|
|
|
typescript
|
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|