#!/usr/bin/env nu # # ~~~ dotfiles installer # # # ~~~ variables # get device let DEVICE_ID = match (uname | get nodename) { "companioncube" => "110", "cavejohnson" => "120", _ => { error make -u { msg: "invalid device" } } } # get locations let DOTFILES_DIR = "/root/dotfiles" # # ~~~ install rm "/etc/nginx/nginx.conf" cp $"($DOTFILES_DIR)/src/($DEVICE_ID)/nginx.conf" "/etc/nginx/nginx.conf" # # ~~~ reset nginx systemctl restart nginx