treewide: cleanup config with enable options

This commit is contained in:
Leonardo Eugênio 2025-02-20 22:01:03 -03:00
parent d469c5fa79
commit 0a387960a2
28 changed files with 420 additions and 358 deletions

View file

@ -5,13 +5,10 @@
...
}:
let
inherit (config.my)
key
accent
font
theme
;
inherit (config.my) accent font theme;
inherit (theme) color;
cfg = config.my.sway;
in
{
imports = [
@ -24,10 +21,17 @@ in
./swaylock.nix
./theme.nix
];
config = lib.mkIf (config.my.desktop == "sway") {
services.mako.enable = true;
services.swayidle.enable = true;
services.kanshi.enable = true;
options.my.sway.enable = lib.mkEnableOption { };
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 = {
enable = true;
@ -36,7 +40,7 @@ in
bars = [ ];
floating.modifier = "Mod4";
terminal = pkgs.alacritty.executable;
terminal = lib.getExe pkgs.alacritty;
window.titlebar = false;
gaps = {
@ -69,7 +73,7 @@ in
};
output = {
"*" = {
adaptive_sync = "off";
adaptive_sync = "on";
bg = "${theme.background} fill";
mode = "1920x1080@144.000Hz";
};
@ -132,7 +136,6 @@ in
swaylock
wdisplays
waybar
dhist
demoji
bmenu

View file

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

View file

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

View file

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

View file

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