From 71f3be8d2d1dfd43d80ce376e97e9578b792edbc Mon Sep 17 00:00:00 2001 From: chn Date: Mon, 4 Mar 2024 18:29:39 +0800 Subject: [PATCH] services.xrdp: fix --- flake.nix | 2 -- modules/services/xrdp.nix | 9 ++++++++- modules/system/envfs.nix | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 19afcfed..df1cb848 100644 --- a/flake.nix +++ b/flake.nix @@ -104,8 +104,6 @@ }) ./modules ./devices/${system} - # TODO: enable xrdp in next release - (moduleInputs: { config.nixos.services.xrdp.enable = moduleInputs.lib.mkForce false; }) ]; }; }) diff --git a/modules/services/xrdp.nix b/modules/services/xrdp.nix index f2c11271..8ccb9d24 100644 --- a/modules/services/xrdp.nix +++ b/modules/services/xrdp.nix @@ -12,13 +12,20 @@ inputs: inherit (inputs.config.nixos.services) xrdp; 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 = { enable = true; port = xrdp.port; openFirewall = true; - defaultWindowManager = "startplasma-x11"; + defaultWindowManager = "${inputs.pkgs.plasma-workspace}/bin/startplasma-x11"; }; } ( diff --git a/modules/system/envfs.nix b/modules/system/envfs.nix index add9ff4a..8abf9b8b 100644 --- a/modules/system/envfs.nix +++ b/modules/system/envfs.nix @@ -2,11 +2,11 @@ inputs: { 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) { environment.variables.ENVFS_RESOLVE_ALWAYS = "1"; } - ]; + ]); }