diff --git a/modules/wsl-conf.nix b/modules/wsl-conf.nix index 66cd259d..ba17338a 100644 --- a/modules/wsl-conf.nix +++ b/modules/wsl-conf.nix @@ -87,11 +87,19 @@ with lib; { description = "Which user to start commands in this WSL distro as"; }; }; + extraOptions = mkOption { + type = attrsOf (attrsOf (oneOf [ str int bool ])); + default = {}; + description = "Extra configuration values to be added to wsl.conf"; + }; }; config = mkIf config.wsl.enable { - environment.etc."wsl.conf".text = generators.toINI { } config.wsl.wslConf; + environment.etc."wsl.conf".text = generators.toINI { } ( + (removeAttrs config.wsl.wslConf [ "extraOptions" ]) + // config.wsl.wslConf.extraOptions + ); warnings = optional (config.wsl.wslConf.boot.systemd && !config.wsl.nativeSystemd) "systemd is enabled in wsl.conf, but wsl.nativeSystemd is not enabled. Unless you did this on purpose, this WILL make your system UNBOOTABLE!"