1 # SPDX-FileCopyrightText: 2023 Frank Doepper
3 # SPDX-License-Identifier: GPL-3.0-only
5 # thank https://magnus.therning.org/2022-03-13-simple-nix-flake-for-haskell-development.html !
8 nixpkgs.url = "nixpkgs/nixos-25.05";
9 flake-utils.url = "flake-utils";
12 outputs = { self, nixpkgs, flake-utils }:
13 flake-utils.lib.eachDefaultSystem (system:
15 pkgs = nixpkgs.legacyPackages.${system};
17 hl = pkgs.haskell.lib;
18 hp = pkgs.haskell.packages.ghc96;
19 project = { withEnv ? false }:
23 returnShellEnv = withEnv;
25 modifier = (t.flip t.pipe) [
27 hl.enableStaticLibraries
28 hl.justStaticExecutables
29 hl.disableLibraryProfiling
30 hl.disableExecutableProfiling
34 packages.default = project { };
35 devShells.default = project { withEnv = true; };
36 apps = builtins.listToAttrs (builtins.map (x: {
40 program = "${project { }}/bin/${x}";
42 }) [ "agitprop" "konsum" "plane" "arbeite" ]);