phosh: try using the lightdm greeter

This commit is contained in:
colin 2022-10-19 05:18:13 -07:00
parent a2856a3601
commit 3e7c112548

View File

@ -10,60 +10,74 @@ in
default = false; default = false;
type = types.bool; type = types.bool;
}; };
sane.gui.phosh.useGreeter = mkOption {
description = ''
launch phosh via a greeter (like lightdm-mobile-greeter).
phosh is usable without a greeter, but skipping the greeter means no PAM session.
'';
default = true;
type = types.bool;
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable (mkMerge [
sane.gui.enable = true; {
sane.gui.enable = true;
users.users.avahi.uid = config.sane.allocations.avahi-uid; users.users.avahi.uid = config.sane.allocations.avahi-uid;
users.users.colord.uid = config.sane.allocations.colord-uid; users.users.colord.uid = config.sane.allocations.colord-uid;
users.users.geoclue.uid = config.sane.allocations.geoclue-uid; users.users.geoclue.uid = config.sane.allocations.geoclue-uid;
users.users.rtkit.uid = config.sane.allocations.rtkit-uid; users.users.rtkit.uid = config.sane.allocations.rtkit-uid;
users.groups.avahi.gid = config.sane.allocations.avahi-gid; users.groups.avahi.gid = config.sane.allocations.avahi-gid;
users.groups.colord.gid = config.sane.allocations.colord-gid; users.groups.colord.gid = config.sane.allocations.colord-gid;
users.groups.geoclue.gid = config.sane.allocations.geoclue-gid; users.groups.geoclue.gid = config.sane.allocations.geoclue-gid;
users.groups.rtkit.gid = config.sane.allocations.rtkit-gid; users.groups.rtkit.gid = config.sane.allocations.rtkit-gid;
# docs: https://github.com/NixOS/nixpkgs/blob/nixos-22.05/nixos/modules/services/x11/desktop-managers/phosh.nix # docs: https://github.com/NixOS/nixpkgs/blob/nixos-22.05/nixos/modules/services/x11/desktop-managers/phosh.nix
services.xserver.desktopManager.phosh = { services.xserver.desktopManager.phosh = {
enable = true; enable = true;
user = "colin"; user = "colin";
group = "users"; group = "users";
phocConfig = { phocConfig = {
# xwayland = "true"; # xwayland = "true";
# find default outputs by catting /etc/phosh/phoc.ini # find default outputs by catting /etc/phosh/phoc.ini
outputs.DSI-1 = { outputs.DSI-1 = {
scale = 1.5; scale = 1.5;
};
}; };
}; };
};
# XXX: phosh enables networkmanager by default; can probably disable these lines # XXX: phosh enables networkmanager by default; can probably disable these lines
networking.useDHCP = false; networking.useDHCP = false;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.wireless.enable = lib.mkForce false; networking.wireless.enable = lib.mkForce false;
# XXX: not clear if these are actually needed? # XXX: not clear if these are actually needed?
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
services.blueman.enable = true; services.blueman.enable = true;
hardware.opengl.enable = true; hardware.opengl.enable = true;
hardware.opengl.driSupport = true; hardware.opengl.driSupport = true;
environment.variables = { environment.variables = {
# Qt apps won't always start unless this env var is set # Qt apps won't always start unless this env var is set
QT_QPA_PLATFORM = "wayland"; QT_QPA_PLATFORM = "wayland";
# electron apps (e.g. Element) should use the wayland backend # electron apps (e.g. Element) should use the wayland backend
# toggle this to have electron apps (e.g. Element) 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 # phocConfig.xwayland should be disabled if you do this
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";
}; };
sane.home-manager.extraPackages = with pkgs; [ sane.home-manager.extraPackages = with pkgs; [
phosh-mobile-settings phosh-mobile-settings
# TODO: see about removing this if the in-built gnome-settings bluetooth manager can work # TODO: see about removing this if the in-built gnome-settings bluetooth manager can work
gnome.gnome-bluetooth gnome.gnome-bluetooth
]; ];
}; }
(mkIf cfg.useGreeter {
services.xserver.enable = true;
services.xserver.displayManager.lightdm.enable = true;
})
]);
} }