https://github.com/ceedubs/unison-nix-snake
Example of building a Unison program via Nix
https://github.com/ceedubs/unison-nix-snake
Last synced: about 1 year ago
JSON representation
Example of building a Unison program via Nix
- Host: GitHub
- URL: https://github.com/ceedubs/unison-nix-snake
- Owner: ceedubs
- Created: 2024-01-18T04:12:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T02:01:59.000Z (over 2 years ago)
- Last Synced: 2025-04-09T17:14:56.555Z (about 1 year ago)
- Language: Nix
- Size: 12.7 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unison Nix Snake
This repository demonstrates using [unison-nix](https://github.com/ceedubs/unison-nix/) to easily package an app written in Unison.
[](https://asciinema.org/a/6QgQOL7Wtw8hUAkNjt7RuEy2k)
## Running the app
```sh
nix run github:ceedubs/unison-nix-snake
```
If you are on an ARM-based Mac (M1, etc) you may need to run the following (since Unison doesn't yet release ARM builds):
```sh
nix run --system x86_64-darwin github:ceedubs/unison-nix-snake
```
The first time that you run this, it will take a while to pull the project from Share. But Nix will cache the result and subsequent runs should be nearly instantaneous.
## Packaging your own Unison app with Nix
Copy [flake.nix](flake.nix) and change the fields passed to `buildUnisonShareProject` as needed.
To start, set `compiledHash = pkgs.lib.fakeHash`. When you do a `nix run`, Nix will complain about the compiled hash not matching and will tell you the actual hash that you should use instead.