├── .gitignore ├── .github └── FUNDING.yml ├── setup.sh ├── LICENSE ├── README.md └── playbook.yml /.gitignore: -------------------------------------------------------------------------------- 1 | *.retry -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: perguth 2 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | NAME=chromeos-developer-setup 4 | 5 | # Clean up when done and on abort 6 | trap "cd .. && rm -rf $NAME" EXIT 7 | 8 | # Install Ansible 9 | sudo apt update && sudo apt install -y ansible 10 | 11 | # Clone repository 12 | git clone https://github.com/perguth/$NAME.git 13 | cd $NAME 14 | 15 | # Run playbook 16 | ansible-playbook playbook.yml 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Per (ᵔᴥᵔ) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ChromeOS developer setup 2 | 3 | > 💡 Install common developer tools in one command. 4 | 5 | It installs: 6 | 7 | - **Bash utilities**: [build-essential](https://www.google.com/search?q=build-essential), [htop](https://hisham.hm/htop/), [iperf3](https://iperf.fr/), [mosh](https://mosh.org/), [nano](https://www.nano-editor.org/), [nmap](https://nmap.org/), [nload](https://github.com/rolandriegel/nload), [ufw](https://g.co/kgs/R7KmgH), [screen](https://www.gnu.org/software/screen/), [tmux](https://github.com/tmux/tmux/wiki), [sshfs](https://github.com/libfuse/sshfs). 8 | - **[Deno](https://deno.land/)**: "Deno is a simple, modern runtime for JavaScript and TypeScript that uses V8 and is built in Rust." 9 | - **[Docker](https://www.docker.com/)** and **[Docker Compose](https://docs.docker.com/compose/)**: "Docker is a platform designed to help developers build, share, and run modern applications." 10 | - **[Gedit](https://wiki.gnome.org/Apps/Gedit)**: "Gedit is an easy-to-use and general-purpose text editor." 11 | - **[Gimp](https://www.gimp.org/)**: "GIMP is a cross-platform image editor available for GNU/Linux, macOS, Windows and more operating systems." 12 | - **[Git](https://git-scm.com/)**: "Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency." 13 | - **[Golang](https://golang.org/)**: "Go is a statically typed, compiled high-level programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson." 14 | - **[NodeJS](https://nodejs.org/)**, **[NPM](https://www.npmjs.com/)** and **[Yarn](https://yarnpkg.com/)**: "Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine." 15 | - **[Socket](https://socket.dev/)**: Will automatically scan packages for maleware that are installed via NPM or NPX. 16 | - **[Rust](https://www.rust-lang.org/)**: "Rust is blazingly fast and memory-efficient: with no runtime or garbage collector, it can power performance-critical services, run on embedded devices, ..." 17 | - **[VS Code](https://code.visualstudio.com/)**: "Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications." 18 | 19 | ## Install 20 | 21 | > 💡 If you're **upgrading** from a previous installation, please follow [these steps](https://github.com/perguth/chromeos-developer-setup/releases/tag/v1.5.1). 22 | 23 | 1. **First [enable Linux](https://support.google.com/chromebook/answer/9145439)**. 24 | 1. **Copy** the following commands **into the [terminal](https://support.google.com/chromebook/thread/565904)**: 25 | 26 | ```bash 27 | bash -c "$(curl -fsSL https://raw.githubusercontent.com/perguth/chromeos-developer-setup/master/setup.sh)" 28 | ``` 29 | 30 | ## Related 31 | 32 | - [ChromeOS Yggdrasil Network setup](https://github.com/perguth/chromeos-yggdrasil-network-setup) 33 | - [ChromeOS window manager](https://github.com/JayGoldberg/chromewm): Tile windows using hotkeys 34 | -------------------------------------------------------------------------------- /playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: 'This will compute a while. Good read: https://mafinto.sh/blog/' 4 | hosts: localhost 5 | connection: local 6 | 7 | become: true 8 | tasks: 9 | 10 | - name: Determine local username 11 | become: false 12 | local_action: command whoami 13 | register: local_username 14 | - name: Determine distribution codename 15 | become: false 16 | local_action: command lsb_release -cs 17 | register: codename 18 | - name: Create temporary directory 19 | become: false 20 | tempfile: 21 | state: directory 22 | register: tmp_dir 23 | 24 | - block: # Utilities 25 | - name: '[Utilities / Gimp / Gedit] Install' 26 | apt: 27 | name: ['build-essential', 'htop', 'iperf3', 'mosh', 'nano', 'nmap', 'nload', 'ufw', 'screen', 'tmux', 'sshfs', 'gimp', 'gedit'] 28 | update_cache: yes 29 | 30 | - block: # VS Code 31 | - name: '[VS Code] Get GPG key' 32 | get_url: 33 | url: https://packages.microsoft.com/keys/microsoft.asc 34 | dest: '{{tmp_dir.path}}/microsoft.asc' 35 | - name: '[VS Code] Dearmor GPG key' 36 | command: 37 | chdir: '{{tmp_dir.path}}' 38 | cmd: gpg --dearmor microsoft.asc 39 | creates: microsoft.asc.gpg 40 | - name: '[VS Code] Ensure key dir exists' 41 | file: 42 | path: /etc/apt/keyrings 43 | state: directory 44 | - name: '[VS Code] Install GPG key' 45 | copy: 46 | src: '{{tmp_dir.path}}/microsoft.asc.gpg' 47 | dest: /etc/apt/keyrings/packages.microsoft.gpg 48 | mode: 0644 49 | - name: '[VS Code] Add reporsitory' 50 | apt_repository: 51 | repo: deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main 52 | filename: vscode 53 | - name: '[VS Code] Install' 54 | apt: 55 | name: ['gnome-keyring', 'code'] 56 | update_cache: yes 57 | 58 | - block: # NodeJS, PNPM and Yarn 59 | - name: '[NodeJS] Add NodeJS GPG key' 60 | apt_key: 61 | url: http://deb.nodesource.com/gpgkey/nodesource.gpg.key 62 | id: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 63 | - name: '[NodeJS] Add NodeJS repository' 64 | apt_repository: 65 | repo: deb http://deb.nodesource.com/node_20.x {{codename.stdout}} main 66 | filename: nodesource 67 | update_cache: no 68 | - name: '[NodeJS] Install' 69 | apt: 70 | name: ['nodejs'] 71 | update_cache: yes 72 | - name: '[NodeJS] Set package root of NPM to the home directory' 73 | become: false 74 | lineinfile: 75 | path: ~/.npmrc 76 | line: prefix = ${HOME}/.npm 77 | create: yes 78 | - name: '[NodeJS] Create directory' 79 | become: false 80 | file: 81 | path: ~/.npm/lib 82 | state: directory 83 | - name: '[NodeJS] Activate Corepack' 84 | become: true 85 | command: corepack enable 86 | - name: '[NodeJS] Activate Yarn' 87 | become: false 88 | command: corepack prepare yarn@stable --activate 89 | - name: '[NodeJS] Activate PNPM' 90 | become: false 91 | command: corepack prepare pnpm --activate 92 | - name: '[NodeJS] Add NPM directory to PATH' 93 | become: false 94 | lineinfile: 95 | path: ~/.bashrc 96 | line: export PATH=$HOME/.npm/bin:$PATH 97 | - name: '[NodeJS] Install Socket package scanner' 98 | become: false 99 | command: npm install -g @socketsecurity/cli 100 | - name: '[NodeJS] Set NPM alias' 101 | become: false 102 | lineinfile: 103 | path: ~/.bashrc 104 | line: alias npm="socket-npm" 105 | - name: '[NodeJS] Set NPX alias' 106 | become: false 107 | lineinfile: 108 | path: ~/.bashrc 109 | line: alias npx="socket-npx" 110 | - name: '[NodeJS] Enable auto-completion' 111 | become: false 112 | lineinfile: 113 | path: ~/.bashrc 114 | line: $(complete -p npm | sed 's/npm$/socket-npm/') 115 | 116 | - block: # Docker and Docker Compose 117 | - name: '[Docker] Add Docker GPG key' 118 | apt_key: 119 | url: https://download.docker.com/linux/debian/gpg 120 | id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 121 | - name: '[Docker] Add Docker repository' 122 | apt_repository: 123 | repo: deb https://download.docker.com/linux/debian {{codename.stdout}} stable 124 | filename: docker 125 | update_cache: no 126 | - name: '[Docker] Install Docker' 127 | apt: update_cache=yes name=docker-ce 128 | - name: '[Docker] Create docker group' 129 | group: 130 | name: docker 131 | state: present 132 | - name: '[Docker] Add user to docker group' 133 | user: 134 | name: '{{local_username.stdout}}' 135 | groups: docker 136 | - name: '[Docker] Determine download URL' 137 | shell: echo "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" 138 | register: docker_compose_url 139 | - name: '[Docker] Install Docker Compose' 140 | get_url: 141 | url: '{{docker_compose_url.stdout}}' 142 | mode: 0755 143 | dest: /usr/local/bin/docker-compose 144 | 145 | - block: # Golang 146 | - name: '[Golang] Determine latest version' 147 | uri: 148 | url: https://go.dev/VERSION?m=text 149 | return_content: yes 150 | register: golang_version 151 | - name: '[Golang] Set Golang version' 152 | set_fact: 153 | golang_version_first_line: "{{ golang_version.content.split('\n')[0] }}" 154 | - name: '[Golang] Get tarball' 155 | get_url: 156 | url: 'https://go.dev/dl/{{ golang_version_first_line }}.linux-amd64.tar.gz' 157 | dest: '{{tmp_dir.path}}' 158 | - name: '[Golang] Extract' 159 | unarchive: 160 | src: '{{tmp_dir.path}}/{{ golang_version_first_line }}.linux-amd64.tar.gz' 161 | copy: no 162 | dest: /usr/local 163 | - name: '[Golang] Configure `~/.bashrc`' 164 | become: false 165 | lineinfile: 166 | path: ~/.bashrc 167 | line: '{{item}}' 168 | with_items: 169 | - export GOROOT=/usr/local/go 170 | - export GOPATH=$HOME/go 171 | - export PATH=$GOPATH/bin:/usr/local/go/bin:$PATH 172 | 173 | - block: # Rust 174 | - name: '[Rust] Get installer' 175 | become: false 176 | get_url: 177 | url: https://sh.rustup.rs 178 | mode: 0755 179 | dest: '{{tmp_dir.path}}/rustup-init' 180 | - name: '[Rust] Install' 181 | become: false 182 | command: '{{tmp_dir.path}}/rustup-init -y' 183 | args: 184 | creates: ~/.rustup 185 | - name: '[Rust] Add to PATH' 186 | become: false 187 | lineinfile: 188 | path: ~/.bashrc 189 | line: source $HOME/.cargo/env 190 | 191 | - block: # Deno 192 | - name: '[Deno] Get installer' 193 | become: false 194 | get_url: 195 | url: https://github.com/denoland/deno/releases/latest/download/deno-x86_64-unknown-linux-gnu.zip 196 | mode: 0755 197 | dest: '{{tmp_dir.path}}/deno.zip' 198 | - name: '[Deno] Create directory' 199 | become: false 200 | file: 201 | path: ~/.deno/bin 202 | state: directory 203 | - name: '[Deno] Extract binary' 204 | become: false 205 | unarchive: 206 | src: '{{tmp_dir.path}}/deno.zip' 207 | dest: ~/.deno/bin 208 | mode: 0755 209 | - name: '[Deno] Add to PATH' 210 | become: false 211 | lineinfile: 212 | path: ~/.bashrc 213 | line: export PATH=$HOME/.deno/bin:$PATH 214 | 215 | - name: Clean up 216 | file: 217 | path: '{{tmp_dir}}' 218 | state: absent 219 | --------------------------------------------------------------------------------