3 # nix flake update --recreate-lock-file
4 inputs.nixpkgs.url = "flake:nixpkgs";
5 # This is needed until all-hies supports glibc-2.31
6 inputs.nixpkgs-2003.url = "github:nixos/nixpkgs/nixos-20.03";
7 inputs.flake-utils.url = "github:numtide/flake-utils";
8 #inputs.haskell-nix.url = "github:input-output-hk/haskell.nix";
9 inputs.all-hies.url = "github:infinisil/all-hies";
10 inputs.all-hies.flake = false;
12 in inputs.flake-utils.lib.eachDefaultSystem (system: let
13 pkgs = inputs.nixpkgs.legacyPackages.${system};
15 projectName = "symantic-parser";
16 pkgs = import inputs.haskell-nix.sources.nixpkgs (inputs.haskell-nix.nixpkgsArgs // {
17 localSystem = { inherit system; };
18 overlays = inputs.haskell-nix.nixpkgsArgs.overlays ++ [
19 (import inputs.all-hies {}).overlay
22 compiler-nix-name = "ghc865";
23 project = pkgs.haskell-nix.cabalProject {
24 src = pkgs.haskell-nix.haskellLib.cleanGit {
28 inherit compiler-nix-name;
29 #index-state = "2020-08-31T00:00:00Z";
30 # To be kept up to date with source-repository-package entries in cabal.project
33 # Update by commenting materialized and running:
34 # nix run .#materialize
35 #materialized = ./plan-nix;
39 defaultPackage = import ./default.nix { inherit pkgs; };
40 devShell = (import ./default.nix {
42 pkgs = import inputs.nixpkgs-2003 {
45 (import inputs.all-hies {}).overlay
48 inherit (inputs.nixpkgs-2003.legacyPackages.${system}) glibc texinfo gmp;
49 glibc = super.glibc.overrideAttrs (_: rec {
50 name = "glibc-${version}";
53 url = "mirror://gnu/glibc/glibc-${version}.tar.xz";
63 # Build with: nix build
64 defaultPackage = project.${projectName}.components.exes."playground";
65 #packages.${projectName} = project;
66 # Run with: nix run .#benchmarks
69 program = "${project.${projectName}.components.exes."benchmarks"}/bin/benchmarks";
71 # Run with: nix run .#playground
74 program = "${inputs.self.defaultPackage.${system}}/bin/playground";
76 # Run with: nix run .#materialize
79 program = (pkgs.writeShellScript "materialize" ''
80 ${pkgs.rsync}/bin/rsync --delete -ai ${project.plan-nix}/ plan-nix/
83 # Run with: nix run .#register
86 program = (pkgs.writeShellScript "register" ''
88 nix-store --add-root nix.root --indirect --realise ${project.roots}
91 # Get a development environment with: nix shell
92 devShell = project.shellFor {
94 hpkgs."${projectName}"
96 #components = hpkgs: [];
97 #additional = hpkgs: [];
104 builtInputs = with project.haskellPackages; [
108 nix-store --add-root nix.root --indirect --realise ${project.roots}