aboutsummaryrefslogtreecommitdiffhomepage
path: root/mitamae
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-09-07 02:38:53 +0900
committernsfisis <nsfisis@gmail.com>2023-09-07 02:38:53 +0900
commit6a7baab2da521c9564a2408d60d885816f1a1be6 (patch)
tree59f49a19f231182c1d1ec86c04222bf3c7c85e30 /mitamae
parent53bd8c469f6d7129658badd92f02d91496ff5647 (diff)
downloaddotfiles-6a7baab2da521c9564a2408d60d885816f1a1be6.tar.gz
dotfiles-6a7baab2da521c9564a2408d60d885816f1a1be6.tar.zst
dotfiles-6a7baab2da521c9564a2408d60d885816f1a1be6.zip
mitamae: introduce mitamae to provision
Diffstat (limited to 'mitamae')
-rw-r--r--mitamae/default.rb87
-rw-r--r--mitamae/node.private-hotaru.json17
-rw-r--r--mitamae/node.work-pc168.json17
3 files changed, 121 insertions, 0 deletions
diff --git a/mitamae/default.rb b/mitamae/default.rb
new file mode 100644
index 0000000..ea2859a
--- /dev/null
+++ b/mitamae/default.rb
@@ -0,0 +1,87 @@
+http_request ".bootstrap/nix-install" do
+ url "https://nixos.org/nix/install"
+end
+
+execute "nix-install" do
+ command "sh .bootstrap/nix-install --daemon"
+ not_if "test -d /nix"
+end
+
+file "/etc/nix/nix.conf" do
+ action :edit
+ block do |content|
+ content + "experimental-features = nix-command flakes\n"
+ end
+ not_if "grep -q 'nix-command flakes' /etc/nix/nix.conf"
+end
+
+home = ENV['HOME']
+
+directory "#{home}/.local/state/nix/profiles"
+
+# XDG Base Directories
+directory "#{home}/.config"
+directory "#{home}/.cache"
+directory "#{home}/.local/share"
+directory "#{home}/.local/state"
+
+directory "#{home}/bin"
+
+execute "home-manager" do
+ command "nix run 'nixpkgs#home-manager' -- switch --flake '.##{node[:name]}'"
+ not_if "type home-manager"
+end
+
+# These dotfiles are not managed by home-manager for now.
+
+link "#{home}/.vimrc" do
+ to "#{home}/dotfiles/.vimrc"
+end
+link "#{home}/.config/alacritty" do
+ to "#{home}/dotfiles/.config/alacritty"
+end
+link "#{home}/.config/git" do
+ to "#{home}/dotfiles/.config/git"
+end
+link "#{home}/.config/nvim" do
+ to "#{home}/dotfiles/.config/nvim"
+end
+
+# Go
+execute "go" do
+ command "go build -o bin/gitalias/git-extract-issue src/gitalias/git-extract-issue.go"
+ not_if "test -f bin/gitalias/git-extract-issue"
+end
+execute "go" do
+ command "go build -o bin/gitalias/git-sw src/gitalias/git-sw.go"
+ not_if "test -f bin/gitalias/git-sw"
+end
+
+directory "#{home}/bin/gitalias"
+
+link "#{home}/bin/gitalias/git-extract-issue" do
+ to "#{home}/dotfiles/bin/gitalias/git-extract-issue"
+end
+link "#{home}/bin/gitalias/git-sw" do
+ to "#{home}/dotfiles/bin/gitalias/git-sw"
+end
+link "#{home}/bin/tmux-pane-idx" do
+ to "#{home}/dotfiles/bin/tmux-pane-idx"
+end
+
+directory "#{home}/.local/state/zsh"
+
+# SKK
+directory "#{home}/.config/skk"
+http_request "#{home}/.config/skk/SKK-JISYO.L.unannotated.gz" do
+ url "https://skk-dev.github.io/dict/SKK-JISYO.L.unannotated.gz"
+end
+execute "unzip skk" do
+ command "gunzip -cd #{home}/.config/skk/SKK-JISYO.L.unannotated.gz > #{home}/.config/skk/jisyo.L"
+ not_if "test -f #{home}/.config/skk/jisyo.L"
+end
+
+link "#{home}/.config/alacritty/alacritty.local.yml" do
+ is_macos = node[:targetArch].include?("darwin")
+ to "#{home}/.config/alacritty/alacritty.#{is_macos ? "macos" : "linux"}.yml"
+end
diff --git a/mitamae/node.private-hotaru.json b/mitamae/node.private-hotaru.json
new file mode 100644
index 0000000..60cec07
--- /dev/null
+++ b/mitamae/node.private-hotaru.json
@@ -0,0 +1,17 @@
+{
+ "name": "private-hotaru",
+ "use": "private",
+ "targetArch": "x86_64-linux",
+ "flake": {
+ "system": "x86_64-linux",
+ "env": {
+ "username": "ken",
+ "homeDirectory": "/home/ken",
+ "gui": {
+ "clipboard": {
+ "copyCommand": null
+ }
+ }
+ }
+ }
+}
diff --git a/mitamae/node.work-pc168.json b/mitamae/node.work-pc168.json
new file mode 100644
index 0000000..2ef46e1
--- /dev/null
+++ b/mitamae/node.work-pc168.json
@@ -0,0 +1,17 @@
+{
+ "name": "work-pc168",
+ "use": "work",
+ "targetArch": "aarch64-darwin",
+ "flake": {
+ "system": "aarch64-darwin",
+ "env": {
+ "username": "ken",
+ "homeDirectory": "/Users/ken",
+ "gui": {
+ "clipboard": {
+ "copyCommand": "pbcopy"
+ }
+ }
+ }
+ }
+}