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