]> woffs.de Git - fd/haskell-amqp-utils.git/blob - flake.nix
update nix build
[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/nixos-unstable";
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_9_0;
28               crypton-connection = super.crypton-connection.override { inherit tls; };
29               rawfilepath = super.rawfilepath_1_1_0;
30               filepath-bytestring = hl.dontCheck super.filepath-bytestring;
31             };
32             modifier = (t.flip t.pipe) [
33               hl.dontHaddock
34               hl.enableStaticLibraries
35               hl.justStaticExecutables
36               hl.disableLibraryProfiling
37               hl.disableExecutableProfiling
38             ];
39           };
40       in {
41         packages.default = project { };
42         devShells.default = project { withEnv = true; };
43         apps = builtins.listToAttrs (builtins.map (x: {
44           name = x;
45           value = {
46             type = "app";
47             program = "${project { }}/bin/${x}";
48           };
49         }) [ "agitprop" "konsum" "plane" "arbeite" ]);
50       });
51 }