nix-files/hosts/modules/gui/sxmo.nix

116 lines
3.1 KiB
Nix
Raw Normal View History

2023-05-16 11:09:57 +00:00
# this work derives from noneucat's sxmo service/packages, found via NUR
# - <repo:nix-community/nur-combined:repos/noneucat/modules/pinephone/sxmo.nix>
#
# sxmo documentation:
# - <repo:anjan/sxmo-docs-next>
#
# sxmo technical overview:
# - inputs
# - dwm: handles vol/power buttons; hardcoded in config.h
# - lisgd: handles gestures
# - startup
# - daemon based (lisgsd, idle_locker, statusbar_periodics)
# - auto-started at login
# - managable by `sxmo_daemons.sh`
# - list available daemons: `sxmo_daemons.sh list`
# - query if a daemon is active: `sxmo_daemons.sh running <my-daemon>`
# - start daemon: `sxmo_daemons.sh start <my-daemon>`
# - user hooks:
# - live in ~/.config/sxmo/hooks/
# - logs:
# - live in ~/.local/state/sxmo.log
# - `journalctl --user --boot` (lightm redirects the sxmo session stdout => systemd)
#
# - default components:
# - DE: sway (if wayland), dwm (if X)
# - menus: bemenu (if wayland), dmenu (if X)
# - gestures: lisgd
# - on-screen keyboard: wvkbd (if wayland), svkbd (if X)
#
2023-05-16 11:09:57 +00:00
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.sane.gui.phosh;
in
{
options = {
sane.gui.sxmo.enable = mkOption {
default = false;
type = types.bool;
};
};
config = mkMerge [
{
sane.programs.sxmoApps = {
package = null;
suggestedPrograms = [
"guiApps"
];
};
}
(mkIf config.sane.gui.sxmo.enable {
sane.programs.sxmoApps.enableFor.user.colin = true;
# TODO: probably need to enable pipewire
networking.useDHCP = false;
networking.networkmanager.enable = true;
networking.wireless.enable = lib.mkForce false;
hardware.bluetooth.enable = true;
services.blueman.enable = true;
# sxmo internally uses doas instead of sudo
security.doas.enable = true;
security.doas.wheelNeedsPassword = false;
# services.xserver.windowManager.session = [{
# name = "sxmo";
# desktopNames = [ "sxmo" ];
# start = ''
# ${pkgs.sxmo-utils}/bin/sxmo_xinit.sh &
# waitPID=$!
# '';
# }];
# services.xserver.enable = true;
# services.greetd = {
# enable = true;
# settings = {
# default_session = {
# command = "${pkgs.sxmo-utils}/bin/sxmo_winit.sh";
# user = "colin";
# };
# };
# };
services.xserver.enable = true;
services.xserver.displayManager.lightdm.enable = true;
services.xserver.displayManager.lightdm.greeters.gtk.enable = true;
services.xserver.displayManager.lightdm.extraSeatDefaults = ''
user-session = swmo
'';
services.xserver.displayManager.sessionPackages = [ pkgs.sxmo-utils ];
environment.systemPackages = with pkgs; [
bemenu
gojq
inotify-tools
libnotify
lisgd
superd
sway
sxmo-utils
xdg-user-dirs
];
environment.sessionVariables.XDG_DATA_DIRS = [
# TODO: only need the share/sxmo directly linked
"${pkgs.sxmo-utils}/share"
];
2023-05-16 11:09:57 +00:00
})
];
}