Skip to content

Commit

Permalink
Fix flake so latest ironhide works on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
zmre committed Sep 6, 2024
1 parent bfa27b4 commit 14876a3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
result

# These are backup files generated by rustfmt
**/*.rs.bk
Expand Down
65 changes: 34 additions & 31 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,41 @@
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
rusttoolchain =
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
cargoToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml));

in rec {
# `nix build`
packages = {
ironhide = pkgs.rustPlatform.buildRustPackage {
pname = cargoToml.package.name;
version = cargoToml.package.version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = with pkgs;
[ rusttoolchain ]
++ pkgs.lib.optionals pkgs.stdenv.isDarwin
[ pkgs.darwin.apple_sdk.frameworks.Security ];
};
default = packages.ironhide;
};

# nix develop
devShells.default = pkgs.mkShell {
buildInputs = with pkgs;
[ rusttoolchain]
outputs = {
self,
nixpkgs,
rust-overlay,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {inherit system overlays;};
rusttoolchain =
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in rec {
# `nix build`
packages = {
ironhide = pkgs.rustPlatform.buildRustPackage {
pname = cargoToml.package.name;
version = cargoToml.package.version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = with pkgs;
[rusttoolchain]
++ pkgs.lib.optionals pkgs.stdenv.isDarwin
[ pkgs.darwin.apple_sdk.frameworks.Security ];
(with pkgs.darwin.apple_sdk.frameworks; [Security SystemConfiguration]);
};
default = packages.ironhide;
};

});
# nix develop
devShells.default = pkgs.mkShell {
buildInputs = with pkgs;
[rusttoolchain]
++ pkgs.lib.optionals pkgs.stdenv.isDarwin
[pkgs.darwin.apple_sdk.frameworks.Security];
};
});
}

0 comments on commit 14876a3

Please sign in to comment.