feat: Added packages.sukr and packages.default

This commit is contained in:
2026-02-16 19:30:36 +05:30
parent 5c3299b774
commit d6d230e9f2

View File

@@ -9,36 +9,35 @@
};
};
outputs =
{
outputs = {
self,
nixpkgs,
fenix,
}:
let
}: let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn system);
in
{
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
fenixPkgs = fenix.packages.${system};
toolchain = fenixPkgs.fromToolchainFile {
forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn (pkgsFor system) (toolchainFor system));
pkgsFor = system:
import nixpkgs {
system = system;
};
toolchainFor = system:
fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-vra6TkHITpwRyA5oBKAHSX0Mi6CBDNQD+ryPSpxFsfg=";
};
in
{
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in {
devShells = forAllSystems (
pkgs: toolchain: {
default = pkgs.mkShell.override {stdenv = pkgs.clangStdenv;} {
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
packages = [
packages =
[
toolchain
pkgs.treefmt
pkgs.shfmt
@@ -56,5 +55,14 @@
};
}
);
packages = forAllSystems (pkgs: toolchain: rec {
sukr = pkgs.rustPlatform.buildRustPackage {
pname = cargoToml.package.name;
version = cargoToml.package.version;
src = ./.;
cargoHash = "sha256-ubioKKShVIkLVHI+IDzFOo67jv4gtzr1Rfhi/9s7/vo=";
};
default = sukr;
});
};
}