From 1709f64a69642ecd1532222e3d3b591ff40101b3 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 18 Jul 2023 02:17:44 +0000 Subject: [PATCH] zsh/starship: fix init --- hosts/common/programs/zsh/starship.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hosts/common/programs/zsh/starship.nix b/hosts/common/programs/zsh/starship.nix index 79ef0fcc..dd1a76db 100644 --- a/hosts/common/programs/zsh/starship.nix +++ b/hosts/common/programs/zsh/starship.nix @@ -1,13 +1,18 @@ +# starship prompt: { config, lib, pkgs, ...}: let - # starship prompt: - # populate ~/.config/starship.toml to customize - starship-init = '' - eval "$(${pkgs.starship}/bin/starship init zsh)" - ''; + enabled = config.sane.zsh.starship; + toml = pkgs.formats.toml {}; in { config = lib.mkIf config.sane.zsh.starship { - programs.zsh.interactiveShellInit = starship-init; + sane.programs.zsh = lib.mkIf enabled { + fs.".config/zsh/.zshrc".symlink.text = '' + eval "$(${pkgs.starship}/bin/starship init zsh)" + ''; + fs.".config/starship.toml".symlink.target = toml.generate "starship.toml" { + format = "$all"; + }; + }; }; }