Skip to content

Commit

Permalink
Fix flake so latest ironhide works on mac (#112)
Browse files Browse the repository at this point in the history
* Fix flake so latest ironhide works on mac

* Update time lib and dev shell
  • Loading branch information
zmre authored Sep 9, 2024
1 parent bfa27b4 commit 576ff25
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 35 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
8 changes: 4 additions & 4 deletions Cargo.lock

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

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
(with pkgs.darwin.apple_sdk.frameworks; [Security SystemConfiguration]);
};
});
}

0 comments on commit 576ff25

Please sign in to comment.