Skip to content

Commit

Permalink
Yeah sort of
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Bärenz authored and turion committed Dec 2, 2024
1 parent c79a642 commit 9685223
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
15 changes: 1 addition & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,7 @@
# Helper to build a flake output for all systems that are defined in nixpkgs
forAllPlatforms = f:
mapAttrs (system: pkgs: f system (pkgs.extend overlay)) inputs.nixpkgs.legacyPackages;
rhine-tree-js = pkgs: let
dommy = (pkgs.pkgsCross.ghcjs.extend overlay).haskell.packages.ghc910.rhine-tree;
in pkgs.writeTextFile {
name = "index.html";
text = ''
<!DOCTYPE html>
<html>
<head>
<script src="${dommy}/bin/dommy">
</script>
</head>
</html>
'';
};
rhine-tree-js = pkgs: import ./rhine-tree/nix { inherit pkgs overlay lib; };
in
{
# Reexport the overlay so other downstream flakes can use it to develop rhine projects with low effort.
Expand Down
19 changes: 19 additions & 0 deletions rhine-tree/nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{pkgs, overlay, lib}:
let
dommyPkg = (pkgs.pkgsCross.ghcjs.extend overlay).haskell.packages.ghc910.rhine-tree;
dommy = lib.traceVal (dommyPkg + "/bin/dommy");
dommyContents = lib.traceVal (builtins.readFile dommy);
botchedHTML = pkgs.writeTextFile {
name = "index.html";
text = ''
<!DOCTYPE html>
<html>
<head>
<script>
${dommyContents}
</script>
</head>
</html>
'';
};
in dommyPkg
2 changes: 1 addition & 1 deletion rhine-tree/static/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="${dommy}">
<script src="../../result/bin/dommy">
</script>
</head>
</html>

0 comments on commit 9685223

Please sign in to comment.