Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00

70 lines
1.9 KiB
Nix

{
lib,
fetchFromGitHub,
gerbil-support,
gerbilPackages,
gerbil,
...
}:
rec {
pname = "glow-lang";
version = "unstable-2023-12-04";
git-version = "0.3.2-237-g08d849ad";
softwareName = "Glow";
gerbil-package = "mukn/glow";
version-path = "version";
gerbilInputs = with gerbilPackages; [
gerbil-utils
gerbil-crypto
gerbil-poo
gerbil-persist
gerbil-ethereum
smug-gerbil
gerbil-leveldb # gerbil-libp2p ftw
];
pre-src = {
fun = fetchFromGitHub;
owner = "Glow-Lang";
repo = "glow";
rev = "08d849adef94ae9deead34e6981e77d47806c6e3";
sha256 = "0dq0s8y3rgx0wa5wsgcdjs0zijnbgff3y4w2mkh5a04gz4lrhl50";
};
postPatch = ''
substituteInPlace "runtime/glow-path.ss" --replace \
'(def glow-install-path (source-path "dapps"))' \
'(def glow-install-path "$out")'
'';
postInstall = ''
mkdir -p $out/bin $out/gerbil/lib/mukn/glow $out/share/glow/dapps
cp main.ss $out/gerbil/lib/mukn/glow/
cp dapps/{buy_sig,coin_flip,rps_simple}.glow $out/share/glow/dapps/
cat > $out/bin/glow <<EOF
#!/bin/sh
ORIG_GERBIL_LOADPATH="\$GERBIL_LOADPATH"
ORIG_GERBIL_PATH="\$GERBIL_PATH"
ORIG_GERBIL_HOME="\$GERBIL_HOME"
unset GERBIL_HOME
GERBIL_LOADPATH="${gerbil-support.gerbilLoadPath ([ "$out" ] ++ gerbilInputs)}"
GLOW_SOURCE="\''${GLOW_SOURCE:-$out/share/glow}"
GERBIL_PATH="\$HOME/.cache/glow/gerbil"
export GERBIL_PATH GERBIL_LOADPATH GLOW_SOURCE ORIG_GERBIL_PATH ORIG_GERBIL_LOADPATH ORIG_GERBIL_HOME
exec ${gerbil}/bin/gxi $out/gerbil/lib/mukn/glow/main.ss "\$@"
EOF
chmod a+x $out/bin/glow
'';
meta = with lib; {
description = "Glow: language for safe Decentralized Applications (DApps)";
homepage = "https://glow-lang.org";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ fare ];
broken = true; # Broken for all platforms since 2023-10-13
};
}