From 968f13d47044bdfe07d7a96310e386145900384e Mon Sep 17 00:00:00 2001 From: Chet Luther Date: Wed, 19 Mar 2025 13:37:25 -0400 Subject: [PATCH] starship: init (#995) Closes: https://github.com/danth/stylix/issues/301 Link: https://github.com/danth/stylix/pull/995 Reviewed-by: awwpotato <153149335+awwpotato@users.noreply.github.com> Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- modules/starship/hm.nix | 79 ++++++++++++++++++++++++++++++++++++ modules/starship/meta.nix | 4 ++ modules/starship/testbed.nix | 26 ++++++++++++ stylix/maintainers.nix | 9 +++- 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 modules/starship/hm.nix create mode 100644 modules/starship/meta.nix create mode 100644 modules/starship/testbed.nix diff --git a/modules/starship/hm.nix b/modules/starship/hm.nix new file mode 100644 index 00000000..0e2662f2 --- /dev/null +++ b/modules/starship/hm.nix @@ -0,0 +1,79 @@ +# Starship configuration documentation: https://starship.rs/config/ +{ + config, + lib, + ... +}: +{ + options.stylix.targets.starship.enable = + config.lib.stylix.mkEnableTarget "Starship" true; + + config = + lib.mkIf (config.stylix.enable && config.stylix.targets.starship.enable) + { + programs.starship.settings = { + palette = "base16"; + palettes.base16 = with config.lib.stylix.colors.withHashtag; { + black = base00; + bright-black = base03; + white = base05; + bright-white = base07; + + # There's just one yellow. + bright-yellow = yellow; + + # Starship calls magenta purple. + purple = magenta; + bright-purple = bright-magenta; + + inherit + # Set Starship's standard normal color names. + red + orange + yellow + green + cyan + blue + magenta + brown + + # Set Starship's standard bright color names. + bright-red + bright-orange + bright-green + bright-cyan + bright-blue + bright-magenta + + # Add base16 names to the template for custom usage. + base00 + base01 + base02 + base03 + base04 + base05 + base06 + base07 + base08 + base09 + base0A + base0B + base0C + base0D + base0E + base0F + + # Add base24 names to the template for custom usage. + base10 + base11 + base12 + base13 + base14 + base15 + base16 + base17 + ; + }; + }; + }; +} diff --git a/modules/starship/meta.nix b/modules/starship/meta.nix new file mode 100644 index 00000000..d3b3a7a3 --- /dev/null +++ b/modules/starship/meta.nix @@ -0,0 +1,4 @@ +{ lib, ... }: +{ + maintainers = [ lib.maintainers.cluther ]; +} diff --git a/modules/starship/testbed.nix b/modules/starship/testbed.nix new file mode 100644 index 00000000..3c4870c7 --- /dev/null +++ b/modules/starship/testbed.nix @@ -0,0 +1,26 @@ +{ lib, pkgs, ... }: +{ + stylix.testbed.application = { + enable = true; + name = "Alacritty"; + package = pkgs.alacritty; + }; + + home-manager.sharedModules = lib.singleton { + programs = { + alacritty = { + enable = true; + package = pkgs.alacritty; + }; + bash = { + enable = true; + package = pkgs.bashInteractive; + }; + starship = { + enable = true; + package = pkgs.starship; + enableBashIntegration = true; + }; + }; + }; +} diff --git a/stylix/maintainers.nix b/stylix/maintainers.nix index 2f436b61..12b8b7dc 100644 --- a/stylix/maintainers.nix +++ b/stylix/maintainers.nix @@ -5,4 +5,11 @@ # are expected to follow the same format as described in [1]. # # [1]: https://github.com/NixOS/nixpkgs/blob/1da63e6cc622a0cb6fd5b86d49923e4eb1e33b70/maintainers/maintainer-list.nix -{ } +{ + cluther = { + name = "Chet Luther"; + email = "chet.luther@gmail.com"; + github = "cluther"; + githubId = 86579; + }; +}