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";
9 in inputs.flake-utils.lib.eachDefaultSystem (system: let
10 pkgs = inputs.nixpkgs.legacyPackages.${system};
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
19 compiler-nix-name = "ghc865";
20 project = pkgs.haskell-nix.cabalProject {
21 src = pkgs.haskell-nix.haskellLib.cleanGit {
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
30 # Update by commenting materialized and running:
31 # nix run .#materialize
32 #materialized = ./plan-nix;
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 {
44 # Build with: nix build
45 defaultPackage = project.${projectName}.components.exes."playground";
46 #packages.${projectName} = project;
47 # Run with: nix run .#benchmarks
50 program = "${project.${projectName}.components.exes."benchmarks"}/bin/benchmarks";
52 # Run with: nix run .#playground
55 program = "${inputs.self.defaultPackage.${system}}/bin/playground";
57 # Run with: nix run .#materialize
60 program = (pkgs.writeShellScript "materialize" ''
61 ${pkgs.rsync}/bin/rsync --delete -ai ${project.plan-nix}/ plan-nix/
64 # Run with: nix run .#register
67 program = (pkgs.writeShellScript "register" ''
69 nix-store --add-root nix.root --indirect --realise ${project.roots}
72 # Get a development environment with: nix shell
73 devShell = project.shellFor {
75 hpkgs."${projectName}"
77 #components = hpkgs: [];
78 #additional = hpkgs: [];
85 builtInputs = with project.haskellPackages; [
89 nix-store --add-root nix.root --indirect --realise ${project.roots}