|
|
||
|---|---|---|
| racket | ||
| racket-catalog | ||
| .gitignore | ||
| README.md | ||
| build-racket-package.nix | ||
| flake.lock | ||
| flake.nix | ||
| make-racket-env.nix | ||
| overlay.nix | ||
| racket-catalog-overrides.rktd | ||
| racket-install-hook.nix | ||
| racket-install-hook.sh | ||
| racket2nix.rkt | ||
README.md
nix support for racket
implements nix helpers for building racket packages and environments
this is a complete new implementation of this functionality. i did not use racket2nix because racket2nix is messy and hasn't been updated for a while. this is a significantly simpler implementation owning to better use of stdenv utilities and racket features
how to use
make nix packages for racket packages
pkgs.racketPackages.callPackage (
{
lib,
buildRacketPackage,
fetchFromGitHub,
}: buildRacketPackage {
pname = "ansi-color";
version = "0.2";
src = final.fetchFromGitHub {
owner = "renatoathaydes";
repo = "ansi-color";
rev = "0.2";
hash = "sha256-7WDW+4R9K+XLb9nMNGQlU+zAi2Gq7cUqzO3csN+AJvI=";
};
}
) {}
automatic conversion from pkgs.racket-lang.org
racket2nix.rkt implements fetching catalog information for a package, converting the info to a nix
expression, building the expression, and then refining the final expression with the source hash
(TOFU), and other metadata from info.rkt
racket racket2nix.nix <pkgs> ...
this will create new files in racket-catalog which will then become available via eg
nix build .#racketPackages.mypackage
build a racket environment
unfortunately, due to racket limitations, nix-shell/nix develop will not work at all for racket
packages that are created using this nix code. instead, similar to python.buildEnv /
python.withPackages, you can create a racket environment with a given set of packages in it. this
functions somewhat like a python "virtualenv" for racket. it is implemented by creating a "tethered
installation" -- see https://docs.racket-lang.org/raco/tethered-install.html.
with pkgs.racketPackages; makeRacketEnv {
packages = [
ansi-color
];
};
the resulting environment will have a bin/racket executable which has the declared packages
available
future work
- add native library support to racket2nix
- allow using either racket or racket-minimal as a base (currently only racket non-minimal is supported)
- instead of having 2 separate packages, rework racket to be a layered installation on top of racket-minimal, reducing duplication. this is similar to how guix does it
- split outputs into bin/lib/doc/man etc