-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathflake.nix
34 lines (32 loc) · 1.27 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
description = "Easy Haskell Language Server tooling for Nix.";
# Pin unstable 'nixpkgs' by default.
inputs.nixpkgs.url = "github:nixos/nixpkgs";
outputs = { self, nixpkgs }:
let
# Generate a user-friendly version number.
version = builtins.substring 0 8 self.lastModifiedDate;
# System types to support.
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; });
in
{
overlay = final: prev: {};
defaultPackage = forAllSystems (system:
nixpkgsFor."${system}".callPackage ./default.nix { });
defaultApp = forAllSystems (system: {
type = "app";
program = "${self.defaultPackage.${system}}/bin/haskell-language-server-wrapper";
});
devShell = forAllSystems (system: import ./shell.nix {
pkgs = nixpkgsFor."${system}";
});
withGhcs = ghcVersions: forAllSystems (system:
self.defaultPackage."${system}".overrideAttrs (old: {
inherit ghcVersions;
}));
};
}