Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Forked from kindaro/Glut.hs
Created October 6, 2019 20:30
Show Gist options
  • Save cleverca22/9e77559fc256d5fbe319cbfd141bd752 to your computer and use it in GitHub Desktop.
Save cleverca22/9e77559fc256d5fbe319cbfd141bd752 to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
lib.fix (self: {
ghc = haskellPackages.ghcWithPackages (ps: with ps; [ GLUT ]);
thing = runCommandCC "thing" { buildInputs = [ self.ghc ]; } ''
mkdir -pv $out/bin/
ghc ${./Glut.hs} -o $out/bin/thing
'';
})
import System.Exit (exitWith, ExitCode(ExitSuccess))
import Graphics.UI.GLUT
main = do
(progName, _args) <- getArgsAndInitialize
initialDisplayMode $= [ SingleBuffered, RGBMode ]
initialWindowSize $= Size 500 500
_ <- createWindow progName
exitWith ExitSuccess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment