fastfetch: convert config to nix

The config was previously in `jsonc` format. This isn't
necessarily a problem, but `jsonc` is very obviously
a worse format than the `nix` DSL! (maybe)

At the least, this enabled changing a very, very long line
easily to an embedded shell script with embedded syntax
highlighting on at least `neovim` with `tree-sitter`.

This change also makes the embedded shell script an actual
real executable shell script that goes into the nix store.
It doesn't serve much value, but why not have a reusable
script when it's free as a result of other improvements?
This commit is contained in:
redbeardymcgee 2024-07-12 22:17:26 -05:00
parent 496ed27b42
commit 17b02a86f8
4 changed files with 112 additions and 109 deletions

View File

@ -1,104 +0,0 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"source": "~/.config/fastfetch/nixos.png",
"type": "kitty-direct",
"height": 15,
"width": 30,
"padding": {
"top": 3,
"left": 3
}
},
"modules": [
"break",
{
"type": "custom",
"format": "\u001b[90m┌──────────────────────Hardware──────────────────────┐"
},
{
"type": "cpu",
"key": "│ ",
"keyColor": "35"
},
{
"type": "gpu",
"key": "│ 󰍛",
"keyColor": "35"
},
{
"type": "memory",
"key": "│ 󰑭",
"keyColor": "35"
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────┘"
},
"break",
{
"type": "custom",
"format": "\u001b[90m┌──────────────────────Software──────────────────────┐"
},
{
"type": "custom",
"format": "\u001b[31m OS -> ZaneyOS 2.2"
},
{
"type": "kernel",
"key": "│ ├",
"keyColor": "31"
},
{
"type": "packages",
"key": "│ ├󰏖",
"keyColor": "31"
},
{
"type": "shell",
"key": "└ └",
"keyColor": "31"
},
"break",
{
"type": "wm",
"key": " WM",
"keyColor": "32"
},
{
"type": "wmtheme",
"key": "│ ├󰉼",
"keyColor": "32"
},
{
"type": "terminal",
"key": "└ └",
"keyColor": "32"
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────┘"
},
"break",
{
"type": "custom",
"format": "\u001b[90m┌────────────────────Uptime / Age────────────────────┐"
},
{
"type": "command",
"key": "│ ",
"keyColor": "33",
"text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days"
},
{
"type": "uptime",
"key": "│ ",
"keyColor": "33"
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────┘"
},
"break"
]
}

View File

@ -0,0 +1,112 @@
{pkgs, ...}: {
programs.fastfetch = {
logo = {
source = ./nixos.png;
type = "kitty-direct";
height = 15;
width = 30;
padding = {
top = 3;
left = 3;
};
};
modules = [
"break"
{
type = "custom";
format = "\u001b[90mHardware";
}
{
type = "cpu";
key = " ";
keyColor = "35";
}
{
type = "gpu";
key = " 󰍛";
keyColor = "35";
}
{
type = "memory";
key = " 󰑭";
keyColor = "35";
}
{
type = "custom";
format = "\u001b[90m";
}
"break"
{
type = "custom";
format = "\u001b[90mSoftware";
}
{
type = "custom";
format = "\u001b[31m OS -> ZaneyOS 2.2";
}
{
type = "kernel";
key = " ";
keyColor = "31";
}
{
type = "packages";
key = " 󰏖";
keyColor = "31";
}
{
type = "shell";
key = " ";
keyColor = "31";
}
"break"
{
type = "wm";
key = " WM";
keyColor = "32";
}
{
type = "wmtheme";
key = " 󰉼";
keyColor = "32";
}
{
type = "terminal";
key = " ";
keyColor = "32";
}
{
type = "custom";
format = "\u001b[90m";
}
"break"
{
type = "custom";
format = "\u001b[90mUptime / Age";
}
{
type = "command";
key = " ";
keyColor = "33";
text = pkgs.writeShellScriptBin "fs-bday" # bash
''
birth_install=$(stat -c %W /)
current=$(date +%s)
delta=$((current - birth_install))
delta_days=$((delta / 86400))
echo $delta_days days
'';
}
{
type = "uptime";
key = " ";
keyColor = "33";
}
{
type = "custom";
format = "\u001b[90m";
}
"break"
];
};
}

View File

@ -242,7 +242,6 @@
git
cmatrix
lolcat
fastfetch
htop
brave
libvirt

View File

@ -31,10 +31,6 @@ in
source = ../../config/wallpapers;
recursive = true;
};
home.file.".config/fastfetch" = {
source = ../../config/fastfetch;
recursive = true;
};
home.file.".config/wlogout/icons" = {
source = ../../config/wlogout;
recursive = true;