mirror of
https://github.com/youwen5/liminalOS.git
synced 2025-06-19 21:49:52 -07:00
refactor: modularize theming
This commit is contained in:
parent
ddfcbd78c8
commit
4c72a5cb8b
5 changed files with 102 additions and 53 deletions
|
@ -8,17 +8,17 @@ let
|
|||
cfg = config.liminalOS.wsl;
|
||||
in
|
||||
{
|
||||
imports = lib.mkIf cfg.enable [
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
imports = [
|
||||
inputs.${cfg.wslName}.nixosModules.default
|
||||
];
|
||||
|
||||
options = {
|
||||
enable = lib.mkEnableOption "wsl";
|
||||
module = lib.mkOption {
|
||||
type = lib.types.submodule;
|
||||
default = inputs.nixos-wsl.nixosModules.default;
|
||||
enable = lib.mkEnableOption "WSL";
|
||||
wslName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "nixos-wsl";
|
||||
description = ''
|
||||
NixOS WSL module. Defaults to <https://github.com/nix-community/NixOS-WSL>
|
||||
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`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -28,4 +28,10 @@ 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.'';
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue