From 9749ff0442ac55cdb10d50ab152a342762acee41 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 28 Feb 2024 13:31:12 +0000 Subject: [PATCH] sane.gui.phosh: remove --- hosts/modules/gui/default.nix | 1 - hosts/modules/gui/phosh.nix | 159 ---------------------------------- 2 files changed, 160 deletions(-) delete mode 100644 hosts/modules/gui/phosh.nix diff --git a/hosts/modules/gui/default.nix b/hosts/modules/gui/default.nix index 83145545..113fc341 100644 --- a/hosts/modules/gui/default.nix +++ b/hosts/modules/gui/default.nix @@ -10,7 +10,6 @@ in ./gnome.nix ./greetd.nix ./gtk.nix - ./phosh.nix ./sxmo ./theme ]; diff --git a/hosts/modules/gui/phosh.nix b/hosts/modules/gui/phosh.nix deleted file mode 100644 index 5bb3833f..00000000 --- a/hosts/modules/gui/phosh.nix +++ /dev/null @@ -1,159 +0,0 @@ -{ lib, config, pkgs, ... }: - -with lib; -let - cfg = config.sane.gui.phosh; -in -{ - options = { - sane.gui.phosh.enable = mkOption { - default = false; - 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 = mkMerge [ - { - sane.programs.phoshApps = { - packageUnwrapped = null; - suggestedPrograms = [ - "guiApps" - # TODO: see about removing gnome-bluetooth if the in-built gnome-settings bluetooth manager can work - "gnome.gnome-bluetooth" - "gnome.gnome-terminal" - "phosh-mobile-settings" - ]; - }; - } - - (mkIf cfg.enable { - sane.programs.phoshApps.enableFor.user.colin = true; - - # docs: https://github.com/NixOS/nixpkgs/blob/nixos-22.05/nixos/modules/services/x11/desktop-managers/phosh.nix - # docs: - # docs: - services.xserver.desktopManager.phosh = { - enable = true; - user = "colin"; - group = "users"; - phocConfig = { - # xwayland = "true"; - # find default outputs by catting /etc/phosh/phoc.ini - outputs.DSI-1 = { - scale = 1.5; - }; - }; - }; - - # phosh enables `services.gnome.{core-os-services, core-shell}` - # and this in turn enables some default apps we don't really care about. - # see - environment.gnome.excludePackages = with pkgs; [ - # gnome.gnome-menus # unused outside gnome classic, but probably harmless - gnome-tour - ]; - services.dleyna-renderer.enable = false; - services.dleyna-server.enable = false; - services.gnome.gnome-browser-connector.enable = false; - services.gnome.gnome-initial-setup.enable = false; - services.gnome.gnome-online-accounts.enable = false; - services.gnome.gnome-remote-desktop.enable = false; - services.gnome.gnome-user-share.enable = false; - services.gnome.rygel.enable = false; - - # gnome doesn't use mkDefault for these -- unclear why not - services.gnome.evolution-data-server.enable = mkForce false; - services.gnome.gnome-online-miners.enable = mkForce false; - - # XXX: phosh enables networkmanager by default; can probably disable these lines - networking.networkmanager.enable = true; - networking.wireless.enable = lib.mkForce false; - - # XXX: not clear if these are actually needed? - hardware.bluetooth.enable = true; - services.blueman.enable = true; - - hardware.opengl.enable = true; - hardware.opengl.driSupport = true; - - environment.variables = { - # Qt apps won't always start unless this env var is set - QT_QPA_PLATFORM = "wayland"; - # 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"; - }; - - systemd.services.phosh.environment = { - # PHOC_DEBUG: comma-separated list of: - # - ``auto-maximize``: Maximize toplevels - # - ``damage-tracking``: Debug damage tracking - # - ``no-quit``: Don't quit when session ends - # - ``touch-points``: Debug touch points - # - ``layer-shell``: Debug layer shell - # - ``cutouts``: Debug display cutouts and notches - PHOC_DEBUG = "layer-shell"; - # G_DEBUG, G_MESSAGE_DEBUG for glib debugging: - }; - - programs.dconf.packages = [ - # org.kde.konsole.desktop - (pkgs.writeTextFile { - name = "dconf-phosh-settings"; - destination = "/etc/dconf/db/site.d/00_phosh_settings"; - text = '' - [org/gnome/desktop/interface] - show-battery-percentage=true - - [org/gnome/settings-daemon/plugins/power] - sleep-inactive-ac-timeout=5400 - sleep-inactive-battery-timeout=5400 - - [sm/puri/phosh] - favorites=['gpodder.desktop', 'nheko.desktop', 'sublime-music.desktop', 'firefox.desktop', 'org.gnome.Terminal.desktop'] - ''; - }) - ]; - }) - - (mkIf (cfg.enable && cfg.useGreeter) { - services.xserver.enable = true; - # NB: setting defaultSession has the critical side-effect that it lets org.freedesktop.AccountsService - # know that our user exists. this ensures lightdm succeeds when calling /org/freedesktop/AccountsServices ListCachedUsers - # lightdm greeters get the login users from lightdm which gets it from org.freedesktop.Accounts.ListCachedUsers. - # this requires the user we want to login as to be cached. - services.xserver.displayManager.job.preStart = '' - ${pkgs.systemd}/bin/busctl call org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts CacheUser s colin - ''; - # XXX for some reason specifying defaultSession = "sm.puri.Phosh" breaks cross-compiled display-manager startup - # - causes an attempt to load x86-64 glib-2.76.2/lib/libglib-2.0.so.0 - # - likely - # - but i believe some variant of this issue existed even during emulated compilation - # services.xserver.displayManager.defaultSession = "sm.puri.Phosh"; - services.xserver.displayManager.lightdm.extraSeatDefaults = '' - user-session = phosh - ''; - # services.xserver.displayManager.lightdm.greeters.gtk.enable = false; # gtk greeter overrides our own? - # services.xserver.displayManager.lightdm.greeter = { - # enable = true; - # package = pkgs.lightdm-mobile-greeter.xgreeters; - # name = "lightdm-mobile-greeter"; - # }; - # # services.xserver.displayManager.lightdm.enable = true; - - services.xserver.displayManager.lightdm.enable = true; - services.xserver.displayManager.lightdm.greeters.mobile.enable = true; - - systemd.services.phosh.wantedBy = lib.mkForce []; # disable auto-start - }) - ]; -}