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 {
marleyos = {
isDesktop = true;
nixGL = enabled;
appearance = {
base = enabled;

View file

@ -14,7 +14,7 @@ in {
config = mkIf (cfg.enable && hasXorg) {
services.picom = {
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.

View file

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

View file

@ -3,9 +3,9 @@
config,
pkgs,
...
}:
let
inherit (lib)
}: let
inherit
(lib)
mkEnableOption
mkIf
concatMapAttrs
@ -18,8 +18,7 @@ let
cfg = config.marleyos.xorg.i3;
isGenericLinux = config.targets.genericLinux.enable;
in
{
in {
options.marleyos.xorg.i3.enable = mkEnableOption "i3";
config = mkIf cfg.enable {
@ -30,7 +29,10 @@ in
picom = enabled;
polybar = enabled;
# 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 = {
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";
config =
let
config = let
directions = {
left = "h";
down = "j";
up = "k";
right = "l";
};
in
{
in {
focus.followMouse = false;
window.border = 0;
floating.border = 0;
@ -68,24 +68,26 @@ in
top = 50;
};
bars = [ ];
bars = [];
# Startup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
startup = with pkgs; [
{ command = "${getExe feh} --no-fehbg --bg-fill ${./bg.jpg}"; }
{ command = "${getExe networkmanagerapplet}"; }
{command = "${getExe feh} --no-fehbg --bg-fill ${./bg.jpg}";}
{command = "${getExe networkmanagerapplet}";}
];
# Keybindings - - - - - - - - - - - - - - - - - - - - - - - - - - - -
modifier = "Mod4";
keybindings =
let
keybindings = let
mod = config.xsession.windowManager.i3.config.modifier;
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;
isGenericLinux = config.targets.genericLinux.enable;
in
@ -107,11 +109,15 @@ in
"${mod}+q" = "kill";
"${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 - - - - - - - - - - - - - - - - - - - - - - - -
// (concatMapAttrs
// (
concatMapAttrs
(key: cmd: {
"${key}" = "exec --no-startup-id pactl ${cmd} && killall -SIGUSR1 i3status";
})
@ -122,13 +128,12 @@ in
XF86AudioMicMute = "set-source-mute @DEFAULT_SOURCE@ toggle";
}
)
# Focus & Movement - - - - - - - - - - - - - - - - - - - - - - - - -
// (concatMapAttrs (direction: key: {
"${mod}+${key}" = "focus ${direction}";
"${mod}+Shift+${key}" = "move ${direction}";
}) directions)
})
directions)
# Switch Workspaces - - - - - - - - - - - - - - - - - - - - - - - - -
// (listToAttrs (
(map (i: {
@ -137,7 +142,6 @@ in
}))
workspaces
))
# Move Windows Between Workspaces - - - - - - - - - - - - - - - - - -
// (listToAttrs (
(map (i: {
@ -148,8 +152,7 @@ in
));
# Resize Windows - - - - - - - - - - - - - - - - - - - - - - - - - - -
modes.resize =
let
modes.resize = let
mod = config.xsession.windowManager.i3.config.modifier;
in
{
@ -157,7 +160,8 @@ in
Escape = "mode default";
"${mod}+Control+r" = "mode default";
}
// (concatMapAttrs
// (
concatMapAttrs
(key: action: {
"${key}" = "resize ${action} 10 px or 10 ppt";
})