refactor(modules): make sure nothing is added without setting enable

This commit is contained in:
matt1432 2025-01-04 19:02:30 -05:00
parent 4a2ad39114
commit 49dc072b81
56 changed files with 684 additions and 506 deletions

View file

@ -1,5 +1,14 @@
{pkgs, ...}: {
config = {
{
lib,
osConfig,
pkgs,
...
}: let
inherit (lib) mkIf;
cfg = osConfig.roles.desktop;
in {
config = mkIf cfg.enable {
programs.bash.shellAliases = {
# https://wiki.hyprland.org/Contributing-and-Debugging/#lsp-and-formatting
"mkCMakeFiles" = "${pkgs.cmake}/bin/cmake -S . -B build/ -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON";

View file

@ -2,10 +2,12 @@
lib,
osConfig,
...
}: {
config = let
cfg = osConfig.roles.desktop;
in {
}: let
inherit (lib) mkIf;
cfg = osConfig.roles.desktop;
in {
config = mkIf cfg.enable {
programs = {
# https://codeberg.org/dnkl/foot/wiki#spawning-new-terminal-instances-in-the-current-working-directory
bash.bashrcExtra =

View file

@ -1,7 +1,16 @@
self: {pkgs, ...}: let
self: {
lib,
osConfig,
pkgs,
...
}: let
inherit (self.lib.hypr) mkBind;
inherit (lib) mkIf;
cfg = osConfig.roles.desktop;
in {
config = {
config = mkIf cfg.enable {
wayland.windowManager.hyprland = {
plugins = [self.inputs.hyprland-plugins.packages.${pkgs.system}.hyprexpo];

View file

@ -4,12 +4,13 @@ self: {
pkgs,
...
}: let
inherit (lib) map mkIf;
inherit (self.lib.hypr) mkBind;
inherit (lib) map mkIf;
cfg = osConfig.roles.desktop;
in {
config = mkIf cfg.isTouchscreen {
config = mkIf (cfg.enable && cfg.isTouchscreen) {
wayland.windowManager.hyprland = {
plugins = [self.inputs.hyprgrass.packages.${pkgs.system}.default];

View file

@ -2,25 +2,27 @@ self: {
osConfig,
lib,
...
}: {
config = let
inherit (lib) map;
inherit (self.lib.hypr) mkBind;
}: let
inherit (self.lib.hypr) mkBind;
inherit (osConfig.services.xserver) xkb;
inherit (osConfig.roles.desktop) mainMonitor;
inherit (lib) mkIf;
miceNames = [
"logitech-g502-x"
"logitech-g502-hero-gaming-mouse"
];
cfg = osConfig.roles.desktop;
mkConf = name: {
inherit name;
sensitivity = 0;
accel_profile = "flat";
};
in {
inherit (osConfig.services.xserver) xkb;
miceNames = [
"logitech-g502-x"
"logitech-g502-hero-gaming-mouse"
];
mkConf = name: {
inherit name;
sensitivity = 0;
accel_profile = "flat";
};
in {
config = mkIf cfg.enable {
wayland.windowManager.hyprland = {
settings = {
device = map mkConf miceNames;
@ -31,8 +33,8 @@ self: {
};
exec-once =
if mainMonitor != null
then ["hyprctl dispatch focusmonitor ${mainMonitor}"]
if cfg.mainMonitor != null
then ["hyprctl dispatch focusmonitor ${cfg.mainMonitor}"]
else [];
input = {

View file

@ -1,7 +1,16 @@
self: {pkgs, ...}: {
config = let
inherit (self.scopedPackages.${pkgs.system}) mpvScripts;
in {
self: {
lib,
osConfig,
pkgs,
...
}: let
inherit (self.scopedPackages.${pkgs.system}) mpvScripts;
inherit (lib) mkIf;
cfg = osConfig.roles.desktop;
in {
config = mkIf cfg.enable {
# For kdialog-open-files
home.packages = [
pkgs.kdialog

View file

@ -1,9 +1,18 @@
self: {pkgs, ...}: let
self: {
lib,
osConfig,
pkgs,
...
}: let
inherit (self.inputs) nixpkgs-wayland;
waypkgs = nixpkgs-wayland.packages.${pkgs.system};
inherit (lib) mkIf;
cfg = osConfig.roles.desktop;
in {
config = let
waypkgs = nixpkgs-wayland.packages.${pkgs.system};
in {
config = mkIf cfg.enable {
programs = {
obs-studio = {
enable = true;