mirror of
https://github.com/Smaug123/static-site-pipeline
synced 2025-10-05 16:28:41 +00:00
Add post about .NET 9 and nixpkgs (#25)
This commit is contained in:
28
hugo/content/posts/2024-11-28-net9-aot.md
Normal file
28
hugo/content/posts/2024-11-28-net9-aot.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
lastmod: "2024-11-28T20:10:00.0000000+00:00"
|
||||||
|
author: patrick
|
||||||
|
categories:
|
||||||
|
- philosophy
|
||||||
|
date: "2024-11-28T20:10:00.0000000+00:00"
|
||||||
|
title: NativeAOT in .NET 9 and Nixpkgs/darwin
|
||||||
|
summary: "How to get a NativeAOT build using nixpkgs"
|
||||||
|
---
|
||||||
|
|
||||||
|
When nixpkgs was at commit [af51545ec9a44eadf3fe3547610a5cdd882bc34e](https://github.com/NixOS/nixpkgs/tree/af51545ec9a44eadf3fe3547610a5cdd882bc34e), the following sufficed for `dotnet publish --self-contained --configuration Release` to Just Work to build a `<PublishAot>true</PublishAot>` executable on aarch64-darwin:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
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
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
Reference in New Issue
Block a user