Skip to content

Commit

Permalink
Added flake-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
youhaveme9 committed Jan 3, 2025
1 parent 914e397 commit 22e8f01
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 30 deletions.
44 changes: 39 additions & 5 deletions flake.lock

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

52 changes: 27 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,34 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs }:
let
system = "aarch64-darwin";
name = "FlexAuth";
src = ./.;
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.${system}.default = derivation {

inherit name system src;

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

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
'';
};
};
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
'';
};
}
);
}

0 comments on commit 22e8f01

Please sign in to comment.