feat(home): Disable nixGL

This commit is contained in:
punkfairie 2025-01-06 20:29:08 -08:00
parent fefab6e9f4
commit 86259e05db
No known key found for this signature in database
GPG key ID: B3C5488E9A1A7CA6
4 changed files with 444 additions and 429 deletions

View file

@ -3,7 +3,6 @@
in { in {
marleyos = { marleyos = {
isDesktop = true; isDesktop = true;
nixGL = enabled;
appearance = { appearance = {
base = enabled; base = enabled;

View file

@ -14,7 +14,7 @@ in {
config = mkIf (cfg.enable && hasXorg) { config = mkIf (cfg.enable && hasXorg) {
services.picom = { services.picom = {
enable = true; enable = true;
package = config.lib.nixGL.wrap pkgs.picom; package = mkIf config.marleyos.nixGL.enable (config.lib.nixGL.wrap pkgs.picom);
}; };
# The module config options are a nightmare. # The module config options are a nightmare.

View file

@ -3,8 +3,7 @@
config, config,
pkgs, pkgs,
... ...
}: }: let
let
inherit (lib) mkEnableOption mkIf getExe; inherit (lib) mkEnableOption mkIf getExe;
cfg = config.marleyos.services.polybar; cfg = config.marleyos.services.polybar;
@ -12,16 +11,16 @@ let
xrandr = getExe pkgs.xorg.xrandr; xrandr = getExe pkgs.xorg.xrandr;
grep = getExe pkgs.gnugrep; grep = getExe pkgs.gnugrep;
cut = "${pkgs.coreutils}/bin/cut"; cut = "${pkgs.coreutils}/bin/cut";
in in {
{
options.marleyos.services.polybar.enable = mkEnableOption "polybar"; options.marleyos.services.polybar.enable = mkEnableOption "polybar";
config = mkIf (cfg.enable && hasXorg) { config = mkIf (cfg.enable && hasXorg) {
services.polybar = { services.polybar = {
enable = true; enable = true;
package = config.lib.nixGL.wrap pkgs.polybar; package = mkIf config.marleyos.nixGL.enable (config.lib.nixGL.wrap pkgs.polybar);
script = # bash script =
# bash
'' ''
for m in $(${xrandr} --query | ${grep} " connected" | ${cut} -d" " -f1); do for m in $(${xrandr} --query | ${grep} " connected" | ${cut} -d" " -f1); do
bar="main" bar="main"
@ -36,8 +35,7 @@ in
# colorblock theme from # colorblock theme from
# https://github.com/adi1090x/polybar-themes # https://github.com/adi1090x/polybar-themes
settings = settings = let
let
color = rec { color = rec {
background = "#26232f"; background = "#26232f";
foreground = background; foreground = background;
@ -59,8 +57,7 @@ in
hasRofi = config.marleyos.programs.rofi.enable; hasRofi = config.marleyos.programs.rofi.enable;
cfgHome = config.xdg.configHome; cfgHome = config.xdg.configHome;
in in {
{
# Global Settings - - - - - - - - - - - - - - - - - - - - - - - - - - # Global Settings - - - - - - - - - - - - - - - - - - - - - - - - - -
"settings" = { "settings" = {
screenchange.reload = true; screenchange.reload = true;
@ -99,11 +96,9 @@ in
padding = 0; padding = 0;
module.margin.left = 0; module.margin.left = 0;
module.margin.right = 0; module.margin.right = 0;
font = font = let
let
mkFt = s: "Maple Mono NF:pixelsize=${toString s};4"; mkFt = s: "Maple Mono NF:pixelsize=${toString s};4";
in in [
[
(mkFt 10) (mkFt 10)
(mkFt 15) (mkFt 15)
]; ];
@ -196,7 +191,9 @@ in
"module/title" = { "module/title" = {
type = "internal/xwindow"; type = "internal/xwindow";
format.text = "<label>"; format.text = "<label>";
format.prefix = pref // { format.prefix =
pref
// {
text = ""; text = "";
background = color.shade2; background = color.shade2;
foreground = color.dark; foreground = color.dark;
@ -222,7 +219,9 @@ in
format.online = "<icon-prev><toggle><icon-next><label-song>"; format.online = "<icon-prev><toggle><icon-next><label-song>";
format.offline = { format.offline = {
text = "<label-offline>"; text = "<label-offline>";
prefix = pref // { prefix =
pref
// {
text = ""; text = "";
background = color.shade1; background = color.shade1;
inherit (color) foreground; inherit (color) foreground;
@ -245,18 +244,15 @@ in
padding = 2; padding = 2;
}; };
}; };
icon = icon = let
let mkIcon = i:
mkIcon =
i:
pref pref
// { // {
text = i; text = i;
foreground = color.dark; foreground = color.dark;
background = color.shade1; background = color.shade1;
}; };
in in {
{
play = mkIcon ""; play = mkIcon "";
pause = mkIcon ""; pause = mkIcon "";
stop = ""; stop = "";
@ -286,12 +282,16 @@ in
interval = 30; interval = 30;
fixed.values = true; fixed.values = true;
format = { format = {
mounted = fmt // { mounted =
fmt
// {
text = "<label-mounted>"; text = "<label-mounted>";
prefix.text = ""; prefix.text = "";
background = color.shade2; background = color.shade2;
}; };
unmounted = fmt // { unmounted =
fmt
// {
text = "<label-unmounted>"; text = "<label-unmounted>";
prefix.text = ""; prefix.text = "";
background = color.shade2; background = color.shade2;
@ -306,7 +306,9 @@ in
"module/cpu" = { "module/cpu" = {
type = "internal/cpu"; type = "internal/cpu";
interval = 1; interval = 1;
format = fmt // { format =
fmt
// {
text = "<label>"; text = "<label>";
prefix.text = ""; prefix.text = "";
background = color.shade2; background = color.shade2;
@ -318,7 +320,9 @@ in
"module/memory" = { "module/memory" = {
type = "internal/memory"; type = "internal/memory";
interval = 1; interval = 1;
format = fmt // { format =
fmt
// {
text = "<label>"; text = "<label>";
prefix.text = ""; prefix.text = "";
background = color.shade1; background = color.shade1;
@ -337,7 +341,9 @@ in
background = color.shade2; background = color.shade2;
padding = 2; padding = 2;
}; };
muted = fmt // { muted =
fmt
// {
text = "<label-muted>"; text = "<label-muted>";
prefix.text = ""; prefix.text = "";
background = color.shade2; background = color.shade2;
@ -360,12 +366,16 @@ in
accumulate.stats = true; accumulate.stats = true;
unknown.as.up = true; unknown.as.up = true;
format = { format = {
connected = fmt // { connected =
fmt
// {
text = "<label-connected>"; text = "<label-connected>";
prefix.text = ""; prefix.text = "";
background = color.shade2; background = color.shade2;
}; };
disconnected = fmt // { disconnected =
fmt
// {
text = "<label-disconnected>"; text = "<label-disconnected>";
prefix.text = ""; prefix.text = "";
background = color.shade2; background = color.shade2;
@ -382,7 +392,9 @@ in
interval = 1.0; interval = 1.0;
time.text = " %I:%M %p"; time.text = " %I:%M %p";
time.alt = " %a, %d %b %Y"; time.alt = " %a, %d %b %Y";
format = fmt // { format =
fmt
// {
text = "<label>"; text = "<label>";
prefix.text = ""; prefix.text = "";
background = color.shade1; background = color.shade1;

View file

@ -3,9 +3,9 @@
config, config,
pkgs, pkgs,
... ...
}: }: let
let inherit
inherit (lib) (lib)
mkEnableOption mkEnableOption
mkIf mkIf
concatMapAttrs concatMapAttrs
@ -18,8 +18,7 @@ let
cfg = config.marleyos.xorg.i3; cfg = config.marleyos.xorg.i3;
isGenericLinux = config.targets.genericLinux.enable; isGenericLinux = config.targets.genericLinux.enable;
in in {
{
options.marleyos.xorg.i3.enable = mkEnableOption "i3"; options.marleyos.xorg.i3.enable = mkEnableOption "i3";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -30,7 +29,10 @@ in
picom = enabled; picom = enabled;
polybar = enabled; polybar = enabled;
# broken on non-nixOS # broken on non-nixOS
screen-locker = if isGenericLinux then disabled else enabled; screen-locker =
if isGenericLinux
then disabled
else enabled;
}; };
}; };
@ -41,20 +43,18 @@ in
xsession.windowManager.i3 = { xsession.windowManager.i3 = {
enable = true; enable = true;
package = config.lib.nixGL.wrap pkgs.i3; package = mkIf config.marleyos.nixGL.enable (config.lib.nixGL.wrap pkgs.i3);
extraConfig = "tiling_drag modifier titlebar"; extraConfig = "tiling_drag modifier titlebar";
config = config = let
let
directions = { directions = {
left = "h"; left = "h";
down = "j"; down = "j";
up = "k"; up = "k";
right = "l"; right = "l";
}; };
in in {
{
focus.followMouse = false; focus.followMouse = false;
window.border = 0; window.border = 0;
floating.border = 0; floating.border = 0;
@ -81,11 +81,13 @@ in
modifier = "Mod4"; modifier = "Mod4";
keybindings = keybindings = let
let
mod = config.xsession.windowManager.i3.config.modifier; mod = config.xsession.windowManager.i3.config.modifier;
workspaces = range 1 10; workspaces = range 1 10;
getI = i: if i == 10 then "0" else toString i; getI = i:
if i == 10
then "0"
else toString i;
inherit (config.xdg) configHome; inherit (config.xdg) configHome;
isGenericLinux = config.targets.genericLinux.enable; isGenericLinux = config.targets.genericLinux.enable;
in in
@ -107,11 +109,15 @@ in
"${mod}+q" = "kill"; "${mod}+q" = "kill";
"${mod}+r" = "exec ${configHome}/rofi/launchers/type-1/launcher.sh"; "${mod}+r" = "exec ${configHome}/rofi/launchers/type-1/launcher.sh";
"${mod}+Return" = "exec ${if isGenericLinux then "wezterm" else "${pkgs.wezterm}/bin/wezterm"}"; "${mod}+Return" = "exec ${
if isGenericLinux
then "wezterm"
else "${pkgs.wezterm}/bin/wezterm"
}";
} }
# PulseAudio Volume - - - - - - - - - - - - - - - - - - - - - - - - # PulseAudio Volume - - - - - - - - - - - - - - - - - - - - - - - -
// (concatMapAttrs // (
concatMapAttrs
(key: cmd: { (key: cmd: {
"${key}" = "exec --no-startup-id pactl ${cmd} && killall -SIGUSR1 i3status"; "${key}" = "exec --no-startup-id pactl ${cmd} && killall -SIGUSR1 i3status";
}) })
@ -122,13 +128,12 @@ in
XF86AudioMicMute = "set-source-mute @DEFAULT_SOURCE@ toggle"; XF86AudioMicMute = "set-source-mute @DEFAULT_SOURCE@ toggle";
} }
) )
# Focus & Movement - - - - - - - - - - - - - - - - - - - - - - - - - # Focus & Movement - - - - - - - - - - - - - - - - - - - - - - - - -
// (concatMapAttrs (direction: key: { // (concatMapAttrs (direction: key: {
"${mod}+${key}" = "focus ${direction}"; "${mod}+${key}" = "focus ${direction}";
"${mod}+Shift+${key}" = "move ${direction}"; "${mod}+Shift+${key}" = "move ${direction}";
}) directions) })
directions)
# Switch Workspaces - - - - - - - - - - - - - - - - - - - - - - - - - # Switch Workspaces - - - - - - - - - - - - - - - - - - - - - - - - -
// (listToAttrs ( // (listToAttrs (
(map (i: { (map (i: {
@ -137,7 +142,6 @@ in
})) }))
workspaces workspaces
)) ))
# Move Windows Between Workspaces - - - - - - - - - - - - - - - - - - # Move Windows Between Workspaces - - - - - - - - - - - - - - - - - -
// (listToAttrs ( // (listToAttrs (
(map (i: { (map (i: {
@ -148,8 +152,7 @@ in
)); ));
# Resize Windows - - - - - - - - - - - - - - - - - - - - - - - - - - - # Resize Windows - - - - - - - - - - - - - - - - - - - - - - - - - - -
modes.resize = modes.resize = let
let
mod = config.xsession.windowManager.i3.config.modifier; mod = config.xsession.windowManager.i3.config.modifier;
in in
{ {
@ -157,7 +160,8 @@ in
Escape = "mode default"; Escape = "mode default";
"${mod}+Control+r" = "mode default"; "${mod}+Control+r" = "mode default";
} }
// (concatMapAttrs // (
concatMapAttrs
(key: action: { (key: action: {
"${key}" = "resize ${action} 10 px or 10 ppt"; "${key}" = "resize ${action} 10 px or 10 ppt";
}) })