data endpoint for entity 90008 (aka. a website)

build(nix): use bun actually tm [skip ci]

ptr.pet 40be2f7b 7621b843

verified
Changed files
+87 -109
+75 -91
flake.lock
···
{
-
"nodes": {
-
"naked-shell": {
-
"locked": {
-
"lastModified": 1681286841,
-
"narHash": "sha256-3XlJrwlR0nBiREnuogoa5i1b4+w/XPe0z8bbrJASw0g=",
-
"owner": "90-008",
-
"repo": "mk-naked-shell",
-
"rev": "7612f828dd6f22b7fb332cc69440e839d7ffe6bd",
-
"type": "github"
-
},
-
"original": {
-
"owner": "90-008",
-
"repo": "mk-naked-shell",
-
"type": "github"
-
}
-
},
-
"nixpkgs": {
-
"locked": {
-
"lastModified": 1744932701,
-
"narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=",
-
"owner": "nixos",
-
"repo": "nixpkgs",
-
"rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef",
-
"type": "github"
-
},
-
"original": {
-
"owner": "nixos",
-
"ref": "nixos-unstable",
-
"repo": "nixpkgs",
-
"type": "github"
-
}
-
},
-
"nixpkgs-lib": {
-
"locked": {
-
"lastModified": 1743296961,
-
"narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
-
"owner": "nix-community",
-
"repo": "nixpkgs.lib",
-
"rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
-
"type": "github"
-
},
-
"original": {
-
"owner": "nix-community",
-
"repo": "nixpkgs.lib",
-
"type": "github"
-
}
-
},
-
"parts": {
-
"inputs": {
-
"nixpkgs-lib": "nixpkgs-lib"
-
},
-
"locked": {
-
"lastModified": 1743550720,
-
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
-
"owner": "hercules-ci",
-
"repo": "flake-parts",
-
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
-
"type": "github"
-
},
-
"original": {
-
"owner": "hercules-ci",
-
"repo": "flake-parts",
-
"type": "github"
-
}
-
},
-
"root": {
-
"inputs": {
-
"naked-shell": "naked-shell",
-
"nixpkgs": "nixpkgs",
-
"parts": "parts",
-
"systems": "systems"
-
}
-
},
-
"systems": {
-
"locked": {
-
"lastModified": 1680978846,
-
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
-
"owner": "nix-systems",
-
"repo": "x86_64-linux",
-
"rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8",
-
"type": "github"
-
},
-
"original": {
-
"owner": "nix-systems",
-
"repo": "x86_64-linux",
-
"type": "github"
-
}
-
}
-
},
-
"root": "root",
-
"version": 7
+
"nodes": {
+
"naked-shell": {
+
"locked": {
+
"lastModified": 1681286841,
+
"narHash": "sha256-3XlJrwlR0nBiREnuogoa5i1b4+w/XPe0z8bbrJASw0g=",
+
"owner": "90-008",
+
"repo": "mk-naked-shell",
+
"rev": "7612f828dd6f22b7fb332cc69440e839d7ffe6bd",
+
"type": "github"
+
},
+
"original": {
+
"owner": "90-008",
+
"repo": "mk-naked-shell",
+
"type": "github"
+
}
+
},
+
"nixpkgs": {
+
"locked": {
+
"lastModified": 1752950548,
+
"narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=",
+
"owner": "nixos",
+
"repo": "nixpkgs",
+
"rev": "c87b95e25065c028d31a94f06a62927d18763fdf",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nixos",
+
"ref": "nixos-unstable",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"nixpkgs-lib": {
+
"locked": {
+
"lastModified": 1751159883,
+
"narHash": "sha256-urW/Ylk9FIfvXfliA1ywh75yszAbiTEVgpPeinFyVZo=",
+
"owner": "nix-community",
+
"repo": "nixpkgs.lib",
+
"rev": "14a40a1d7fb9afa4739275ac642ed7301a9ba1ab",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "nixpkgs.lib",
+
"type": "github"
+
}
+
},
+
"parts": {
+
"inputs": {
+
"nixpkgs-lib": "nixpkgs-lib"
+
},
+
"locked": {
+
"lastModified": 1753121425,
+
"narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=",
+
"owner": "hercules-ci",
+
"repo": "flake-parts",
+
"rev": "644e0fc48951a860279da645ba77fe4a6e814c5e",
+
"type": "github"
+
},
+
"original": {
+
"owner": "hercules-ci",
+
"repo": "flake-parts",
+
"type": "github"
+
}
+
},
+
"root": {
+
"inputs": {
+
"naked-shell": "naked-shell",
+
"nixpkgs": "nixpkgs",
+
"parts": "parts"
+
}
+
}
+
},
+
"root": "root",
+
"version": 7
}
+12 -18
flake.nix
···
{
inputs.parts.url = "github:hercules-ci/flake-parts";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
-
inputs.systems.url = "github:nix-systems/x86_64-linux";
inputs.naked-shell.url = "github:90-008/mk-naked-shell";
outputs = inp:
inp.parts.lib.mkFlake {inputs = inp;} {
-
systems = import inp.systems;
+
systems = ["x86_64-linux"];
imports = [
inp.naked-shell.flakeModule
];
···
...
}: let
pkgs = inp.nixpkgs.legacyPackages.${system};
-
packageJson = builtins.fromJSON (builtins.readFile ./package.json);
in {
devShells.default = config.mk-naked-shell.lib.mkNakedShell {
name = "gazesys-devshell";
···
'';
};
packages.gazesys-modules = pkgs.stdenv.mkDerivation {
-
pname = "${packageJson.name}-modules";
-
version = packageJson.version;
+
name = "gazesys-modules";
src = ./.;
···
outputHashAlgo = "sha256";
outputHashMode = "recursive";
-
nativeBuildInputs = with pkgs; [bun];
+
nativeBuildInputs = [pkgs.bun];
dontConfigure = true;
-
# impureEnvVars = pkgs.lib.fetchers.proxyImpureEnvVars
-
# ++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ];
+
dontCheck = true;
+
dontFixup = true;
+
dontPatchShebangs = true;
buildPhase = "bun install --no-cache --no-progress --frozen-lockfile";
installPhase = ''
mkdir -p $out
-
# Do not copy .cache or .bin
cp -R ./node_modules/* $out
cp -R ./node_modules/.bin $out
ls -la $out
'';
-
dontFixup = true;
-
dontPatchShebangs = true;
};
packages.gazesys = pkgs.stdenv.mkDerivation {
-
pname = packageJson.name;
-
version = packageJson.version;
+
name = "gazesys-website";
src = ./.;
-
nativeBuildInputs = [pkgs.makeBinaryWrapper pkgs.rsync];
+
nativeBuildInputs = [pkgs.makeBinaryWrapper];
buildInputs = [pkgs.bun];
PUBLIC_BASE_URL="http://localhost:5173";
-
GUESTBOOK_BASE_URL="http://localhost:8080";
+
+
dontCheck = true;
-
# dontConfigure = true;
configurePhase = ''
runHook preConfigure
cp -R --no-preserve=ownership ${config.packages.gazesys-modules} node_modules
find node_modules -type d -exec chmod 755 {} \;
substituteInPlace node_modules/.bin/vite \
-
--replace-fail "/usr/bin/env node" "${pkgs.nodejs-slim_latest}/bin/node"
+
--replace-fail "/usr/bin/env node" "${pkgs.bun}/bin/bun --bun"
runHook postConfigure
'';
buildPhase = ''
···
mkdir -p $out/bin
cp -R ./build/* $out
-
makeBinaryWrapper ${pkgs.bun}/bin/bun $out/bin/${packageJson.name} \
+
makeBinaryWrapper ${pkgs.bun}/bin/bun $out/bin/website \
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.bun ]} \
--add-flags "run --bun --no-install --cwd $out start"