Compare commits

...

2 commits

Author SHA1 Message Date
be97a926ce Flake: add package 2025-01-26 19:09:49 +01:00
9e481f20da Add nix flake 2025-01-26 19:09:18 +01:00
4 changed files with 108 additions and 0 deletions

1
.envrc
View file

@ -1 +1,2 @@
use flake
layout node layout node

57
flake.lock generated Normal file
View file

@ -0,0 +1,57 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 0,
"narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=",
"path": "/nix/store/l9nb64iii15y0nr37qrs1cfm6rlpg6gh-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

21
flake.nix Normal file
View file

@ -0,0 +1,21 @@
{
inputs = {
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
];
};
packages = rec {
default = shows-api;
shows-api = pkgs.callPackage ./package.nix {};
};
}
);
}

29
package.nix Normal file
View 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
'';
}