Skip to content

Commit

Permalink
Added dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
youhaveme9 committed Jan 3, 2025
1 parent 22e8f01 commit 50f5645
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 23 deletions.
23 changes: 22 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 45 additions & 22 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,56 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};

outputs = { self, nixpkgs, flake-utils}:
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
system = "aarch64-darwin";
name = "FlexAuth";
src = ./.;
pkgs = nixpkgs.legacyPackages.${system};
# name = "FlexAuth";
# src = ./.;
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
{
packages.${system}.default = derivation {
inherit name system src;

buildInputs = with pkgs; [
rust
cargo
];
with pkgs;
{
devShells.default = mkShell {
nativeBuildInputs = [
rust-bin.stable.latest.default
openssl_1_1
pkg-config
];

phases = [ "buildPhase" ];
buildPhase = ''
CARGO_TARGET_DIR=$out ${nixpkgs.cargo}/bin/cargo build --manifest-path $src/Cargo.toml --release
${nixpkgs.binutils}/bin/strip $out/release/flakes -o /tmp/test
rm -rf $out
mv /tmp/test $out
'';
};
}
buildInputs = [
openssl_1_1
pkg-config
zlib
];

CARGO_HOME = "${pkgs.writeTextDir "cargo-home" ""}";
OPENSSL_DIR = "${openssl_1_1}";
};

packages.default = pkgs.rustPlatform.buildRustPackage {
pname = "inhouse-auth";
version = "0.1.0";
src = ./.;

nativeBuildInputs = [
openssl
pkg-config
];

cargoHash = "sha256-wZ5q6Ghkr9/14cLZqASlPZZI4pktxmHy0BxOmzIbrMM=";
};
}
);
}

0 comments on commit 50f5645

Please sign in to comment.