meta: Move phosh config to specialization

This is part of attempting to use Hyprland over Phosh (again) for
more control over things.
This commit is contained in:
Donovan Glover 2024-07-14 16:54:23 -04:00
parent 6d9149dbab
commit 051c903154
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
3 changed files with 65 additions and 51 deletions

View File

@ -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;

View File

@ -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;

60
specializations/phosh.nix Normal file
View File

@ -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;
}
'';
};
};
}