]> woffs.de Git - fd/haskell-amqp-utils.git/blob - flake.nix
update to ghc-9.6, unix-2.8
[fd/haskell-amqp-utils.git] / flake.nix
1 # SPDX-FileCopyrightText: 2023 Frank Doepper
2 #
3 # SPDX-License-Identifier: GPL-3.0-only
4
5 # thank https://magnus.therning.org/2022-03-13-simple-nix-flake-for-haskell-development.html !
6 {
7   inputs = {
8     nixpkgs.url = "nixpkgs/haskell-updates";
9     flake-utils.url = "flake-utils";
10   };
11
12   outputs = { self, nixpkgs, flake-utils }:
13     flake-utils.lib.eachDefaultSystem (system:
14       let
15         pkgs = nixpkgs.legacyPackages.${system};
16         t = pkgs.lib.trivial;
17         hl = pkgs.haskell.lib;
18         hp = pkgs.haskell.packages.ghc96;
19         project = { withEnv ? false }:
20           hp.developPackage {
21             root = ./.;
22             name = "amqp-utils";
23             returnShellEnv = withEnv;
24             withHoogle = false;
25             overrides = self: super: rec {
26               amqp = hl.dontCheck super.amqp_0_22_2;
27               tls = super.tls_1_7_0;
28               crypton-connection = super.crypton-connection.override { inherit tls; };
29               rawfilepath = hl.overrideCabal super.rawfilepath {
30                 src = pkgs.fetchFromGitHub {
31                   owner = "georgefst";
32                   repo = "rawfilepath";
33                   rev = "044079fa0c3a407037be9086fab92f1209dfb1a8";
34                   hash = "sha256-2LFMLjhm6lLzXTditN0pi9R4QKg0zdBsDOPhcQUD1lQ=";
35                 };
36               };
37             };
38             modifier = (t.flip t.pipe) [
39               hl.dontHaddock
40               hl.enableStaticLibraries
41               hl.justStaticExecutables
42               hl.disableLibraryProfiling
43               hl.disableExecutableProfiling
44             ];
45           };
46       in {
47         packages.default = project { };
48         devShells.default = project { withEnv = true; };
49         apps = builtins.listToAttrs (builtins.map (x: {
50           name = x;
51           value = {
52             type = "app";
53             program = "${project { }}/bin/${x}";
54           };
55         }) [ "agitprop" "konsum" "plane" "arbeite" ]);
56       });
57 }