alpha
Login
or
Join now
tombl.dev
/
distro
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
add serve app
author
Thomas Stokes
date
1 year ago
(Jan 18, 2025, 6:44 PM +0800)
commit
8f13976c
8f13976ca545b30616638a2e3e5ab450a4d02edf
parent
c06441fd
c06441fdf87deb29d529caa4ae4deca6ae9d4dfc
+18
-1
1 changed file
Expand all
Collapse all
Unified
Split
flake
apps.nix
+18
-1
flake/apps.nix
Reviewed
···
1
1
+
{lib, ...}:
2
2
+
1
3
{
2
4
perSystem =
3
5
{ pkgs, self', ... }:
···
16
18
'';
17
19
in
18
20
pkgs.writeShellScriptBin "wasm-linux-runner" ''
19
19
-
deno run --allow-read ${runner-lib}/run.js --initcpio=${initramfs} "$@"
21
21
+
${lib.getExe pkgs.deno} run --allow-read ${runner-lib}/run.js --initcpio=${initramfs} "$@"
22
22
+
'';
23
23
+
24
24
+
apps.serve.program =
25
25
+
let site = pkgs.runCommand "wasm-linux-site" { src = "${linux.src}/tools/wasm"; } ''
26
26
+
mkdir $out
27
27
+
cp -r $src/public/* $out/
28
28
+
ln -s ${initramfs} $out/initramfs.cpio
29
29
+
ln -sf ${linux} $out/dist
30
30
+
'';
31
31
+
in
32
32
+
pkgs.writeShellScriptBin "wasm-linux-serve" ''
33
33
+
${lib.getExe pkgs.miniserve} ${site} --index index.html \
34
34
+
--header Cross-Origin-Opener-Policy:same-origin \
35
35
+
--header Cross-Origin-Embedder-Policy:require-corp \
36
36
+
--header Cross-Origin-Resource-Policy:cross-origin
20
37
'';
21
38
};
22
39
}