Compare commits

...

2 Commits

Author SHA1 Message Date
8e3ce58551
Add some packages 2024-02-14 16:47:04 +01:00
a31033e026
Add binfmt qemu system emulation 2024-02-14 16:45:47 +01:00
3 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,35 @@
{ pkgs, config, lib, ... }:
let
configForSystem = (system:
let
riscv = [ "riscv32-linux" "riscv64-linux" ];
arm = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" ];
x86 = [ "i686-linux" "x86_64-linux" ];
windows = [ "x86_64-windows" "i686-windows" ];
systems = {
x86_64-linux = riscv ++ arm ++ windows;
aarch64-linux = riscv;
};
in
if (systems ? "${system}") then systems."${system}" else []
);
emulatedSystems = configForSystem "${pkgs.system}";
cfg = config.nixfiles.binfmt;
in
{
options.nixfiles.binfmt = {
enable = lib.mkOption {
description = "Whether to configure default binfmt emulated systems for the current architecture";
type = lib.types.bool;
default = false;
example = true;
};
};
config = lib.mkMerge [
(lib.mkIf (cfg.enable && (builtins.length emulatedSystems) > 0) {
boot.binfmt = {inherit emulatedSystems;};
})
];
}

View File

@ -5,5 +5,6 @@
./nvidia.nix
./opengl.nix
./sound.nix
./binfmt.nix
];
}

View File

@ -17,6 +17,7 @@ in
# Enable system Nix configuration
nix.enable = lib.mkDefault true;
};
nixfiles.binfmt.enable = true;
# locale settings
i18n = {
@ -70,6 +71,7 @@ in
htop
lshw
pciutils
compsize
# nix utilities
nix-du
@ -79,6 +81,9 @@ in
age
pass
sops
# etc
neofetch
];
programs.neovim.defaultEditor = lib.mkDefault true;