Files
static-site-pipeline/hugo/content/posts/2024-11-28-net9-aot.md
2024-11-28 20:17:56 +00:00

913 B

lastmod, author, categories, date, title, summary
lastmod author categories date title summary
2024-11-28T20:10:00.0000000+00:00 patrick
philosophy
2024-11-28T20:10:00.0000000+00:00 NativeAOT in .NET 9 and Nixpkgs/darwin How to get a NativeAOT build using nixpkgs

When nixpkgs was at commit af51545ec9a44eadf3fe3547610a5cdd882bc34e, the following sufficed for dotnet publish --self-contained --configuration Release to Just Work to build a <PublishAot>true</PublishAot> executable on aarch64-darwin:

{
    outputs = { nixpkgs, ... }:
    let pkgs = nixpkgs.legacyPackages.aarch64-darwin; in
    {
        devShell = pkgs.mkShell {
            buildInputs = [ pkgs.dotnetCorePackages.sdk_9_0 ];
            packages = [
              pkgs.clang
              pkgs.darwin.ICU
              pkgs.darwin.binutils
            ];
        }
    }
}