fix: flake

This commit is contained in:
kody.low
2024-04-07 08:21:09 -07:00
parent 30d53f5e29
commit 3cec49ce0d
2 changed files with 54 additions and 3 deletions

16
.config/semgrep.yaml Normal file
View File

@@ -0,0 +1,16 @@
rules:
# - id: use-of-unwrap
# pattern: $X.unwrap()
# message: "Found use of unwrap(). Consider using more robust error handling."
# languages: [rust]
# severity: WARNING
# - id: use-of-expect
# pattern: $X.expect(...)
# message: "Found use of expect(). Consider providing clearer error messages or using more robust error handling."
# languages: [rust]
# severity: WARNING
- id: direct-panic
pattern: panic!(...)
message: "Direct use of panic!(). Consider if there's a more graceful way to handle this error case."
languages: [rust]
severity: ERROR

View File

@@ -1,5 +1,5 @@
{
description = "A very basic flake";
description = "Cashu Development Kit";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
@@ -15,11 +15,46 @@
outputs = { self, nixpkgs, flakebox, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { system = system; };
lib = pkgs.lib;
flakeboxLib = flakebox.lib.${system} { };
in
{
rustSrc = flakeboxLib.filterSubPaths {
root = builtins.path {
name = "cashu-sdk";
path = ./.;
};
paths = [ "crates/cashu" "crates/cashu-sdk" ];
};
targetsStd = flakeboxLib.mkStdTargets { };
toolchainsStd = flakeboxLib.mkStdToolchains { };
toolchainNative = flakeboxLib.mkFenixToolchain {
targets = (pkgs.lib.getAttrs [ "default" ] targetsStd);
};
commonArgs = {
buildInputs = [ pkgs.openssl ] ++ lib.optionals pkgs.stdenv.isDarwin
[ pkgs.darwin.apple_sdk.frameworks.SystemConfiguration ];
nativeBuildInputs = [ pkgs.pkg-config ];
};
outputs = (flakeboxLib.craneMultiBuild { toolchains = toolchainsStd; })
(craneLib':
let
craneLib = (craneLib'.overrideArgs {
pname = "flexbox-multibuild";
src = rustSrc;
}).overrideArgs commonArgs;
in rec {
workspaceDeps = craneLib.buildWorkspaceDepsOnly { };
workspaceBuild =
craneLib.buildWorkspace { cargoArtifacts = workspaceDeps; };
});
in {
devShells = flakeboxLib.mkShells {
toolchain = toolchainNative;
packages = [ ];
nativeBuildInputs = with pkgs; [ ];
};
});
}