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";
8 in inputs.flake-utils.lib.eachDefaultSystem (system: let
9 pkgs = inputs.nixpkgs.legacyPackages.${system};
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
18 compiler-nix-name = "ghc865";
19 project = pkgs.haskell-nix.cabalProject {
20 src = pkgs.haskell-nix.haskellLib.cleanGit {
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
29 # Update by commenting materialized and running:
30 # nix run .#materialize
31 #materialized = ./plan-nix;
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 {
43 # Build with: nix build
44 defaultPackage = project.${projectName}.components.exes."playground";
45 #packages.${projectName} = project;
46 # Run with: nix run .#benchmarks
49 program = "${project.${projectName}.components.exes."benchmarks"}/bin/benchmarks";
51 # Run with: nix run .#playground
54 program = "${inputs.self.defaultPackage.${system}}/bin/playground";
56 # Run with: nix run .#materialize
59 program = (pkgs.writeShellScript "materialize" ''
60 ${pkgs.rsync}/bin/rsync --delete -ai ${project.plan-nix}/ plan-nix/
63 # Run with: nix run .#register
66 program = (pkgs.writeShellScript "register" ''
68 nix-store --add-root nix.root --indirect --realise ${project.roots}
71 # Get a development environment with: nix shell
72 devShell = project.shellFor {
74 hpkgs."${projectName}"
76 #components = hpkgs: [];
77 #additional = hpkgs: [];
84 builtInputs = with project.haskellPackages; [
88 nix-store --add-root nix.root --indirect --realise ${project.roots}