2022-06-07 00:39:40 +00:00
|
|
|
{ lib, config, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.colinsane.gui.phosh;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
colinsane.gui.phosh.enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-06-09 21:50:24 +00:00
|
|
|
colinsane.gui.enable = true;
|
2022-06-07 00:39:40 +00:00
|
|
|
# docs: https://github.com/NixOS/nixpkgs/blob/nixos-22.05/nixos/modules/services/x11/desktop-managers/phosh.nix
|
|
|
|
services.xserver.desktopManager.phosh = {
|
|
|
|
enable = true;
|
|
|
|
user = "colin";
|
|
|
|
group = "users";
|
|
|
|
phocConfig = {
|
2022-06-07 01:10:19 +00:00
|
|
|
# xwayland = "true";
|
2022-06-07 00:39:40 +00:00
|
|
|
# find default outputs by catting /etc/phosh/phoc.ini
|
|
|
|
outputs.DSI-1 = {
|
|
|
|
scale = 1.5;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-06-07 01:10:19 +00:00
|
|
|
hardware.opengl.enable = true;
|
|
|
|
hardware.opengl.driSupport = true;
|
|
|
|
|
2022-06-07 00:39:40 +00:00
|
|
|
environment.variables = {
|
|
|
|
# Qt apps won't always start unless this env var is set
|
|
|
|
QT_QPA_PLATFORM = "wayland";
|
2022-06-07 01:10:19 +00:00
|
|
|
# electron apps (e.g. Element) should use the wayland backend
|
|
|
|
# toggle this to have electron apps (e.g. Element) use the wayland backend.
|
|
|
|
# phocConfig.xwayland should be disabled if you do this
|
|
|
|
NIXOS_OZONE_WL = "1";
|
2022-06-07 00:39:40 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|