This commit is contained in:
Leonardo Eugênio 2025-02-21 00:28:03 -03:00
parent 321cb97502
commit 87167a660f
15 changed files with 233 additions and 232 deletions

View file

@ -7,12 +7,12 @@
theme = lib.mkOption { }; theme = lib.mkOption { };
accent = lib.mkOption { }; accent = lib.mkOption { };
font = lib.mkOption { }; font = lib.mkOption { };
username = lib.mkOption { }; username = lib.mkOption { type = lib.types.str; };
mail = lib.mkOption { }; mail = lib.mkOption { };
dmenu = lib.mkOption { }; dmenu = lib.mkOption { type = lib.types.str; };
desktop = lib.mkOption { }; desktop = lib.mkOption { type = lib.types.str; };
browser = lib.mkOption { }; browser = lib.mkOption { type = lib.types.str; };
editor = lib.mkOption { }; editor = lib.mkOption { type = lib.types.str; };
}; };
}; };
} }

View file

@ -6,9 +6,12 @@
}: }:
let let
inherit (config.my) accent editor desktop; inherit (config.my) accent editor desktop;
cfg = config.my.fish;
in in
{ {
config = { options.my.fish.enable = lib.mkEnableOption { };
config = lib.mkIf cfg.enable {
programs.fish = { programs.fish = {
enable = true; enable = true;
shellInit = '' shellInit = ''

View file

@ -2,16 +2,10 @@
config, config,
pkgs, pkgs,
lib, lib,
inputs,
... ...
}: }:
let let
inherit (config.my) inherit (config.my) theme accent;
key
theme
accent
font
;
inherit (theme) color; inherit (theme) color;
colors = { colors = {

View file

@ -1,9 +1,24 @@
{ config, lib, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.my.gaming; cfg = config.my.gaming;
in in
{ {
options.my.gaming.enable = lib.mkEnableOption { }; options.my.gaming.enable = lib.mkEnableOption { };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.mangohud.enable = true;
home.packages = with pkgs; [
# lutris-unwrapped
# steam # It's enabled in the system config
tlauncher
gamescope
glxinfo
vulkan-tools
];
}; };
} }

View file

@ -45,7 +45,11 @@
./powerplay-led-idle.nix ./powerplay-led-idle.nix
]; ];
my = import ./variables.nix; my = import ./variables.nix // {
sway.enable = true;
pass.enable = true;
fish.enable = true;
};
# Home Manager needs a bit of information about you and the # Home Manager needs a bit of information about you and the
# paths it should manage. # paths it should manage.
@ -92,14 +96,6 @@
mate.engrampa mate.engrampa
# gnome.nautilus # gnome.nautilus
## games
# lutris-unwrapped
# steam # It's enabled in the system config
tlauncher
gamescope
glxinfo
vulkan-tools
## Theming ## Theming
orchis_theme_compact orchis_theme_compact
papirus_red papirus_red

View file

@ -1,80 +1,68 @@
{ { config, lib, ... }:
config,
pkgs,
lib,
font,
...
}:
let let
inherit (config.my) cfg = config.my.mangohud;
key
theme
color
accent
font
;
in in
{ {
config = { options.my.mangohud.enable = lib.mkEnableOption { };
programs.mangohud = {
enable = true;
enableSessionWide = true;
settings = {
full = true;
# histogram = true;
no_display = true;
fps_limit = "0,30,60,72,90,120,144,240,288,320";
toggle_fps_limit = "Shift_R+F10";
toggle_preset = "Control_R+F9";
fps_metrics = "Control_R+F8";
# legacy_layout = "false"; config.programs.mangohud = lib.mkIf cfg.enable {
# gpu_stats = true; enable = true;
# gpu_temp = true; enableSessionWide = true;
# gpu_core_clock = true; settings = {
# gpu_mem_clock = true; full = true;
# gpu_power = true; # histogram = true;
# gpu_load_change = true; no_display = true;
# gpu_load_value = "50,90"; fps_limit = "0,30,60,72,90,120,144,240,288,320";
gpu_load_color = "FFFFFF,FFAA7F,CC0000"; toggle_fps_limit = "Shift_R+F10";
# gpu_text = "GPU"; toggle_preset = "Control_R+F9";
# cpu_stats = true; fps_metrics = "Control_R+F8";
# cpu_temp = true;
# cpu_power = true;
# cpu_mhz = true;
# cpu_load_change = true;
# core_load_change = true;
# cpu_load_value = "50,90";
cpu_load_color = "FFFFFF,FFAA7F,CC0000";
cpu_color = "2e97cb";
# cpu_text = "CPU";
# io_stats = true;
# io_read = true;
# io_write = true;
io_color = "a491d3";
# swap = true;
# vram = true;
vram_color = "ad64c1";
# ram = true;
ram_color = "c26693";
# fps = true;
engine_color = "eb5b5b";
gpu_color = "2e9762";
wine_color = "eb5b5b";
# frame_timing = "1";
frametime_color = "00ff00";
media_player_color = "ffffff";
background_alpha = "0.8";
font_size = "24";
background_color = "020202"; # legacy_layout = "false";
position = "top-left"; # gpu_stats = true;
# text_color = "ffffff"; # gpu_temp = true;
round_corners = "10"; # gpu_core_clock = true;
toggle_hud = "Shift_R+F12"; # gpu_mem_clock = true;
# toggle_logging = "Shift_L+F12"; # gpu_power = true;
# output_folder = "/home/lelgenio"; # gpu_load_change = true;
}; # gpu_load_value = "50,90";
gpu_load_color = "FFFFFF,FFAA7F,CC0000";
# gpu_text = "GPU";
# cpu_stats = true;
# cpu_temp = true;
# cpu_power = true;
# cpu_mhz = true;
# cpu_load_change = true;
# core_load_change = true;
# cpu_load_value = "50,90";
cpu_load_color = "FFFFFF,FFAA7F,CC0000";
cpu_color = "2e97cb";
# cpu_text = "CPU";
# io_stats = true;
# io_read = true;
# io_write = true;
io_color = "a491d3";
# swap = true;
# vram = true;
vram_color = "ad64c1";
# ram = true;
ram_color = "c26693";
# fps = true;
engine_color = "eb5b5b";
gpu_color = "2e9762";
wine_color = "eb5b5b";
# frame_timing = "1";
frametime_color = "00ff00";
media_player_color = "ffffff";
background_alpha = "0.8";
font_size = "24";
background_color = "020202";
position = "top-left";
# text_color = "ffffff";
round_corners = "10";
toggle_hud = "Shift_R+F12";
# toggle_logging = "Shift_L+F12";
# output_folder = "/home/lelgenio";
}; };
}; };
} }

