Compare commits
No commits in common. "7a5219af7ca5de1ec369211e89658ac6dd9bb4de" and "a65936845fdc37ae59d972510977ade939b0c4ee" have entirely different histories.
7a5219af7c
...
a65936845f
1 changed files with 54 additions and 24 deletions
|
|
@ -1,31 +1,61 @@
|
|||
{...}: {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
catppuccinFlavour = "mocha";
|
||||
catppuccinStarship = pkgs.catppuccin + /starship/${catppuccinFlavour}.toml;
|
||||
|
||||
presets = {
|
||||
nerdFontSymbols = pkgs.fetchurl {
|
||||
url = "https://starship.rs/presets/toml/nerd-font-symbols.toml";
|
||||
hash = "sha256-JKX+DKY4IPQwNj3znkhMUReNqbKBxdJyBZW+WCdKwuU=";
|
||||
};
|
||||
};
|
||||
# -------------------------------- F U N C T I O N S --------------------------------
|
||||
|
||||
/*
|
||||
Gonna be honest, I have no idea how this works, although it seems to work
|
||||
Stolen from https://gist.github.com/pdalpra/daf339f59288201a6c8ba7dc84e9060e
|
||||
*/
|
||||
# Takes a list of attrSets and merges them
|
||||
mergeAllAttrSets = attrsSets:
|
||||
foldl' recursiveUpdate {} attrsSets;
|
||||
|
||||
# Reads a TOML file and parses it
|
||||
readTomlPreset = file: (fromTOML (readFile file));
|
||||
in {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
presets = [
|
||||
"nerd-font-symbols"
|
||||
settings = mergeAllAttrSets [
|
||||
(readTomlPreset presets.nerdFontSymbols)
|
||||
(readTomlPreset catppuccinStarship)
|
||||
{
|
||||
nix_shell = {
|
||||
disabled = false;
|
||||
heuristic = true;
|
||||
};
|
||||
os = {
|
||||
disabled = false;
|
||||
};
|
||||
directory = {
|
||||
disabled = false;
|
||||
truncation_length = 6;
|
||||
truncation_symbol = ".../";
|
||||
};
|
||||
palette = "catppuccin_${catppuccinFlavour}";
|
||||
}
|
||||
];
|
||||
settings = {
|
||||
nix_shell = {
|
||||
disabled = false;
|
||||
heuristic = true;
|
||||
};
|
||||
os = {
|
||||
disabled = false;
|
||||
};
|
||||
directory = {
|
||||
disabled = false;
|
||||
truncation_length = 6;
|
||||
truncation_symbol = ".../";
|
||||
};
|
||||
};
|
||||
};
|
||||
# The catppuccin module only works for home-manager, so this
|
||||
# sets up starship with home-manager using the system config
|
||||
# home-manager.users.toast = {osConfig, ...}: {
|
||||
# programs.starship = {
|
||||
# enable = false;
|
||||
# catppuccin.enable = true;
|
||||
# settings = osConfig.programs.starship.settings;
|
||||
# };
|
||||
# };
|
||||
home-manager.users.toast = {osConfig, ...}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
catppuccin.enable = true;
|
||||
settings = osConfig.programs.starship.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue