1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-16 15:52:25 +02:00

Add meta section to nix package, fix nix update script writing to wrong variable in hashes.json

This commit is contained in:
Emma [it/its]@Rory& 2024-06-28 12:13:17 +02:00
parent 628b094865
commit 03e150fc26
4 changed files with 20 additions and 10 deletions

View File

@ -5,11 +5,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1708118438,
"narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=",
"lastModified": 1719254875,
"narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80",
"rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
"type": "github"
},
"original": {

View File

@ -13,11 +13,21 @@
inherit system;
};
hashesFile = builtins.fromJSON (builtins.readFile ./hashes.json);
lib = pkgs.lib;
in rec {
packages.default = pkgs.buildNpmPackage {
pname = "spacebar-server-ts";
src = ./.;
name = "spacebar-server-ts";
meta = with lib; {
description = "Spacebar server, a FOSS reimplementation of the Discord backend.";
homepage = "https://github.com/spacebarchat/server";
license = licenses.agpl3Plus;
platforms = platforms.all;
mainProgram = "start-bundle";
};
src = ./.;
nativeBuildInputs = with pkgs; [ python3 ];
npmDepsHash = hashesFile.npmDepsHash;
makeCacheWritable = true;

View File

@ -1,3 +1,3 @@
{
"npmDepsHash": "sha256-fZNDN2/fNy6Nu7tbr0RhQ8j4BP7X1Yhrh/fSTH7hbJc="
"npmDepsHash": "sha256-RxGkjCU9qqqDMjhJ5aEq1w7c7lS4nAp0/3F0zASJQms="
}

View File

@ -3,8 +3,8 @@
nix flake update
DEPS_HASH=`prefetch-npm-deps package-lock.json`
TMPFILE=$(mktemp)
jq '.npm_deps_hash = "'$DEPS_HASH'"' hashes.json > $TMPFILE
jq '.npmDepsHash = "'$DEPS_HASH'"' hashes.json > $TMPFILE
mv -- "$TMPFILE" hashes.json
nom build .# || exit $?
git add hashes.json flake.lock flake.nix
git add hashes.json flake.lock flake.nix