Skip to content
Snippets Groups Projects
flake.nix 2.07 KiB
Newer Older
  description = "Horizon Haskell Platform";
Daniel Firth's avatar
Daniel Firth committed
  nixConfig = {
    extra-substituters = "https://horizon.cachix.org";
    extra-trusted-public-keys = "horizon.cachix.org-1:MeEEDRhRZTgv/FFGCv3479/dmJDfJ82G6kfUDxMSAw0=";
  };

    flake-parts.url = "github:hercules-ci/flake-parts";
    lint-utils.url = "git+https://gitlab.homotopic.tech/nix/lint-utils";
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
  };
Daniel Firth's avatar
Daniel Firth committed
  outputs =
    inputs@
    { self
    , flake-parts
Daniel Firth's avatar
Daniel Firth committed
    , lint-utils
    , nixpkgs
    , ...
    }:
    flake-parts.lib.mkFlake { inherit inputs; } {
Daniel Firth's avatar
Daniel Firth committed
      systems = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
      perSystem = { config, system, ... }:
        let
          pkgs = nixpkgs.legacyPackages.${system};
          haskellLib = pkgs.haskell.lib.compose;

          legacyPackages = pkgs.callPackage (nixpkgs + /pkgs/development/haskell-modules) {
            buildHaskellPackages = pkgs.haskell.packages.ghc944;
            compilerConfig = pkgs.callPackage ./configuration-ghc.nix { inherit haskellLib; };
            configurationArm = { pkgs, haskellLib }: self: super: { };
            configurationCommon = import ./configuration.nix;
            configurationDarwin = import ./configuration-darwin.nix;
            configurationNix = { pkgs, haskellLib }: self: super: { };
            ghc = pkgs.haskell.compiler.ghc944;
            inherit haskellLib;
            initialPackages = import ./initial-packages.nix;
            nonHackagePackages = self: super: { };
          };
          packages = pkgs.lib.filterAttrs
            (n: v: v != null
              && builtins.typeOf v == "set"
              && pkgs.lib.hasAttr "type" v
              && v.type == "derivation"
              && v.meta.broken == false)
            legacyPackages;

        in
        {
Daniel Firth's avatar
Daniel Firth committed

          checks = with lint-utils.linters.${system}; {
            dhall-format = dhall-format { src = self; };
            nixpkgs-fmt = nixpkgs-fmt { src = self; find = "flake.nix"; };
          inherit legacyPackages;
          inherit packages;