adventOfCode-2022/flake.nix

50 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2022-12-08 11:26:39 +01:00
{
description = "AdventOfCode 2022";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
easy-hls = {
url = "github:jkachmar/easy-hls-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, easy-hls }:
flake-utils.lib.eachSystem ["x86_64-linux" "x86_64-darwin"] ( system:
let
pkgs = import nixpkgs { inherit system; };
hp = pkgs.haskellPackages.extend (self: super: {
adventofcode = self.callCabal2nix "adventofcode" ./. {};
});
hls = easy-hls.defaultPackage.${system};
in
rec {
packages = { inherit (hp) adventofcode; };
defaultPackage = packages.adventofcode;
apps.adventofcode = flake-utils.lib.mkApp { drv = packages.adventofcode; };
defaultApp = apps.adventofcode;
devShell = hp.shellFor {
packages = h: [h.adventofcode];
withHoogle = true;
buildInputs = with pkgs; [
2022-12-13 16:39:09 +01:00
haskell-language-server
2022-12-08 11:26:39 +01:00
cabal-install
entr
ghcid
hls
hp.hlint
stylish-haskell
];
shellHook = ''
2022-12-13 16:39:09 +01:00
${pkgs.hpack}/bin/hpack
2022-12-08 11:26:39 +01:00
'';
};
}
);
}