style: format with nixpkgs-fmt

This commit is contained in:
seth 2023-04-18 20:01:16 -04:00 committed by GitHub
parent a8981723bb
commit 27683fd6b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 94 additions and 75 deletions

View file

@ -8,12 +8,14 @@ in {
with lib; with lib;
with pkgs; with pkgs;
let let
file = fetchFromGitHub { file = fetchFromGitHub
owner = "catppuccin"; {
repo = "alacritty"; owner = "catppuccin";
rev = "3c808cbb4f9c87be43ba5241bc57373c793d2f17"; repo = "alacritty";
sha256 = "sha256-w9XVtEe7TqzxxGUCDUR9BFkzLZjG8XrplXJ3lX6f+x0="; rev = "3c808cbb4f9c87be43ba5241bc57373c793d2f17";
} + "/catppuccin-${cfg.flavour}.yml"; sha256 = "sha256-w9XVtEe7TqzxxGUCDUR9BFkzLZjG8XrplXJ3lX6f+x0=";
} + "/catppuccin-${cfg.flavour}.yml";
in mkIf cfg.enable (ctp.fromYaml pkgs file); in
mkIf cfg.enable (ctp.fromYaml pkgs file);
} }

View file

@ -7,10 +7,11 @@ in {
config.programs.bottom.settings = with builtins; config.programs.bottom.settings = with builtins;
with lib; with lib;
with pkgs; with pkgs;
mkIf cfg.enable (fromTOML (readFile (fetchFromGitHub { mkIf cfg.enable (fromTOML (readFile (fetchFromGitHub
owner = "catppuccin"; {
repo = "bottom"; owner = "catppuccin";
rev = "c0efe9025f62f618a407999d89b04a231ba99c92"; repo = "bottom";
sha256 = "sha256-VaHX2I/Gn82wJWzybpWNqU3dPi3206xItOlt0iF6VVQ="; rev = "c0efe9025f62f618a407999d89b04a231ba99c92";
} + "/themes/${cfg.flavour}.toml"))); sha256 = "sha256-VaHX2I/Gn82wJWzybpWNqU3dPi3206xItOlt0iF6VVQ=";
} + "/themes/${cfg.flavour}.toml")));
} }

View file

