Nix: move patch-package to devDependencies, drop usage of npx, drop patchPhase
This commit is contained in:
parent
a2af0e934e
commit
a1f4cf8eca
17
flake.nix
17
flake.nix
@ -43,22 +43,16 @@
|
||||
license = licenses.agpl3Plus;
|
||||
platforms = platforms.all;
|
||||
mainProgram = "start-bundle";
|
||||
maintainers = with maintainers; [ RorySys ]; # lol.
|
||||
};
|
||||
|
||||
src = ./.;
|
||||
nativeBuildInputs = with pkgs; [
|
||||
python3
|
||||
nodePackages.patch-package
|
||||
jq
|
||||
];
|
||||
npmDepsHash = hashesFile.npmDepsHash;
|
||||
npmBuildScript = "build:src";
|
||||
makeCacheWritable = true;
|
||||
postPatch = ''
|
||||
echo "Patching postinstall to use OS-provided patch-package"
|
||||
jq -r '.scripts["postinstall"] = "patch-package"' package.json > package.tmp.json
|
||||
mv package.tmp.json package.json
|
||||
'';
|
||||
nativeBuildInputs = with pkgs; [
|
||||
python3
|
||||
];
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
# set -x
|
||||
@ -118,7 +112,7 @@
|
||||
|
||||
containers.docker = pkgs.dockerTools.buildLayeredImage {
|
||||
name = "spacebar-server-ts";
|
||||
tag = "latest";
|
||||
tag = self.packages.${system}.default.version;
|
||||
contents = [ self.packages.${system}.default ];
|
||||
config = {
|
||||
Cmd = [ "${self.outputs.packages.${system}.default}/bin/start-bundle" ];
|
||||
@ -145,6 +139,7 @@
|
||||
pkgs.lib.recursiveUpdate (pkgs.lib.attrsets.unionOfDisjoint { } self.packages) {
|
||||
x86_64-linux = {
|
||||
spacebar-server-tests = self.packages.x86_64-linux.default.passthru.tests;
|
||||
docker-image = self.containers.x86_64-linux.docker;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"npmDepsHash": "sha256-45XGoErD/Lm0QunatMHZnUtrlpcmYmlwUyUGhwjrBHU="
|
||||
"npmDepsHash": "sha256-v3RAXTGnVkLK2KpQLHfT9BBh27L9f/N9F1MMAUghkV4="
|
||||
}
|
||||
|
||||
BIN
package-lock.json
generated
BIN
package-lock.json
generated
Binary file not shown.
@ -4,7 +4,7 @@
|
||||
"description": "A Spacebar server written in Node.js",
|
||||
"scripts": {
|
||||
"prepare": "husky install",
|
||||
"postinstall": "npx patch-package",
|
||||
"postinstall": "patch-package",
|
||||
"start": "node --enable-source-maps dist/bundle/start.js",
|
||||
"start:api": "node --enable-source-maps dist/api/start.js",
|
||||
"start:cdn": "node --enable-source-maps dist/cdn/start.js",
|
||||
@ -65,6 +65,7 @@
|
||||
"eslint": "^9.39.1",
|
||||
"globals": "^16.5.0",
|
||||
"husky": "^9.1.7",
|
||||
"patch-package": "^8.0.1",
|
||||
"prettier": "^3.6.2",
|
||||
"pretty-quick": "^4.2.2",
|
||||
"ts-node": "^10.9.2",
|
||||
|
||||
Reference in New Issue
Block a user