snake/flake.nix

54 lines
1.4 KiB
Nix
Raw Normal View History

2022-03-12 18:39:23 -05:00
{
2023-01-17 21:51:52 -05:00
description = "A snake game in Haskell using Dunai";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
2022-03-12 18:39:23 -05:00
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [];
2022-03-14 08:30:15 -04:00
pkgs = nixpkgs.legacyPackages.${system};
2022-03-12 18:39:23 -05:00
# package/executable name
packageName = "snake";
execName = packageName;
# version of ghc used
2023-01-17 21:51:52 -05:00
hp = pkgs.haskell.packages.ghc92;
2022-03-12 18:39:23 -05:00
project = returnShellEnv:
hp.developPackage {
inherit returnShellEnv;
name = packageName;
root = ./.;
withHoogle = false;
modifier = drv:
pkgs.haskell.lib.addBuildTools drv (with hp; [
# Specify your build/dev dependencies here.
2022-03-14 13:17:32 -04:00
hlint
haskell-language-server
ormolu
pkgs.mesa
pkgs.mesa_glu
pkgs.freeglut
2022-03-12 18:39:23 -05:00
]);
};
in
{
# Used by `nix build` & `nix run` (prod exe)
defaultPackage = project false;
defaultApp = {
type = "app";
program = "${self.defaultPackage.${system}}/bin/${execName}";
};
# Used by `nix develop` (dev shell)
devShell = project true;
});
}