wsl: enable binfmt
This commit is contained in:
parent
211d9edaaa
commit
89f7debf17
@ -2,7 +2,12 @@
|
||||
{
|
||||
config = {
|
||||
networking.hostName = "nixos-wsl";
|
||||
nixfiles.profile.base.enable = true;
|
||||
|
||||
nixfiles = {
|
||||
profile.base.enable = true;
|
||||
binfmt.enable = true;
|
||||
};
|
||||
|
||||
networking.networkmanager.enable = false;
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
{ pkgs, config, lib, options, ... }:
|
||||
let
|
||||
|
||||
configForSystem = (system:
|
||||
@ -27,9 +27,16 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (cfg.enable && (builtins.length emulatedSystems) > 0) {
|
||||
config = let
|
||||
enable = cfg.enable && (builtins.length emulatedSystems) > 0;
|
||||
in lib.mkMerge [
|
||||
(lib.mkIf enable {
|
||||
boot.binfmt = {inherit emulatedSystems;};
|
||||
})
|
||||
|
||||
# keep Windows binfmt registration on wsl
|
||||
(lib.mkIf (cfg.enable && lib.hasAttrByPath [ "wsl" "interop" "register" ] options) {
|
||||
wsl.interop.register = lib.mkDefault true;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user