Files
zotero-notes-export-org/flake.nix
2026-02-17 21:25:46 +01:00

73 lines
2.6 KiB
Nix

{
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/
'';
};
}
);
}