Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b58f9a5
Add eget installation tasks and update README with new tags
kenorb May 29, 2026
4992421
Enhance eget package management by adding new packages and updating i…
kenorb May 29, 2026
1edb821
Add .eget.toml configuration file
kenorb May 29, 2026
0390fa8
Add .markdown-link-check.json configuration file
kenorb May 29, 2026
cccc3c1
Delete .github/workflows/reviewdog.yml
kenorb May 29, 2026
e910c31
Add .env file with locale settings
kenorb May 29, 2026
c12a912
Add eget feature to devcontainer configuration
kenorb May 29, 2026
e67f739
Add .eget.toml configuration file and symlink to dotfiles
kenorb May 29, 2026
0b5cf79
Add pattern to ignore GitHub releases in markdown link check
kenorb May 29, 2026
e6b9899
Add .lycheeignore file and remove .markdown-link-check.json
kenorb May 29, 2026
d520210
Add .markdown-link-check.json configuration file
kenorb May 29, 2026
6da7482
Add task to ensure ~/.local/bin directory exists for eget installation
kenorb May 29, 2026
9fced07
Add architecture-aware package mapping for eget installation
kenorb May 29, 2026
9e7d478
Update paths to use ansible_user_dir instead of lookup for HOME in do…
kenorb May 29, 2026
8bef068
Idempotency check may not find the installed binary.
kenorb May 29, 2026
38a74f5
Fix regex for eget version extraction to remove leading 'v'.
kenorb May 29, 2026
205d957
Replace ogham/exa with maintained eza (eza-community/eza)
kenorb May 29, 2026
5ad1065
Update paths to use ansible_facts['user_dir'] for consistency in dotf…
kenorb May 29, 2026
cac4097
Refactor README.md for clarity and conciseness in Ansible setup instr…
kenorb May 29, 2026
c146596
Add alpha-miner to eget package mapping and variables example
kenorb May 29, 2026
6f50858
Fix pre-commit, links, and eget setup.
opencode-agent[bot] May 29, 2026
dac40d7
Revert "Fix pre-commit, links, and eget setup."
opencode-agent[bot] May 29, 2026
330166b
Fix pre-commit formatting and links
opencode-agent[bot] May 29, 2026
cba8623
Restored link configs and placeholders.
opencode-agent[bot] May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ These playbooks are used to set up and configure your Linux environment autonomo
## Requirements

- `pipenv`
Install by: `sudo apt --yes install pipenv`
- `ansible` (installed via Pipenv)

## Usage

Before running the playbooks, ensure you have your `variables.yml` set up:
Before running the playbook, ensure you have your `variables.yml` set up:

```bash
cd .ansible/
cp variables-example.yml variables.yml
# Edit variables.yml to your liking
cp variables-example.yml variables.yml # Modify after copy.
```

Run the setup playbook:

```bash
pipenv sync
pipenv run ansible-playbook -i inventory/hosts playbooks/setup-linux.yml -K
```

Expand All @@ -30,13 +30,14 @@ You can use tags to run specific parts of the playbook using the `--tags` flag.
| Tag | Description |
| --- | --- |
| `apt` | Runs all APT related tasks (upgrade, install, releases). |
| `upgrade` | Performs `apt upgrade`. |
| `install` | Installs the list of packages defined in `apt.install`. |
| `brave` | Installs Brave Browser. |
| `cuda` | Specific tasks for CUDA Toolkit. |
| `dotfiles` | Manages symlinks for dotfiles in your home directory. |
| `eget` | Installs `eget` and configured binary packages. |
| `install` | Installs the list of packages defined in `apt.install` and `eget` packages. |
| `nvidia` | Handles NVIDIA/CUDA related installations. |
| `cuda` | Specific tasks for CUDA Toolkit. |
| `upgrade` | Performs `apt upgrade` and updates `eget` packages. |
| `vscode` | Installs Visual Studio Code. |
| `brave` | Installs Brave Browser. |

Example:

Expand All @@ -54,7 +55,8 @@ The `setup-linux.yml` playbook performs the following operations:
3. **CUDA Toolkit**: Configures and installs NVIDIA CUDA drivers and toolkit.
4. **VS Code**: Adds the Microsoft repository and installs Visual Studio Code.
5. **Brave Browser**: Adds the Brave repository and installs the browser.
6. **Dotfiles**: Symlinks configuration files from this repository into your `$HOME`.
6. **Eget**: Installs the `eget` binary and a set of useful CLI tools to `~/.local/bin`.
7. **Dotfiles**: Symlinks configuration files from this repository into your `$HOME`.

### Note on Dotfiles Conflicts

Expand Down
5 changes: 5 additions & 0 deletions .ansible/playbooks/setup-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
become: true
tags: [apt, brave]

- name: Import eget installation tasks
ansible.builtin.import_tasks: tasks/eget.yml
when: eget | default(false) | bool
tags: [eget, upgrade, install]

- name: Import dotfiles symlink tasks
ansible.builtin.import_tasks: tasks/dotfiles.yml
when: dotfiles is defined
Expand Down
16 changes: 8 additions & 8 deletions .ansible/playbooks/tasks/dotfiles.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Check if dotfiles exist (files)
ansible.builtin.stat:
path: "{{ lookup('env', 'HOME') }}/{{ item.key }}"
path: "{{ ansible_facts['user_dir'] }}/{{ item.key }}"
loop: "{{ dotfiles.files | dict2items }}"
register: dotfiles_stat

Expand All @@ -16,7 +16,7 @@

- name: Remove symlink if set to false (files)
ansible.builtin.file:
path: "{{ lookup('env', 'HOME') }}/{{ item.item.key }}"
path: "{{ ansible_facts['user_dir'] }}/{{ item.item.key }}"
state: absent
loop: "{{ dotfiles_stat.results }}"
when:
Expand All @@ -26,7 +26,7 @@
- name: Create symlinks for dotfiles (files)
ansible.builtin.file:
src: "{{ (playbook_dir + '/../../' + item.item.key) | realpath }}"
dest: "{{ lookup('env', 'HOME') }}/{{ item.item.key }}"
dest: "{{ ansible_facts['user_dir'] }}/{{ item.item.key }}"
state: link
force: false
loop: "{{ dotfiles_stat.results }}"
Expand All @@ -37,7 +37,7 @@
- name: Create symlinks for dotfiles with .new extension if file exists
ansible.builtin.file:
src: "{{ (playbook_dir + '/../../' + item.item.key) | realpath }}"
dest: "{{ lookup('env', 'HOME') }}/{{ item.item.key }}.new"
dest: "{{ ansible_facts['user_dir'] }}/{{ item.item.key }}.new"
state: link
force: true
loop: "{{ dotfiles_stat.results }}"
Expand All @@ -48,7 +48,7 @@

- name: Check if dotfiles exist (directories)
ansible.builtin.stat:
path: "{{ lookup('env', 'HOME') }}/{{ item.key }}"
path: "{{ ansible_facts['user_dir'] }}/{{ item.key }}"
loop: "{{ dotfiles.dirs | dict2items }}"
register: dotdirs_stat

Expand All @@ -63,7 +63,7 @@

- name: Remove symlink if set to false (directories)
ansible.builtin.file:
path: "{{ lookup('env', 'HOME') }}/{{ item.item.key }}"
path: "{{ ansible_facts['user_dir'] }}/{{ item.item.key }}"
state: absent
loop: "{{ dotdirs_stat.results }}"
when:
Expand All @@ -73,7 +73,7 @@
- name: Create symlinks for dotfiles (directories)
ansible.builtin.file:
src: "{{ (playbook_dir + '/../../' + item.item.key) | realpath }}"
dest: "{{ lookup('env', 'HOME') }}/{{ item.item.key }}"
dest: "{{ ansible_facts['user_dir'] }}/{{ item.item.key }}"
state: link
force: false
loop: "{{ dotdirs_stat.results }}"
Expand All @@ -84,7 +84,7 @@
- name: Create symlinks for dotfiles (directories) with .new extension if directory exists
ansible.builtin.file:
src: "{{ (playbook_dir + '/../../' + item.item.key) | realpath }}"
dest: "{{ lookup('env', 'HOME') }}/{{ item.item.key }}.new"
dest: "{{ ansible_facts['user_dir'] }}/{{ item.item.key }}.new"
state: link
force: true
loop: "{{ dotdirs_stat.results }}"
Expand Down
102 changes: 102 additions & 0 deletions .ansible/playbooks/tasks/eget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
- name: Ensure ~/.local/bin exists
ansible.builtin.file:
path: "{{ ansible_facts['user_dir'] }}/.local/bin"
state: directory
mode: '0755'

- name: Check if eget is already installed
ansible.builtin.stat:
path: "{{ ansible_facts['user_dir'] }}/.local/bin/eget"
register: eget_stat

- name: Get latest release of eget
ansible.builtin.uri:
url: https://api.github.com/repos/zyedidia/eget/releases/latest
return_content: true
register: eget_latest
when: not eget_stat.stat.exists

- name: Set eget facts
ansible.builtin.set_fact:
eget_version: "{{ eget_latest.json.tag_name | regex_replace('^v', '') }}"
eget_platform: >-
linux_{{
'amd64' if ansible_facts['architecture'] == 'x86_64'
else 'arm64' if ansible_facts['architecture'] == 'aarch64'
else 'arm'
}}
when: not eget_stat.stat.exists

- name: Create temporary directory for eget
ansible.builtin.tempfile:
state: directory
suffix: eget
register: eget_tmp
when: not eget_stat.stat.exists

- name: Download and extract eget
ansible.builtin.unarchive:
src: >-
https://github.com/zyedidia/eget/releases/download/v{{ eget_version }}/eget-{{
eget_version }}-{{ eget_platform }}.tar.gz
dest: "{{ eget_tmp.path }}"
remote_src: true
Comment thread
kenorb marked this conversation as resolved.
extra_opts:
- "--strip-components=1"
- "eget-{{ eget_version }}-{{ eget_platform }}/eget"
when: not eget_stat.stat.exists

- name: Install eget to ~/.local/bin
ansible.builtin.copy:
src: "{{ eget_tmp.path }}/eget"
dest: "{{ ansible_facts['user_dir'] }}/.local/bin/eget"
mode: '0755'
remote_src: true
when: not eget_stat.stat.exists

- name: Cleanup temporary directory
ansible.builtin.file:
path: "{{ eget_tmp.path }}"
state: absent
when: not eget_stat.stat.exists and eget_tmp.path is defined

- name: Define eget package mapping
ansible.builtin.set_fact:
eget_arch: >-
{{ 'x86_64' if ansible_facts['architecture'] == 'x86_64'
else 'arm64' if ansible_facts['architecture'] == 'aarch64'
else 'arm' }}
eget_plain_arch: "{{ ansible_facts['architecture'] }}"

- name: Set architecture-aware package mappings
ansible.builtin.set_fact:
eget_package_map:
alpha-miner: "-a .tar.gz --file alpha/alpha --tag v1.7.5-beta --to alpha-miner AlphaMine-Tech/alpha-miner"
bat: >-
-a {{ eget_arch }}-unknown-linux-{{ 'gnu' if eget_arch == 'x86_64' else 'musl' }}
-a tar.gz sharkdp/bat
btop: "-a btop-{{ eget_plain_arch }}-unknown-linux-musl.tar.gz aristocratos/btop"
duf: "-a linux_{{ eget_arch }}.tar.gz muesli/duf"
eza: "-a {{ eget_plain_arch }}-unknown-linux-gnu -a ^no_libgit -a tar.gz eza-community/eza"
fd: "-a {{ eget_arch }}-unknown-linux-gnu -a tar.gz sharkdp/fd"
jq: >-
-a {{ 'linux64' if eget_arch == 'x86_64' else 'linux-arm64' if eget_arch == 'arm64' else 'linux-arm' }}
jqlang/jq
pandoc: "-a linux-{{ 'amd64' if eget_arch == 'x86_64' else 'arm64' }}.tar.gz jgm/pandoc"
rg: "-a {{ eget_plain_arch }}-unknown-linux-musl.tar.gz BurntSushi/ripgrep"
tealdeer: "-a tealdeer-linux-{{ eget_arch }}-musl -a ^sha256 dbrgn/tealdeer"
vale: "-a {{ 'Linux_64-bit' if eget_arch == 'x86_64' else 'Linux_arm64' }}.tar.gz errata-ai/vale"
yq: "-a ^.tar.gz mikefarah/yq"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Install eget packages
ansible.builtin.shell:
cmd: "eget {{ eget_package_map[item] }} && sleep 1"
creates: "{{ ansible_facts['user_dir'] }}/.local/bin/{{ item }}"
environment:
EGET_BIN: "{{ ansible_facts['user_dir'] }}/.local/bin"
PATH: "{{ ansible_facts['user_dir'] }}/.local/bin:{{ ansible_facts['env']['PATH'] }}"
loop: "{{ eget_packages | default([]) }}"
register: eget_install_results
changed_when: "'Downloaded' in eget_install_results.stdout or 'Extracted' in eget_install_results.stdout"
when: eget_packages is defined and item in eget_package_map
18 changes: 17 additions & 1 deletion .ansible/variables-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
apt:
install:
- 7zip
- btop
- btrfs-progs
- coreutils
- curl
Expand Down Expand Up @@ -75,6 +74,7 @@ dotfiles:
.ctags: true
.curlrc: true
.editorconfig: true
.eget.toml: true
.exportsrc: true
.functions_unicode: true
.functionsrc: true
Expand All @@ -87,6 +87,7 @@ dotfiles:
.inputrc: true
.iterm2_shell_integration.zsh: true
.lldbinit: true
.lycheeignore: true
.markdownlint.yaml: true
.mdlrc: true
.my.cnf: true
Expand All @@ -104,6 +105,21 @@ dotfiles:
.zprofile: true
.zshrc: true

eget: true
eget_packages:
- alpha-miner
- bat
- btop
- duf
- eza
- fd
- jq
- pandoc
- rg
- tealdeer
- vale
- yq

nvidia:
cuda_toolkit: true
cuda_toolkit_package: cuda-toolkit-13-1
3 changes: 3 additions & 0 deletions .devcontainer/.eget.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[global]
target = "~/.local/bin"
upgrade_only = true
Comment thread
kenorb marked this conversation as resolved.
17 changes: 16 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers-contrib/features/actionlint:1": {},
"ghcr.io/devcontainers-extra/features/eget:1": { "version": "1.3.4" },
"ghcr.io/devcontainers-contrib/features/node-asdf:0": {},
"ghcr.io/devcontainers-extra/features/pipx-package:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
Expand All @@ -54,5 +55,19 @@
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
// Note: Python dependencies can be added in the `requirements.txt` file.
"onCreateCommand": "sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ansible && ansible-playbook .devcontainer/provision.yml"
"onCreateCommand": "sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ansible && ansible-playbook .devcontainer/provision.yml",

"postCreateCommand": {
"bat": "eget -a x86_64-unknown-linux-gnu -a tar.gz sharkdp/bat",
"btop": "eget -a btop-x86_64-unknown-linux-musl.tar.gz aristocratos/btop",
"duf": "eget -a linux_x86_64.tar.gz muesli/duf",
"eza": "eget -a x86_64-unknown-linux-gnu -a ^no_libgit -a tar.gz eza-community/eza",
"fd": "eget -a x86_64-unknown-linux-gnu -a tar.gz sharkdp/fd",
"jq": "eget -a linux64 jqlang/jq",
"pandoc": "eget -a linux-amd64.tar.gz jgm/pandoc",
"rg": "eget -a x86_64-unknown-linux-musl.tar.gz BurntSushi/ripgrep",
"tealdeer": "eget -a tealdeer-linux-x86_64-musl -a ^sha256 dbrgn/tealdeer",
"vale": "eget -a Linux_64-bit.tar.gz errata-ai/vale",
"yq": "eget -a ^.tar.gz mikefarah/yq"
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
3 changes: 3 additions & 0 deletions .eget.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[global]
target = "~/.local/bin"
upgrade_only = true
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
18 changes: 0 additions & 18 deletions .github/workflows/reviewdog.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Lychee config to exclude links
# @docs: <https://lychee.cli.rs/recipes/excluding-links/>
# Keep the order sorted.

^https?://127\.0\.0\.1
^https?://example\.com
^https?://localhost

# Placeholders and templates
^https://github\.com/org/repo
^https://github\.com/zyedidia/eget/releases/download/v
32 changes: 32 additions & 0 deletions .markdown-link-check.json
Comment thread
kenorb marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"aliveStatusCodes": [200, 206],
"ignorePatterns": [
{
"pattern": "^http://localhost"
},
{
"pattern": "^https://localhost"
},
{
"pattern": "^http://127.0.0.1"
},
{
"pattern": "^https://127.0.0.1"
},
{
"pattern": "^http://example.com"
},
{
"pattern": "^https://example.com"
},
{
"pattern": "^https://github.com/org/repo"
},
{
"pattern": "^https://github.com/zyedidia/eget/releases/download/v"
}
],
"retryCount": 3,
"retryOn429": true,
"timeout": "10s"
}
Loading
Loading