ref: 316939aa215181b1d22b69e94241eef757add98d dotfiles/bash/symlinks.sh -rw-r--r-- 2.9 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash

function upsert_dir_symlink() {
  local from="$1"
  local to="$2"
  { [ -d "$to" ] || [ -L "$to" ]; } || {
    ln -s "$from" "$to"
  }
}
export -f upsert_dir_symlink

upsert_dir_symlink "$HOME/dev/libre/borg/config" ~/.config/borg

ln -fs "$DOTFILES/bash/bashrc.sh"               ~/.bashrc
ln -fs "$DOTFILES/bash/bash_profile.sh"         ~/.bash_profile
ln -fs "$DOTFILES/git/gitattributes"            ~/.gitattributes
ln -fs "$DOTFILES/git/gitignore"                ~/.gitignore_global
ln -fs "$DOTFILES/encrypted/nugitconfig.ini"    ~/.nugitconfig
ln -fs "$DOTFILES/sbclrc.lisp"                  ~/.sbclrc
ln -fs "$DOTFILES/inputrc.conf"                 ~/.inputrc
ln -fs "$DOTFILES/Xmodmap.conf"                 ~/.Xmodmap
isLinux && {
  ln -fs "$DOTFILES/nixos/npmrc.sh"             ~/.npmrc
}

## SSH config
mkdir -p ~/.ssh
ln -fs "$DOTFILES/ssh_config.conf"              ~/.ssh/config

ln -fs "$DOTFILES/git/mrconfig.ini"             ~/.mrconfig

upsert_dir_symlink "$MEDIA_PREFIX/UTCLOUD"      ~/UTCLOUD
upsert_dir_symlink "$MEDIA_PREFIX/SNEAKER"     ~/SNEAKER

## Clojure
mkdir -p ~/.lein ~/.clojure
ln -fs "$DOTFILES/lein/profiles.clj"            ~/.lein/profiles.clj
ln -fs "$DOTFILES/lein/deps.edn"                ~/.clojure/deps.edn


## tmux
ln -fs "$DOTFILES/tmux/tmux.conf"               ~/.tmux.conf
ln -fs "$DOTFILES/tmux/tmux-macos.conf"         ~/.tmux-macos.conf
ln -fs "$DOTFILES/tmux/tmux-gnu-linux.conf"     ~/.tmux-gnu-linux.conf

## Newsboat
mkdir -p ~/.newsboat
ln -fs "$DOTFILES/newsboat/urls"                ~/.newsboat/urls
ln -fs "$DOTFILES/newsboat/config"              ~/.newsboat/config

## NixOS
ln -fs "$DOTFILES/nixos/evince.destkop"         ~/.local/share/applications/evince.desktop
ln -fs "$DOTFILES/nixos/firefox.destkop"        ~/.local/share/applications/firefox.desktop

## Emacs
mkdir -p "$HOME/.emacs.d/private/layers/"
ln -fs "$DOTFILES/newsboat/elfeed.org"           ~/.emacs.d/private/elfeed.org
ln -fs "$DOTFILES/spacemacs.el"                 ~/.spacemacs
ln -fs "$DOTFILES/emacs/gnus.el"                ~/.gnus.el
[[ -d ~/.emacs.d/.cache/layouts/ ]] && ln -fs "$CACHE_DIR/euandreh-auto-save.el" ~/.emacs.d/.cache/layouts/euandreh-auto-save

## xmonad
mkdir -p ~/.xmonad
ln -fs "$DOTFILES/xmonad/xsession.sh"           ~/.xsession
ln -fs "$DOTFILES/xmonad/xmonad.hs"             ~/.xmonad/xmonad.hs
ln -fs "$DOTFILES/xmonad/xmobar.hs"             ~/.xmobarrc

## Mail
mkdir -p ~/mbsync/.notmuch/hooks ~/mbsync/EuAndreh ~/mbsync/Gmail ~/mbsync/Nubank
ln -fs "$DOTFILES/mail/notmuch-post.sh"         ~/mbsync/.notmuch/hooks/post-new
ln -fs "$DOTFILES/mail/mbsyncrc.ini"            ~/.mbsyncrc
ln -fs "$DOTFILES/mail/notmuch.ini"             ~/.notmuch-config
ln -fs /tmp/mbsync."$(date +%Y-%m-%d)".log      /tmp/mbsync.log
ln -fs /tmp/notmuch."$(date +%Y-%m-%d)".log     /tmp/notmuch.log
ln -fs /tmp/archivebox."$(date +%Y-%m-%d)".log  /tmp/archivebox.log