From d412f2641d55f8d1a6c5450e93cf6449b66e8bba Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 11 Jan 2025 20:36:27 +0800 Subject: [PATCH] move starship configuration to home/modules. --- .../configurations/Tytonidae/default.nix | 2 +- .../Tytonidae/starship/default.nix | 13 ------- home/modules/default.nix | 1 + home/modules/shell/default.nix | 3 -- .../starship/config.toml | 0 home/modules/starship/default.nix | 36 +++++++++++++++++++ 6 files changed, 38 insertions(+), 17 deletions(-) delete mode 100644 home/david/configurations/Tytonidae/starship/default.nix rename home/{david/configurations/Tytonidae => modules}/starship/config.toml (100%) create mode 100644 home/modules/starship/default.nix diff --git a/home/david/configurations/Tytonidae/default.nix b/home/david/configurations/Tytonidae/default.nix index e207d8e..e8f536b 100644 --- a/home/david/configurations/Tytonidae/default.nix +++ b/home/david/configurations/Tytonidae/default.nix @@ -8,7 +8,6 @@ }: { imports = [ - ./starship ./firefox.nix ./niri ]; @@ -25,6 +24,7 @@ bash.enable = true; ghostty.enable = true; foot.enable = false; + starship.enable = true; }; xdg.userDirs = { diff --git a/home/david/configurations/Tytonidae/starship/default.nix b/home/david/configurations/Tytonidae/starship/default.nix deleted file mode 100644 index 4318c73..0000000 --- a/home/david/configurations/Tytonidae/starship/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, ... }: -{ - programs.starship = { - enable = true; - # settings = - # let - # config-file = builtins.readFile ./config.toml; - # in - # builtins.fromTOML config-file; - }; - - xdg.configFile."starship.toml".source = config.lib.file.mkOutOfStoreSymlink ./config.toml; -} diff --git a/home/modules/default.nix b/home/modules/default.nix index 5417394..a824df9 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -12,6 +12,7 @@ ./shell ./ghostty.nix ./foot + ./starship ]; options = { diff --git a/home/modules/shell/default.nix b/home/modules/shell/default.nix index f8369b9..2b0a6bf 100644 --- a/home/modules/shell/default.nix +++ b/home/modules/shell/default.nix @@ -44,9 +44,6 @@ in config = mkMerge [ { programs = { - starship = cfg-helper { - enable = true; - }; zoxide = cfg-helper { enable = true; }; diff --git a/home/david/configurations/Tytonidae/starship/config.toml b/home/modules/starship/config.toml similarity index 100% rename from home/david/configurations/Tytonidae/starship/config.toml rename to home/modules/starship/config.toml diff --git a/home/modules/starship/default.nix b/home/modules/starship/default.nix new file mode 100644 index 0000000..cf8691e --- /dev/null +++ b/home/modules/starship/default.nix @@ -0,0 +1,36 @@ +{ lib, config, ... }: +let + cfg = config.youthlic.programs.starship; +in +{ + options = { + youthlic.programs.starship = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + example = false; + description = '' + whether enable starship + ''; + }; + }; + }; + config = lib.mkIf cfg.enable { + programs.starship = lib.mkMerge [ + { + enable = true; + settings = + let + config-file = builtins.readFile ./config.toml; + in + builtins.fromTOML config-file; + } + (lib.mkIf config.youthlic.programs.fish.enable { + enableFishIntegration = true; + }) + (lib.mkIf config.youthlic.programs.bash.enable { + enableBashIntegration = true; + }) + ]; + }; +}