services.xrdp: fix

This commit is contained in:
陈浩南 2024-03-04 18:29:39 +08:00
parent f312b3f53f
commit 71f3be8d2d
3 changed files with 11 additions and 6 deletions

View File

@ -104,8 +104,6 @@
}) })
./modules ./modules
./devices/${system} ./devices/${system}
# TODO: enable xrdp in next release
(moduleInputs: { config.nixos.services.xrdp.enable = moduleInputs.lib.mkForce false; })
]; ];
}; };
}) })

View File

@ -12,13 +12,20 @@ inputs:
inherit (inputs.config.nixos.services) xrdp; inherit (inputs.config.nixos.services) xrdp;
in mkIf xrdp.enable (mkMerge in mkIf xrdp.enable (mkMerge
[ [
{
assertions =
[{
assertion = !inputs.config.nixos.system.envfs.enable;
message = "Somehow xrdp could not start if envfs is enabled";
}];
}
{ {
services.xrdp = services.xrdp =
{ {
enable = true; enable = true;
port = xrdp.port; port = xrdp.port;
openFirewall = true; openFirewall = true;
defaultWindowManager = "startplasma-x11"; defaultWindowManager = "${inputs.pkgs.plasma-workspace}/bin/startplasma-x11";
}; };
} }
( (

View File

@ -2,11 +2,11 @@ inputs:
{ {
options.nixos.system.envfs = let inherit (inputs.lib) mkOption types; in options.nixos.system.envfs = let inherit (inputs.lib) mkOption types; in
{ {
enable = mkOption { type = types.bool; default = true; }; enable = mkOption { type = types.bool; default = false; };
}; };
config = inputs.lib.mkMerge config = inputs.lib.mkIf inputs.config.nixos.system.envfs.enable (inputs.lib.mkMerge
[ [
(builtins.elemAt inputs.topInputs.envfs.nixosModules.envfs.imports 0 inputs) (builtins.elemAt inputs.topInputs.envfs.nixosModules.envfs.imports 0 inputs)
{ environment.variables.ENVFS_RESOLVE_ALWAYS = "1"; } { environment.variables.ENVFS_RESOLVE_ALWAYS = "1"; }
]; ]);
} }