From 051c903154c4390118432a901bd60d37b7df4a8e Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sun, 14 Jul 2024 16:54:23 -0400 Subject: [PATCH] meta: Move phosh config to specialization This is part of attempting to use Hyprland over Phosh (again) for more control over things. --- hosts/phone/configuration.nix | 35 +------------------- modules/desktop.nix | 21 +++--------- specializations/phosh.nix | 60 +++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 51 deletions(-) create mode 100644 specializations/phosh.nix diff --git a/hosts/phone/configuration.nix b/hosts/phone/configuration.nix index 73273ff6..bceeb83f 100644 --- a/hosts/phone/configuration.nix +++ b/hosts/phone/configuration.nix @@ -1,11 +1,7 @@ -{ self, pkgs, lib, config, ... }: +{ self, pkgs, lib, ... }: let inherit (builtins) attrValues; - - transparency = "0.7"; - getColorCh = colorName: channel: config.lib.stylix.colors."${colorName}-rgb-${channel}"; - rgba = color: ''rgba(${getColorCh color "r"}, ${getColorCh color "g"}, ${getColorCh color "b"}, ${transparency})''; in { imports = attrValues self.nixosModules; @@ -28,34 +24,6 @@ in xdg-user-dirs xresources ; - - background = { - stylix.targets.gtk.extraCss = /* css */ '' - phosh-lockscreen, .phosh-lockshield { - background-image: linear-gradient(${rgba "base00"}, ${rgba "base00"}), url('file:///home/user/wall-lock.jpg'); - background-size: cover; - background-position: center; - } - - phosh-app-grid { - background-image: linear-gradient(${rgba "base00"}, ${rgba "base00"}), url('file:///home/user/wall-grid.jpg'); - background-size: cover; - background-position: center; - } - - phosh-top-panel { - background-image: linear-gradient(${rgba "base00"}, ${rgba "base00"}), url('file:///home/user/wall-panel.jpg'); - background-size: cover; - background-position: center; - } - - phosh-home { - background-image: linear-gradient(${rgba "base00"}, ${rgba "base00"}), url('file:///home/user/wall-home.jpg'); - background-size: cover; - background-position: center; - } - ''; - }; }; environment.systemPackages = attrValues { @@ -73,7 +41,6 @@ in desktop = { phone = true; - phosh = true; }; hardware.keyboardBinds = true; diff --git a/modules/desktop.nix b/modules/desktop.nix index 110b6b20..0b63aa44 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -4,7 +4,7 @@ let inherit (lib) mkEnableOption mkIf mkMerge mkOption; inherit (lib.types) float int; inherit (config.modules.system) username; - inherit (cfg) bloat gnome plasma container opacity fontSize graphical phone phosh; + inherit (cfg) bloat gnome plasma container opacity fontSize graphical phone; inherit (nix-config.packages.${pkgs.system}) aleo-fonts; inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji; inherit (builtins) attrValues; @@ -34,7 +34,6 @@ in plasma = mkEnableOption "Plasma specialization"; container = mkEnableOption "disable some options for container performance"; graphical = mkEnableOption "xserver for graphical containers"; - phosh = mkEnableOption "use phosh instead of hyprland"; }; config = { @@ -53,7 +52,7 @@ in }; }; - i18n.inputMethod = mkIf (!phosh) { + i18n.inputMethod = { enabled = "fcitx5"; fcitx5 = { @@ -71,21 +70,9 @@ in xserver = mkIf (!container || graphical) { enable = true; excludePackages = [ pkgs.xterm ]; - - displayManager.lightdm.enable = mkIf phosh false; - - desktopManager.phosh = mkIf phosh { - enable = true; - group = "users"; - user = username; - - phocConfig = { - xwayland = "immediate"; - }; - }; }; - pipewire = mkIf (!phosh) { + pipewire = mkIf (!phone) { enable = true; alsa = { @@ -96,7 +83,7 @@ in pulse.enable = true; }; - greetd = mkIf (!container && !phosh) { + greetd = mkIf (!container) { enable = true; restart = false; diff --git a/specializations/phosh.nix b/specializations/phosh.nix new file mode 100644 index 00000000..b3c1b191 --- /dev/null +++ b/specializations/phosh.nix @@ -0,0 +1,60 @@ +{ config, lib, ... }: + +let + inherit (lib) mkForce; + inherit (config.modules.system) username; + inherit (builtins) attrValues; + + transparency = "0.7"; + getColorCh = colorName: channel: config.lib.stylix.colors."${colorName}-rgb-${channel}"; + rgba = color: ''rgba(${getColorCh color "r"}, ${getColorCh color "g"}, ${getColorCh color "b"}, ${transparency})''; +in +{ + programs.hyprland.enable = mkForce false; + i18n.inputMethod.enabled = mkForce null; + services.greetd.enable = mkForce false; + + 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, .phosh-lockshield { + background-image: linear-gradient(${rgba "base00"}, ${rgba "base00"}), url('file:///home/${username}/wall-lock.jpg'); + background-size: cover; + background-position: center; + } + + phosh-app-grid { + background-image: linear-gradient(${rgba "base00"}, ${rgba "base00"}), url('file:///home/${username}/wall-grid.jpg'); + background-size: cover; + background-position: center; + } + + phosh-top-panel { + background-image: linear-gradient(${rgba "base00"}, ${rgba "base00"}), url('file:///home/${username}/wall-panel.jpg'); + background-size: cover; + background-position: center; + } + + phosh-home { + background-image: linear-gradient(${rgba "base00"}, ${rgba "base00"}), url('file:///home/${username}/wall-home.jpg'); + background-size: cover; + background-position: center; + } + ''; + }; + }; +}