]> Git — Sourcephile - haskell/symantic-parser.git/blob - flake.nix
Rename many things and continue Instr interpretation
[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 inherit pkgs;
41 }).shell;
42 /*
43 # Build with: nix build
44 defaultPackage = project.${projectName}.components.exes."playground";
45 #packages.${projectName} = project;
46 # Run with: nix run .#benchmarks
47 apps."benchmarks" = {
48 type = "app";
49 program = "${project.${projectName}.components.exes."benchmarks"}/bin/benchmarks";
50 };
51 # Run with: nix run .#playground
52 apps."playground" = {
53 type = "app";
54 program = "${inputs.self.defaultPackage.${system}}/bin/playground";
55 };
56 # Run with: nix run .#materialize
57 apps.materialize = {
58 type = "app";
59 program = (pkgs.writeShellScript "materialize" ''
60 ${pkgs.rsync}/bin/rsync --delete -ai ${project.plan-nix}/ plan-nix/
61 '').outPath;
62 };
63 # Run with: nix run .#register
64 apps.register = {
65 type = "app";
66 program = (pkgs.writeShellScript "register" ''
67 set -x
68 nix-store --add-root nix.root --indirect --realise ${project.roots}
69 '').outPath;
70 };
71 # Get a development environment with: nix shell
72 devShell = project.shellFor {
73 packages = hpkgs: [
74 hpkgs."${projectName}"
75 ];
76 #components = hpkgs: [];
77 #additional = hpkgs: [];
78 withHoogle = false;
79 tools = {
80 cabal = "3.2.0.0";
81 #hie = "unstable";
82 #hlint = "2.2.11";
83 };
84 builtInputs = with project.haskellPackages; [
85 ];
86 exactDeps = true;
87 shellHook = ''
88 nix-store --add-root nix.root --indirect --realise ${project.roots}
89 '';
90 };
91 */
92 }
93 );
94 }