chore: initial project commit
This commit is contained in:
72
flake.nix
Normal file
72
flake.nix
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
description = "Zotero Org Export Annotations - Export Zotero annotations to Org-mode files";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
# Node.js ecosystem
|
||||
nodejs_20
|
||||
nodePackages.npm
|
||||
|
||||
# TypeScript tooling
|
||||
nodePackages.typescript
|
||||
nodePackages.typescript-language-server
|
||||
|
||||
# Code quality
|
||||
nodePackages.eslint
|
||||
nodePackages.prettier
|
||||
|
||||
# Runtime dependency (for testing exports)
|
||||
pandoc
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo ""
|
||||
echo "╔══════════════════════════════════════════════════════════╗"
|
||||
echo "║ Zotero Org Export Annotations - Dev Environment ║"
|
||||
echo "╠══════════════════════════════════════════════════════════╣"
|
||||
echo "║ Commands: ║"
|
||||
echo "║ npm install - Install dependencies ║"
|
||||
echo "║ npm start - Start dev server with hot reload ║"
|
||||
echo "║ npm run build - Build production XPI ║"
|
||||
echo "║ npm run lint - Run ESLint ║"
|
||||
echo "╚══════════════════════════════════════════════════════════╝"
|
||||
echo ""
|
||||
export PATH="$PWD/node_modules/.bin:$PATH"
|
||||
'';
|
||||
};
|
||||
|
||||
packages.default = pkgs.stdenv.mkDerivation {
|
||||
pname = "zotero-org-export-annotations";
|
||||
version = "1.0.0";
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
nodejs_20
|
||||
nodePackages.npm
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
export HOME=$(mktemp -d)
|
||||
npm ci --ignore-scripts
|
||||
npm run build
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r .scaffold/build/*.xpi $out/
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user