mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-12-05 12:06:20 +01:00
Apple Silicon's 16K pages mean FEX cannot run natively and qemu-user cannot run complex x86_64 binaries. Wire the maintained rowanG077/nix-x86-on-aarch64 runtime (FEX inside a 4K muvm microVM) into shoukei so games, Steam, Wine and other x86/x86_64 programs work, and let the module own the x86 ELF handlers instead of qemu-user. The input is pinned to our fork (ryan4yin/nix-x86-on-aarch64) at the reviewed commit. Dropping boot.binfmt.emulatedSystems also removes x86_64 from nix.settings.extra-platforms, so the qemu-user/uncached-x86-build gap is recorded as WA-022. - flake.nix: add nix-x86-on-aarch64 input (WA-021) - hosts/12kingdoms-shoukei/game/: programs.x86-on-arm + steam/wine, 6 GiB VM - hardware-configuration.nix: drop emulatedSystems/preferStaticEmulators - apple-silicon.nix: drop the now-redundant box64 - docs: WA-012 resolved; WA-021 and WA-022 added; host README updated
70 lines
2.4 KiB
Nix
70 lines
2.4 KiB
Nix
{
|
||
lib,
|
||
myvars,
|
||
...
|
||
}:
|
||
#############################################################
|
||
#
|
||
# Shoukei - NixOS running on Macbook Pro 2022 M2 16G
|
||
#
|
||
#############################################################
|
||
let
|
||
hostName = "shoukei"; # Define your hostname.
|
||
in
|
||
{
|
||
imports = [
|
||
./hardware-configuration.nix
|
||
./game
|
||
# shoukei reuses ai's preservation layout; no host-specific overrides yet
|
||
../idols-ai/preservation.nix
|
||
];
|
||
|
||
# disable sunshine for security
|
||
services.sunshine.enable = lib.mkForce false;
|
||
# battery-first: override the profile default
|
||
services.tuned.ppdSettings.main.default = lib.mkForce "power-saver";
|
||
|
||
# Laptop joins untrusted networks and is never scraped (see youko's
|
||
# `offlineHosts`); don't expose :9100, and don't keep the smartctl exporter
|
||
# (:9633) running either -- nothing collects it and the laptop isn't a
|
||
# long-lived drive to watch.
|
||
services.prometheus.exporters.node.enable = lib.mkForce false;
|
||
services.prometheus.exporters.smartctl.enable = lib.mkForce false;
|
||
|
||
# resolvconf restarts nscd on every /etc/resolv.conf rewrite (see
|
||
# /etc/resolvconf.conf). Boot network churn exceeds the default start limit
|
||
# (5/10s) and latches nscd into `failed`, which also fails nss-lookup.target /
|
||
# nss-user-lookup.target; `try-restart` cannot revive it. nscd cannot be
|
||
# disabled (NixOS loads NSS modules through it, see nsswitch.nix), so don't
|
||
# rate-limit these external restarts and back off on the crash path instead.
|
||
systemd.services.nscd = {
|
||
startLimitIntervalSec = 0;
|
||
serviceConfig = {
|
||
RestartSec = "1s";
|
||
RestartSteps = 5;
|
||
RestartMaxDelaySec = "60s";
|
||
};
|
||
};
|
||
|
||
networking = {
|
||
inherit hostName;
|
||
inherit (myvars.networking) nameservers;
|
||
};
|
||
|
||
fileSystems."/btr_pool" = {
|
||
device = "/dev/disk/by-uuid/c2e8b249-240e-4eef-bf4e-81e7dbbf4887";
|
||
fsType = "btrfs";
|
||
options = [ "subvolid=5" ];
|
||
};
|
||
|
||
modules.btrbk.enable = true;
|
||
|
||
# This value determines the NixOS release from which the default
|
||
# settings for stateful data, like file locations and database versions
|
||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||
# this value at the release version of the first install of this system.
|
||
# Before changing this value read the documentation for this option
|
||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||
system.stateVersion = "25.11"; # Did you read the comment?
|
||
}
|