@ -2,13 +2,15 @@
let let
cfg = config.programs.btop.catppuccin; cfg = config.programs.btop.catppuccin;
themePath = "/themes/catppuccin_${cfg.flavour}.theme"; themePath = "/themes/catppuccin_${cfg.flavour}.theme";
theme = pkgs.fetchFromGitHub { theme = pkgs.fetchFromGitHub
owner = "catppuccin"; {
repo = "btop"; owner = "catppuccin";
rev = "7109eac2884e9ca1dae431c0d7b8bc2a7ce54e54"; repo = "btop";
sha256 = "sha256-QoPPx4AzxJMYo/prqmWD/CM7e5vn/ueyx+XQ5+YfHF8="; rev = "7109eac2884e9ca1dae431c0d7b8bc2a7ce54e54";
} + themePath; sha256 = "sha256-QoPPx4AzxJMYo/prqmWD/CM7e5vn/ueyx+XQ5+YfHF8=";
in { } + themePath;
in
{
options.programs.btop.catppuccin = options.programs.btop.catppuccin =
lib.ctp.mkCatppuccinOpt "btop" config; lib.ctp.mkCatppuccinOpt "btop" config;

View file

@ -1,22 +1,26 @@
{ config, pkgs, lib, ... }: let { config, pkgs, lib, ... }:
extendedLib = import ../lib/mkExtLib.nix lib; let
in { extendedLib = import ../lib/mkExtLib.nix lib;
imports = let in
files = [ {
./alacritty.nix imports =
./bat.nix let
./bottom.nix files = [
./btop.nix ./alacritty.nix
./kitty.nix ./bat.nix
./starship.nix ./bottom.nix
./helix.nix ./btop.nix
./gtk.nix ./kitty.nix
./neovim.nix ./starship.nix
./polybar.nix ./helix.nix
./sway.nix ./gtk.nix
./tmux.nix ./neovim.nix
]; ./polybar.nix
in extendedLib.ctp.mapModules config pkgs extendedLib files; ./sway.nix
./tmux.nix
];
in
extendedLib.ctp.mapModules config pkgs extendedLib files;
options.catppuccin = with extendedLib; { options.catppuccin = with extendedLib; {
flavour = mkOption { flavour = mkOption {

View file

@ -3,18 +3,18 @@ let cfg = config.gtk.catppuccin;
in { in {
options.gtk.catppuccin = with lib; options.gtk.catppuccin = with lib;
ctp.mkCatppuccinOpt "gtk" config // { ctp.mkCatppuccinOpt "gtk" config // {
accent = ctp.mkAccentOpt "gtk" config; accent = ctp.mkAccentOpt "gtk" config;
size = mkOption { size = mkOption {
type = types.enum [ "standard" "compact" ]; type = types.enum [ "standard" "compact" ];
default = "standard"; default = "standard";
description = "Catppuccin size variant for gtk"; description = "Catppuccin size variant for gtk";
};
tweaks = mkOption {
type = types.listOf (types.enum [ "black" "rimless" "normal" ]);
default = [ "normal" ];
description = "Catppuccin tweaks for gtk";
};
}; };
tweaks = mkOption {
type = types.listOf (types.enum [ "black" "rimless" "normal" ]);
default = [ "normal" ];
description = "Catppuccin tweaks for gtk";
};
};
config.gtk.theme = with builtins; config.gtk.theme = with builtins;
with lib; with lib;
@ -26,7 +26,8 @@ in {
# use the light gtk theme for latte # use the light gtk theme for latte
gtkTheme = if cfg.flavour == "latte" then "Light" else "Dark"; gtkTheme = if cfg.flavour == "latte" then "Light" else "Dark";
in mkIf cfg.enable { in
mkIf cfg.enable {
name = name =
"Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}"; "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}";
package = pkgs.catppuccin-gtk.override { package = pkgs.catppuccin-gtk.override {

View file

@ -15,11 +15,12 @@ in {
theme = "catppuccin-${cfg.flavour}"; theme = "catppuccin-${cfg.flavour}";
editor.color-modes = mkDefault true; editor.color-modes = mkDefault true;
}; };
themes."catppuccin-${cfg.flavour}" = fromTOML (readFile (fetchFromGitHub { themes."catppuccin-${cfg.flavour}" = fromTOML (readFile (fetchFromGitHub
owner = "catppuccin"; {
repo = "helix"; owner = "catppuccin";
rev = "5677c16dc95297a804caea9161072ff174018fdd"; repo = "helix";
sha256 = "sha256-aa8KZ7/1TXcBqaV/TYOZ8rpusOf5QeQ9i2Upnncbziw="; rev = "5677c16dc95297a804caea9161072ff174018fdd";
} + "/themes/${subdir}/catppuccin_${cfg.flavour}.toml")); sha256 = "sha256-aa8KZ7/1TXcBqaV/TYOZ8rpusOf5QeQ9i2Upnncbziw=";
} + "/themes/${subdir}/catppuccin_${cfg.flavour}.toml"));
}; };
} }

View file

@ -7,10 +7,11 @@ in {
config.services.polybar.extraConfig = with builtins; config.services.polybar.extraConfig = with builtins;
with lib; with lib;
with pkgs; with pkgs;
mkIf cfg.enable (readFile (fetchFromGitHub { mkIf cfg.enable (readFile (fetchFromGitHub
owner = "catppuccin"; {
repo = "polybar"; owner = "catppuccin";
rev = "9ee66f83335404186ce979bac32fcf3cd047396a"; repo = "polybar";
sha256 = "sha256-bUbSgMg/sa2faeEUZo80GNmhOX3wn2jLzfA9neF8ERA="; rev = "9ee66f83335404186ce979bac32fcf3cd047396a";
} + "/themes/${cfg.flavour}.ini")); sha256 = "sha256-bUbSgMg/sa2faeEUZo80GNmhOX3wn2jLzfA9neF8ERA=";
} + "/themes/${cfg.flavour}.ini"));
} }

View file

@ -15,7 +15,8 @@ let
sha256 = "sha256-bXEsxt4ozl3cAzV3ZyvbPsnmy0RAdpLxHwN82gvjLdU="; sha256 = "sha256-bXEsxt4ozl3cAzV3ZyvbPsnmy0RAdpLxHwN82gvjLdU=";
}; };
}; };
in { in
{
options.programs.tmux.catppuccin = options.programs.tmux.catppuccin =
lib.ctp.mkCatppuccinOpt "tmux" config; lib.ctp.mkCatppuccinOpt "tmux" config;

View file

@ -17,7 +17,8 @@ with lib; rec {
json = with pkgs; runCommand "converted.json" { } '' json = with pkgs; runCommand "converted.json" { } ''
${yj}/bin/yj < ${file} > $out ${yj}/bin/yj < ${file} > $out
''; '';
in fromJSON (readFile json); in
fromJSON (readFile json);
# a -> a -> [path] -> [path] # a -> a -> [path] -> [path]
# this imports a list of paths while inheriting # this imports a list of paths while inheriting

View file

@ -1,11 +1,14 @@
{ config, pkgs, lib, ... }: let { config, pkgs, lib, ... }:
extendedLib = import ../lib/mkExtLib.nix lib; let
in { extendedLib = import ../lib/mkExtLib.nix lib;
imports = let in
files = [ {
./grub.nix imports =
]; let
in files = [
./grub.nix
];
in
extendedLib.ctp.mapModules config pkgs extendedLib files; extendedLib.ctp.mapModules config pkgs extendedLib files;

View file

@ -10,11 +10,13 @@ let
rev = "803c5df0e83aba61668777bb96d90ab8f6847106"; rev = "803c5df0e83aba61668777bb96d90ab8f6847106";
sha256 = "sha256-/bSolCta8GCZ4lP0u5NVqYQ9Y3ZooYCNdTwORNvR7M0="; sha256 = "sha256-/bSolCta8GCZ4lP0u5NVqYQ9Y3ZooYCNdTwORNvR7M0=";
}; };
in runCommand "catppuccin-grub-theme" { } '' in
runCommand "catppuccin-grub-theme" { } ''
mkdir -p "$out" mkdir -p "$out"
cp -r ${src}/src/catppuccin-${cfg.flavour}-grub-theme/* "$out"/ cp -r ${src}/src/catppuccin-${cfg.flavour}-grub-theme/* "$out"/
''; '';
in { in
{
options.boot.loader.grub.catppuccin = options.boot.loader.grub.catppuccin =
lib.ctp.mkCatppuccinOpt "grub" config; lib.ctp.mkCatppuccinOpt "grub" config;