This commit is contained in:
George Thomas 2025-12-04 09:53:37 +00:00
parent 6727a0a301
commit beaacd3e03

View File

@ -17,40 +17,39 @@
, crane , crane
, rust-overlay , rust-overlay
}: }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
(system: let
let overlays = [
overlays = [ haskellNix.overlay
haskellNix.overlay (final: _prev: {
(final: _prev: { hixProject =
hixProject = final.haskell-nix.hix.project {
final.haskell-nix.hix.project { src = ./.;
src = ./.; evalSystem = "x86_64-linux";
evalSystem = "x86_64-linux"; };
}; })
}) (import rust-overlay)
(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 { })
]; ];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; }; };
haskell = pkgs.hixProject.flake { }; packages = {
rust = (crane.mkLib pkgs).overrideToolchain (p: p.rust-bin.selectLatestNightlyWith ( haskell = haskell.packages."aoc:exe:aoc";
toolchain: toolchain.default.override { rust = rust.buildPackage { src = rust.cleanCargoSource ./rust; };
extensions = [ "rust-src" ]; };
targets = [ "x86_64-unknown-linux-gnu" ]; }
} );
));
in
{
devShells.default = pkgs.mkShell {
inputsFrom = [
haskell.devShells.default
(rust.devShell { })
];
};
packages = {
haskell = haskell.packages."aoc:exe:aoc";
rust = rust.buildPackage { src = rust.cleanCargoSource ./rust; };
};
}
);
} }