Repository navigation
feat(linux): NixOS support — immutable-system adaptations for certificate, hosts and accelerator - #4147
Open
Aozora-Wings wants to merge 4 commits into
Open
feat(linux): NixOS support — immutable-system adaptations for certificate, hosts and accelerator#4147Aozora-Wings wants to merge 4 commits into
Aozora-Wings wants to merge 4 commits into
Conversation
Aozora-Wings
force-pushed
the
nixos-upstream-pr
branch
2 times, most recently
from
October 13, 2026 13:59
05984fa to
936185c
Compare
Add an explicit --nixos flag (default off; /etc/NIXOS auto-detect kept for backward compat) so any build machine can produce the NixOS-adapted package: directory publish instead of SingleFile and no bundled .NET runtime (Nix packaging invokes system dotnet via a wrapper).
Aozora-Wings
force-pushed
the
nixos-upstream-pr
branch
from
October 13, 2026 13:59
936185c to
7637882
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds NixOS support for the Linux build. NixOS is an immutable system: the Nix store (where the package is installed),
/etc/hostsand the system CA certificate store are all read-only at runtime and managed declaratively. The current Linux implementation assumes writable/etc/hosts, writable system certificate store, and a subprocess accelerator that can be spawned with elevated privileges — none of which hold on NixOS.All changes are guarded by a runtime NixOS detection (
IsNixOS, checks/etc/NIXOSorID=nixosin/etc/os-release) and do not affect other platforms.Changes
LinuxPlatformServiceImpl.NixOS.cs):IsNixOShelper shared by all adaptations.pkexecinstall/remove of system certificates on NixOS (system trust is declarative viasecurity.pki.certificateFiles).BundledCertificateHelper: support a bundled CA certificate (cer + pfx) shipped in the package, synced to AppData at startup so the proxy private key always matches the system-trusted cert.-clt nixos -gcertcommand to export the root certificate for declarative installation.HostsFileServiceImpl): on NixOS, dump the accelerator's host entries to AppData as a reference file instead of writing/etc/hosts, for merge into the system's declarativenetworking.hosts.EPERM, and privilege escalation would lose the wrapper-injected runtime environment). Instead the UI writes the IPC parameters (pipe name / pid / proxy mode) to an environment file and a systemd system service (steampp-accelerator,User=<main user>,AmbientCapabilities=cap_net_bind_service) starts the accelerator on demand. UI shows the service state.IDotNetPublishCommand): new explicit--nixosflag. When set, publish as directory (not SingleFile) and do not bundle the .NET runtime (Nix packaging invokes the systemdotnetvia a wrapper; a bundled runtime copied from the Nix store would embed store paths and break on other machines). The/etc/NIXOSauto-detection is kept for backward compatibility, so any build machine (e.g. official CI on ubuntu runners) can produce the NixOS-adapted package by passing--nixos.Avalonia.BuildServices0.0.29 across Avalonia projects; usesans-serifas the default font family on Linux.Testing
linux-x64on NixOS (see fork'snixos-branchCI and thenixos-branchrelease artifacts).IsNixOS).Notes
Program.csfont change: Avalonia's default font family resolution picks a bundled font on Linux that renders poorly in CJK locales;sans-seriffalls back to the system font stack.