]> Git — Sourcephile - haskell/symantic-parser.git/blob - flake.nix
add GramDump and migrate to HLS
[haskell/symantic-parser.git] / flake.nix
1 {
2 # Update inputs with:
3 # nix flake update --recreate-lock-file
4 inputs.nixpkgs.url = "flake:nixpkgs";
5 inputs.flake-utils.url = "github:numtide/flake-utils";
6 #inputs.haskell-nix.url = "github:input-output-hk/haskell.nix";
7 outputs = inputs: let
8 in inputs.flake-utils.lib.eachDefaultSystem (system: let
9 pkgs = inputs.nixpkgs.legacyPackages.${system};
10 /*
11 projectName = "symantic-parser";
12 pkgs = import inputs.haskell-nix.sources.nixpkgs (inputs.haskell-nix.nixpkgsArgs // {
13 localSystem = { inherit system; };
14 overlays = inputs.haskell-nix.nixpkgsArgs.overlays ++ [
15 (import inputs.all-hies {}).overlay
16 ];
17 });
18 compiler-nix-name = "ghc865";
19 project = pkgs.haskell-nix.cabalProject {
20 src = pkgs.haskell-nix.haskellLib.cleanGit {
21 name = projectName;
22 src = ./.;
23 };
24 inherit compiler-nix-name;
25 #index-state = "2020-08-31T00:00:00Z";
26 # To be kept up to date with source-repository-package entries in cabal.project
27 sha256map = {
28 };
29 # Update by commenting materialized and running:
30 # nix run .#materialize
31 #materialized = ./plan-nix;
32 };
33 */
34 in {
35 # nix -L build
36 defaultPackage = import ./default.nix { inherit pkgs; };
37 # nix develop --command "$EDITOR src/**/*.hs"
38 # nix develop --command "cabal repl"
39 devShell = (import ./default.nix {
40 }).shell;
41 /*
42 # Build with: nix build
43 defaultPackage = project.${projectName}.components.exes."playground";
44 #packages.${projectName} = project;
45 # Run with: nix run .#benchmarks
46 apps."benchmarks" = {
47 type = "app";
48 program = "${project.${projectName}.components.exes."benchmarks"}/bin/benchmarks";
49 };
50 # Run with: nix run .#playground
51 apps."playground" = {
52 type = "app";
53 program = "${inputs.self.defaultPackage.${system}}/bin/playground";
54 };
55 # Run with: nix run .#materialize
56 apps.materialize = {
57 type = "app";
58 program = (pkgs.writeShellScript "materialize" ''
59 ${pkgs.rsync}/bin/rsync --delete -ai ${project.plan-nix}/ plan-nix/
60 '').outPath;
61 };
62 # Run with: nix run .#register
63 apps.register = {
64 type = "app";
65 program = (pkgs.writeShellScript "register" ''
66 set -x
67 nix-store --add-root nix.root --indirect --realise ${project.roots}
68 '').outPath;
69 };
70 # Get a development environment with: nix shell
71 devShell = project.shellFor {
72 packages = hpkgs: [
73 hpkgs."${projectName}"
74 ];
75 #components = hpkgs: [];
76 #additional = hpkgs: [];
77 withHoogle = false;
78 tools = {
79 cabal = "3.2.0.0";
80 #hie = "unstable";
81 #hlint = "2.2.11";
82 };
83 builtInputs = with project.haskellPackages; [
84 ];
85 exactDeps = true;
86 shellHook = ''
87 nix-store --add-root nix.root --indirect --realise ${project.roots}
88 '';
89 };
90 */
91 }
92 );
93 }