garnet/flake.nix

65 lines
1.8 KiB
Nix
Raw Normal View History

2025-12-02 00:32:49 +00:00
{
2025-12-04 09:51:26 +00:00
inputs = {
haskellNix.url = "github:input-output-hk/haskell.nix";
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
crane.url = "github:ipetkov/crane";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
2025-12-04 09:52:28 +00:00
outputs =
{ self
, nixpkgs
, flake-utils
, haskellNix
, crane
, rust-overlay
}:
2025-12-04 09:53:37 +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";
2025-12-10 14:31:44 +00:00
name = "aoc";
compiler-nix-name = "ghc912";
shell.tools.cabal = "latest";
shell.tools.hlint = "latest";
shell.tools.haskell-language-server = "latest";
2025-12-04 09:53:37 +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 { })
2025-12-02 00:32:49 +00:00
];
packages = with pkgs; [
bacon
ghcid
];
2025-12-04 09:53:37 +00:00
};
packages = {
haskell = haskell.packages."aoc:exe:aoc";
rust = rust.buildPackage { src = rust.cleanCargoSource ./rust; };
};
}
);
2025-12-02 00:32:49 +00:00
}