services.xrdp: fix

This commit is contained in:
陈浩南 2024-03-01 18:49:14 +08:00
parent d54404d5bc
commit d622d85546
3 changed files with 12 additions and 4 deletions

View File

@ -135,6 +135,7 @@ inputs:
};
gamemode = { enable = true; drmDevice = 0; };
slurm = { enable = true; cpu = { cores = 16; threads = 2; }; memoryMB = 94208; gpus."4060" = 1; };
xrdp = { enable = true; hostname = [ "pc.chn.moe" ]; };
};
bugs = [ "xmunet" "backlight" "amdpstate" ];
};

View File

@ -1583,11 +1583,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1709005833,
"narHash": "sha256-Hr/SbEI2rI+ltnEseIGnJjjP5RroIlTZRC0QDYC5VgM=",
"lastModified": 1709289954,
"narHash": "sha256-3QRSwG/saKRLw7kn/4hOyae5OBtVWxcicoXs30b+BvA=",
"owner": "CHN-beta",
"repo": "nixpkgs",
"rev": "5e87b7d99f8a2d7837966306ea9d1b42d8fabded",
"rev": "b11a94c935ea08f149a58352901f810263f082d1",
"type": "github"
},
"original": {

View File

@ -5,6 +5,7 @@ inputs:
enable = mkOption { type = types.bool; default = false; };
port = mkOption { type = types.ints.unsigned; default = 3389; };
hostname = mkOption { type = types.nullOr (types.nonEmptyListOf types.nonEmptyStr); default = null; };
optimizeForNvidia = mkOption { type = types.bool; default = inputs.config.nixos.hardware.gpu.type == "nvidia"; };
};
config =
let
@ -14,7 +15,13 @@ inputs:
[
{
services.xrdp =
{ enable = true; port = xrdp.port; openFirewall = true; defaultWindowManager = "startplasma-x11"; };
{
enable = true;
package = inputs.pkgs.xrdp.override { inherit (xrdp) optimizeForNvidia; };
port = xrdp.port;
openFirewall = true;
defaultWindowManager = "startplasma-x11";
};
}
(
mkIf (xrdp.hostname != null)