Commit fcbe959

HPCesia <me@hpcesia.com>
2026-03-22 15:41:53
refactor: fastfetch icon
den
1 parent 0950014
Changed files (2)
modules
core
hosts
modules/core/tools/fastfetch.nix
@@ -1,11 +1,19 @@
 {
+  inputs,
+  lib,
+  den,
+  ...
+}: {
+  flake-file.inputs.nixos-logo = {
+    url = "git+https://repo.hpcesia.com/HPCesia/nixos-logo?shallow=1";
+    flake = false;
+  };
+
+  den.default.includes = [den.aspects.core._.tools._.fastfetch];
   den.default.homeManager = {
     programs.fastfetch = {
       enable = true;
       settings = {
-        logo = {
-          type = "auto";
-        };
         display.separator = " ";
         modules = [
           "title"
@@ -100,4 +108,25 @@
       };
     };
   };
+
+  den.aspects.core.provides.tools.provides.fastfetch = {
+    host,
+    user,
+    ...
+  }: let
+    listHas = l: e: (lib.lists.findFirstIndex (x: x == e) null l) != null;
+    isGraphic = listHas ["desktop" "laptop"] host.usage;
+    isHm = listHas user.classes "homeManager";
+  in {
+    homeManager.programs.fastfetch.settings.logo = lib.mkIf isHm (
+      if isGraphic
+      then {
+        type = "kitty-direct";
+        source = "${inputs.nixos-logo}/nixos-griseo.png";
+        width = 28;
+        height = 14;
+      }
+      else {type = "auto";}
+    );
+  };
 }
modules/hosts/kevin/home.nix
@@ -1,14 +0,0 @@
-{
-  inputs,
-  lib,
-  ...
-}: {
-  flake.modules.homeManager."hosts/kevin" = {config, ...}: {
-    programs.fastfetch.settings.logo = lib.mkIf config.programs.fastfetch.enable (lib.mkForce {
-      type = "kitty-direct";
-      source = "${inputs.nixos-logo}/nixos-griseo.png";
-      width = 28;
-      height = 14;
-    });
-  };
-}