Skip to content

Commit

Permalink
terminal/tools/fastfetch: use home-manager module
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed May 31, 2024
1 parent be7958d commit 512c3ed
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 135 deletions.
274 changes: 139 additions & 135 deletions modules/home/programs/terminal/tools/fastfetch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,142 +17,146 @@ in
};

config = mkIf cfg.enable {
programs.fastfetch.enable = true;

xdg.configFile = {
"fastfetch/config.jsonc".text =
# json
''
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"padding": {
"top": 2
}
},
"display": {
"color": {
"keys": "green",
"title": "blue"
},
"percent": {
"type": 9
},
"separator": " 󰁔 ",
},
"modules": [
{
"type": "custom",
"format": "\u001b[34m┌──────────── \u001b[1mOS Information\u001b[0m \u001b[34m────────────┐"
},
{
"type": "title",
"key": " ╭─ ",
"keyColor": "green",
"color": {
"user": "green",
"host": "green"
}
},${lib.optionalString pkgs.stdenv.isDarwin # json
''
{
"type": "os",
"key": " ├─  ",
"keyColor": "green"
},
{
"type": "kernel",
"key": " ├─  ",
"keyColor": "green"
},
{
"type": "packages",
"key": " ├─  ",
"keyColor": "green"
},
''}${lib.optionalString pkgs.stdenv.isLinux # json
''
{
"type": "os",
"key": " ├─ ",
"keyColor": "green"
},
{
"type": "kernel",
"key": " ├─ ",
"keyColor": "green"
},
{
"type": "packages",
"key": " ├─ ",
"keyColor": "green"
},
''}
{
"type": "shell",
"key": " ╰─  ",
"keyColor": "green"
},
{
"type": "custom",
"format": "\u001b[34m├───────── \u001b[1mHardware Information\u001b[0m \u001b[34m─────────┤"
},
{
"type": "display",
"key": " ╭─ 󰍹 ",
"keyColor": "blue"
},
{
"type": "cpu",
"key": " ├─ 󰍛 ",
"keyColor": "blue"
},
{
"type": "gpu",
"key": " ├─ 󰍛 ",
"keyColor": "blue"
},
{
"type": "memory",
"key": " ├─  ",
"keyColor": "blue"
},
{
"type": "disk",
"key": " ╰─ 󱛟 ",
"keyColor": "blue"
},
{
"type": "custom",
"format": "\u001b[34m├───────── \u001b[1mSoftware Information\u001b[0m \u001b[34m─────────┤"
},
{
"type": "wm",
"key": " ╭─  ",
"keyColor": "yellow"
},
{
"type": "terminal",
"key": " ├─  ",
"keyColor": "yellow"
},
{
"type": "font",
"key": " ╰─  ",
"keyColor": "yellow"
},
{
"type": "custom",
"format": "\u001b[34m└────────────────────────────────────────┘"
},
{
"type": "custom",
"format": " \u001b[38m \u001b[34m \u001b[36m \u001b[35m \u001b[34m \u001b[33m \u001b[32m \u001b[31m "
},
"break"
]
}
'';
programs.fastfetch = {
enable = true;

settings = {
"$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
logo = {
padding = {
top = 2;
};
};
display = {
color = {
keys = "green";
title = "blue";
};
percent = {
type = 9;
};
separator = " 󰁔 ";
};
modules =
[
{
type = "custom";
outputColor = "blue";
format = ''┌──────────── OS Information ────────────┐'';
}
{
type = "title";
key = " ╭─ ";
keyColor = "green";
color = {
user = "green";
host = "green";
};
}
]
++ lib.optionals pkgs.stdenv.isDarwin [
{
type = "os";
key = " ├─  ";
keyColor = "green";
}
{
type = "kernel";
key = " ├─  ";
keyColor = "green";
}
{
type = "packages";
key = " ├─  ";
keyColor = "green";
}
]
++ lib.optionals pkgs.stdenv.isLinux [
{
type = "os";
key = " ├─ ";
keyColor = "green";
}
{
type = "kernel";
key = " ├─ ";
keyColor = "green";
}
{
type = "packages";
key = " ├─ ";
keyColor = "green";
}
]
++ [
{
type = "shell";
key = " ╰─  ";
keyColor = "green";
}
{
type = "custom";
outputColor = "blue";
format = ''├───────── Hardware Information ─────────┤'';
}
{
type = "display";
key = " ╭─ 󰍹 ";
keyColor = "blue";
}
{
type = "cpu";
key = " ├─ 󰍛 ";
keyColor = "blue";
}
{
type = "gpu";
key = " ├─ 󰍛 ";
keyColor = "blue";
}
{
type = "memory";
key = " ├─  ";
keyColor = "blue";
}
{
type = "disk";
key = " ╰─ 󱛟 ";
keyColor = "blue";
}
{
type = "custom";
outputColor = "blue";
format = ''├───────── Software Information ─────────┤'';
}
{
type = "wm";
key = " ╭─  ";
keyColor = "yellow";
}
{
type = "terminal";
key = " ├─  ";
keyColor = "yellow";
}
{
type = "font";
key = " ╰─  ";
keyColor = "yellow";
}
{
type = "custom";
outputColor = "blue";
format = ''└────────────────────────────────────────┘'';
}
{
type = "custom";
format = "         ";
}
"break"
];
};
};
};
}
12 changes: 12 additions & 0 deletions overlays/fastfetch/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
_: _final: prev: {
fastfetch = prev.fastfetch.overrideAttrs (_oldAttrs: {
version = "2.14.0";

src = prev.fetchFromGitHub {
owner = "fastfetch-cli";
repo = "fastfetch";
rev = "2.14.0";
hash = "sha256-RJDRxH9VKNxBSfoFl1rDTeKKyLC3C09F0Z3ksJoMDRk=";
};
});
}

0 comments on commit 512c3ed

Please sign in to comment.