Home

js-spectre @7230b4554e2d62f217e12504610499b7f47e3179 - refs - log -
-
https://git.jolheiser.com/js-spectre.git
JS implementation for spectre/masterpassword
js-spectre / nix / pkg.nix
- raw -
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  pkgs ? import <nixpkgs> { },
}:
let
  inherit (pkgs) lib;
  root = ../.;
in
pkgs.buildNpmPackage (_: {
  pname = "spectre";
  version = (lib.importJSON (root + "/package.json")).version;
  src = root;
  npmDepsHash = "sha256-1kXyZIRO23kaHz29Zezc6QmwS5c47WZQrdkGVCgyYYY=";

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp lib/spectre.min.js $out/spectre.min.js
    substitute example/index.html $out/index.html --replace-fail '../lib/spectre.min.js' 'spectre.min.js'

    runHook postInstall
  '';
})