garnet/flake.nix

73 lines
2.1 KiB
Nix
Raw Normal View History

2026-02-17 14:57:34 +00:00
{
inputs = {
haskellNix.url = "github:input-output-hk/haskell.nix";
hls-2-13 = { url = "github:haskell/haskell-language-server/2.13.0.0"; flake = false; };
nixpkgs.follows = "haskellNix/nixpkgs-2511";
flake-utils.url = "github:numtide/flake-utils";
crane.url = "github:ipetkov/crane";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
hs-bindgen.url = "github:well-typed/hs-bindgen/release-0.1-alpha";
2026-02-17 14:57:34 +00:00
};
outputs =
{ self
, nixpkgs
, flake-utils
, haskellNix
, hls-2-13
, crane
, rust-overlay
, hs-bindgen
2026-02-17 14:57:34 +00:00
}:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
overlays = [
haskellNix.overlay
(final: _prev: {
hixProject =
final.haskell-nix.hix.project {
src = ./.;
evalSystem = "x86_64-linux";
name = "garnet";
compiler-nix-name = "ghc9141";
shell.tools.cabal = "latest";
shell.withHoogle = false;
shell.tools.haskell-language-server = {
2026-02-18 14:31:21 +00:00
src = hls-2-13;
sha256map = {
"https://github.com/snowleopard/alga"."d4e43fb42db05413459fb2df493361d5a666588a" = "0s1mlnl64wj7pkg3iipv5bb4syy3bhxwqzqv93zqlvkyfn64015i";
2026-02-17 14:57:34 +00:00
};
2026-02-18 14:31:21 +00:00
};
2026-02-17 14:57:34 +00:00
};
})
(import rust-overlay)
];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
haskell = pkgs.hixProject.flake { };
rust = (crane.mkLib pkgs).overrideToolchain (p: p.rust-bin.selectLatestNightlyWith (
toolchain: toolchain.default.override {
extensions = [ "rust-src" ];
targets = [ "x86_64-unknown-linux-gnu" ];
}
));
in
{
devShells.default = pkgs.mkShell {
inputsFrom = [
haskell.devShells.default
(rust.devShell { })
];
packages = with pkgs; [
bacon
ghcid
hs-bindgen.packages.${system}.hs-bindgen-cli
2026-02-17 14:57:34 +00:00
rust-analyzer
rust-cbindgen
2026-02-17 14:57:34 +00:00
];
};
}
);
}