make flake package

This commit is contained in:
cy 2025-04-01 03:16:54 -04:00
parent c77e76014f
commit 92f7edfba4
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts
2 changed files with 34 additions and 2 deletions

View file

@ -4,12 +4,17 @@
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
crane.url = "github:ipetkov/crane";
};
outputs = inputs@{ flake-parts, ... }:
outputs = inputs@{ flake-parts, crane, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
perSystem = { config, self', inputs', pkgs, system, ... }:
let
craneLib = crane.mkLib pkgs;
in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkg-config
@ -18,6 +23,17 @@
openssl
];
};
packages.default = craneLib.buildPackage {
src = craneLib.cleanCargoSource ./.;
strictDeps = true;
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [
openssl
];
};
};
};
}