modules(desktop): Add graphical option for containers

xserver is required to make GUI applications run inside containers.
This commit is contained in:
Donovan Glover 2024-05-19 11:18:36 -04:00
parent b5b20c7b19
commit 372811f651
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,8 @@ let
sakayaPort = 39493;
in
{
modules.desktop.graphical = true;
networking.nat.forwardPorts = singleton {
destination = "192.168.100.49:${sakayaPort}";
sourcePort = sakayaPort;

View File

@ -4,7 +4,7 @@ let
inherit (lib) mkEnableOption mkIf mkMerge mkOption;
inherit (lib.types) str float int;
inherit (config.modules.system) username;
inherit (cfg) bloat gnome plasma container theme opacity fontSize;
inherit (cfg) bloat gnome plasma container theme opacity fontSize graphical;
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji;
inherit (builtins) attrValues;
@ -37,6 +37,7 @@ in
gnome = mkEnableOption "GNOME specialization";
plasma = mkEnableOption "Plasma specialization";
container = mkEnableOption "disable some options for container performance";
graphical = mkEnableOption "xserver for graphical containers";
};
config = {
@ -70,7 +71,7 @@ in
mountOnMedia = true;
};
xserver = mkIf (!container) {
xserver = mkIf (!container || graphical) {
enable = true;
excludePackages = [ pkgs.xterm ];
};