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