flake: check package builds
This commit is contained in:
parent
3c6091106f
commit
86e202aff0
37
flake.nix
37
flake.nix
@ -11,24 +11,27 @@
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, treefmt-nix, ... }@inputs:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.$${system};
|
||||
(flake-utils.lib.eachSystem
|
||||
(with flake-utils.lib.system; [ x86_64-linux aarch64-darwin ])
|
||||
(system: { checks.builds = self.packages.$${system}.default; })
|
||||
// flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.$${system};
|
||||
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
|
||||
treefmtEval = treefmt-nix.lib.evalModule pkgs (pkgs: {
|
||||
projectRootFile = "flake.nix";
|
||||
programs.rustfmt.enable = true;
|
||||
programs.nixfmt.enable = true;
|
||||
});
|
||||
in {
|
||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
||||
inherit (cargoToml.package) name version;
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
};
|
||||
treefmtEval = treefmt-nix.lib.evalModule pkgs (pkgs: {
|
||||
projectRootFile = "flake.nix";
|
||||
programs.rustfmt.enable = true;
|
||||
programs.nixfmt.enable = true;
|
||||
});
|
||||
in {
|
||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
||||
inherit (cargoToml.package) name version;
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
};
|
||||
|
||||
formatter = treefmtEval.config.build.wrapper;
|
||||
});
|
||||
formatter = treefmtEval.config.build.wrapper;
|
||||
}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user