wsl: enable binfmt
This commit is contained in:
parent
211d9edaaa
commit
89f7debf17
@ -2,7 +2,12 @@
|
|||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
networking.hostName = "nixos-wsl";
|
networking.hostName = "nixos-wsl";
|
||||||
nixfiles.profile.base.enable = true;
|
|
||||||
|
nixfiles = {
|
||||||
|
profile.base.enable = true;
|
||||||
|
binfmt.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
networking.networkmanager.enable = false;
|
networking.networkmanager.enable = false;
|
||||||
programs.gnupg.agent = {
|
programs.gnupg.agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
{ pkgs, config, lib, options, ... }:
|
||||||
let
|
let
|
||||||
|
|
||||||
configForSystem = (system:
|
configForSystem = (system:
|
||||||
@ -27,9 +27,16 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkMerge [
|
config = let
|
||||||
(lib.mkIf (cfg.enable && (builtins.length emulatedSystems) > 0) {
|
enable = cfg.enable && (builtins.length emulatedSystems) > 0;
|
||||||
|
in lib.mkMerge [
|
||||||
|
(lib.mkIf enable {
|
||||||
boot.binfmt = {inherit emulatedSystems;};
|
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