fix: reconfigure modules to build successfully on demeter

This commit is contained in:
Youwen Wu 2024-12-23 04:29:01 -08:00
parent ce89f8149e
commit 180741ec71
Signed by: youwen
GPG key ID: 865658ED1FE61EC3
11 changed files with 54 additions and 63 deletions

View file

@ -9,18 +9,11 @@ let
in
{
imports = [
inputs.${cfg.wslName}.nixosModules.default
inputs.nixos-wsl.nixosModules.default
];
options = {
options.liminalOS.wsl = {
enable = lib.mkEnableOption "WSL";
wslName = lib.mkOption {
type = lib.types.str;
default = "nixos-wsl";
description = ''
Name of the NixOS WSL module in your flake inputs. You should define `inputs.nixos-wsl.url = "github:nixos-community/nixos-wsl", and set `liminalOS.wsl.wslName` if you did not call it `nixos-wsl`.
'';
};
};
config.wsl = lib.mkIf cfg.enable {
@ -28,10 +21,4 @@ in
defaultUser = config.liminalOS.username;
useWindowsDriver = true;
};
assertions = [
{
assertion = builtins.hasAttr cfg.wslName inputs;
message = ''You enabled WSL but did not add the WSL module to your flake inputs, or did not set `liminalOS.theming.wslName` to the name of your NixOS WSL input, if it is not `nixos-wsl`. Please set `inputs.nixos-wsl.url = "github:nix-community/nixos-wsl"` or set the wslName option to the name of your WSL flake input.'';
}
];
}