Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
15a46e05c0 |
3 changed files with 66 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -25,3 +25,4 @@ vite.config.ts.timestamp-*
|
|||
|
||||
# Nix
|
||||
/.direnv
|
||||
result*
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
packages.default = pkgs.callPackage ./nix/derivation.nix {};
|
||||
|
||||
devShells.default = with pkgs;
|
||||
mkShellNoCC {
|
||||
buildInputs = [bun wrangler];
|
||||
|
|
63
nix/derivation.nix
Normal file
63
nix/derivation.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
bun,
|
||||
nodejs,
|
||||
}: stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "tcl-guessr";
|
||||
version = "0.0.1";
|
||||
|
||||
src = ../.;
|
||||
|
||||
nativeBuildInputs = [bun nodejs];
|
||||
|
||||
bunDeps = stdenvNoCC.mkDerivation {
|
||||
pname = "${finalAttrs.pname}-bun-deps";
|
||||
inherit (finalAttrs) version;
|
||||
|
||||
nativeBuildInputs = [bun];
|
||||
|
||||
src = lib.fileset.toSource {
|
||||
root = finalAttrs.src;
|
||||
fileset = lib.fileset.unions [
|
||||
../package.json
|
||||
../bun.lockb
|
||||
../patches
|
||||
];
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
bun install \
|
||||
--frozen-lockfile \
|
||||
--ignore-scripts \
|
||||
--backend copyfile \
|
||||
--force
|
||||
|
||||
cp -r node_modules/ $out
|
||||
'';
|
||||
|
||||
outputHashMode = "recursive";
|
||||
outputHash = "sha256-cYbyVt2Hc96WRAIsNkgnG0vUB47m1ixbhYhHmXetaII=";
|
||||
};
|
||||
|
||||
configurePhase = ''
|
||||
cp -r $bunDeps node_modules
|
||||
chmod -R +w node_modules
|
||||
patchShebangs node_modules/{*,.*}
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
bun run build
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp -r .svelte-kit/cloudflare $out
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit (finalAttrs) bunDeps;
|
||||
};
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue