Skip to content

Commit

Permalink
feat(home-manager): add starship theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Stonks3141 committed Mar 28, 2023
1 parent f79d1ec commit fa2b78a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
description = "Soothing pastel theme for Nix";
inputs = {};
outputs = { self }: {
nixosModules.default = import ./nixos;
homeManagerModules.default = import ./home-manager;
Expand Down
15 changes: 6 additions & 9 deletions home-manager/bat.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
{ config, pkgs, lib, ... }: {
{ config, pkgs, lib, ... }:
let cfg = config.programs.bat.catppuccin; in
{
options.programs.bat.catppuccin = {
enable = lib.mkEnableOption "Catppuccin";
enable = lib.mkEnableOption "Catppuccin theme";
flavour = lib.mkOption {
type = lib.types.enum [ "latte" "frappe" "macchiato" "mocha" ];
default = config.catppuccin.flavour;
description = "Catppuccin flavour for bat";
};
};

config = let
cfg = config.programs.bat.catppuccin;
in
{
home.activation = {
batCache = "${pkgs.bat}/bin/bat cache --build";
};
config = {
home.activation.batCache = "${pkgs.bat}/bin/bat cache --build";

programs.bat = lib.mkIf cfg.enable {
enable = true;
Expand Down
1 change: 1 addition & 0 deletions home-manager/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ config, pkgs, lib, ... }: {
imports = [
./bat.nix
./starship.nix
];
options.catppuccin = {
flavour = lib.mkOption {
Expand Down
25 changes: 25 additions & 0 deletions home-manager/starship.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ config, pkgs, lib, ... }:
let cfg = config.programs.starship.catppuccin; in
{
options.programs.starship.catppuccin = {
enable = lib.mkEnableOption "Catppuccin theme";
flavour = lib.mkOption {
type = lib.types.enum [ "latte" "frappe" "macchiato" "mocha" ];
default = config.catppuccin.flavour;
description = "Catppuccin flavour for starship";
};
};

config.programs.starship.settings = lib.mkIf cfg.enable
({
format = lib.mkDefault "$all";
palette = "catppuccin_${cfg.flavour}";
} // builtins.fromTOML (builtins.readFile
(pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "starship";
rev = "3e3e54410c3189053f4da7a7043261361a1ed1bc";
sha256 = "sha256-soEBVlq3ULeiZFAdQYMRFuswIIhI9bclIU8WXjxd7oY=";
} + /palettes/${cfg.flavour}.toml)));
}
2 changes: 1 addition & 1 deletion nixos/default.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ pkgs, lib, ... }: {}
{ pkgs, lib, ... }: { }

0 comments on commit fa2b78a

Please sign in to comment.