3 nixpkgs.url = "flake:nixpkgs";
4 pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
5 pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
6 gtk-helpers.url = "github:keera-studios/gtk-helpers";
7 gtk-helpers.flake = false;
12 inherit (inputs.nixpkgs) lib;
13 forAllSystems = f: lib.genAttrs lib.systems.flakeExposed (system: f rec {
15 pkgs = inputs.nixpkgs.legacyPackages.${system};
16 # pkgs.haskellPackages currently defaults to GHC 9.0.1
17 # Use something like pkgs.haskell.packages.ghc810 for a specific GHC version.
18 haskellPackages = pkgs.haskellPackages.extend (with pkgs.haskell.lib; hfinal: hsuper: {
19 ${pkg} = buildFromSdist (hfinal.callCabal2nix pkg ./. { });
20 gtk-helpers = hfinal.callCabal2nix "gtk-helpers"
25 src = inputs.gtk-helpers;
26 patches = map pkgs.fetchpatch [
28 meta.description = "Fix build with GHC 9";
29 url = "https://github.com/keera-studios/gtk-helpers/pull/13.diff";
30 sha256 = "sha256-4wgLvvloBwC4zCKmfDQKCh3CrtRJ4zgLMaoEPJvF6fQ=";
36 keera-hails-reactivevalues = dontCheck (doJailbreak (unmarkBroken hsuper.keera-hails-reactivevalues));
42 defaultPackage = forAllSystems ({ haskellPackages, ... }: haskellPackages.${pkg});
43 packages = forAllSystems ({ haskellPackages, ... }: { });
44 # nix -L develop or direnv allow
45 devShell = forAllSystems ({ pkgs, haskellPackages, system, ... }:
46 haskellPackages.shellFor {
51 haskellPackages.cabal-install
52 #haskellPackages.ghcid
53 #haskellPackages.haskell-language-server
54 #haskellPackages.hlint
55 #haskellPackages.hsc2hs
58 #pkgs.gobject-introspection
59 #(pkgs.python3.withPackages (p: with p; [
64 inherit (checks.${system}.pre-commit-check) shellHook;
67 checks = forAllSystems (args: with args; {
68 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
70 #settings.ormolu.cabalDefaultExtensions = true;
71 settings.ormolu.defaultExtensions = [
77 nixpkgs-fmt.enable = true;
78 fourmolu.enable = true;
79 cabal-fmt.enable = true;