about summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authoréclairevoyant <848000+eclairevoyant@users.noreply.github.com>2024-03-19 08:59:01 -0400
committertomf <tom@tom-fitzhenry.me.uk>2024-03-20 21:08:43 +1100
commit4f9d91e276539428a20bcb47d781778e152a67ee (patch)
tree2b0099d11e3deeb21e191a4849e7649928fa925c /nixos/modules/programs
parent724c33094ee275f1774c5e9b8af1006c97f22bb5 (diff)
downloadnixlib-4f9d91e276539428a20bcb47d781778e152a67ee.tar
nixlib-4f9d91e276539428a20bcb47d781778e152a67ee.tar.gz
nixlib-4f9d91e276539428a20bcb47d781778e152a67ee.tar.bz2
nixlib-4f9d91e276539428a20bcb47d781778e152a67ee.tar.lz
nixlib-4f9d91e276539428a20bcb47d781778e152a67ee.tar.xz
nixlib-4f9d91e276539428a20bcb47d781778e152a67ee.tar.zst
nixlib-4f9d91e276539428a20bcb47d781778e152a67ee.zip
nixos/starship: allow setting package
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/starship.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/programs/starship.nix b/nixos/modules/programs/starship.nix
index 34f6f0882c61..9eeeab15016d 100644
--- a/nixos/modules/programs/starship.nix
+++ b/nixos/modules/programs/starship.nix
@@ -12,7 +12,7 @@ let
       nativeBuildInputs = [ pkgs.yq ];
     } ''
     tomlq -s -t 'reduce .[] as $item ({}; . * $item)' \
-      ${lib.concatStringsSep " " (map (f: "${pkgs.starship}/share/starship/presets/${f}.toml") cfg.presets)} \
+      ${lib.concatStringsSep " " (map (f: "${cfg.package}/share/starship/presets/${f}.toml") cfg.presets)} \
       ${userSettingsFile} \
       > $out
   '';
@@ -28,6 +28,8 @@ in
   options.programs.starship = {
     enable = lib.mkEnableOption (lib.mdDoc "the Starship shell prompt");
 
+    package = lib.mkPackageOption pkgs "starship" { };
+
     interactiveOnly = lib.mkOption {
       default = true;
       example = false;
@@ -68,7 +70,7 @@ in
         if [[ ! -f "$HOME/.config/starship.toml" ]]; then
           export STARSHIP_CONFIG=${settingsFile}
         fi
-        eval "$(${pkgs.starship}/bin/starship init bash)"
+        eval "$(${cfg.package}/bin/starship init bash)"
       fi
     '';
 
@@ -81,7 +83,7 @@ in
         if not test -f "$HOME/.config/starship.toml";
           set -x STARSHIP_CONFIG ${settingsFile}
         end
-        eval (${pkgs.starship}/bin/starship init fish)
+        eval (${cfg.package}/bin/starship init fish)
       end
     '';
 
@@ -94,7 +96,7 @@ in
         if [[ ! -f "$HOME/.config/starship.toml" ]]; then
           export STARSHIP_CONFIG=${settingsFile}
         fi
-        eval "$(${pkgs.starship}/bin/starship init zsh)"
+        eval "$(${cfg.package}/bin/starship init zsh)"
       fi
     '';
   };