2019-03-03 08:50:49 +00:00
|
|
|
HOME = '/home/kazu634'
|
|
|
|
|
|
|
|
# Create User:
|
|
|
|
user 'kazu634' do
|
|
|
|
password '$1$7Zch2rSt$XEFT8T9XS24gY1rctRLtA1'
|
|
|
|
|
|
|
|
create_home true
|
|
|
|
home HOME
|
|
|
|
|
2019-08-10 09:19:08 +00:00
|
|
|
shell '/usr/bin/zsh'
|
2019-03-03 08:50:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Create directories:
|
|
|
|
%w( repo src tmp works .cache ).each do |d|
|
|
|
|
directory "#{HOME}/#{d}" do
|
|
|
|
owner 'kazu634'
|
|
|
|
group 'kazu634'
|
|
|
|
mode '755'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# `git-now` deployment:
|
|
|
|
git '/home/kazu634/repo/git-now' do
|
2022-07-03 12:29:46 +00:00
|
|
|
repository 'https://github.com/iwata/git-now.git'
|
2019-03-03 08:50:49 +00:00
|
|
|
user 'kazu634'
|
|
|
|
|
|
|
|
recursive true
|
|
|
|
end
|
|
|
|
|
|
|
|
execute 'make install' do
|
|
|
|
user 'root'
|
|
|
|
cwd '/home/kazu634/repo/git-now/'
|
|
|
|
|
|
|
|
not_if 'which git-now'
|
|
|
|
end
|
|
|
|
|
|
|
|
# Deploy dot files:
|
|
|
|
git '/home/kazu634/repo/dotfiles' do
|
2022-08-07 09:13:46 +00:00
|
|
|
repository 'https://gitea.kazu634.com/kazu634/dotfiles.git'
|
2019-03-03 08:50:49 +00:00
|
|
|
user 'kazu634'
|
|
|
|
end
|
|
|
|
|
|
|
|
execute 'install_dotfiles' do
|
|
|
|
user 'root'
|
|
|
|
command 'su - kazu634 -c "/home/kazu634/repo/dotfiles/install.sh"'
|
|
|
|
|
|
|
|
not_if 'test -f /home/kazu634/.zshenv'
|
|
|
|
end
|
|
|
|
|
|
|
|
# Deploy `zplug`:
|
|
|
|
git '/home/kazu634/.zplug' do
|
2022-07-03 12:29:46 +00:00
|
|
|
repository 'https://github.com/zplug/zplug.git'
|
2019-03-03 08:50:49 +00:00
|
|
|
user 'kazu634'
|
|
|
|
end
|
|
|
|
|
2022-08-07 10:06:23 +00:00
|
|
|
# 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
|
|
|
|
|
2019-03-03 08:50:49 +00:00
|
|
|
# sudoers
|
|
|
|
remote_file '/etc/sudoers.d/kazu634' do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '440'
|
|
|
|
end
|
|
|
|
|
|
|
|
# automatically delete the /home/kazu634/tmp directory:
|
|
|
|
remote_file '/etc/cron.d/remove_tmp' do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '644'
|
|
|
|
end
|
2024-02-12 08:52:23 +00:00
|
|
|
|
|
|
|
# Deploy `~/works/rsync.sh`:
|
|
|
|
%w( rsync.sh lsyncd.conf.lua ).each do |file|
|
|
|
|
remote_file "/home/kazu634/works/#{file}" do
|
|
|
|
owner 'kazu634'
|
|
|
|
group 'kazu634'
|
|
|
|
mode '755'
|
|
|
|
end
|
|
|
|
end
|