starship: only generate file when configured

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman
2026-02-26 22:00:35 -06:00
parent d70de619f7
commit 3113094428
+4 -2
View File
@@ -10,6 +10,7 @@ let
cfg = config.programs.starship;
tomlFormat = pkgs.formats.toml { };
hasGeneratedConfig = cfg.settings != { } || cfg.presets != [ ];
initFish = if cfg.enableInteractive then "interactiveShellInit" else "shellInitLast";
in
@@ -110,7 +111,7 @@ in
sessionVariables.STARSHIP_CONFIG = cfg.configPath;
file.${cfg.configPath} =
file.${cfg.configPath} = mkIf hasGeneratedConfig (
let
settingsFile = tomlFormat.generate "starship-config" cfg.settings;
in
@@ -131,7 +132,8 @@ in
${settingsFile} \
> $out
'';
};
}
);
};