]> Git — Sourcephile - haskell/symantic-plaintext.git/blob - flake.nix
wip
[haskell/symantic-plaintext.git] / flake.nix
1 {
2 inputs.nixpkgs.url = "flake:nixpkgs";
3 #inputs.symantic-base.url = "git+https://git.code.sourcephile.fr/~julm/symantic-base?ref=main";
4 #inputs.symantic-base.url = "git+ssh://git@losurdo.wg/julm/symantic-base?ref=main";
5 inputs.symantic-base.url = "git://git.sourcephile.fr/haskell/symantic-base";
6 inputs.symantic-base.inputs.nixpkgs.follows = "nixpkgs";
7 outputs = inputs: let
8 pkg = "symantic-plaintext";
9 lib = inputs.nixpkgs.lib;
10 forAllSystems = f: lib.genAttrs lib.systems.flakeExposed (system: f rec {
11 inherit system;
12 pkgs = inputs.nixpkgs.legacyPackages.${system};
13 haskellPackages = pkgs.haskellPackages.extend (with pkgs.haskell.lib; hfinal: hsuper: {
14 ${pkg} = buildFromSdist (hfinal.callCabal2nix pkg ./. {});
15 symantic-base = buildFromSdist (hfinal.callCabal2nix "symantic-base" inputs.symantic-base {});
16 });
17 });
18 in {
19 # nix -L build
20 defaultPackage = forAllSystems ({haskellPackages, ...}: haskellPackages.${pkg});
21 # nix -L develop
22 devShell = forAllSystems ({pkgs, haskellPackages, ...}:
23 haskellPackages.shellFor {
24 packages = ps: [ ps.${pkg} ];
25 nativeBuildInputs = [
26 haskellPackages.cabal-install
27 haskellPackages.ghcid
28 haskellPackages.haskell-language-server
29 haskellPackages.hlint
30 pkgs.git-chglog
31 pkgs.reuse
32 ];
33 withHoogle = false;
34 });
35 };
36 }