From e9d702563b30e220e9732df32c1f56fd6194a6e7 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Wed, 25 Oct 2023 00:00:00 +0700 Subject: [PATCH] Update package list and adjust some TODO milestones --- TODO.md | 16 ++++++-------- group_vars/all/options.yml | 11 ++++++++++ roles/chroot/defaults/main.yml | 3 ++- roles/chroot/templates/repositories.j2 | 9 +++++--- roles/config/templates/fish/aliases.j2 | 1 - roles/config/templates/fish/env.j2 | 5 +++++ roles/containers/tasks/apptainer.jsonnet | 13 +++-------- roles/containers/tasks/apptainer.yml | 28 +++--------------------- roles/packages/defaults/main.yml | 10 +++------ roles/packages/tasks/go-packages.jsonnet | 7 ++++++ roles/packages/tasks/go-packages.yml | 25 +++++++++++++++++++++ tasks/check_other.yml | 8 +++---- 12 files changed, 76 insertions(+), 60 deletions(-) diff --git a/TODO.md b/TODO.md index e9e9c56..95ff892 100644 --- a/TODO.md +++ b/TODO.md @@ -16,7 +16,7 @@ Plans for the future of this dotfiles. - [ ] ~~[fnm](https://github.com/Schniz/fnm)~~ - [ ] ~~[asdf](https://github.com/asdf-vm/asdf)~~ - [ ] [userspace-tablet-driver](https://github.com/kurikaesu/userspace-tablet-driver-daemon) for my XP-PEN Artist 16 Pro -- [ ] [lite-xl](https://github.com/lite-xl/lite-xl) / helix +- [ ] [lite-xl](https://github.com/lite-xl/lite-xl) / helix / kakoune - [ ] Wayland compositors: [japokwm](https://github.com/werererer/japokwm), [dwl](https://github.com/djpohly/dwl), [labwc](https://github.com/labwc/labwc), [vivarium](https://github.com/inclement/vivarium), [qtile](https://github.com/qtile/qtile) (also revaluate [hikari](https://hub.darcs.net/raichoo/hikari) and [wayfire](https://wayfire.org)) - [x] ~~[tremc](https://github.com/tremc/tremc) / [rtorrent](https://github.com/rakshasa/rtorrent/)~~ ==> I use [qbt](https://github.com/ludviglundgren/qbittorrent-cli) with qbittorrent-nox daemon now - [ ] Other terminals (contour, wezterm) @@ -38,11 +38,11 @@ Plans for the future of this dotfiles. - [ ] Build podman container images with ansible-bender - [ ] Add `target-determinator` and `aspect-cli` to packages (or containers, with underlying `bazel`) +- [ ] Migrate hardcoded paths to use XDG variables ## Sandboxing - [ ] Dockerfile for [animdl](https://github.com/justfoolingaround/animdl) + mpv -- [ ] [language-tool Dockerfile](https://github.com/Erikvl87/docker-languagetool) for usage with Neovim - [ ] podman rootless with dbus access (without ANONYMOUS authentication) + socket permissions (wayland / dbus/ pipewire / pulseaudio) in container (777 is no good) ## Neovim @@ -54,14 +54,10 @@ Plans for the future of this dotfiles. ## LSP/DAP -- [ ] fennel-ls / fennel_language_server - [ ] elixirls (config for `nvim-lspconfig` and `nvim-dap` + install script) - [ ] denols -- [ ] flux_lsp -- [ ] teal_ls -- [ ] buck2 (can't be built with stable cargo yet) - [ ] ocamllsp -- [ ] hls (haskell-language-server) +- [ ] vscode-js-debug (config for `nvim-dap` + install script) ### Interesting plugins @@ -75,7 +71,6 @@ My Neovim config is already a mess, so it's fine making it even messier. - [ ] refactoring.nvim - [ ] rust-tools.nvim - [ ] telekasten.nvim -- [ ] lsp-inlayhints.nvim - [ ] tangerine.nvim / aniseed / hotpot / nfnl - [ ] silicon.nvim / silicon.lua - [ ] nabla.nvim @@ -85,4 +80,7 @@ My Neovim config is already a mess, so it's fine making it even messier. - [ ] haskell-tools.nvim - [ ] nvim-asciidoc-preview - [ ] lsp-lens.nvim -- [ ] null-ls.nvim -> efmls-configs-nvim (or plain efm-language-server) +- [ ] venv-selector.nvim +- [ ] virtual-types.nvim +- [ ] hover.nvim +- [ ] nvim-tree.lua -> neo-tree??? diff --git a/group_vars/all/options.yml b/group_vars/all/options.yml index 74b45a3..8b82a82 100644 --- a/group_vars/all/options.yml +++ b/group_vars/all/options.yml @@ -42,3 +42,14 @@ umask: '0027' # Leave jq behind! `jaq`, `gojq` and `yq` are here for the rescue jq_binary: /usr/bin/gojq + +# XDG directory spec (need to be absolute paths here) +xdg_dir: + bin_home: '{{ ansible_user_dir }}/.local/bin' + cache_home: '{{ ansible_user_dir }}/.cache' + config_home: '{{ ansible_user_dir }}/.config' + data_home: '{{ ansible_user_dir }}/.local/share' + state_home: '{{ ansible_user_dir }}/.local/state' + + # This is not in XDG spec, but it's used here as a user-scoped /usr/libexec + libexec_dir: '{{ ansible_user_dir }}/.local/libexec' diff --git a/roles/chroot/defaults/main.yml b/roles/chroot/defaults/main.yml index 733cd35..e1bdef8 100644 --- a/roles/chroot/defaults/main.yml +++ b/roles/chroot/defaults/main.yml @@ -1,3 +1,4 @@ --- chroot_dir: '{{ ansible_env.HOME }}/Alpine-chroot' -apk_repository: https://dl-cdn.alpinelinux.org/alpine +apk_repository: + - https://dl-cdn.alpinelinux.org/alpine diff --git a/roles/chroot/templates/repositories.j2 b/roles/chroot/templates/repositories.j2 index 2c9fb08..300d314 100644 --- a/roles/chroot/templates/repositories.j2 +++ b/roles/chroot/templates/repositories.j2 @@ -1,3 +1,6 @@ -{{ apk_repository }}/edge/main -{{ apk_repository }}/edge/community -{{ apk_repository }}/edge/testing +{% for repo in apk_repository %} +{{ repo }}/edge/main +{{ repo }}/edge/community +{{ repo }}/edge/testing + +{% endfor %} diff --git a/roles/config/templates/fish/aliases.j2 b/roles/config/templates/fish/aliases.j2 index 3cb7138..5783ae5 100644 --- a/roles/config/templates/fish/aliases.j2 +++ b/roles/config/templates/fish/aliases.j2 @@ -6,7 +6,6 @@ abbr h helm abbr k kubectl abbr kx kubectx abbr kn kubens -abbr c cdktf abbr t terraform abbr p pulumi diff --git a/roles/config/templates/fish/env.j2 b/roles/config/templates/fish/env.j2 index f1f2f2c..1227a55 100644 --- a/roles/config/templates/fish/env.j2 +++ b/roles/config/templates/fish/env.j2 @@ -51,6 +51,7 @@ set -gx PULUMI_HOME $XDG_DATA_HOME/pulumi set -gx CDKTF_HOME $XDG_DATA_HOME/terraform-cdk set -gx TF_PLUGIN_CACHE_DIR $XDG_CACHE_HOME/terraform/plugin-cache set -gx APPTAINER_CACHEDIR $XDG_CACHE_HOME/apptainer +set -gx MAGEFILE_CACHE $XDG_CACHE_HOME/magefile # set -gx MANPATH :$XDG_DATA_HOME/man # common envs @@ -104,6 +105,8 @@ set -gx KUBESHARK_DISABLE_VERSION_CHECK true set -gx DCTL_NO_VERSION_CHECK true ## deno set -gx DENO_NO_UPDATE_CHECK true +## tabbyml +set -gx TABBY_DISABLE_USAGE_COLLECTION 1 ## Hashicorp stuff phoning home set -gx CHECKPOINT_DISABLE true set -gx DISABLE_VERSION_CHECK true @@ -111,6 +114,8 @@ set -gx VAGRANT_I_KNOW_WHAT_IM_DOING_PLEASE_BE_QUIET true set -gx VAGRANT_BOX_UPDATE_CHECK_DISABLE true set -gx VAGRANT_DISABLE_RESOLV_REPLACE true set -gx VAGRANT_PREFER_SYSTEM_BIN true +## OPA +set -gx OPA_TELEMETRY_SERVICE_URL "" # gopass settings not covered by the config file set -gx GOPASS_CONFIG_NOSYSTEM true diff --git a/roles/containers/tasks/apptainer.jsonnet b/roles/containers/tasks/apptainer.jsonnet index a857c25..e55ce27 100644 --- a/roles/containers/tasks/apptainer.jsonnet +++ b/roles/containers/tasks/apptainer.jsonnet @@ -64,25 +64,18 @@ local docker_images = { name: 'bazel', image: 'gcr.io/bazel-public/bazel', - tag: '6.3.2', - }, - { - name: 'libguestfs', - image: 'ghcr.io/bkahlert/libguestfs', - tag: '1.2.1', - // guestfish, virt-builder, virt-customize, etc. - command: '', + tag: '6.4.0', }, { name: 'terraform', image: 'docker.io/hashicorp/terraform', - tag: '1.5.7', + tag: '1.6.2', args: hashicorp_args, }, { name: 'vault', image: 'docker.io/hashicorp/vault', - tag: '1.15.0', + tag: '1.15.1', args: hashicorp_args, }, ]; diff --git a/roles/containers/tasks/apptainer.yml b/roles/containers/tasks/apptainer.yml index 0d7e9fb..7dd7494 100644 --- a/roles/containers/tasks/apptainer.yml +++ b/roles/containers/tasks/apptainer.yml @@ -9,7 +9,7 @@ removes: ~/.local/libexec/bazel.sif name: apptainer | Clean old bazel.sif file - command: - cmd: /usr/bin/apptainer pull ~/.local/libexec/bazel.sif docker://gcr.io/bazel-public/bazel:6.3.2 + cmd: /usr/bin/apptainer pull ~/.local/libexec/bazel.sif docker://gcr.io/bazel-public/bazel:6.4.0 creates: ~/.local/libexec/bazel.sif removes: /usr/bin/apptainer name: apptainer | Pull and build bazel.sif file @@ -25,35 +25,13 @@ name: apptainer | Create bazel-apptainer launch script name: apptainer | Create bazel environment tags: bazel-apptainer -- block: - - command: - cmd: rm -rf ~/.local/libexec/libguestfs.sif - removes: ~/.local/libexec/libguestfs.sif - name: apptainer | Clean old libguestfs.sif file - - command: - cmd: /usr/bin/apptainer pull ~/.local/libexec/libguestfs.sif docker://ghcr.io/bkahlert/libguestfs:1.2.1 - creates: ~/.local/libexec/libguestfs.sif - removes: /usr/bin/apptainer - name: apptainer | Pull and build libguestfs.sif file - - copy: - content: | - #!/bin/sh - TERM=xterm-256color \ - exec apptainer --silent --quiet exec \ - --ipc --no-eval --no-privs --unsquash --userns --uts --pid --cleanenv \ - ~/.local/libexec/libguestfs.sif "$@" - dest: ~/.local/bin/libguestfs - mode: "755" - name: apptainer | Create libguestfs-apptainer launch script - name: apptainer | Create libguestfs environment - tags: libguestfs-apptainer - block: - command: cmd: rm -rf ~/.local/libexec/terraform.sif removes: ~/.local/libexec/terraform.sif name: apptainer | Clean old terraform.sif file - command: - cmd: /usr/bin/apptainer pull ~/.local/libexec/terraform.sif docker://docker.io/hashicorp/terraform:1.5.5 + cmd: /usr/bin/apptainer pull ~/.local/libexec/terraform.sif docker://docker.io/hashicorp/terraform:1.6.2 creates: ~/.local/libexec/terraform.sif removes: /usr/bin/apptainer name: apptainer | Pull and build terraform.sif file @@ -75,7 +53,7 @@ removes: ~/.local/libexec/vault.sif name: apptainer | Clean old vault.sif file - command: - cmd: /usr/bin/apptainer pull ~/.local/libexec/vault.sif docker://docker.io/hashicorp/vault:1.14.1 + cmd: /usr/bin/apptainer pull ~/.local/libexec/vault.sif docker://docker.io/hashicorp/vault:1.15.1 creates: ~/.local/libexec/vault.sif removes: /usr/bin/apptainer name: apptainer | Pull and build vault.sif file diff --git a/roles/packages/defaults/main.yml b/roles/packages/defaults/main.yml index 60377bd..d948b5e 100644 --- a/roles/packages/defaults/main.yml +++ b/roles/packages/defaults/main.yml @@ -49,8 +49,6 @@ system_apk_packages: - aerc - age - alacritty - - amfora - - anime4kcpp - ansible-lint - apko - apptainer @@ -63,7 +61,6 @@ system_apk_packages: - bat - below - bettercap - - bombadillo - borgbackup - breezy - brillo @@ -157,12 +154,15 @@ system_apk_packages: - grype - gsettings-desktop-schemas # To run `gsettings` command to customize GTK theming - gst-plugins-pipewire + - guestfs-tools - gum - helix - helm - hexyl - htmlq - httm + - hunspell + - hunspell-en-us - hwatch - hyperfine - ictree @@ -199,7 +199,6 @@ system_apk_packages: - mdbook - megatools - mercurial - - mesa-dri-classic - mesa-dri-gallium - mesa-va-gallium - mesa-vdpau-gallium @@ -235,7 +234,6 @@ system_apk_packages: - onefetch - openssh-client-default - openssh-doc - - packer - pandoc-cli - pastel - pavucontrol-qt @@ -325,7 +323,6 @@ system_apk_packages: - tcpdump - tea - termshark - - terraform - testdisk - texlive-full - tidyhtml @@ -336,7 +333,6 @@ system_apk_packages: - tzdata - ugrep - unfurl - - unmake - up - usbutils - usql diff --git a/roles/packages/tasks/go-packages.jsonnet b/roles/packages/tasks/go-packages.jsonnet index 3c4427e..fb34f3c 100644 --- a/roles/packages/tasks/go-packages.jsonnet +++ b/roles/packages/tasks/go-packages.jsonnet @@ -74,6 +74,13 @@ local packages = { name: 'zk', url: 'github.com/mickael-menu/zk' }, { name: 'mods', url: 'github.com/charmbracelet/mods' }, + // Nicety Pulumi stuff + { name: 'crd2pulumi', url: 'github.com/pulumi/crd2pulumi' }, + { name: 'schema-tools', url: 'github.com/pulumi/schema-tools' }, + { name: 'kubespy', url: 'github.com/pulumi/kubespy' }, + { name: 'registrygen', url: 'github.com/pulumi/registrygen' }, + { name: 'pulumictl', url: 'github.com/pulumi/pulumictl/cmd/pulumictl' }, + // TODO: make an Alpine package when stablized and less feature locked down // (e.g. can customize themes, fonts, ...) { name: 'd2', url: 'oss.terrastruct.com/d2' }, diff --git a/roles/packages/tasks/go-packages.yml b/roles/packages/tasks/go-packages.yml index 214af18..2a71ee6 100644 --- a/roles/packages/tasks/go-packages.yml +++ b/roles/packages/tasks/go-packages.yml @@ -343,6 +343,31 @@ removes: /usr/bin/go name: packages | Install mods tags: mods +- command: + cmd: /usr/bin/go install -ldflags "-s -w" github.com/pulumi/crd2pulumi@latest + removes: /usr/bin/go + name: packages | Install crd2pulumi + tags: crd2pulumi +- command: + cmd: /usr/bin/go install -ldflags "-s -w" github.com/pulumi/schema-tools@latest + removes: /usr/bin/go + name: packages | Install schema-tools + tags: schema-tools +- command: + cmd: /usr/bin/go install -ldflags "-s -w" github.com/pulumi/kubespy@latest + removes: /usr/bin/go + name: packages | Install kubespy + tags: kubespy +- command: + cmd: /usr/bin/go install -ldflags "-s -w" github.com/pulumi/registrygen@latest + removes: /usr/bin/go + name: packages | Install registrygen + tags: registrygen +- command: + cmd: /usr/bin/go install -ldflags "-s -w" github.com/pulumi/pulumictl/cmd/pulumictl@latest + removes: /usr/bin/go + name: packages | Install pulumictl + tags: pulumictl - command: cmd: /usr/bin/go install -ldflags "-s -w" oss.terrastruct.com/d2@latest removes: /usr/bin/go diff --git a/tasks/check_other.yml b/tasks/check_other.yml index 336ee10..625744f 100644 --- a/tasks/check_other.yml +++ b/tasks/check_other.yml @@ -4,7 +4,7 @@ msg: This playbook should not be run as 'root' when: ansible_real_user_id == 0 -- name: check | 0700 permission on $HOME directory +- name: check | 0700 permission on HOME directory file: path: '{{ ansible_user_dir }}' state: directory @@ -12,11 +12,11 @@ group: '{{ ansible_user_id }}' mode: '700' -- name: check | Whether ~/.config and ~/.local/share exist +- name: check | Whether XDG_CONFIG_HOME and XDG_DATA_HOME exist file: path: '{{ item }}' state: directory mode: '755' loop: - - ~/.config - - ~/.local/share + - '{{ xdg_dir.config_home }}' + - '{{ xdg_dir.data_home }}'