From d092c5f41691c5b5861691b63705442b1ab757fe Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Thu, 18 Jul 2024 15:46:25 -0400 Subject: [PATCH] meta: Migrate phosh settings to phone config Currently there are too many serious issues to realistically use Hyprland on the PinePhone, and Phosh supports most of the features we need out of the box anyway, so it makes sense to use that full-time over trying to make something else work. --- hosts/phone/configuration.nix | 50 +++++++++++++++++++++++++++++- specializations/phosh.nix | 57 ----------------------------------- 2 files changed, 49 insertions(+), 58 deletions(-) delete mode 100644 specializations/phosh.nix diff --git a/hosts/phone/configuration.nix b/hosts/phone/configuration.nix index 0b37c04e..7588b1d9 100644 --- a/hosts/phone/configuration.nix +++ b/hosts/phone/configuration.nix @@ -1,9 +1,14 @@ -{ self, pkgs, lib, ... }: +{ self, pkgs, config, lib, ... }: let inherit (lib) mkForce; inherit (lib.gvariant) mkTuple; + inherit (config.modules.system) username; inherit (builtins) attrValues; + + getColorCh = colorName: channel: config.lib.stylix.colors."${colorName}-rgb-${channel}"; + rgba = color: transparency: ''rgba(${getColorCh color "r"}, ${getColorCh color "g"}, ${getColorCh color "b"}, ${transparency})''; + bg = ''linear-gradient(${rgba "base00" "0.7"}, ${rgba "base00" "0.7"})''; in { imports = attrValues self.nixosModules; @@ -67,6 +72,31 @@ in }; }; }; + + background = { + stylix.targets.gtk.extraCss = /* css */ '' + phosh-lockscreen { + background: ${bg}, url('file:///home/${username}/wall-lock.jpg'); + } + + phosh-app-grid { + background: ${bg}, url('file:///home/${username}/wall-grid.jpg'); + } + + phosh-top-panel { + background: ${bg}, url('file:///home/${username}/wall-panel.jpg'); + } + + phosh-home { + background: ${bg}, url('file:///home/${username}/wall-home.jpg'); + } + + phosh-lockscreen, phosh-app-grid, phosh-top-panel, phosh-home { + background-size: cover; + background-position: center; + } + ''; + }; }; environment.systemPackages = attrValues { @@ -107,10 +137,13 @@ in hardware.keyboardBinds = true; }; + i18n.inputMethod.enable = mkForce false; + programs = { calls.enable = true; cdemu.enable = mkForce false; + hyprland.enable = mkForce false; }; @@ -122,10 +155,25 @@ in }; services = { + xserver = { + displayManager.lightdm.enable = false; + + desktopManager.phosh = { + enable = true; + group = "users"; + user = username; + + phocConfig = { + xwayland = "immediate"; + }; + }; + }; + openssh.enable = true; udisks2.enable = mkForce false; pipewire.enable = mkForce false; + greetd.enable = mkForce false; }; boot = { diff --git a/specializations/phosh.nix b/specializations/phosh.nix deleted file mode 100644 index 8070c7bf..00000000 --- a/specializations/phosh.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ config, lib, ... }: - -let - inherit (lib) mkForce; - inherit (config.modules.system) username; - inherit (builtins) attrValues; - - getColorCh = colorName: channel: config.lib.stylix.colors."${colorName}-rgb-${channel}"; - rgba = color: transparency: ''rgba(${getColorCh color "r"}, ${getColorCh color "g"}, ${getColorCh color "b"}, ${transparency})''; - bg = ''linear-gradient(${rgba "base00" "0.7"}, ${rgba "base00" "0.7"})''; -in -{ - programs.hyprland.enable = mkForce false; - i18n.inputMethod.enable = mkForce false; - services.greetd.enable = mkForce false; - - services.xserver = { - displayManager.lightdm.enable = false; - - desktopManager.phosh = { - enable = true; - group = "users"; - user = username; - - phocConfig = { - xwayland = "immediate"; - }; - }; - }; - - home-manager.sharedModules = attrValues { - background = { - stylix.targets.gtk.extraCss = /* css */ '' - phosh-lockscreen { - background: ${bg}, url('file:///home/${username}/wall-lock.jpg'); - } - - phosh-app-grid { - background: ${bg}, url('file:///home/${username}/wall-grid.jpg'); - } - - phosh-top-panel { - background: ${bg}, url('file:///home/${username}/wall-panel.jpg'); - } - - phosh-home { - background: ${bg}, url('file:///home/${username}/wall-home.jpg'); - } - - phosh-lockscreen, phosh-app-grid, phosh-top-panel, phosh-home { - background-size: cover; - background-position: center; - } - ''; - }; - }; -}