diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f7780ed..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.data/ -target/ \ No newline at end of file diff --git a/crates/00-system/crate.arch.sh b/crates/00-system/crate.arch.sh new file mode 100644 index 0000000..164fde4 --- /dev/null +++ b/crates/00-system/crate.arch.sh @@ -0,0 +1,12 @@ +super_apply() { + pacman -Syyu --noconfirm + pacman -S --needed --noconfirm sudo reflector + if ! grep -q "Reflector" /etc/pacman.d/mirrorlist; then + cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak + reflector -c NL -f 10 --threads 4 --save /etc/pacman.d/mirrorlist + else + echo "err: reflector already executed -- skipping..." + fi + + cp files/pacman.conf /etc/pacman.conf +} \ No newline at end of file diff --git a/crates/00-system/crate.sh b/crates/00-system/crate.sh new file mode 100644 index 0000000..5519bcb --- /dev/null +++ b/crates/00-system/crate.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +describe="Install stuff on the system!" +scripts="@distro @self" + +super_apply() { + cp files/sudoers /etc/sudoers +} \ No newline at end of file diff --git a/crates/00-system/files/pacman.conf b/crates/00-system/files/pacman.conf new file mode 100644 index 0000000..e63be35 --- /dev/null +++ b/crates/00-system/files/pacman.conf @@ -0,0 +1,31 @@ +[options] +HoldPkg = pacman glibc yay +Architecture = auto + +Color +CheckSpace +ParallelDownloads = 5 + +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional + +#[testing] +#Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +#[community-testing] +#Include = /etc/pacman.d/mirrorlist + +[community] +Include = /etc/pacman.d/mirrorlist + +#[multilib-testing] +#Include = /etc/pacman.d/mirrorlist + +[multilib] +Include = /etc/pacman.d/mirrorlist diff --git a/crates/00-system/files/sudoers b/crates/00-system/files/sudoers new file mode 100644 index 0000000..e77799b --- /dev/null +++ b/crates/00-system/files/sudoers @@ -0,0 +1,4 @@ +root ALL=(ALL:ALL) ALL +%wheel ALL=(ALL:ALL) ALL +%root ALL=(ALL:ALL) NOPASSWD: ALL +@includedir /etc/sudoers.d diff --git a/crates/05-i3/crate.arch.sh b/crates/05-i3/crate.arch.sh new file mode 100644 index 0000000..ba1eeec --- /dev/null +++ b/crates/05-i3/crate.arch.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +pkgs="i3 i3lock i3status libpulse brightnessctl xss-lock dex maim dmenu gnome-keyring" + +super_apply() { + pacman -S --needed --noconfirm $pkgs +} + +super_undo() { + pacman -R --noconfirm $pkgs +} diff --git a/crates/05-i3/crate.sh b/crates/05-i3/crate.sh new file mode 100644 index 0000000..36c624e --- /dev/null +++ b/crates/05-i3/crate.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +describe="Installs i3" +scripts="@distro @self" + +apply() { + [ -d "$HOME/.config/i3" ] || mkdir -p $HOME/.config/i3 + [ -d "$HOME/.config/i3status" ] || mkdir -p $HOME/.config/i3status + [ -e "$HOME/.config/i3/config" ] || ln files/config $HOME/.config/i3/config + [ -e "$HOME/.config/i3status/config" ] || ln files/status_config $HOME/.config/i3status/config +} + +undo() { + rm $HOME/.config/i3/config + rm $HOME/.config/i3status/config +} + +super_apply() { + cp files/40-proper-touchpad.conf /etc/X11/xorg.conf.d/40-proper-touchpad.conf +} + +super_undo() { + rm /etc/X11/xorg.conf.d/40-proper-touchpad.conf +} diff --git a/crates/i3/files/touchpad.conf b/crates/05-i3/files/40-proper-touchpad.conf similarity index 100% rename from crates/i3/files/touchpad.conf rename to crates/05-i3/files/40-proper-touchpad.conf diff --git a/crates/i3/files/i3config b/crates/05-i3/files/config similarity index 55% rename from crates/i3/files/i3config rename to crates/05-i3/files/config index 18e8618..aba8c1f 100644 --- a/crates/i3/files/i3config +++ b/crates/05-i3/files/config @@ -1,7 +1,6 @@ -####################### -## Strix' i3 config ## -## Mar 22, 2023 ## -## mutation: 1m ## +###################### +## Raine's i3 config ## +## Sept 2, 2023 ## ####################### ## Mostly similar to i3's config yet differs @@ -14,26 +13,21 @@ set $screen_lock i3lock -c "#111111" --nofork set $appmenu i3-dmenu-desktop set $screenshot maim -s | xclip -selection clipboard -t image/png +set $alt_screenshot maim ~/Pictures/Screenshots/$(date +%s).png +set $mod Mod4 +set $alt Mod1 set $font pango:monospace 8 # Startup Applications: # Things that will startup when starting i3. # --- -exec_always --no-startup-id dex --autostart --environment i3 -exec_always --no-startup-id nm-applet -exec_always --no-startup-id xss-lock --transfer-sleep-lock -- $screen_lock -exec_always --no-startup-id gnome-keyring-daemon --start --components=ssh,secrets,pkcs11 -exec_always --no-startup-id feh --bg-fill ~/Pictures/wallpaper.jpg -exec_always --no-startup-id picom - -# Gaps & Borders: -# --- -gaps inner 10 -smart_gaps on - -default_border pixel 1 -hide_edge_borders smart_no_gaps +exec --no-startup-id xrandr --output DP-2-1 --left-of DP-1-1 +exec --no-startup-id sh .scripts/clock-in.sh +exec --no-startup-id dex --autostart --environment i3 +exec --no-startup-id nm-applet +exec --no-startup-id xss-lock --transfer-sleep-lock -- $screen_lock +exec --no-startup-id gnome-keyring-daemon --start --components=ssh,secrets,pkcs11 # Extra variables: # Only need changing for very specific installations. @@ -46,16 +40,27 @@ set $audio_mute_mic XF86AudioMicMute set $brightness_up XF86MonBrightnessUp set $brightness_down XF86MonBrightnessDown +set $nav_up l +set $nav_down k +set $nav_left j +set $nav_right semicolon + set $ws_1 "1:main" set $ws_2 "2:term" -set $ws_3 "3:docs" +set $ws_3 "3:browser" set $ws_4 "4:mail" -set $ws_5 "5" +set $ws_5 "5:notes" set $ws_6 "6" set $ws_7 "7" set $ws_8 "8" -set $ws_9 "9:bg" -set $ws_10 "10:misc" +set $ws_9 "9:background" +set $ws_10 "10:multimedia" + +set $mode_resize_combo Mod4+r +set $mode_session_combo Mod4+Delete +set $mode_keybind_combo Mod4+Insert + +set $op_floating_modifier Mod1 set $meta_refresh_statusbar killall -SIGUSR1 i3status bar { @@ -65,38 +70,47 @@ bar { # END OF CONFIG -set $mod Mod4 -set $alt Mod1 - # Customization - -# class border backgr. text indic. child_border -client.focused #81A1C1 #81A1C1 #ffffff #D8DEE9 -client.focused_inactive #2E3440 #2E3440 #88C0D0 #454948 -client.unfocused #2E3440 #2E3440 #88C0D0 #454948 -client.urgent #D08770 #3B4252 #ffffff #268BD2 -client.placeholder #000000 #0c0c0c #ffffff #000000 -client.background #3B4252 +#! Customization +# class border backgr. text indicator child_border +client.focused #D991BA #D27099 #ffffff #D96FBA #D951B0 +client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a +client.unfocused #333333 #222222 #888888 #292d2e #222222 +client.urgent #EF2929 #900000 #ffffff #900000 #900000 +client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c +client.background #888A85 # Generic -floating_modifier $mod +floating_modifier $op_floating_modifier tiling_drag modifier titlebar font $font +workspace $ws_1 output DP-2-1 +workspace $ws_2 output DP-2-1 +workspace $ws_3 output DP-1-1 +workspace $ws_4 output DP-1-1 +workspace $ws_5 output DP-2-1 +workspace $ws_6 output DP-2-1 +workspace $ws_7 output DP-1-1 +workspace $ws_8 output DP-1-1 +workspace $ws_9 output DP-2-1 +workspace $ws_10 output DP-2-1 + # Open a terminal bindsym $mod+Return exec $terminal # Kill current window -bindsym $mod+$alt+q kill +bindsym $alt+Shift+q kill # Open app menu -bindsym $mod+d exec --no-startup-id $appmenu +bindsym $mod+Shift+d exec --no-startup-id $appmenu # Lock screen bindsym $mod+l exec --no-startup-id $screen_lock # Screenshots -bindsym Print exec --no-startup-id $screenshot +bindsym Print exec $screenshot +bindsym Mod1+Print exec $alt_screenshot # Audio bindsym $audio_volume_up exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $meta_refresh_statusbar @@ -109,35 +123,43 @@ bindsym $brightness_up exec --no-startup-id brightnessctl set +5% && $meta_refre bindsym $brightness_down exec --no-startup-id brightnessctl set 5%- && $meta_refresh_statusbar # Change focused window -bindsym $mod+Up focus up -bindsym $mod+Down focus down -bindsym $mod+Left focus left -bindsym $mod+Right focus right +bindsym $alt+$nav_up focus up +bindsym $alt+$nav_down focus down +bindsym $alt+$nav_left focus left +bindsym $alt+$nav_right focus right +bindsym $alt+Up focus up +bindsym $alt+Down focus down +bindsym $alt+Left focus left +bindsym $alt+Right focus right # Move focused window -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Right move right +bindsym $alt+Shift+Up move up +bindsym $alt+Shift+Down move down +bindsym $alt+Shift+Left move left +bindsym $alt+Shift+Right move right +bindsym $alt+Shift+$nav_up move up +bindsym $alt+Shift+$nav_down move down +bindsym $alt+Shift+$nav_left move left +bindsym $alt+Shift+$nav_right move right # Splits -bindsym $mod+Shift+h split h -bindsym $mod+Shift+v split v - -# Change container layout -bindsym $mod+Shift+s layout stacking -bindsym $mod+Shift+t layout tabbed -bindsym $mod+Shift+d layout toggle split +bindsym $alt+h split h +bindsym $alt+v split v # Make current window fullscreen -bindsym $mod+Shift+f fullscreen toggle +bindsym $alt+f fullscreen toggle + +# Change container layout +bindsym $mod+Mod1+s layout stacking +bindsym $mod+Mod1+t layout tabbed +bindsym $mod+Mod1+e layout toggle split # Floating stuff bindsym $mod+space focus mode_toggle -bindsym $mod+Shift+space floating toggle +bindsym $alt+space floating toggle # Scratchpad -bindsym $mod+Shift+minus move scratchpad +bindsym $alt+minus move scratchpad bindsym $mod+minus scratchpad show # Switch to workspace @@ -164,20 +186,22 @@ bindsym $mod+Shift+8 move container to workspace $ws_8 bindsym $mod+Shift+9 move container to workspace $ws_9 bindsym $mod+Shift+0 move container to workspace $ws_10 -# Move through workspaces -bindsym $mod+$alt+Left workspace prev -bindsym $mod+$alt+Right workspace next +# Move to workspace next to current +bindsym $mod+$nav_left workspace prev +bindsym $mod+$nav_right workspace next +bindsym $mod+Left workspace prev +bindsym $mod+Right workspace next # WM stuff # reload i3 config -bindsym $mod+$alt+c reload +bindsym $mod+Control+c reload # restart i3 -bindsym $mod+$alt+r restart -# exit i3 +bindsym $mod+Control+r restart +# exit i3 (recognized combo; for people who need to exit your session) bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Exit i3?' -B 'Yes, exit i3' 'i3-msg exit'" # Modes -bindsym $mod+r mode resize +bindsym $mode_resize_combo mode resize mode "resize" { bindsym $nav_left resize shrink width 10 px or 10 ppt bindsym $nav_down resize grow height 10 px or 10 ppt @@ -190,17 +214,23 @@ mode "resize" { bindsym Return mode "default" bindsym Escape mode "default" - bindsym $mod+r mode "default" + bindsym $mode_resize_combo mode "default" } -bindsym $mod+s mode "session" +bindsym $mode_session_combo mode session mode "session" { - bindsym l exec --no-startup-id $lock, mode "default" + bindsym l exec --no-startup-id $screen_lock, mode "default" bindsym e exec --no-startup-id i3-msg exit, mode "default" bindsym Shift+r exec --no-startup-id systemctl reboot, mode "default" + bindsym Shift+h exec --no-startup-id systemctl hibernate, mode "default" bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default" bindsym Return mode "default" bindsym Escape mode "default" - bindsym $mod+s mode "default" + bindsym $mode_session_combo mode "default" +} + +bindsym $mode_keybind_combo mode kbmode +mode "kbmode" { + bindsym $mode_keybind_combo mode "default" } diff --git a/crates/i3/files/i3status_config b/crates/05-i3/files/status_config similarity index 87% rename from crates/i3/files/i3status_config rename to crates/05-i3/files/status_config index 3fce4a7..6c8b38e 100644 --- a/crates/i3/files/i3status_config +++ b/crates/05-i3/files/status_config @@ -5,16 +5,16 @@ general { } order += "ipv6" -order += "wireless wlp58s0" +order += "ethernet eno1" order += "battery 0" order += "disk /" order += "memory" order += "load" order += "tztime local" -wireless wlp58s0 { - format_up = "W: (%quality at %essid, %bitrate) %ip" - format_down = "W: down" +ethernet eno1 { + format_up = "E: %ip (%speed)" + format_down = "E: down" } battery 0 { diff --git a/crates/10-zsh/crate.arch.sh b/crates/10-zsh/crate.arch.sh new file mode 100644 index 0000000..5e00687 --- /dev/null +++ b/crates/10-zsh/crate.arch.sh @@ -0,0 +1,7 @@ +super_apply() { + pacman -S --needed --noconfirm zsh cmake +} + +super_undo() { + pacman -R --noconfirm zsh +} \ No newline at end of file diff --git a/crates/10-zsh/crate.sh b/crates/10-zsh/crate.sh new file mode 100644 index 0000000..e08f719 --- /dev/null +++ b/crates/10-zsh/crate.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +describe="Install zsh and oh-my-zsh!" +scripts="@distro @self" + +super_apply() { + [ -d /tmp/fastfetch ] || git clone https://github.com/LinusDierheimer/fastfetch /tmp/fastfetch + + if ! command -v fastfetch &> /dev/null; then + cd /tmp/fastfetch + mkdir -p build + cd build + cmake .. + cmake --build . --target fastfetch + mv fastfetch /usr/local/bin/fastfetch + fi + + usermod $USER --shell /bin/zsh +} + +super_undo() { + usermod $USER --shell /bin/bash +} + +apply() { + if [ ! -d "$HOME/.oh-my-zsh" ]; then + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended + + PL_DIR=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions + [ -d "$PL_DIR" ] || git clone https://github.com/zsh-users/zsh-autosuggestions $PL_DIR + PL_DIR=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting + [ -d "$PL_DIR" ] || git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $PL_DIR + fi + + unlink $HOME/.zshrc + [ -e "$HOME/.zshrc" ] || ln files/.zshrc $HOME/.zshrc +} + +undo() { + unlink $HOME/.zshrc + rm -rf $HOME/.oh-my-zsh +} \ No newline at end of file diff --git a/crates/10-zsh/files/.zshrc b/crates/10-zsh/files/.zshrc new file mode 100644 index 0000000..15fc2b4 --- /dev/null +++ b/crates/10-zsh/files/.zshrc @@ -0,0 +1,22 @@ +export GPG_TTY=$(tty) + +# paths +export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + +# ZSH +export ZSH="$HOME/.oh-my-zsh" + +ZSH_THEME="afowler" +plugins=(git docker docker-compose node zsh-autosuggestions zsh-syntax-highlighting) +source $ZSH/oh-my-zsh.sh + +# ALIASES +alias open="xdg-open" +alias nobeep="sudo modprobe -r pcspkr" +alias s="title $HOST && cmatrix -rs && clear" +alias q="exit" + +# COSMETICS +#fastfetch + +export PATH="${PATH}:/home/${USER}/.local/bin" diff --git a/crates/20-vim/crate.arch.sh b/crates/20-vim/crate.arch.sh new file mode 100644 index 0000000..e114bc1 --- /dev/null +++ b/crates/20-vim/crate.arch.sh @@ -0,0 +1,7 @@ +super_apply() { + pacman -S --needed --noconfirm vim +} + +super_undo() { + echo "we never uninstall vim -_-" +} \ No newline at end of file diff --git a/crates/20-vim/crate.sh b/crates/20-vim/crate.sh new file mode 100644 index 0000000..3210eac --- /dev/null +++ b/crates/20-vim/crate.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +describe="Install vim and it's stuff" +scripts="@distro @self" + +apply() { + [ -e "$HOME/.vimrc" ] || ln files/.vimrc $HOME/.vimrc + [ -e "$HOME/.ideavimrc" ] || ln files/.ideavimrc $HOME/.ideavimrc +} + +undo() { + unlink $HOME/.vimrc + unlink $HOME/.ideavimrc +} \ No newline at end of file diff --git a/crates/vim/ideavimrc b/crates/20-vim/files/.ideavimrc similarity index 100% rename from crates/vim/ideavimrc rename to crates/20-vim/files/.ideavimrc diff --git a/crates/20-vim/files/.vimrc b/crates/20-vim/files/.vimrc new file mode 100644 index 0000000..abb89b3 --- /dev/null +++ b/crates/20-vim/files/.vimrc @@ -0,0 +1,2 @@ +set number +set relativenumber diff --git a/crates/30-alacritty/crate.arch.sh b/crates/30-alacritty/crate.arch.sh new file mode 100644 index 0000000..cc95257 --- /dev/null +++ b/crates/30-alacritty/crate.arch.sh @@ -0,0 +1,7 @@ +super_apply() { + pacman -S --needed --noconfirm alacritty +} + +super_undo() { + pacman -R --noconfirm alacritty +} \ No newline at end of file diff --git a/crates/30-alacritty/crate.sh b/crates/30-alacritty/crate.sh new file mode 100644 index 0000000..27f5762 --- /dev/null +++ b/crates/30-alacritty/crate.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +describe="Installs alacritty and configs" +scripts="@distro @self" + +apply() { + [ -d "$HOME/.config/alacritty" ] || mkdir -p $HOME/.config/alacritty + [ -e "$HOME/.config/alacritty/alacritty.yml" ] || ln files/alacritty.yml $HOME/.config/alacritty/alacritty.yml +} + +undo() { + unlink $HOME/.config/alacritty/alacritty.yml +} \ No newline at end of file diff --git a/crates/30-alacritty/files/alacritty.yml b/crates/30-alacritty/files/alacritty.yml new file mode 100644 index 0000000..1a30120 --- /dev/null +++ b/crates/30-alacritty/files/alacritty.yml @@ -0,0 +1,6 @@ +cursor: + style: + shape: 'Block' + blinking: 'On' + blink_interval: 500 + diff --git a/crates/common/crate.toml b/crates/common/crate.toml deleted file mode 100644 index 8afd2d8..0000000 --- a/crates/common/crate.toml +++ /dev/null @@ -1,28 +0,0 @@ -[crate] -name = "common" -description = "A versatile crate for managing dotfiles and system configurations." - -[[packages]] -name = "git" -description = "Version control system" - -[[packages]] -name = "nvim" -description = "Text editor for creating and editing files" -distro_name_mapping = { pacman = "neovim" } - -[[packages]] -name = "zsh" -description = "Shell designed for interactive use" - -[[actions.command]] -user = "root" -command = "sh ./scripts/pam_wheel.sh" -description = "Pam wheel setup" - -[[actions.command]] -command = "git config --global user.name Strix && git config --global user.email strix@saluco.nl" -description = "git setup" - -[metadata] -repository = "https://git.saluco.nl/strix/dotfiles" diff --git a/crates/common/scripts/pam_wheel.sh b/crates/common/scripts/pam_wheel.sh deleted file mode 100644 index e3adf88..0000000 --- a/crates/common/scripts/pam_wheel.sh +++ /dev/null @@ -1,4 +0,0 @@ -if [ -f /usr/lib/security/pam_wheel.so ] && ! grep -q "# pam_wheel.so added" /etc/pam.d/su; then - echo "auth sufficient pam_wheel.so trust use_uid" > /etc/pam.d/su - echo "# pam_wheel.so added" > /etc/pam.d/su -fi diff --git a/crates/i3/crate.toml b/crates/i3/crate.toml deleted file mode 100644 index 399166a..0000000 --- a/crates/i3/crate.toml +++ /dev/null @@ -1,62 +0,0 @@ -[crate] -name = "i3" -description = "install and setup i3" - -[[packages]] -name = "i3" - -[[packages]] -name = "i3lock" - -[[packages]] -name = "i3status" - -[[packages]] -name = "libpulse" -require = ["distro:arch"] - -[[packages]] -name = "brightnessctl" - -[[packages]] -name = "xss-lock" - -[[packages]] -name = "dex" - -[[packages]] -name = "maim" - -[[packages]] -name = "dmenu" - -[[packages]] -name = "gnome-keyring" - -[[packages]] -name = "feh" - -[[packages]] -name = "picom" - -[[actions.link]] -src = "files/i3config" -dest = "~/.config/i3/config" - -[[actions.link]] -src = "files/i3status_config" -dest = "~/.config/i3status/config" - -[[actions.link]] -src = "files/picom.conf" -dest = "~/.config/picom.conf" - -[[actions.command]] -user = "root" -command = "[ -d '/etc/X11/xorg.conf.d' ] || mkdir -p /etc/X11/xorg.conf.d/" -description = "ensure /etc/X11/xorg.conf.d" - -[[actions.command]] -user = "root" -command = "cp files/touchpad.conf /etc/X11/xorg.conf.d/40-touchpad.conf" -description = "copy touchpad config to /etc/X11/xorg.conf.d" diff --git a/crates/i3/files/picom.conf b/crates/i3/files/picom.conf deleted file mode 100644 index 5bff83a..0000000 --- a/crates/i3/files/picom.conf +++ /dev/null @@ -1,9 +0,0 @@ -inactive-opacity = 0.75; - -blur: { - method = "box"; - size = 10; - background = false; - background-frame = false; - background-fixed = false; -} diff --git a/crates/ssh/config b/crates/ssh/config deleted file mode 100644 index 8c9646d..0000000 --- a/crates/ssh/config +++ /dev/null @@ -1,22 +0,0 @@ -## neb servers - -# hydrogen red helix -Host H - Hostname hydrogen.red.helix.saluco.nl - -# argon red helix -Host A - Hostname argon.red.helix.saluco.nl - -# iron red sphere -Host I - Hostname iron.red.sphere.saluco.nl - -## utility servers -Host git - Hostname git.saluco.nl - User git - -Host github - Hostname github.com - User git diff --git a/crates/ssh/crate.toml b/crates/ssh/crate.toml deleted file mode 100644 index 676e2e8..0000000 --- a/crates/ssh/crate.toml +++ /dev/null @@ -1,10 +0,0 @@ -[crate] -name = "ssh" -description = "fixes the ssh files" - -[[actions.command]] -command = "ls -lah" - -[[actions.link]] -src = "./config" -dest = "~/.ssh/config" \ No newline at end of file diff --git a/crates/vim/crate.toml b/crates/vim/crate.toml deleted file mode 100644 index 92810a3..0000000 --- a/crates/vim/crate.toml +++ /dev/null @@ -1,15 +0,0 @@ -[crate] -name = "vim" -description = "install & configure vim" - - -[[packages]] -name = "neovim" - -[[actions.link]] -src = "./ideavimrc" -dest = "~/.ideavimrc" - -[[actions.link]] -src = "./init.vim" -dest = "~/.config/nvim/init.vim" \ No newline at end of file diff --git a/crates/vim/init.vim b/crates/vim/init.vim deleted file mode 100644 index d87f89e..0000000 --- a/crates/vim/init.vim +++ /dev/null @@ -1,27 +0,0 @@ -" vim preferences -set number -set relativenumber -syntax on - -" No arrow keys -noremap -noremap -noremap -noremap - -" ensure vim-plug -let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' -if empty(glob(data_dir . '/autoload/plug.vim')) - silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - autocmd VimEnter * PlugInstall --sync | source $MYVIMRC -endif - -call plug#begin() - -Plug 'ThePrimeagen/vim-be-good' -Plug 'machakann/vim-highlightedyank' -Plug 'tpope/vim-commentary' -Plug 'wellle/targets.vim' -Plug 'vim-scripts/loremipsum' - -call plug#end() diff --git a/crates/zsh/crate.toml b/crates/zsh/crate.toml deleted file mode 100644 index 1a8c65a..0000000 --- a/crates/zsh/crate.toml +++ /dev/null @@ -1,14 +0,0 @@ -[crate] -name = "zsh" -description = "install & configure zsh" - -[[packages]] -name = "zsh" - -[[actions.command]] -command = "sh ./setup-omzsh.sh" -description = "oh-my-zsh setup" - -[[actions.link]] -src = "./zshrc" -dest = "~/.zshrc" \ No newline at end of file diff --git a/crates/zsh/setup-omzsh.sh b/crates/zsh/setup-omzsh.sh deleted file mode 100644 index 9565661..0000000 --- a/crates/zsh/setup-omzsh.sh +++ /dev/null @@ -1,10 +0,0 @@ -if [ ! -d "$HOME/.oh-my-zsh" ]; then - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended - - PL_DIR=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions - [ -d "$PL_DIR" ] || git clone https://github.com/zsh-users/zsh-autosuggestions $PL_DIR - PL_DIR=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting - [ -d "$PL_DIR" ] || git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $PL_DIR -fi - -[ -f "$HOME/.zshrc" ] && unlink $HOME/.zshrc \ No newline at end of file diff --git a/crates/zsh/zshrc b/crates/zsh/zshrc deleted file mode 100644 index 4bbe248..0000000 --- a/crates/zsh/zshrc +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/zsh - -# Raine's .zshrc - -if [ "$PROFILEINC" = "1" ]; then - . ~/.profile -fi - -export EDITOR=vim -export GPG_TTY=$(tty) -export PATH="$PATH:$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$HOME/.local/bin" - -# oh-my-zsh init -if [ -f "$HOME/.oh-my-zsh/oh-my-zsh.sh" ]; then - export ZSH="$HOME/.oh-my-zsh" - ZSH_THEME="afowler" - plugins=(git docker docker-compose node zsh-autosuggestions zsh-syntax-highlighting zsh-cargo-completion) - source $ZSH/oh-my-zsh.sh -else - echo "oh-my-zsh not detected :(" - PS1="$(whoami)@${HOSTNAME:-$(hostname)} $ " -fi - -update_dotfiles() { - cd $HOME/.dotfiles - git pull - cd - &> /dev/null -} - -container() { - docker run \ - -ti \ - --rm \ - --name tmp-$(id -u)-$(openssl rand -hex 8) \ - --network ${CONTAINER_NETWORK:-internal} \ - alpine \ - ash -} - -[ -f "$HOME/.config/i3/shortcuts-i3.sh" ] && . ~/.config/i3/shortcuts-i3.sh - -alias q="exit" -alias vim="nvim" -alias vi="nvim" diff --git a/dot b/dot new file mode 100755 index 0000000..bfcd9f0 --- /dev/null +++ b/dot @@ -0,0 +1,86 @@ +#!/bin/sh + +ask=0 + +is_function() { + type "$1" 2> /dev/null | sed "s/$1//" | grep -qwi function +} + +curr_distro() { + cat /etc/os-release | grep -G "^ID=" | sed 's/ID=//' +} + +include() { + [ -f "$1" ] || return 1 + . $1 + return 0 +} + +func() { + if is_function $(echo "super_$2"); then + [ "${DO_SUDO:-yes}" = "yes" ] || return 0 + sudo sh -c ". $1 && super_$2" + fi + is_function $2 && $2 +} + +get_command() { + case $1 in + a*) + printf "apply" + ;; + u*) + printf "undo" + ;; + *) + echo "err: not supported" >&2 + exit 1 + ;; + esac +} + +# only run this *in crate dir* +run_crate() { + include ./crate.sh || exit 1 + if [ -n "$describe" ]; then + echo "desc($(basename $PWD)): $describe" + fi + cmd=$(get_command $1) + scripts=${scripts:-"@self @distro"} + for s in $scripts; do + echo "exec($(basename $PWD)): $s/$cmd" + case $s in + @self) + func ./crate.sh $cmd + ;; + @distro) + unset -f super_$cmd + unset -f $cmd + include ./crate.$(curr_distro).sh + func ./crate.$(curr_distro).sh $cmd + unset -f super_$cmd + unset -f $cmd + include ./crate.sh + ;; + *) + sh $s + ;; + esac + done +} + +if [ $# -eq 2 ]; then + [ -d crates/*$1 ] || exit 1 + cd crates/*$1 + run_crate $2 + cd ../.. +else + [ $# -eq 0 ] && exit 2 + for crate in $(find ./crates -mindepth 1 -maxdepth 1 -type d | sort); do + cd $crate + run_crate $1 + cd ../.. + done +fi + + \ No newline at end of file diff --git a/sync-runner/Cargo.lock b/sync-runner/Cargo.lock deleted file mode 100644 index 0eb3d2a..0000000 --- a/sync-runner/Cargo.lock +++ /dev/null @@ -1,1332 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anstream" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "anstyle-parse" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" -dependencies = [ - "anstyle", - "once_cell", - "windows-sys 0.59.0", -] - -[[package]] -name = "bitflags" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "cc" -version = "1.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" -dependencies = [ - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "4.5.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" - -[[package]] -name = "colorchoice" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" - -[[package]] -name = "colored" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array 0.14.7", - "typenum", -] - -[[package]] -name = "dbus" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb21987b9fb1613058ba3843121dd18b163b254d8a6e797e144cbac14d96d1b" -dependencies = [ - "libc", - "libdbus-sys", - "winapi", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys 0.3.7", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys 0.4.1", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "execute" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a82608ee96ce76aeab659e9b8d3c2b787bffd223199af88c674923d861ada10" -dependencies = [ - "execute-command-macro", - "execute-command-tokens", - "generic-array 1.2.0", -] - -[[package]] -name = "execute-command-macro" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dec53d547564e911dc4ff3ecb726a64cf41a6fa01a2370ebc0d95175dd08bd" -dependencies = [ - "execute-command-macro-impl", -] - -[[package]] -name = "execute-command-macro-impl" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce8cd46a041ad005ab9c71263f9a0ff5b529eac0fe4cc9b4a20f4f0765d8cf4b" -dependencies = [ - "execute-command-tokens", - "quote", - "syn", -] - -[[package]] -name = "execute-command-tokens" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69dc321eb6be977f44674620ca3aa21703cb20ffbe560e1ae97da08401ffbcad" - -[[package]] -name = "fern" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" -dependencies = [ - "log", -] - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "generic-array" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c8444bc9d71b935156cc0ccab7f622180808af7867b1daae6547d773591703" -dependencies = [ - "typenum", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "git2" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fda788993cc341f69012feba8bf45c0ba4f3291fcc08e214b4d5a7332d88aff" -dependencies = [ - "bitflags", - "libc", - "libgit2-sys", - "log", - "openssl-probe", - "openssl-sys", - "url", -] - -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "idna" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "indexmap" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.170" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" - -[[package]] -name = "libdbus-sys" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" -dependencies = [ - "pkg-config", -] - -[[package]] -name = "libgit2-sys" -version = "0.18.0+1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1a117465e7e1597e8febea8bb0c410f1c7fb93b1e1cddf34363f8390367ffec" -dependencies = [ - "cc", - "libc", - "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -] - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags", - "libc", -] - -[[package]] -name = "libssh2-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "libz-sys" -version = "1.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" - -[[package]] -name = "log" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "once_cell" -version = "1.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" - -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "openssl-sys" -version = "0.9.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - -[[package]] -name = "proc-macro2" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "resolve-path" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321e5e41b3b192dab6f1e75b9deacb6688b4b8c5e68906a78e8f43e7c2887bb5" -dependencies = [ - "dirs 4.0.0", -] - -[[package]] -name = "serde" -version = "1.0.218" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.218" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "shellexpand" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" -dependencies = [ - "dirs 5.0.1", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "smallvec" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync-runner" -version = "0.1.0" -dependencies = [ - "clap", - "colored", - "dbus", - "execute", - "fern", - "git2", - "glob", - "hex", - "lazy_static", - "log", - "regex", - "resolve-path", - "serde", - "sha2", - "shellexpand", - "toml", - "whoami", -] - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "toml" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-ident" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" - -[[package]] -name = "url" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "web-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "whoami" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" -dependencies = [ - "redox_syscall", - "wasite", - "web-sys", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" -dependencies = [ - "memchr", -] - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerofrom" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/sync-runner/Cargo.toml b/sync-runner/Cargo.toml deleted file mode 100644 index 6ef4146..0000000 --- a/sync-runner/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "sync-runner" -version = "0.1.0" -edition = "2021" - -[dependencies] -clap = { version = "4.5.29", features = ["derive"] } -colored = "3.0.0" -dbus = "0.9.7" -execute = "0.2.13" -fern = "0.7.1" -git2 = "0.20.0" -glob = "0.3.2" -hex = "0.4.3" -lazy_static = "1.5.0" -log = "0.4.26" -regex = "1.11.1" -resolve-path = "0.1.0" -serde = { version = "1.0.218", features = ["serde_derive"] } -sha2 = "0.10.8" -shellexpand = "3.1.0" -toml = "0.8.20" -whoami = "1.5.2" diff --git a/sync-runner/src/action.rs b/sync-runner/src/action.rs deleted file mode 100644 index 667cbed..0000000 --- a/sync-runner/src/action.rs +++ /dev/null @@ -1,10 +0,0 @@ -use clap::Parser; - -#[derive(Parser, Debug)] -pub enum Action { - /// Sync your device with dotfiles repository - Sync { - #[arg(short, long)] - config_path: Option, - }, -} diff --git a/sync-runner/src/cfg/daemon.rs b/sync-runner/src/cfg/daemon.rs deleted file mode 100644 index 3d4a908..0000000 --- a/sync-runner/src/cfg/daemon.rs +++ /dev/null @@ -1,7 +0,0 @@ -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize, Debug)] -pub struct Daemon { - /// interval in minutes - pub interval: u64, -} diff --git a/sync-runner/src/cfg/mod.rs b/sync-runner/src/cfg/mod.rs deleted file mode 100644 index 44f4c48..0000000 --- a/sync-runner/src/cfg/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ - -#![allow(unused)] - -use std::{collections::HashMap, fs::read_to_string}; - -use serde::{Deserialize, Serialize}; - -mod daemon; - -#[derive(Serialize, Deserialize, Debug)] -pub struct Config { - pub title: String, - pub daemon: daemon::Daemon, - pub source: HashMap -} - -impl Config { - pub fn parse(path: &str) -> Result> { - Ok(toml::from_str::(&read_to_string(path)?)?) - } -} diff --git a/sync-runner/src/crates/action.rs b/sync-runner/src/crates/action.rs deleted file mode 100644 index a4fa945..0000000 --- a/sync-runner/src/crates/action.rs +++ /dev/null @@ -1,102 +0,0 @@ -use std::{ - collections::HashMap, - fs::{self, remove_file}, - process::{Command, Stdio}, - time::Duration, -}; - -use dbus::{ - arg::Variant, - blocking::{BlockingSender, Connection}, - Message, -}; -use log::{debug, error, info, trace}; -use resolve_path::PathResolveExt; -use serde::{Deserialize, Serialize}; - -use crate::tags::Tag; - -#[derive(Serialize, Deserialize, Debug)] -pub struct Actions { - /// command actions - #[serde(rename = "command")] - pub commands: Option>, - /// link actions - #[serde(rename = "link")] - pub links: Option>, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct CommandAction { - #[serde(default = "whoami::username")] - user: String, - command: String, - pub description: Option, - pub require: Option>, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct LinkAction { - pub src: String, - pub dest: String, - overwrite: Option, -} - -impl CommandAction { - pub fn new>(command: S, user: S) -> Self { - Self { - command: command.into(), - user: user.into(), - description: None, - require: None, - } - } - - pub fn run(&self) -> Result> { - trace!("running \"{}\" as {}...", &self.command, &self.user); - if self.user != whoami::username() { - Ok(Command::new("sudo") - .arg("-u") - .arg(&self.user) - .arg("--") - .arg("sh") - .arg("-c") - .arg(&self.command) - .status()? - .code() - .unwrap_or(1)) - } else { - Ok(Command::new("sh") - .arg("-c") - .arg(&self.command) - .status()? - .code() - .unwrap_or(1)) - } - } -} - -impl LinkAction { - pub fn link(&self) -> Result<(), Box> { - trace!( - "linking from {:?} to {:?}...", - &self.src.resolve(), - &self.dest.resolve() - ); - if let Ok(existing) = fs::read_link(&self.dest.resolve()) { - if existing == self.src.resolve() { - debug!("link OK"); - return Ok(()); - } else { - if self.overwrite.unwrap_or(false) == true { - debug!("removing {}...", self.dest); - remove_file(self.dest.resolve())?; - } else { - return Err("Destination is linked to a different path".into()); - } - } - } - std::os::unix::fs::symlink(&self.src.resolve(), &self.dest.resolve())?; - Ok(()) - } -} diff --git a/sync-runner/src/crates/manifest.rs b/sync-runner/src/crates/manifest.rs deleted file mode 100644 index e2d4cd3..0000000 --- a/sync-runner/src/crates/manifest.rs +++ /dev/null @@ -1,27 +0,0 @@ -use std::fmt::Display; - -use serde::{Deserialize, Serialize}; - -use super::{action::Actions, package::Package}; - -#[derive(Serialize, Deserialize, Debug)] -pub struct CrateManifest { - #[serde(rename = "crate")] - pub crate_info: CrateInfo, - pub packages: Option>, - pub actions: Option, - pub metadata: Option, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct CrateInfo { - pub name: String, - pub description: String, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct Metadata { - pub homepage: Option, - pub repository: Option, - pub issues: Option, -} \ No newline at end of file diff --git a/sync-runner/src/crates/mod.rs b/sync-runner/src/crates/mod.rs deleted file mode 100644 index af10023..0000000 --- a/sync-runner/src/crates/mod.rs +++ /dev/null @@ -1,62 +0,0 @@ -use log::{error, info, warn}; -use manifest::CrateManifest; -use package::PackageManager; -use serde::{Deserialize, Serialize}; - -pub mod action; -pub mod manifest; -pub mod package; - -pub struct Crate { - pub manifest: CrateManifest, -} - -impl Crate { - pub fn from_toml_str(string: &str) -> Result { - Ok(Crate { - manifest: toml::from_str::(string)?, - }) - } - - pub fn install_packages(&self) -> bool { - if let Some(packages) = &self.manifest.packages { - info!("Installing packages..."); - let pkgs: Vec = packages - .iter() - .map(|p| p.get_correct_package_name()) - .collect(); - info!(target: "item", "pkgs: {}", pkgs.join(", ")); - if let Some(pm) = PackageManager::get_available() { - pm.install(pkgs).is_ok() - } else { - false - } - } else { - false - } - } - - pub fn run_actions(&self) -> Result<(), Box> { - if let Some(actions) = &self.manifest.actions { - if let Some(commands) = &actions.commands { - for command in commands { - info!( - "Running {}...", - &command.description.clone().unwrap_or("action".to_string()) - ); - command.run()?; - } - } - if let Some(links) = &actions.links { - for link in links { - info!("Link {} -> {}...", link.src, link.dest); - if let Err(e) = link.link() { - error!("could not link: {e}"); - continue; - } - } - } - } - Ok(()) - } -} diff --git a/sync-runner/src/crates/package.rs b/sync-runner/src/crates/package.rs deleted file mode 100644 index 2e11f8d..0000000 --- a/sync-runner/src/crates/package.rs +++ /dev/null @@ -1,78 +0,0 @@ -use std::{collections::HashMap, io}; - -use log::{error, info}; -use serde::{Deserialize, Serialize}; - -use super::action::CommandAction; - -#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash)] -pub enum PackageManager { - #[serde(rename = "pacman")] - Pacman, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct Package { - pub name: String, - pub distro_name_mapping: Option>, -} - -impl PackageManager { - pub fn install(&self, packages: Vec) -> Result> { - match &self { - PackageManager::Pacman => { - CommandAction::new( - format!("pacman -S --noconfirm {}", packages.join(" ")), - "root".to_string(), - ) - .run()?; - } - } - Ok(true) - } - - pub fn get_available() -> Option { - Self::from_str(match whoami::distro().as_str() { - "Manjaro Linux" => "pacman", - _ => "unknown" - }) - } - - pub fn from_str(distro: &str) -> Option { - match distro { - "pacman" => Some(PackageManager::Pacman), - _ => None, - } - } -} - -impl Package { - pub fn get_correct_package_name(&self) -> String { - if let Some(pm) = PackageManager::get_available() { - if let Some(mappings) = &self.distro_name_mapping { - if let Some(name) = mappings.get(&pm) { - name.to_string() - } else { - self.name.clone() - } - } else { - self.name.clone() - } - } else { - self.name.clone() - } - } - - pub fn install(&self) -> Result> { - if let Some(pm) = PackageManager::get_available() { - pm.install(vec![self.get_correct_package_name()])?; - } else { - error!("no package manager found..."); - return Err(Box::new(io::Error::new( - io::ErrorKind::NotFound, - "package manager not found", - ))); - } - Ok(false) - } -} diff --git a/sync-runner/src/logging.rs b/sync-runner/src/logging.rs deleted file mode 100644 index 6f6c082..0000000 --- a/sync-runner/src/logging.rs +++ /dev/null @@ -1,64 +0,0 @@ -use std::env; - -use colored::Colorize; -use fern::Dispatch; -use log::{Record, SetLoggerError}; - -fn format_regular>(log: S, record: &Record) -> String { - let log = log.into(); - let line_prefix = |line: String, extend: bool| { - let prefix = if extend { - match record.level() { - log::Level::Trace => " ]".bright_blue(), - log::Level::Debug => " ?".green(), - log::Level::Info => " >".blue(), - log::Level::Warn => " #".yellow(), - log::Level::Error => " !".red(), - }.to_string() - } else { - match record.level() { - log::Level::Trace => "[TRACE]".bright_blue().italic(), - log::Level::Debug => "??".green(), - log::Level::Info => "=>".blue(), - log::Level::Warn => "##".yellow(), - log::Level::Error => "!!".red().bold() - }.to_string() - }; - return format!("{} {}", prefix, line); - }; - - let mut lines = log.lines().peekable(); - let mut output = match lines.peek() { - Some(_line) => line_prefix(lines.next().unwrap().to_string(), false), - None => return "".to_string(), - }; - - for line in lines { - output.push_str(&*format!("\n{}", line_prefix(line.to_string(), true))); - } - - output -} - -pub fn setup_logger() -> Result<(), SetLoggerError> { - Dispatch::new() - .format(|out, message, record| { - match record.metadata().target() { - // command output logging - "command:stdout" => out.finish(format_args!("{} {}", ">>".cyan(), message.to_string())), - "command:stderr" => out.finish(format_args!("{} {}", ">>".red(), message.to_string())), - // this target means, it's an item and not a log. - "item" => out.finish(format_args!("{} {}", "*".blue(), message.to_string())), - // default logging - _ => out.finish(format_args!("{}", format_regular(message.to_string(), record))), - } - }) - .level( - env::var("SYNCR_LOG_LEVEL") - .unwrap_or_else(|_| "info".to_string()) - .parse() - .unwrap_or(log::LevelFilter::Info), - ) - .chain(std::io::stdout()) - .apply() -} diff --git a/sync-runner/src/main.rs b/sync-runner/src/main.rs deleted file mode 100644 index 5735a1e..0000000 --- a/sync-runner/src/main.rs +++ /dev/null @@ -1,87 +0,0 @@ -use std::{ - env::set_current_dir, - fs::{exists, read_to_string, File}, - path::{absolute, Path}, - process::{exit, Stdio}, -}; - -use action::Action; -use cfg::Config; -use clap::Parser; -use colored::Colorize; -use execute::{command_args, Execute}; -use log::{debug, error, info, trace, warn}; -use prelude::abspath; - -mod action; -mod cfg; -mod crates; -mod logging; -mod prelude; -mod source; -mod tags; - -fn main() -> Result<(), Box> { - logging::setup_logger()?; - - info!(target: "item", "user: {}", whoami::username()); - info!(target: "item", "distro: {}", whoami::distro()); - - let action = Action::parse(); - match action { - Action::Sync { config_path } => { - trace!("fetching config dir... {config_path:?}"); - if let Some(config_path) = abspath(&config_path.unwrap_or("~/.syncr".into())) { - trace!("setting config dir as cwd... {config_path}"); - set_current_dir(config_path)?; - } - let config = Config::parse(&abspath("./syncr.toml").unwrap())?; - info!("syncing \"{}\"...", config.title.bold()); - - info!("updating sources..."); - let mut available_sources = vec![]; - for (name, source) in &config.source { - debug!("checking {name}..."); - if !source.available() { - warn!("source \"{name}\" unavailable."); - } else { - info!("source \"{name}\" available!"); - available_sources.push(source); - } - } - - if available_sources.len() == 0 { - error!("{}", "sync impossible; no sources.".bold()); - exit(1); - } - - let oldpwd = absolute(".")?; - for source in available_sources { - // cd to source dir - source.go_to_dir()?; - for (mut path, c) in source.get_crates()? { - path.pop(); - set_current_dir(absolute(path)?)?; - info!("Syncing crate: {}...", c.manifest.crate_info.name); - - c.install_packages(); - - if let Err(e) = c.run_actions() { - error!("action failed: {e}"); - } - - set_current_dir(&oldpwd)?; // i hate this but im lazy okay - source.go_to_dir()?; - } - } - set_current_dir(oldpwd)?; - - info!("Completed sync."); - } - _ => { - println!("{action:#?}"); - } - } - - Ok(()) -} diff --git a/sync-runner/src/prelude.rs b/sync-runner/src/prelude.rs deleted file mode 100644 index f318ed2..0000000 --- a/sync-runner/src/prelude.rs +++ /dev/null @@ -1,9 +0,0 @@ -use std::path::{Path, PathBuf}; - -use std::env; - -pub fn abspath(p: &str) -> Option { - let exp_path = shellexpand::full(p).ok()?; - let can_path = std::fs::canonicalize(exp_path.as_ref()).ok()?; - can_path.into_os_string().into_string().ok() -} diff --git a/sync-runner/src/source/git.rs b/sync-runner/src/source/git.rs deleted file mode 100644 index 408011c..0000000 --- a/sync-runner/src/source/git.rs +++ /dev/null @@ -1,245 +0,0 @@ -use std::{ - env::current_dir, - fs::{self, create_dir_all, exists}, - io::Write, - path::{Path, PathBuf}, -}; - -use git2::{build::RepoBuilder, Repository}; -use log::{debug, info, trace, warn}; -use serde::{Deserialize, Serialize}; -use sha2::{Digest, Sha256, Sha512}; - -use crate::prelude::abspath; - -#[derive(Serialize, Deserialize, Debug)] -pub struct Git { - pub url: String, - #[serde(default = "default_branch")] - pub branch: String, -} - -fn default_branch() -> String { - "main".to_string() -} - -impl Git { - fn url_hash(&self) -> String { - let mut hasher = Sha256::new(); - hasher.update(&self.url); - let hash = hasher.finalize(); - hex::encode(hash) - } - - fn branch_hash(&self) -> String { - let mut hasher = Sha256::new(); - hasher.update(&self.branch); - let hash = hasher.finalize(); - hex::encode(hash) - } - - pub fn repository_path_str(&self) -> String { - format!(".data/git/{}.{}", self.url_hash(), self.branch_hash()) - } - - pub fn repository_path(&self) -> Result { - fs::canonicalize(self.repository_path_str()) - } - - pub fn exists_on_fs(&self) -> bool { - self.repository_path().is_ok() - } - - pub fn clone_repository(&self) -> Result { - RepoBuilder::new() - .branch(&self.branch) - .clone(&self.url, Path::new(&self.repository_path_str())) - } - - pub fn repository(&self) -> Result { - if !self.exists_on_fs() { - create_dir_all(self.repository_path_str()).unwrap(); - } - match Repository::open(self.repository_path().unwrap()) { - Ok(r) => Ok(r), - Err(_) => self.clone_repository(), - } - } - - fn up_to_date(&self) -> Result> { - debug!("checking repo up to date..."); - let repo = self.repository()?; - let mut remote = repo.find_remote("origin")?; - - // Fetch latest references from remote - remote.fetch(&[self.branch.clone()], None, None)?; - - let fetch_head = repo.refname_to_id(&format!("refs/remotes/origin/{}", self.branch))?; - let local_head = repo.refname_to_id(&format!("refs/heads/{}", self.branch))?; - - Ok(fetch_head == local_head) - } - - pub fn update(&self) -> Result> { - if self.up_to_date()? { - return Ok(true); - } - debug!("updating repository..."); - let repository = self.repository()?; - let mut remote = repository.find_remote("origin")?; - let mut cb = git2::RemoteCallbacks::new(); - - cb.transfer_progress(|stats| { - if stats.received_objects() == stats.total_objects() { - print!( - "resolving deltas {}/{}\r", - stats.indexed_deltas(), - stats.total_deltas() - ); - } else if stats.total_objects() > 0 { - print!( - "received {}/{} objects ({}) in {} bytes\r", - stats.received_objects(), - stats.total_objects(), - stats.indexed_objects(), - stats.received_bytes() - ); - } - std::io::stdout().flush().unwrap(); - true - }); - - let mut fo = git2::FetchOptions::new(); - fo.remote_callbacks(cb); - // Always fetch all tags. - // Perform a download and also update tips - fo.download_tags(git2::AutotagOption::All); - info!("fetching {}...", remote.name().unwrap()); - remote.fetch(&[self.branch.clone()], Some(&mut fo), None)?; - - let fetch_head = repository.find_reference("FETCH_HEAD")?; - - do_merge( - &repository, - &self.branch, - repository.reference_to_annotated_commit(&fetch_head)?, - )?; - - Ok(true) - } - - pub fn ensure(&self) -> Result<&Self, Box> { - if self.exists_on_fs() { - self.update(); - } else { - self.clone_repository()?; - } - Ok(self) - } -} - -fn do_merge<'a>( - repo: &'a Repository, - remote_branch: &str, - fetch_commit: git2::AnnotatedCommit<'a>, -) -> Result<(), git2::Error> { - // 1. do a merge analysis - let analysis = repo.merge_analysis(&[&fetch_commit])?; - - // 2. Do the appopriate merge - if analysis.0.is_fast_forward() { - info!("doing a fast forward..."); - // do a fast forward - let refname = format!("refs/heads/{}", remote_branch); - match repo.find_reference(&refname) { - Ok(mut r) => { - fast_forward(repo, &mut r, &fetch_commit)?; - } - Err(_) => { - // The branch doesn't exist so just set the reference to the - // commit directly. Usually this is because you are pulling - // into an empty repository. - repo.reference( - &refname, - fetch_commit.id(), - true, - &format!("Setting {} to {}", remote_branch, fetch_commit.id()), - )?; - repo.set_head(&refname)?; - repo.checkout_head(Some( - git2::build::CheckoutBuilder::default() - .allow_conflicts(true) - .conflict_style_merge(true) - .force(), - ))?; - } - }; - } else if analysis.0.is_normal() { - // do a normal merge - let head_commit = repo.reference_to_annotated_commit(&repo.head()?)?; - normal_merge(&repo, &head_commit, &fetch_commit)?; - } else { - info!("nothing to do..."); - } - Ok(()) -} - -fn fast_forward( - repo: &Repository, - lb: &mut git2::Reference, - rc: &git2::AnnotatedCommit, -) -> Result<(), git2::Error> { - let name = match lb.name() { - Some(s) => s.to_string(), - None => String::from_utf8_lossy(lb.name_bytes()).to_string(), - }; - let msg = format!("fast-forward: setting {} to id: {}", name, rc.id()); - info!("{}", msg); - lb.set_target(rc.id(), &msg)?; - repo.set_head(&name)?; - repo.checkout_head(Some( - git2::build::CheckoutBuilder::default() - // For some reason the force is required to make the working directory actually get updated - // I suspect we should be adding some logic to handle dirty working directory states - // but this is just an example so maybe not. - .force(), - ))?; - Ok(()) -} - -fn normal_merge( - repo: &Repository, - local: &git2::AnnotatedCommit, - remote: &git2::AnnotatedCommit, -) -> Result<(), git2::Error> { - let local_tree = repo.find_commit(local.id())?.tree()?; - let remote_tree = repo.find_commit(remote.id())?.tree()?; - let ancestor = repo - .find_commit(repo.merge_base(local.id(), remote.id())?)? - .tree()?; - let mut idx = repo.merge_trees(&ancestor, &local_tree, &remote_tree, None)?; - - if idx.has_conflicts() { - warn!("merge conficts detected..."); - repo.checkout_index(Some(&mut idx), None)?; - return Ok(()); - } - let result_tree = repo.find_tree(idx.write_tree_to(repo)?)?; - // now create the merge commit - let msg = format!("Merge: {} into {}", remote.id(), local.id()); - let sig = repo.signature()?; - let local_commit = repo.find_commit(local.id())?; - let remote_commit = repo.find_commit(remote.id())?; - // Do our merge commit and set current branch head to that commit. - let _merge_commit = repo.commit( - Some("HEAD"), - &sig, - &sig, - &msg, - &result_tree, - &[&local_commit, &remote_commit], - )?; - // Set working tree to match head. - repo.checkout_head(None)?; - Ok(()) -} diff --git a/sync-runner/src/source/mod.rs b/sync-runner/src/source/mod.rs deleted file mode 100644 index 9b43853..0000000 --- a/sync-runner/src/source/mod.rs +++ /dev/null @@ -1,78 +0,0 @@ -use std::{ - env::{current_dir, set_current_dir}, - fs::{create_dir_all, exists, read_to_string}, - path::PathBuf, -}; - -use log::{debug, info, trace}; -use serde::{Deserialize, Serialize}; - -use crate::{crates::Crate, prelude::abspath}; - -pub mod git; - -#[derive(Serialize, Deserialize, Debug)] -#[serde(default)] -pub struct Source { - interval: u64, - git: Option, - dir: Option, -} - -impl Default for Source { - fn default() -> Self { - Source { - interval: 60, - git: None, - dir: None, - } - } -} - -impl Source { - pub fn available(&self) -> bool { - if let Some(git) = &self.git { - trace!("checking git..."); - return git.ensure().is_ok(); - } - if let Some(dir) = &self.dir { - return exists(dir).is_ok(); - } - false - } - - pub fn go_to_dir(&self) -> Result<(), Box> { - if let Some(git) = &self.git { - if PathBuf::from(git.repository_path_str()) == current_dir()? { - return Ok(()); - } - let dir = git.ensure()?.repository_path()?; - trace!( - "setting git dir as cwd... ({}@{}, {})", - git.url, - git.branch, - dir.display() - ); - set_current_dir(dir)?; - } - if let Some(path) = &self.dir { - set_current_dir(path)?; - } - Ok(()) - } - - pub fn get_crates(&self) -> Result, Box> { - let mut crates = vec![]; - // get crates (read dir, crates/*/crate.toml) - for crate_file in glob::glob("crates/*/crate.toml").expect("err") { - match crate_file { - Ok(cd) => { - debug!("found {}", cd.display()); - crates.push((cd.clone(), Crate::from_toml_str(&read_to_string(cd)?)?)) - } - _ => continue, - } - } - Ok(crates) - } -} diff --git a/sync-runner/src/tags.rs b/sync-runner/src/tags.rs deleted file mode 100644 index 4be8d32..0000000 --- a/sync-runner/src/tags.rs +++ /dev/null @@ -1,71 +0,0 @@ -use serde::{Deserialize, Deserializer, Serialize, Serializer}; - -#[derive(Debug)] -pub struct Tag { - pub category: String, - pub value: String -} - -impl<'de> Deserialize<'de> for Tag { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - // First, deserialize the string - let s: String = Deserialize::deserialize(deserializer)?; - - // Split the string into category and value by ":" - let parts: Vec<&str> = s.splitn(2, ':').collect(); - if parts.len() != 2 { - return Err(serde::de::Error::invalid_value( - serde::de::Unexpected::Str(&s), - &"a string in the format 'category:value'", - )); - } - - // Return a Tag with the split parts - Ok(Tag { - category: parts[0].to_string(), - value: parts[1].to_string(), - }) - } -} - -impl Serialize for Tag { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - serializer.serialize_str(&format!("{}:{}", self.category, self.value)) - } -} - -impl Into for Tag { - fn into(self) -> String { - self.category + " : " + &self.value - } -} - -impl TryFrom for Tag { - type Error = std::io::Error; - fn try_from(value: String) -> Result { - let parts: Vec<&str> = value.split(':').collect(); - if parts.len() != 2 { - Err(std::io::Error::new(std::io::ErrorKind::InvalidData, "could not match string to tag")) - } else { - Ok(Self { - category: parts[0].into(), - value: parts[1].into() - }) - } - } -} - -impl Tag { - pub fn distro() -> Tag { - Tag { - category: "distro".into(), - value: whoami::distro() - } - } -} \ No newline at end of file diff --git a/sync.sh b/sync.sh deleted file mode 100644 index e0d44c3..0000000 --- a/sync.sh +++ /dev/null @@ -1,6 +0,0 @@ -if ! [ -f /tmp/sync-runner ]; then - curl -O /tmp/sync-runner https://git.saluco.nl/repos/strix/releases/download/latest/sync-runner - chmod +x /tmp/sync-runner -fi - -/tmp/sync-runner \ No newline at end of file diff --git a/syncr.toml b/syncr.toml deleted file mode 100644 index d012160..0000000 --- a/syncr.toml +++ /dev/null @@ -1,17 +0,0 @@ -title = "strix's syncr config" - -[daemon] -# interval -# discription: how often to check for new updates, this is the default for syncs -# you can define a custom interval for specific sources -# unit = minutes -interval = 60 - -[source.personal] -dir = "." - -# [source.personal.git] # default is the uid -# url = "https://git.saluco.nl/strix/dotfiles.git" -# branch = "syncr" -# crate_dir = "./crates" # default -# cfg_toml = "./syncr.toml" # default