make emulation a module

This commit is contained in:
Osman Faruk Bayram 2025-02-11 22:16:56 +03:00
parent 93b8218e46
commit a3fa8203db
4 changed files with 24 additions and 5 deletions

View file

@ -18,10 +18,9 @@
blockBluesky = false; blockBluesky = false;
enableKDE = true; enableKDE = true;
enableTailscale = true; enableTailscale = true;
enableAarch64Emulation = true;
}; };
boot.binfmt.emulatedSystems = ["aarch64-linux"];
nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;

View file

@ -20,6 +20,7 @@
enableTailscale = true; enableTailscale = true;
# jellyfin is unnecessary for now # jellyfin is unnecessary for now
enableJellyfin = true; enableJellyfin = true;
enableAarch64Emulation = true;
}; };
# Bootloader. # Bootloader.
@ -148,8 +149,5 @@
acceleration = "cuda"; acceleration = "cuda";
}; };
boot.binfmt.emulatedSystems = ["aarch64-linux"];
nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
system.stateVersion = "25.05"; # great taboo of the nixos world system.stateVersion = "25.05"; # great taboo of the nixos world
} }

View file

@ -3,6 +3,7 @@
./arduino.nix ./arduino.nix
./common-packages.nix ./common-packages.nix
./concentration.nix ./concentration.nix
./emulation.nix
./firefox.nix ./firefox.nix
./fonts.nix ./fonts.nix
./graphical-interface.nix ./graphical-interface.nix

21
modules/emulation.nix Normal file
View file

@ -0,0 +1,21 @@
{
pkgs,
lib,
config,
...
}: {
options = {
myModules.enableAarch64Emulation = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable Aarch64 emulation";
};
};
config = lib.mkMerge [
(lib.mkIf config.myModules.enableAarch64Emulation {
boot.binfmt.emulatedSystems = ["aarch64-linux"];
nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
})
];
}