From e4facfab9abcea2fc2a64921fa535119fd39073c Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sat, 23 Nov 2024 15:15:30 -0800 Subject: [PATCH] fix(home): Remove unneccesary mkIfs Don't need to check if the module is enabled for settings within that module.... they won't be applied if it's not enabled by default --- modules/home/options/my/default.nix | 2 +- modules/home/options/theme/default.nix | 16 ++++++++-------- modules/home/programs/bat/default.nix | 2 +- modules/home/programs/figlet/default.nix | 2 +- modules/home/programs/git/default.nix | 2 +- modules/home/programs/neo/default.nix | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/home/options/my/default.nix b/modules/home/options/my/default.nix index 9b280b3..e6aa350 100644 --- a/modules/home/options/my/default.nix +++ b/modules/home/options/my/default.nix @@ -64,7 +64,7 @@ in home.username = mkDefault cfg.name; - programs.git = mkIf config.programs.git.enable { + programs.git = { userName = mkDefault cfg.git.name; userEmail = mkDefault cfg.git.email; }; diff --git a/modules/home/options/theme/default.nix b/modules/home/options/theme/default.nix index cffacac..ef9a031 100644 --- a/modules/home/options/theme/default.nix +++ b/modules/home/options/theme/default.nix @@ -139,19 +139,19 @@ in # icons (mkIf (cfg.icons != null) { - gtk = mkIf config.gtk.enable (mkDefault { + gtk = mkDefault { iconTheme = { inherit (cfg.icons) name; package = mkIf (cfg.icons.package != null) cfg.icons.package; }; - }); + }; - services.dunst = mkIf config.services.dunst.enable (mkDefault { + services.dunst = mkDefault { iconTheme = { inherit (cfg.icons) name; package = mkIf (cfg.icons.package != null) cfg.icons.package; }; - }); + }; }) # pinentry @@ -160,13 +160,13 @@ in cfg.pinentry ]; - programs.rbw = mkIf config.programs.rbw.enable (mkDefault { + programs.rbw = mkDefault { settings.pinentry = cfg.pinentry; - }); + }; - services.gpg-agent = mkIf config.services.gpg-agent.enable (mkDefault { + services.gpg-agent = mkDefault { pinentryPackage = cfg.pinentry; - }); + }; }) ]; } diff --git a/modules/home/programs/bat/default.nix b/modules/home/programs/bat/default.nix index 5eb40a2..887641e 100644 --- a/modules/home/programs/bat/default.nix +++ b/modules/home/programs/bat/default.nix @@ -34,7 +34,7 @@ in BATDIFF_USE_DELTA = "true"; }; - programs.fish = lib.mkIf config.programs.fish.enable { + programs.fish = { functions = { cat = { wraps = "bat"; diff --git a/modules/home/programs/figlet/default.nix b/modules/home/programs/figlet/default.nix index 00c349f..79a6048 100644 --- a/modules/home/programs/figlet/default.nix +++ b/modules/home/programs/figlet/default.nix @@ -17,7 +17,7 @@ in marleyos.figlet-xero-fonts ]; - programs.fish.functions = lib.mkIf config.programs.fish.enable { + programs.fish.functions = { figlet = { wraps = "figlet"; body = # fish diff --git a/modules/home/programs/git/default.nix b/modules/home/programs/git/default.nix index 84e92a8..2374c22 100644 --- a/modules/home/programs/git/default.nix +++ b/modules/home/programs/git/default.nix @@ -192,7 +192,7 @@ in g = "git"; }; - programs.fish.functions = lib.mkIf config.programs.fish.enable { + programs.fish.functions = { git_develop_branch = # fish '' command git rev-parse --git-dir &>/dev/null || return diff --git a/modules/home/programs/neo/default.nix b/modules/home/programs/neo/default.nix index be1a33e..5fd693a 100644 --- a/modules/home/programs/neo/default.nix +++ b/modules/home/programs/neo/default.nix @@ -17,7 +17,7 @@ in neo ]; - programs.fish.functions = mkIf config.programs.fish.enable { + programs.fish.functions = { neo = { wraps = "neo"; body = # fish