flake restructure

This commit is contained in:
Paul Zinselmeyer 2023-10-18 20:39:43 +02:00
parent 7871d4c9f9
commit 09124c8249

View file

@ -21,14 +21,16 @@
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane}:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane}: let
forAllSystems = function:
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
] (system: let
pkgs = import nixpkgs {
inherit system overlays;
inherit system;
overlays = [ (import rust-overlay) ];
};
rustToolchain = pkgs.rust-bin.stable.latest.default;
markdownFilter = path: _type: builtins.match ".*md$" path != null;
@ -51,19 +53,17 @@
bin = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts;
});
in
with pkgs;
{
packages = {
in function {
inherit bin pkgs;
});
in {
packages = forAllSystems({pkgs, bin}: {
inherit bin;
default = bin;
});
devShells = forAllSystems({pkgs, bin}: pkgs.mkShell {
inputsFrom = bin;
});
hydraJobs."build" = forAllSystems({pkgs, bin}: bin);
};
devShells.default = mkShell {
inputsFrom = [ bin ];
};
hydraJobs."build" = bin;
}
);
}