Racket Development Nixos

499 views
Skip to first unread message

Tobias Huttner

unread,
Oct 4, 2020, 7:11:44 AM10/4/20
to Racket Developers
Hello all,
I'd like to contribute to racket and it's distribution. I'm using the
NixOS[1] linux distribution and experiencing problems. Is anybody else
on NixOS and have some tips to get started with racket development on
NixOS? Thanks in advice

Kind regards
Tobias Huttner

[1] https://nixos.org

Paulo Matos

unread,
Oct 5, 2020, 3:11:58 PM10/5/20
to Racket Developers
Hi,

Welcome to Racket and we're happy to have more contributors.

I am not on NixOS, however I think NixOS is growing in popularity and would be definitely great to ensure it works there.
Feel free to open an issue with what you are seeing in https://github.com/racket/racket/issues/new/choose

If I feel like I can help, I will try to bootup a VM with NixOS and try to help there.

Paulo Matos

Philip McGrath

unread,
Oct 5, 2020, 4:03:39 PM10/5/20
to Racket Developers
I can't be too much help, but I do remember some previous threads on the racket-users list about using Racket on NixOS and GuixSD. I'd suggest asking there as well: it tends to be more active than the dev list, and even discussions that get pretty deep in the internals of the implementation are welcome there. There are also some issues at https://github.com/racket/racket (some open, others closed).

-Philip

William G Hatch

unread,
Oct 5, 2020, 5:27:10 PM10/5/20
to Tobias Huttner, Racket Developers
I use NixOS, and I have various janky scripts for Racket development
on NixOS. They aren't great or beautiful -- I basically wrote the
minimal amount to get things working and I hack on them every time
something goes wrong. At this point they seem to work for me. I use
these scripts to get environments for building Racket in my home
directory, using the official installers in my home directory, and
doing package development using a Racket built or installed in my home
directory. They are not for building an actual NixOS package. It
might be nice to do Racket package development using a Racket in the
nix-store, but it's frustrating that Racket's documentation setup
stage wants to mutate documents that end up in the nix-store, thus
giving errors each time you try to set up a package you are
developing. Either the Nix package build or Racket's build process
needs to be changed to play nicely there, and I haven't bothered
looking into it. Anyway, my workflow is to use the NixOS Racket
package as the stable Racket installation I use for non-development
purposes (eg. to run my Rash scripts or other programs that have made
it into my day-to-day workflow outside of hacking on Racket) and these
script environments for hacking on packages and Racket itself.

The scripts are in my dotfiles repo on github. I'll highlight some
pertinent parts that may help you.

The core stuff is in the `nixos` subdirectory of the repo:

https://github.com/willghatch/dotfileswgh/tree/master/nixos

It has a nix-shell environment with the packages needed to build
Racket, and a script to run as the nix-shell command that sets some
needed environment variables for things like openssl to work.

I tie that all together with a racket-dev-environment.sh script:

https://github.com/willghatch/dotfileswgh/blob/master/commands/racket-dev-environment.sh

And then I also have some convenience wrappers for it: `rpdev` for
package development, `rcdev` for working on Racket itself, and `rdev`
for an environment for testing multiple versions of Racket together.
Each just sets some useful environment variables to set my path and
helpful display in my shell prompt:

https://github.com/willghatch/dotfileswgh/blob/master/commands/rpdev


I'll also note that there is a `racket2nix` project for building
Racket packages as NixOS packages. It's been a while since I've
looked at it, but I'm hopeful that it will eventually make it trivial
for Racket packages to become NixOS packages.

https://github.com/fractalide/racket2nix

Tobias Huttner

unread,
Oct 6, 2020, 5:36:57 AM10/6/20
to racke...@googlegroups.com
Thanks for the answers.

On 10/5/20 11:27 PM, William G Hatch wrote:
> The scripts are in my dotfiles repo on github.  I'll highlight some
> pertinent parts that may help you. I'll also note that there is a

I'll take a look, thanks :)

> `racket2nix` project for building
> Racket packages as NixOS packages.  It's been a while since I've
> looked at it, but I'm hopeful that it will eventually make it trivial
> for Racket packages to become NixOS packages.

I've tried to build drracket with racket2nix, but there were errors. I
think due to cyclic dependencies. It would be nice if there were NixOS
packages equivalents of racket packages.


Reply all
Reply to author
Forward
0 new messages