View file

@ -4,8 +4,13 @@
config, config,
... ...
}: }:
let
cfg = config.my.mpd;
in
{ {
config = lib.mkIf (config.my.desktop != "gnome") { options.my.mpd.enable = lib.mkEnableOption { };
config = lib.mkIf cfg.enable {
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = config.home.homeDirectory + "/Música"; musicDirectory = config.home.homeDirectory + "/Música";

View file

@ -2,11 +2,15 @@
config, config,
pkgs, pkgs,
lib, lib,
inputs,
... ...
}: }:
let
cfg = config.my.pass;
in
{ {
config = { options.my.pass.enable = lib.mkEnableOption { };
config = lib.mkIf cfg.enable {
programs.password-store = { programs.password-store = {
enable = true; enable = true;
package = pkgs.pass.withExtensions ( package = pkgs.pass.withExtensions (

View file

@ -5,13 +5,10 @@
... ...
}: }:
let let
inherit (config.my) inherit (config.my) accent font theme;
key
accent
font
theme
;
inherit (theme) color; inherit (theme) color;
cfg = config.my.sway;
in in
{ {
imports = [ imports = [
@ -24,10 +21,17 @@ in
./swaylock.nix ./swaylock.nix
./theme.nix ./theme.nix
]; ];
config = lib.mkIf (config.my.desktop == "sway") {
services.mako.enable = true; options.my.sway.enable = lib.mkEnableOption { };
services.swayidle.enable = true;
services.kanshi.enable = true; config = lib.mkIf cfg.enable {
my.mako.enable = true;
my.kanshi.enable = true;
my.swayidle.enable = true;
my.swaylock.enable = true;
my.mpd.enable = true;
my.zathura.enable = true;
my.waybar.enable = true;
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
@ -36,7 +40,7 @@ in
bars = [ ]; bars = [ ];
floating.modifier = "Mod4"; floating.modifier = "Mod4";
terminal = pkgs.alacritty.executable; terminal = lib.getExe pkgs.alacritty;
window.titlebar = false; window.titlebar = false;
gaps = { gaps = {
@ -147,7 +151,6 @@ in
swaylock swaylock
wdisplays wdisplays
waybar
dhist dhist
demoji demoji
bmenu bmenu

View file

@ -1,20 +1,12 @@
{ { config, lib, ... }:
config,
pkgs,
lib,
...
}:
let let
inherit (config.my) cfg = config.my.kanshi;
key
accent
font
theme
;
inherit (theme) color;
in in
{ {
services.kanshi = { options.my.kanshi.enable = lib.mkEnableOption { };
config.services.kanshi = lib.mkIf cfg.enable {
enable = true;
settings = [ settings = [
{ {
profile = { profile = {

View file

@ -6,60 +6,66 @@
}: }:
let let
inherit (config.my) inherit (config.my)
key
accent accent
font font
theme theme
; ;
inherit (theme) color; inherit (theme) color;
cfg = config.my.mako;
in in
{ {
services.mako = { options.my.mako.enable = lib.mkEnableOption { };
borderSize = 2;
padding = "5";
margin = "15";
layer = "overlay";
font = "${font.interface} ${toString font.size.small}"; config = lib.mkIf cfg.enable {
textColor = color.txt; services.mako = {
enable = true;
borderSize = 2;
padding = "5";
margin = "15";
layer = "overlay";
backgroundColor = color.bg; font = "${font.interface} ${toString font.size.small}";
borderColor = accent.color; textColor = color.txt;
progressColor = "over ${accent.color}88";
defaultTimeout = 10000; backgroundColor = color.bg;
borderColor = accent.color;
progressColor = "over ${accent.color}88";
extraConfig = '' defaultTimeout = 10000;
[app-name=volumesh]
default-timeout=5000
group-by=app-name
format=<b>%s</b>\n%b
'';
# # {{@@ header() @@}} extraConfig = ''
# # text [app-name=volumesh]
default-timeout=5000
group-by=app-name
format=<b>%s</b>\n%b
'';
# # features # # {{@@ header() @@}}
# icons=1 # # text
# markup=1
# actions=1
# default-timeout=10000
# # position # # features
# layer=overlay # icons=1
}; # markup=1
systemd.user.services.mako = lib.mkIf (config.services.mako.enable) { # actions=1
Unit = { # default-timeout=10000
Description = "Notification daemon";
PartOf = [ "graphical-session.target" ]; # # position
After = [ "graphical-session.target" ]; # layer=overlay
}; };
Service = { systemd.user.services.mako = lib.mkIf (config.services.mako.enable) {
ExecStart = "${pkgs.mako}/bin/mako"; Unit = {
Restart = "on-failure"; Description = "Notification daemon";
}; PartOf = [ "graphical-session.target" ];
Install = { After = [ "graphical-session.target" ];
WantedBy = [ "sway-session.target" ]; };
Service = {
ExecStart = "${pkgs.mako}/bin/mako";
Restart = "on-failure";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
}; };
}; };
} }

View file

@ -5,18 +5,15 @@
... ...
}: }:
let let
inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
asScript = filename: text: toString (pkgs.writeShellScript filename text); asScript = filename: text: toString (pkgs.writeShellScript filename text);
cfg = config.my.swayidle;
in in
{ {
services.swayidle = { options.my.swayidle.enable = lib.mkEnableOption { };
config.services.swayidle = {
enable = cfg.enable;
timeouts = [ timeouts = [
{ {
timeout = 360; timeout = 360;

View file

@ -1,20 +1,14 @@
{ { config, lib, ... }:
config,
pkgs,
lib,
...
}:
let let
inherit (config.my) inherit (config.my) accent font theme;
key
accent
font
theme
;
inherit (theme) color; inherit (theme) color;
cfg = config.my.swaylock;
in in
{ {
programs.swaylock.settings = { options.my.swaylock.enable = lib.mkEnableOption { };
config.programs.swaylock.settings = lib.mkIf cfg.enable {
image = toString theme.background; image = toString theme.background;
font = font.interface; font = font.interface;
font-size = font.size.medium; font-size = font.size.medium;

View file

@ -14,9 +14,13 @@ let
font font
; ;
inherit (theme) color; inherit (theme) color;
cfg = config.my.waybar;
in in
{ {
config = { options.my.waybar.enable = lib.mkEnableOption { };
config = lib.mkIf cfg.enable {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;

View file

@ -1,10 +1,4 @@
{ { config, lib, ... }:
config,
pkgs,
lib,
font,
...
}:
let let
inherit (config.my) inherit (config.my)
key key
@ -13,56 +7,62 @@ let
theme theme
; ;
inherit (theme) color; inherit (theme) color;
cfg = config.my.zathura;
in in
{ {
config = { options.my.zathura.enable = lib.mkEnableOption { };
programs.zathura.enable = true;
programs.zathura.options = {
font = "${font.mono} ${toString font.size.small}";
guioptions = "s";
selection-clipboard = "clipboard"; config = lib.mkIf cfg.enable {
programs.zathura = {
enable = true;
options = {
font = "${font.mono} ${toString font.size.small}";
guioptions = "s";
recolor = true; selection-clipboard = "clipboard";
# Turn images grayscale, so they don't look weird
recolor-keephue = false;
recolor-lightcolor = "rgba(0,0,0,0)";
recolor-darkcolor = color.txt;
default-bg = color.bg_dark; recolor = true;
# Turn images grayscale, so they don't look weird
recolor-keephue = false;
recolor-lightcolor = "rgba(0,0,0,0)";
recolor-darkcolor = color.txt;
inputbar-bg = color.bg_dark; default-bg = color.bg_dark;
inputbar-fg = color.txt;
statusbar-bg = color.bg; inputbar-bg = color.bg_dark;
statusbar-fg = color.txt; inputbar-fg = color.txt;
completion-bg = color.bg; statusbar-bg = color.bg;
completion-fg = color.txt; statusbar-fg = color.txt;
completion-group-bg = color.bg_dark; completion-bg = color.bg;
completion-group-fg = color.txt; completion-fg = color.txt;
completion-highlight-bg = accent.color; completion-group-bg = color.bg_dark;
completion-highlight-fg = accent.fg; completion-group-fg = color.txt;
index-active-bg = accent.color; completion-highlight-bg = accent.color;
index-active-fg = accent.fg; completion-highlight-fg = accent.fg;
};
programs.zathura.mappings = { index-active-bg = accent.color;
"<C-b>" = "toggle_statusbar"; index-active-fg = accent.fg;
${key.left} = "scroll left"; };
${key.down} = "scroll down"; mappings = {
${key.up} = "scroll up"; "<C-b>" = "toggle_statusbar";
${key.right} = "scroll right"; ${key.left} = "scroll left";
"[index] ${key.left}" = "navigate_index collapse"; ${key.down} = "scroll down";
"[index] ${key.down}" = "navigate_index down"; ${key.up} = "scroll up";
"[index] ${key.up}" = "navigate_index up"; ${key.right} = "scroll right";
"[index] ${key.right}" = "navigate_index expand"; "[index] ${key.left}" = "navigate_index collapse";
${lib.toUpper key.down} = "navigate next"; "[index] ${key.down}" = "navigate_index down";
${lib.toUpper key.up} = "navigate previous"; "[index] ${key.up}" = "navigate_index up";
${key.next} = "search forward"; "[index] ${key.right}" = "navigate_index expand";
${lib.toUpper key.next} = "search backward"; ${lib.toUpper key.down} = "navigate next";
${lib.toUpper key.up} = "navigate previous";
${key.next} = "search forward";
${lib.toUpper key.next} = "search backward";
};
}; };
}; };
} }