diff --git a/manifests/configz-user.lua b/manifests/configz-user.lua index 90d6feb..7a1404a 100644 --- a/manifests/configz-user.lua +++ b/manifests/configz-user.lua @@ -3,3 +3,4 @@ require("modules.clojure") require("modules.lua-lsp") require("modules.nvim") require("modules.nvm") +require("modules.tmux") diff --git a/manifests/workstation.pp b/manifests/workstation.pp index 0a44582..a39f10f 100644 --- a/manifests/workstation.pp +++ b/manifests/workstation.pp @@ -18,7 +18,6 @@ node default { include core::git include core::zsh include core::bin - include core::tmux include core::fonts include core::emacs include core::terminal diff --git a/modules/tmux.lua b/modules/tmux.lua new file mode 100644 index 0000000..12da780 --- /dev/null +++ b/modules/tmux.lua @@ -0,0 +1,29 @@ +local git = require "lib.git" + +local plugin_dir = os.getenv "HOME" .. "/.tmux/plugins" +local config_file = os.getenv "HOME" .. "/.tmux.conf" + +if not configz.is_file(config_file) then + configz.link(config_file, { + source = os.getenv "PWD" .. "/site-modules/core/files/tmux.conf", + }) +end + +if not configz.is_directory(plugin_dir) then + configz.directory(plugin_dir) +end + +local plugins = { + ["tmux-yank"] = { url = "https://github.com/tmux-plugins/tmux-yank.git" }, + ["tmux-open"] = { url = "https://github.com/tmux-plugins/tmux-open.git" }, + ["tmux-copycat"] = { url = "https://github.com/tmux-plugins/tmux-copycat.git" }, + ["base16-tmux"] = { url = "https://github.com/tinted-theming/base16-tmux.git", revision = "main" }, +} + +for plugin, config in pairs(plugins) do + git.repo { + src = config.url, + target = plugin_dir .. "/" .. plugin, + version = config.revision or "master", + } +end diff --git a/site-modules/core/manifests/tmux.pp b/site-modules/core/manifests/tmux.pp deleted file mode 100644 index d8f83e5..0000000 --- a/site-modules/core/manifests/tmux.pp +++ /dev/null @@ -1,48 +0,0 @@ -# -# Config for tmux terminal multiplexer -# -# Author Ade Attwood -# Updated 2018-07-16 -# - -class core::tmux { - exec { 'make tmux dir': - creates => "${user_home}/.tmux/plugins", - path => '/usr/bin:/usr/sbin:/bin', - command => "mkdir -p ${user_home}/.tmux/plugin", - } - - file { "${user_home}/.tmux.conf": - ensure => 'link', - owner => $user, - target => find_file('core/tmux.conf'), - } - - vcsrepo { "${user_home}/.tmux/plugins/tmux-yank": - ensure => latest, - source => 'https://github.com/tmux-plugins/tmux-yank.git', - provider => git, - revision => 'master', - } - - vcsrepo { "${user_home}/.tmux/plugins/tmux-open": - ensure => latest, - source => 'https://github.com/tmux-plugins/tmux-open.git', - provider => git, - revision => 'master', - } - - vcsrepo { "${user_home}/.tmux/plugins/tmux-copycat": - ensure => latest, - source => 'https://github.com/tmux-plugins/tmux-copycat.git', - provider => git, - revision => 'master', - } - - vcsrepo { "${user_home}/.tmux/plugins/base16-tmux": - ensure => latest, - source => 'https://github.com/tinted-theming/base16-tmux.git', - provider => git, - revision => 'main', - } -}