Skip to content

Commit

Permalink
wslConf: introduce extraOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbr committed Oct 4, 2024
1 parent acb21a7 commit 2722456
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/wsl-conf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down

0 comments on commit 2722456

Please sign in to comment.