on master help sign in
Make nix derivation portable to aarch64
commit8519dd2560a665ed1a4e8810d7c5aab516e82206 authorHarendra Kumar <harendra@composewell.com> dateTue 11 Apr 2023, 12:31 (4 years ago) parentb831856
1 file changed+18−7
docs/User/HowTo/Compiling.md+18−7
docs/User/HowTo/Compiling.md+18−7
@@ -120,13 +120,24 @@ Please note that `cabal2nix` may not always be able to generate a complete nix
120120expression on `macOS`. See [this
121121issue](https://github.com/NixOS/cabal2nix/issues/470).
122122
123−You may need to add ``nixpkgs.darwin.apple_sdk.frameworks.Cocoa`` to
124−your ``buildInputs`` or ``executableFrameworkDepends``. Something like
125−this:
123+You may need to add ``nixpkgs.darwin.apple_sdk.frameworks.Cocoa``
124+to ``librarySystemDepends``. For example, to create a streamly-0.9.0
125+derivation from Hackage:
126126
127127```
128−executableFrameworkDepends =
129− if builtins.currentSystem == "x86_64-darwin"
130− then [nixpkgs.darwin.apple_sdk.frameworks.Cocoa]
131− else [];
128+ streamly =
129+ nixpkgs.haskell.lib.overrideCabal
130+ (
131+ super.callHackageDirect
132+ { pkg = "streamly";
133+ ver = "0.9.0";
134+ sha256 = "sha256-eOxVb8qQjZDo1+S7CStqYSExOg2QHWkMY+zlOYqwZak=";
135+ } {}
136+ )
137+ (old:
138+ { librarySystemDepends =
139+ if nixpkgs.lib.strings.hasInfix "darwin" builtins.currentSystem
140+ then [nixpkgs.darwin.apple_sdk.frameworks.Cocoa]
141+ else [];
142+ });
132143```