From 706e949d066fc7ae9986ed1577e38cdad3082105 Mon Sep 17 00:00:00 2001 From: servius Date: Mon, 4 May 2026 15:54:52 +0530 Subject: [PATCH] refactor(home): replace `// optionalAttrs` with `mkIf` --- home/programs/starship.nix | 7 ++----- home/services/xdg.nix | 26 +++++++++----------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/home/programs/starship.nix b/home/programs/starship.nix index a04c7df6..f9626381 100644 --- a/home/programs/starship.nix +++ b/home/programs/starship.nix @@ -3,8 +3,7 @@ lib, device, ... -}: -{ +}: { programs.starship = { enable = true; enableFishIntegration = true; @@ -29,7 +28,5 @@ // builtins.fromTOML (builtins.readFile (pkgs.catppuccinThemes.starship + /palettes/${flavour}.toml)); }; -} -// lib.optionalAttrs (!(device.is "tsuba")) { - stylix.targets.starship.enable = false; + stylix.targets.starship.enable = lib.mkIf (device.is "tsuba") false; } diff --git a/home/services/xdg.nix b/home/services/xdg.nix index 8ff87e39..8ea7fc16 100644 --- a/home/services/xdg.nix +++ b/home/services/xdg.nix @@ -1,25 +1,17 @@ { - pkgs, lib, device, - inputs, ... }: { - xdg = - { - portal = { - enable = device.is "ryu"; - config = { - hyprland.default = ["hyprland"]; - common.default = ["*" "hyprland"]; - }; + xdg = { + portal = { + enable = device.is "ryu"; + config = { + hyprland.default = ["hyprland"]; + common.default = ["*" "hyprland"]; }; - } - // lib.optionalAttrs (device.is "ryu" || device.is "tako") { - userDirs.setSessionVariables = true; }; -} -# // lib.optionalAttrs (device.is "ryu") { -# environment.pathsToLink = ["/share/xdg-desktop-portal" "/share/applications"]; -# } + userDirs.setSessionVariables = lib.mkIf (device.is "ryu" || device.is "tako") true; + }; +} -- 2.54.0