Flake: add package
This commit is contained in:
parent
9e481f20da
commit
be97a926ce
2 changed files with 33 additions and 0 deletions
|
|
@ -12,6 +12,10 @@
|
|||
nodejs
|
||||
];
|
||||
};
|
||||
packages = rec {
|
||||
default = shows-api;
|
||||
shows-api = pkgs.callPackage ./package.nix {};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
29
package.nix
Normal file
29
package.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
lib,
|
||||
buildNpmPackage,
|
||||
nodejs,
|
||||
}:
|
||||
buildNpmPackage {
|
||||
name = "shows-api";
|
||||
version = "1.0";
|
||||
|
||||
src = builtins.fetchGit {
|
||||
url = "https://git.everest.tailscale/Toast/shows-api";
|
||||
rev = "82e1a6258fc7704395233c23c79050204dbd1992";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-iNib7GPvbpTexhRsq24TXoW0jlIox1IcA3wmE0BQcJM=";
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
npm config delete cache
|
||||
npm prune
|
||||
|
||||
mkdir -p $out
|
||||
mv package.json package-lock.json node_modules dist $out
|
||||
|
||||
makeWrapper ${lib.getExe nodejs} $out/bin/shows-api \
|
||||
--add-flags $out/dist/main --chdir $out
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue