aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/install.conf.yaml
blob: 6c738e1b4323c204e156213ce7a6fe771fe97288 (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
- defaults:
    link:
      create: true
      relink: true
      force: true
    shell:
      quiet: true
      stdin: true

- clean: ["~"]

- create:
    - ~/.local/share/bash-completion/completions
    - ~/.local/share/zsh/site-functions
    - ~/.bash
    - ~/.zsh

- shell:
    - description: Installing submodules
      command: git submodule update --init --recursive

    - description: Installing rust
      command:
        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path && (
        rustup completions bash >~/.local/share/bash-completion/completions/rustup;
        rustup completions zsh >~/.local/share/zsh/site-functions/_rustup;
        rustup completions bash cargo >~/.local/share/bash-completion/completions/cargo;
        rustup completions zsh cargo >~/.local/share/zsh/site-functions/_cargo)

    - description: Installing Starship
      command:
        target=$(rustc -Vv | grep host | cut -d' ' -f2 | sed s/gnu/musl/ | sed s/armv7/arm/) &&
        scripts/install-crate.sh --git starship/starship --no-tag --target $target && (
        starship completions bash >~/.local/share/bash-completion/completions/starship;
        starship completions zsh >~/.local/share/zsh/site-functions/_starship)

    - description: Installing fzf
      command: td=$(mktemp -d) &&
        arch="$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/ | sed s/armv7l/armv7/)" &&
        tag="$(curl -sI https://github.com/junegunn/fzf/releases/latest | grep -Po 'tag\/v?\K(\S+)')" &&
        name="fzf-${tag}-linux_${arch}" &&
        url="https://github.com/junegunn/fzf/releases/latest/download/${name}.tar.gz" &&
        curl -sL $url | tar -C $td -xz &&
        test -x $td/fzf &&
        rm -f ~/.local/bin/fzf &&
        install -Dm 755 $td/fzf ~/.local/bin/fzf &&
        rm -rf $td && (
        curl -sL https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.bash >~/.local/share/bash-completion/completions/fzf;
        curl -sL https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh >~/.local/share/zsh/site-functions/_fzf;
        curl -sL https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.bash >~/.bash/fzf-key-bindings.sh;
        curl -sL https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh >~/.zsh/fzf-key-bindings.zsh;
        curl -sL https://gist.github.com/junegunn/8b572b8d4b5eddd8b85e5f4d40f17236/raw/6e5d520bfc96d6b3e42571a54cb4d1ebc8e2dd84/functions.sh | tee -a  ~/.zsh/fzf-key-bindings.zsh ~/.bash/fzf-key-bindings.sh;
        curl -sL https://gist.github.com/junegunn/8b572b8d4b5eddd8b85e5f4d40f17236/raw/6e5d520bfc96d6b3e42571a54cb4d1ebc8e2dd84/key-binding.bash >>~/.bash/fzf-key-bindings.sh;
        curl -sL https://gist.github.com/junegunn/8b572b8d4b5eddd8b85e5f4d40f17236/raw/6e5d520bfc96d6b3e42571a54cb4d1ebc8e2dd84/key-binding.zsh  >>~/.bash/fzf-key-bindings.sh;
        )

    # Install manually with cargo see https://github.com/sharkdp/bat/issues/2106
    # - description: Installing bat
    #   command:
    #     target=$(rustc -Vv | grep host | cut -d' ' -f2 | sed s/armv7/arm/) &&
    #     scripts/install-crate.sh --git sharkdp/bat --target $target --completion-bash --completion-zsh

    - description: Installing fd
      command:
        target=$(rustc -Vv | grep host | cut -d' ' -f2 | sed s/armv7/arm/) &&
        scripts/install-crate.sh --git sharkdp/fd --target $target --completion-bash --completion-zsh

    - description: Installing ripgrep
      command:
        target=$(rustc -Vv | grep host | cut -d' ' -f2  | sed s/gnu/musl/ | sed s/armv7/arm/) &&
        scripts/install-crate.sh --git BurntSushi/ripgrep --target $target --completion-bash --completion-zsh

    - description: Installing cheat.sh
      command: curl https://cht.sh/:cht.sh >~/.local/bin/cht.sh &&
        chmod +x ~/.local/bin/cht.sh && (
        curl https://cht.sh/:bash_completion >~/.local/share/bash-completion/completions/cht;
        curl https://cheat.sh/:zsh >~/.local/share/zsh/site-functions/_cht)

    - description: Installing gh
      command: td=$(mktemp -d) &&
        arch="$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/ | sed s/armv7l/armv6/)" &&
        tag="$(curl -sI https://github.com/cli/cli/releases/latest | grep -Po 'tag\/v?\K(\S+)')" &&
        name="gh_${tag}_linux_${arch}" &&
        url="https://github.com/cli/cli/releases/latest/download/${name}.tar.gz" &&
        curl -sL $url | tar -C $td -xz &&
        test -x $td/$name/bin/gh &&
        install -Dm 755 $td/$name/bin/gh ~/.local/bin/gh &&
        rm -rf $td && (
        gh completion --shell bash >~/.local/share/bash-completion/completions/gh;
        gh completion --shell zsh >~/.local/share/zsh/site-functions/_gh)

    - description: Installing git-open
      command:
        curl -sL "https://raw.githubusercontent.com/paulirish/git-open/master/git-open" >~/.local/bin/git-open &&
        chmod +x ~/.local/bin/git-open;

    - description: Installing git completions
      command: \! command -v git &> /dev/null ||
        url=https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion && (
        curl -sL ${url}.bash >~/.local/share/bash-completion/completions/git;
        curl -sL ${url}.zsh >~/.local/share/zsh/site-functions/_git)

    - description: Installing dotnet completions
      command: \! command -v dotnet &> /dev/null ||
        url=https://raw.githubusercontent.com/dotnet/cli/master/scripts/register-completions && (
        curl -sL ${url}.bash >~/.local/share/bash-completion/completions/dotnet;
        curl -sL ${url}.zsh >~/.local/share/zsh/site-functions/_dotnet)

    - description: Installing docker completions
      command: \! command -v docker &> /dev/null ||
        url=https://raw.githubusercontent.com/docker/cli/master/contrib/completion && (
        curl -sL ${url}/bash/docker >~/.local/share/bash-completion/completions/docker;
        curl -sL ${url}/zsh/_docker >~/.local/share/zsh/site-functions/_docker)

    - description: Installing pandoc completions
      command: \! command -v pandoc &> /dev/null ||
        url=https://raw.githubusercontent.com/srijanshetty/zsh-pandoc-completion/master/_pandoc && (
        pandoc --bash-completion >~/.local/share/bash-completion/completions/docker;
        curl -sL ${url} >~/.local/share/zsh/site-functions/_pandoc)

    - description: Installing zsh-autosuggestions
      command: repo=https://github.com/zsh-users/zsh-autosuggestions &&
        target=~/.zsh/zsh-autosuggestions &&
        git clone $repo $target ||
        git -C $target pull

    - description: Installing zsh-syntax-highlighting
      command: repo=https://github.com/zsh-users/zsh-syntax-highlighting
        target=~/.zsh/zsh-syntax-highlighting &&
        git clone $repo $target ||
        git -C $target pull

- link:
    # shell
    ~/.bashrc:
    ~/.bash:
      glob: true
      path: bash/*
    ~/.bash/:
      glob: true
      if: '[ -n "${WSL_DISTRO_NAME+1}" ]'
      path: wsl/*

    ~/.zshenv:
    ~/.zsh/.zshrc: zsh/zshrc
    ~/.zsh/.zshenv: bash/env.sh
    ~/.zsh/aliases.sh: bash/aliases.sh
    ~/.zsh:
      glob: true
      path: zsh/*
    ~/.zsh/:
      glob: true
      if: '[ -n "${WSL_DISTRO_NAME+1}" ]'
      path: wsl/*

    ~/.config/starship.toml: starship.toml
    ~/.config/alacritty.yml: alacritty.yml
    ~/.config/bat/config: bat.conf
    ~/.gitconfig:
    ~/.ssh/config: ssh/config
    ~/.tmux.conf:
      path: /dev/null
      if: "! ln -f tmux.conf ~/.tmux.conf"
    ~/.gnupg/:
      glob: true
      path: gnupg/*.conf
    ~/.local/bin:
      glob: true
      path: bin/*

- shell:
    - description: Installing gpg key
      command: gpg --auto-key-locate keyserver --locate-keys tobyv13@gmail.com
    - description: Importing GPG trustfile
      command: gpg --import-ownertrust gnupg/trustfile.txt
    # ISSUE #1 Fails to import key inside of WSL2
    # - description: Importing gpg key (WSL)
    #   command: \! command -v gpg.exe &> /dev/null || gpg.exe --auto-key-locate keyserver --locate-keys tobyv13@gmail.com
    # - description: Importing gpg trustfile (WSL)
    #   command: \! command -v gpg.exe &> /dev/null || gpg.exe --import-ownertrust gnupg/trustfile.txt

- shell:
    - description: ""
      command: if [ -n "${WSL_DISTRO_NAME+1}" ]; then ./wsl.install; fi
      stdout: true
      # stderr: true