mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-06 21:56:13 +01:00
fix: flake
This commit is contained in:
16
.config/semgrep.yaml
Normal file
16
.config/semgrep.yaml
Normal 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
|
||||
41
flake.nix
41
flake.nix
@@ -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; [ ];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user