From 03e150fc2605aa46b54ed69cfc9a3feb02475f5b Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Fri, 28 Jun 2024 12:13:17 +0200 Subject: [PATCH] Add meta section to nix package, fix nix update script writing to wrong variable in hashes.json --- flake.lock | 12 ++++++------ flake.nix | 12 +++++++++++- hashes.json | 2 +- nix-update.sh | 4 ++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index ae5e8b23..77bf2b86 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/flake.nix b/flake.nix index 00a18f64..cc624004 100644 --- a/flake.nix +++ b/flake.nix @@ -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; diff --git a/hashes.json b/hashes.json index dd55b81d..bc319094 100644 --- a/hashes.json +++ b/hashes.json @@ -1,3 +1,3 @@ { - "npmDepsHash": "sha256-fZNDN2/fNy6Nu7tbr0RhQ8j4BP7X1Yhrh/fSTH7hbJc=" + "npmDepsHash": "sha256-RxGkjCU9qqqDMjhJ5aEq1w7c7lS4nAp0/3F0zASJQms=" } diff --git a/nix-update.sh b/nix-update.sh index 4413e6e0..a676e294 100755 --- a/nix-update.sh +++ b/nix-update.sh @@ -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 \ No newline at end of file +git add hashes.json flake.lock flake.nix