Programs/common/starship: add upstream nerd font preset
This commit is contained in:
parent
9a8309def9
commit
a80920a663
1 changed files with 43 additions and 20 deletions
|
|
@ -1,4 +1,8 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
with builtins;
|
||||||
|
|
||||||
let
|
let
|
||||||
catppuccinFlavour = "mocha";
|
catppuccinFlavour = "mocha";
|
||||||
catppuccinStarship = pkgs.fetchFromGitHub {
|
catppuccinStarship = pkgs.fetchFromGitHub {
|
||||||
|
|
@ -8,27 +12,46 @@ let
|
||||||
rev = "main";
|
rev = "main";
|
||||||
hash = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0=";
|
hash = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0=";
|
||||||
} + /palettes/${catppuccinFlavour}.toml;
|
} + /palettes/${catppuccinFlavour}.toml;
|
||||||
|
|
||||||
|
presets = {
|
||||||
|
nerdFontSymbols = pkgs.fetchurl {
|
||||||
|
url = "https://starship.rs/presets/toml/nerd-font-symbols.toml";
|
||||||
|
hash = "sha256-fPmZrfhwM9NakdlJ7Y4rZ5n6JjsqXNEQ9XuFa8en9n0=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# -------------------------------- 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
|
in
|
||||||
{
|
{
|
||||||
programs.starship = with builtins; {
|
programs.starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = mergeAllAttrSets [
|
||||||
nix_shell = {
|
(readTomlPreset presets.nerdFontSymbols)
|
||||||
disabled = false;
|
(readTomlPreset catppuccinStarship)
|
||||||
heuristic = true;
|
{
|
||||||
symbol = " ";
|
nix_shell = {
|
||||||
};
|
disabled = false;
|
||||||
os = {
|
heuristic = true;
|
||||||
disabled = false;
|
};
|
||||||
symbols.NixOS = " ";
|
os = {
|
||||||
};
|
disabled = false;
|
||||||
directory = {
|
};
|
||||||
disabled = false;
|
directory = {
|
||||||
read_only = " ";
|
disabled = false;
|
||||||
};
|
};
|
||||||
palette = "catppuccin_${catppuccinFlavour}";
|
palette = "catppuccin_${catppuccinFlavour}";
|
||||||
} //
|
}
|
||||||
# Add the catppuccin palette to the settings file
|
];
|
||||||
(fromTOML (readFile catppuccinStarship));
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue