diff --git a/flake.nix b/flake.nix index 49545fc7..fbc4bd12 100644 --- a/flake.nix +++ b/flake.nix @@ -39,10 +39,19 @@ inherit src version; strictDeps = true; COMMIT_HASH = self.rev or (pkgs.lib.removeSuffix "-dirty" self.dirtyRev); - buildInputs = [ - pkgs.gcc - pkgs.libiconv + nativeBuildInputs = [ + pkgs.darwin.cctools ]; + postFixup = '' + for bin in $out/bin/*; do + if [ -f "$bin" ] && [ -x "$bin" ]; then + # Get all linked libraries and fix libiconv references + otool -L "$bin" | grep -o '/nix/store/[^/]*/lib/libiconv[^ ]*' | while read -r lib; do + install_name_tool -change "$lib" /usr/lib/libiconv.dylib "$bin" + done + fi + done + ''; }; cargoArtifacts = craneLib.buildDepsOnly commonArgs; @@ -101,10 +110,7 @@ ]; perSystem = - { - system, - ... - }: + { system, ... }: let pkgs = mkPkgs system; build = mkKomorebiPackages { inherit pkgs; }; diff --git a/justfile b/justfile index ab299ca1..ab316fef 100644 --- a/justfile +++ b/justfile @@ -4,7 +4,6 @@ fmt: test -z "$(rg 'eyre!' --type rust)" || (echo "eyre! macro not allowed"; false) test -z "$(rg 'dbg!' --type rust)" || (echo "dbg! macro not allowed"; false) test -z "$(rg 'println!' --type rust ./komorebi)" || (echo "println! macro not allowed"; false) - taplo fmt Cargo.toml */Cargo.toml cargo +stable clippy prettier --write README.md nix fmt diff --git a/shell.nix b/shell.nix index 96a37b90..6ea338e5 100644 --- a/shell.nix +++ b/shell.nix @@ -8,16 +8,12 @@ mkShell { RUST_BACKTRACE = "full"; buildInputs = [ - alejandra cargo-deny cargo-nextest cargo-udeps - gcc jq just - libiconv prettier - taplo python311Packages.mkdocs-material python311Packages.mkdocs-macros