From 23dfb61e2d558bd98f36d767b74fbd222be43df2 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 7 Aug 2022 18:13:46 +0900 Subject: [PATCH 1/3] Change the `git` repository to `gitea.kazu634.com`. --- cookbooks/kazu634/kazu634.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbooks/kazu634/kazu634.rb b/cookbooks/kazu634/kazu634.rb index 335ec9f..df7ad66 100644 --- a/cookbooks/kazu634/kazu634.rb +++ b/cookbooks/kazu634/kazu634.rb @@ -36,7 +36,7 @@ end # Deploy dot files: git '/home/kazu634/repo/dotfiles' do - repository 'https://github.com/kazu634/dotfiles.git' + repository 'https://gitea.kazu634.com/kazu634/dotfiles.git' user 'kazu634' end From a42048cc7d446d4b4b6c5aca796f3635d7b70f21 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 7 Aug 2022 18:18:36 +0900 Subject: [PATCH 2/3] Install `starship`. --- cookbooks/base/default.rb | 3 +++ cookbooks/base/starship.rb | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 cookbooks/base/starship.rb diff --git a/cookbooks/base/default.rb b/cookbooks/base/default.rb index 7c1175a..a20739c 100644 --- a/cookbooks/base/default.rb +++ b/cookbooks/base/default.rb @@ -63,6 +63,9 @@ include_recipe './mc.rb' # Install lsyncd command: include_recipe './lsyncd.rb' +# Install starship command: +include_recipe './starship.rb' + # recipes for Ubuntu 16.04 if node['platform_version'].to_f == 16.04 # ntp configurations diff --git a/cookbooks/base/starship.rb b/cookbooks/base/starship.rb new file mode 100644 index 0000000..d5812eb --- /dev/null +++ b/cookbooks/base/starship.rb @@ -0,0 +1,14 @@ +# インストールスクリプトのダウンロード +execute 'wget -O /tmp/starship-install.sh https://starship.rs/install.sh' do + not_if 'test -e /usr/local/bin/starship' +end + +execute 'chmod +x /tmp/starship-install.sh' do + not_if 'test -e /usr/local/bin/starship' +end + +execute '/tmp/starship-install.sh -y' do + user 'root' + + not_if 'test -e /usr/local/bin/starship' +end From 8f63c7bf3f825fd075dab53ed02c406c6a3c48ed Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 7 Aug 2022 19:06:23 +0900 Subject: [PATCH 3/3] Deploy config file for `starship`. --- .../files/home/kazu634/.config/starship.toml | 176 ++++++++++++++++++ cookbooks/kazu634/kazu634.rb | 13 ++ 2 files changed, 189 insertions(+) create mode 100644 cookbooks/kazu634/files/home/kazu634/.config/starship.toml diff --git a/cookbooks/kazu634/files/home/kazu634/.config/starship.toml b/cookbooks/kazu634/files/home/kazu634/.config/starship.toml new file mode 100644 index 0000000..e3d946d --- /dev/null +++ b/cookbooks/kazu634/files/home/kazu634/.config/starship.toml @@ -0,0 +1,176 @@ +[status] +disabled = false + +[hostname] +ssh_symbol = " 🌏 " + +[git_branch] +symbol = "🌱 " +format = '\[[$symbol$branch]($style)\]' + +[git_status] +conflicted = "🏳" +ahead = "🏎💨" +behind = "😰" +diverged = "😵" +up_to_date = "✓" +untracked = "🤷" +stashed = "📦" +modified = "📝" +staged = '[++\($count\)](green)' +renamed = "👅" +deleted = "🗑" + +[aws] +format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]' + +[c] +format = '\[[$symbol($version(-$name))]($style)\]' + +[cmake] +format = '\[[$symbol($version)]($style)\]' + +[cmd_duration] +format = '\[[⏱ $duration]($style)\]' + +[cobol] +format = '\[[$symbol($version)]($style)\]' + +[conda] +format = '\[[$symbol$environment]($style)\]' + +[crystal] +format = '\[[$symbol($version)]($style)\]' + +[daml] +format = '\[[$symbol($version)]($style)\]' + +[dart] +format = '\[[$symbol($version)]($style)\]' + +[deno] +format = '\[[$symbol($version)]($style)\]' + +[docker_context] +format = '\[[$symbol$context]($style)\]' + +[dotnet] +format = '\[[$symbol($version)(🎯 $tfm)]($style)\]' + +[elixir] +format = '\[[$symbol($version \(OTP $otp_version\))]($style)\]' + +[elm] +format = '\[[$symbol($version)]($style)\]' + +[erlang] +format = '\[[$symbol($version)]($style)\]' + +[gcloud] +format = '\[[$symbol$account(@$domain)(\($region\))]($style)\]' + +[golang] +format = '\[[$symbol($version)]($style)\]' + +[haskell] +format = '\[[$symbol($version)]($style)\]' + +[helm] +format = '\[[$symbol($version)]($style)\]' + +[hg_branch] +format = '\[[$symbol$branch]($style)\]' + +[java] +format = '\[[$symbol($version)]($style)\]' + +[julia] +format = '\[[$symbol($version)]($style)\]' + +[kotlin] +format = '\[[$symbol($version)]($style)\]' + +[kubernetes] +format = '\[[$symbol$context( \($namespace\))]($style)\]' + +[lua] +format = '\[[$symbol($version)]($style)\]' + +[memory_usage] +format = '\[$symbol[$ram( | $swap)]($style)\]' + +[nim] +format = '\[[$symbol($version)]($style)\]' + +[nix_shell] +format = '\[[$symbol$state( \($name\))]($style)\]' + +[nodejs] +format = '\[[$symbol($version)]($style)\]' + +[ocaml] +format = '\[[$symbol($version)(\($switch_indicator$switch_name\))]($style)\]' + +[openstack] +format = '\[[$symbol$cloud(\($project\))]($style)\]' + +[package] +format = '\[[$symbol$version]($style)\]' + +[perl] +format = '\[[$symbol($version)]($style)\]' + +[php] +format = '\[[$symbol($version)]($style)\]' + +[pulumi] +format = '\[[$symbol$stack]($style)\]' + +[purescript] +format = '\[[$symbol($version)]($style)\]' + +[python] +format = '\[[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)\]' + +[raku] +format = '\[[$symbol($version-$vm_version)]($style)\]' + +[red] +format = '\[[$symbol($version)]($style)\]' + +[ruby] +format = '\[[$symbol($version)]($style)\]' + +[rust] +format = '\[[$symbol($version)]($style)\]' + +[scala] +format = '\[[$symbol($version)]($style)\]' + +[spack] +format = '\[[$symbol$environment]($style)\]' + +[sudo] +format = '\[[as $symbol]\]' + +[swift] +format = '\[[$symbol($version)]($style)\]' + +[terraform] +format = '\[[$symbol$workspace]($style)\]' + +[time] +format = '\[[$time]($style)\]' + +[username] +format = '\[[$user]($style)\]' + +[vagrant] +format = '\[[$symbol($version)]($style)\]' + +[vlang] +format = '\[[$symbol($version)]($style)\]' + +[zig] +format = '\[[$symbol($version)]($style)\]' + diff --git a/cookbooks/kazu634/kazu634.rb b/cookbooks/kazu634/kazu634.rb index df7ad66..9f8ea3d 100644 --- a/cookbooks/kazu634/kazu634.rb +++ b/cookbooks/kazu634/kazu634.rb @@ -53,6 +53,19 @@ git '/home/kazu634/.zplug' do user 'kazu634' end +# Starship config +directory '/home/kazu634/.config' do + owner 'kazu634' + group 'kazu634' + mode '0740' +end + +remote_file '/home/kazu634/.config/starship.toml' do + owner 'kazu634' + group 'kazu634' + mode '0640' +end + # sudoers remote_file '/etc/sudoers.d/kazu634' do owner 'root'