Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ ballRadius = 20

-- | Draw the ball in gloss
ballPic :: Ball -> Picture
ballPic Ball { ballPos = (x, y) } = translate x y $ color white $ thickCircle (ballRadius / 2) ballRadius
ballPic Ball { ballPos = (x, y) } = translate x y $ color red $ thickCircle (ballRadius / 2) ballRadius

-- | The type of internal state of the 'ballSim'
data Ball = Ball
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ There are also useful utilities for debugging and quickchecking.
git clone https://github.com/turion/essence-of-live-coding-tutorial
cd essence-of-live-coding-tutorial
```
2. Either install [`nix`](https://nixos.org/download.html) and launch a `nix-shell`,
2. Either install [`nix`](https://nixos.org/download.html) and launch `nix develop`,
or install the [external dependencies listed below](#external-dependencies)
3. `cabal update`
(A new version of the library was released recently)
4. Sanity check: Launch `cabal repl` and close it again.
This should succeed without errors.
5. Open `Main.hs` in an editor.
6. Run `ghcid` from the console.
6. Run `ghcid` from the console (the same where you did `nix develop` before).

You should now be seeing a window containing a solid circle (a ball).
If you click anywhere in the window, the ball will start to move in that direction.
Expand All @@ -45,23 +45,23 @@ it will automatically reload.
(See [below](#non-linux-systems).)
* A standard Haskell development environment, including `cabal` and `ghci`.
(`stack` is not needed.)
Supported GHC versions are 8.6 and 8.8.
* [`ghcid`](https://github.com/ndmitchell/ghcid).
* OpenGL development libraries and PulseAudio development libraries.
(For other sound setups, see [below](#sound-support).)
In Debian-based systems, this amounts to installing these packages:
`libgl1-mesa-dev` `libglu1-mesa-dev` `freeglut3-dev` `libpulse-dev` `libblas-dev` `liblapack-dev`

If you use `nix` on Linux, all of these will be easily available with `nix develop`.

### Nix cache & nixpkgs versions

* The `nix-shell` is pinned to an up-to-date version of `nixos-unstable`.
* The `nix develop` is pinned to an up-to-date version of `nixos-unstable`.
This may cause a long build.
You can alleviate that by using `cachix`,
or using a different `nixpkgs` version.
* If you use [`cachix`](https://cachix.org/),
you can speed up your build by using `cachix use manuelbaerenz`.
I'm uploading build artifacts there.
* To use a different `nixpkgs`, edit the first lines of `mypkgs.nix`, and re-run `nix-shell`.

### Non-Linux systems

Expand Down
3 changes: 0 additions & 3 deletions default.nix

This file was deleted.

61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
description = "Tutorial application for essence-of-live-coding";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
haskell-flake-utils.url = "github:ivanovs-4/haskell-flake-utils";
};

outputs = { self, nixpkgs, haskell-flake-utils, ... }@inputs:
haskell-flake-utils.lib.simpleCabal2flake {
inherit self nixpkgs;
systems = [ "x86_64-linux" ];

name = "essence-of-live-coding-tutorial";

hpPreOverrides = { pkgs }: self: super:
with pkgs.haskell.lib;
with haskell-flake-utils.lib;
tunePackages pkgs super {
essence-of-live-coding = [ (jailbreakUnbreak pkgs) ];
};
};
}
54 changes: 0 additions & 54 deletions mypkgs.nix

This file was deleted.

13 changes: 0 additions & 13 deletions shell.nix

This file was deleted.