{ # Update inputs with: # nix flake update --recreate-lock-file inputs.nixpkgs.url = "flake:nixpkgs"; # This is needed until all-hies supports glibc-2.31 inputs.nixpkgs-2003.url = "github:nixos/nixpkgs/nixos-20.03"; inputs.flake-utils.url = "github:numtide/flake-utils"; #inputs.haskell-nix.url = "github:input-output-hk/haskell.nix"; inputs.all-hies.url = "github:infinisil/all-hies"; inputs.all-hies.flake = false; outputs = inputs: let in inputs.flake-utils.lib.eachDefaultSystem (system: let pkgs = inputs.nixpkgs.legacyPackages.${system}; /* projectName = "symantic-parser"; pkgs = import inputs.haskell-nix.sources.nixpkgs (inputs.haskell-nix.nixpkgsArgs // { localSystem = { inherit system; }; overlays = inputs.haskell-nix.nixpkgsArgs.overlays ++ [ (import inputs.all-hies {}).overlay ]; }); compiler-nix-name = "ghc865"; project = pkgs.haskell-nix.cabalProject { src = pkgs.haskell-nix.haskellLib.cleanGit { name = projectName; src = ./.; }; inherit compiler-nix-name; #index-state = "2020-08-31T00:00:00Z"; # To be kept up to date with source-repository-package entries in cabal.project sha256map = { }; # Update by commenting materialized and running: # nix run .#materialize #materialized = ./plan-nix; }; */ in { defaultPackage = import ./default.nix { inherit pkgs; }; devShell = (import ./default.nix { ghc = "ghc883"; pkgs = import inputs.nixpkgs-2003 { inherit system; overlays = [ (import inputs.all-hies {}).overlay /* (self: super: { inherit (inputs.nixpkgs-2003.legacyPackages.${system}) glibc texinfo gmp; glibc = super.glibc.overrideAttrs (_: rec { name = "glibc-${version}"; version = "2.30"; src = pkgs.fetchurl { url = "mirror://gnu/glibc/glibc-${version}.tar.xz"; inherit sha256; }; }); }) */ ]; }; }).shell; /* # Build with: nix build defaultPackage = project.${projectName}.components.exes."playground"; #packages.${projectName} = project; # Run with: nix run .#benchmarks apps."benchmarks" = { type = "app"; program = "${project.${projectName}.components.exes."benchmarks"}/bin/benchmarks"; }; # Run with: nix run .#playground apps."playground" = { type = "app"; program = "${inputs.self.defaultPackage.${system}}/bin/playground"; }; # Run with: nix run .#materialize apps.materialize = { type = "app"; program = (pkgs.writeShellScript "materialize" '' ${pkgs.rsync}/bin/rsync --delete -ai ${project.plan-nix}/ plan-nix/ '').outPath; }; # Run with: nix run .#register apps.register = { type = "app"; program = (pkgs.writeShellScript "register" '' set -x nix-store --add-root nix.root --indirect --realise ${project.roots} '').outPath; }; # Get a development environment with: nix shell devShell = project.shellFor { packages = hpkgs: [ hpkgs."${projectName}" ]; #components = hpkgs: []; #additional = hpkgs: []; withHoogle = false; tools = { cabal = "3.2.0.0"; #hie = "unstable"; #hlint = "2.2.11"; }; builtInputs = with project.haskellPackages; [ ]; exactDeps = true; shellHook = '' nix-store --add-root nix.root --indirect --realise ${project.roots} ''; }; */ } ); }