summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authormtgmonkey <mtgmonkey@nixos>2025-12-08 11:21:14 +0100
committermtgmonkey <mtgmonkey@nixos>2025-12-08 11:21:14 +0100
commit5585a49393a05c25b7df7a6a48d1f39db6324b69 (patch)
tree9f96a496c4c00da9fd286d2b6742d95eb8ae17e1 /flake.nix
parente767a5ee5becd575039ff39db40a7373ccca7eaf (diff)
semantics, readability, relicense, initResource argument removal
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix61
1 files changed, 60 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index 6e93c4c..6468b28 100644
--- a/flake.nix
+++ b/flake.nix
@@ -5,9 +5,68 @@
outputs = {nixpkgs, ...}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
+ debugGhcOptions = pkgs.lib.concatStringsSep " " (debugGhcFlags ++ commonGhcFlags);
+ debugGhcFlags = [
+ "-O0"
+ "-Wall"
+ "-Widentities"
+ "-Wincomplete-record-updates"
+ "-Wincomplete-uni-patterns"
+ # "-Wmissing-export-lists"
+ "-Wmissing-home-modules"
+ "-Wpartial-fields"
+ "-Wredundant-constraints"
+ "-threaded"
+ "-rtsopts"
+ "-with-rtsopts=-N"
+ "-main-is Game"
+ ];
+ haddockOptions = pkgs.lib.concatStringsSep " " haddockFlags;
+ haddockFlags = [
+ "--html"
+ "--odir docs"
+ "--optghc=-i./src"
+ "src/Game.hs"
+ ];
+ releaseGhcOptions = pkgs.lib.concatStringsSep " " (releaseGhcFlags ++ commonGhcFlags);
+ releaseGhcFlags = [
+ "-O2"
+ "-threaded"
+ "-rtsopts"
+ "-with-rtsopts=-N"
+ "-main-is Game"
+ ];
+ noHaddockOptions = "";
+ commonGhcFlags = [
+ "-i./src"
+ ];
+ ghcPackages = p: [
+ p.GLFW-b
+ p.linear
+ p.OpenGL
+ ];
in {
packages.${system} = {
- default = pkgs.callPackage ./package.nix {};
+ debug = pkgs.callPackage ./package.nix {
+ ghcOptions = debugGhcOptions;
+ haddockOptions = noHaddockOptions;
+ inherit ghcPackages;
+ };
+ release = pkgs.callPackage ./package.nix {
+ ghcOptions = releaseGhcOptions;
+ haddockOptions = noHaddockOptions;
+ inherit ghcPackages;
+ };
+ docs = pkgs.callPackage ./package.nix {
+ ghcOptions = "--version";
+ inherit haddockOptions;
+ inherit ghcPackages;
+ };
+ default = pkgs.callPackage ./package.nix {
+ ghcOptions = releaseGhcOptions;
+ inherit haddockOptions;
+ inherit ghcPackages;
+ };
};
};
}