beam database (unfinished), overloadedRecordDot, fourmolu, relude

also one fix where the "skip voting and see results" link is broken.
This commit is contained in:
Jack Wines 2025-08-25 07:54:36 -07:00
parent 123bbe79b5
commit cee339a8ed
Signed by: Jack
SSH key fingerprint: SHA256:AaP2Hr/e3mEjeY+s9XJmQqAesqEms8ENRhwRkpO0WUk
11 changed files with 438 additions and 102 deletions

151
flake.nix
View file

@ -1,43 +1,128 @@
# SPDX-FileCopyrightText: 2021 Serokell <https://serokell.io/>
#
# SPDX-License-Identifier: CC0-1.0
{
description = "My haskell application";
description = "srid/haskell-template: Nix template for Haskell projects";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
# tmp-postgres.url = "github:jfischoff/tmp-postgres";
# tmp-postgres.flake = false;
mission-control.url = "github:Platonic-Systems/mission-control";
flake-root.url = "github:srid/flake-root";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [
inputs.haskell-flake.flakeModule
inputs.treefmt-nix.flakeModule
inputs.flake-root.flakeModule
inputs.mission-control.flakeModule
];
perSystem = { self', system, lib, config, pkgs, ... }: {
# Our only Haskell project. You can have multiple projects, but this template
# has only one.
# See https://github.com/srid/haskell-flake/blob/master/example/flake.nix
haskellProjects.default = {
# The base package set (this value is the default)
# basePackages = pkgs.haskellPackages.ghc_9_12_1;
haskellPackages = pkgs.haskellPackages;
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
# DON'T FORGET TO PUT YOUR PACKAGE NAME HERE, REMOVING `throw`
packageName = "rcv-site";
in {
packages.${packageName} =
haskellPackages.callCabal2nix packageName self rec {
# Dependency overrides go here
# Packages to add on top of `basePackages`
packages = {
# Add source or Hackage overrides here
# (Local packages are added automatically)
# https://github.com/lehins/hip.git
# hip.source = inputs.hip + "/hip";
# tmp-postgres.source = inputs.tmp-postgres;
};
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
# Add your package overrides here
settings = {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
haskellPackages.haskell-language-server # you must build it with your ghc to work
cabal-install
];
inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system});
# tmp-postgres.check = false;
# beam-migrate = {
# broken = false;
# jailbreak = true;
# };
# beam-postgres = {
# broken = false;
# jailbreak = true;
# };
# barbies-th = {
# broken = false;
# jailbreak = true;
# };
};
# Development shell configuration
devShell = {
# hlsCheck.enable = false;
};
# What should haskell-flake add to flake outputs?
autoWire = [ "packages" "apps" "checks" ]; # Wire all but the devShell
};
devShell = self.devShells.${system}.default;
});
# Auto formatters. This also adds a flake check to ensure that the
# source tree was auto formatted.
treefmt.config = {
projectRootFile = "flake.nix";
programs.ormolu.enable = true;
programs.nixpkgs-fmt.enable = true;
programs.cabal-fmt.enable = true;
programs.hlint.enable = true;
# We use fourmolu
programs.ormolu.package = pkgs.haskellPackages.fourmolu;
};
mission-control.scripts = {
hoogle = {
description = "Start Hoogle server for project dependencies";
exec = ''
hoogle serve -p 8888 --local;
'';
category = "Dev Tools";
};
haddocks = {
description = "make docs & serve them";
exec = ''
echo http://127.0.0.1:8887;
cabal haddock-project --executables --internal --hoogle || true;
python3 -m http.server -d haddocks 8887;
'';
category = "Dev Tools";
};
};
# Default package & app.
packages.default = self'.packages.rcv-site;
apps.default = self'.apps.rcv-site;
# Default shell.
devShells.default = pkgs.mkShell {
name = "haskell-template";
meta.description = "Haskell development environment";
# See https://zero-to-flakes.com/haskell-flake/devshell#composing-devshells
inputsFrom = [
config.haskellProjects.default.outputs.devShell
config.treefmt.build.devShell
config.mission-control.devShell
];
nativeBuildInputs = with pkgs; [
];
};
};
};
}