diff --git a/.emacs.d/docker/.devcontainer/devcontainer.json b/.emacs.d/docker/.devcontainer/devcontainer.json new file mode 100644 index 0000000..96e4f8e --- /dev/null +++ b/.emacs.d/docker/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +{ + "dockerComposeFile": [ + "../docker-compose.yml" + ], + "service": "devcontainer", + + "remoteUser": "ubuntu", + + "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind", + "workspaceFolder": "/workspace", + + "mounts": [ + { + "type":"bind", + "source":"${localEnv:HOME}/.ssh", + "target":"/home/ubuntu/.ssh" + }, + { + "type": "bind", + "source": "${localEnv:SSH_AUTH_SOCK}", + "target": "/ssh-agent" + } + ], + + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {}, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + } +} diff --git a/.emacs.d/docker/Dockerfile b/.emacs.d/docker/Dockerfile index 9abb59d..046dcf4 100644 --- a/.emacs.d/docker/Dockerfile +++ b/.emacs.d/docker/Dockerfile @@ -1,78 +1,14 @@ -FROM ubuntu:22.04 - -ARG CLANG_VERSION=19 +# syntax=docker/dockerfile:1 +FROM ubuntu:24.04 # /* cspell:disable-next-line */ ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update - -RUN apt-get install -y tzdata - -RUN apt-get install -y ubuntu-desktop - -RUN apt-get install -y curl git ripgrep +RUN apt-get update && apt-get install -y tzdata ubuntu-desktop git curl wget lsb-release software-properties-common ripgrep # cspell:disable-next-line -RUN add-apt-repository ppa:ubuntuhandbook1/emacs && \ +RUN add-apt-repository ppa:ubuntuhandbook1/emacs -y && \ apt-get update # emacs30 as of 2026/02/28 RUN apt-get install -y emacs - -# for clangd -RUN apt-get update && apt-get install -y git curl wget lsb-release software-properties-common - -WORKDIR /tmp - -ADD --chown=root:root --chmod=777 https://apt.llvm.org/llvm.sh llvm.sh - -RUN ./llvm.sh ${CLANG_VERSION} - -# cSpell:disable -RUN apt-get update && apt-get install -y \ - clang-${CLANG_VERSION} \ - clang++-${CLANG_VERSION} \ - clang-tidy-${CLANG_VERSION} \ - clangd-${CLANG_VERSION} \ - clang-format-${CLANG_VERSION} \ - libomp-${CLANG_VERSION}-dev \ - libstdc++-12-dev -# cSpell:eable - -RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} ${CLANG_VERSION} -RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} ${CLANG_VERSION} -RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} ${CLANG_VERSION} -RUN update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-${CLANG_VERSION} ${CLANG_VERSION} -RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${CLANG_VERSION} ${CLANG_VERSION} - -RUN apt-get update && apt-get install -y libreadline-dev libgtest-dev libboost-all-dev - -# NOTE: apt-get install cmake causes following error -# The following packages have unmet dependencies: -# emacs-pgtk : Breaks: dh-elpa-helper (< 2.1.7) but 2.0.9ubuntu1 is to be installed -# E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. -# so install latest cmake -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - > /usr/share/keyrings/kitware-archive-keyring.gpg -RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' > /etc/apt/sources.list.d/kitware.list -RUN apt-get update && apt-get install -y cmake - -# rust -# cspell:disable-next-line -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - -# python - -# user -RUN useradd -m ubuntu - -# setup sudo -RUN apt-get update && apt-get install -y sudo -RUN echo "ubuntu:password" | chpasswd -RUN usermod -aG sudo ubuntu - -USER ubuntu - -WORKDIR /home/ubuntu - -CMD ["/bin/bash"] diff --git a/.emacs.d/docker/README.md b/.emacs.d/docker/README.md deleted file mode 100644 index 446f811..0000000 --- a/.emacs.d/docker/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Emacsのdotfiles開発用のdocker - -```bash -docker image build -t emacs-dev-ubuntu . -docker container exec -it emacs-dev bash -``` diff --git a/.emacs.d/docker/docker-compose.yml b/.emacs.d/docker/docker-compose.yml index d8f8236..01ea73d 100644 --- a/.emacs.d/docker/docker-compose.yml +++ b/.emacs.d/docker/docker-compose.yml @@ -1,13 +1,10 @@ -name: emacs-dev - services: - ubuntu: - build: . - container_name: emacs-dev + devcontainer: + build: + context: . + dockerfile: Dockerfile + container_name: dotfiles-emacs-dev-container volumes: - - type: bind - source: "../../../dotfiles" - target: "/workspace/dotfiles" - type: bind source: "../../.emacs.d" target: "/home/ubuntu/.emacs.d" @@ -15,9 +12,8 @@ services: source: /tmp/.X11-unix target: /tmp/.X11-unix - type: bind - source: "../../../cpplox" # cSpell:disable-line - target: "/workspace/cpplox" # cSpell:disable-line + source: "../../" + target: "/workspace" environment: DISPLAY: $DISPLAY tty: true - working_dir: /workspace diff --git a/.emacs.d/emacs-custom.el b/.emacs.d/emacs-custom.el deleted file mode 100644 index 6ea4596..0000000 --- a/.emacs.d/emacs-custom.el +++ /dev/null @@ -1,7 +0,0 @@ -;;; -*- lexical-binding: t -*- -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(default ((t (:family "Ubuntu Mono" :foundry "DAMA" :slant normal :weight regular :height 120 :width normal))))) diff --git a/.gitignore b/.gitignore index 7e967f1..15b5092 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ __pycache__ compile_commands.json .envrc .config/fish/conf.d/rustup.fish +devcontainer-lock.json +.emacs.d/emacs-custom.el diff --git a/ansible/playbook.yaml b/ansible/playbook.yaml index dbdc7de..e4f783e 100644 --- a/ansible/playbook.yaml +++ b/ansible/playbook.yaml @@ -20,7 +20,7 @@ - role: system_tools - role: terminal tags: [not_for_wsl] - - role: editor + - role: emacs - role: dev_tools - role: fonts - role: gui_tools diff --git a/ansible/roles/editor/tasks/commands/emacs.yaml b/ansible/roles/emacs/tasks/commands/emacs.yaml similarity index 100% rename from ansible/roles/editor/tasks/commands/emacs.yaml rename to ansible/roles/emacs/tasks/commands/emacs.yaml diff --git a/ansible/roles/editor/tasks/main.yaml b/ansible/roles/emacs/tasks/main.yaml similarity index 100% rename from ansible/roles/editor/tasks/main.yaml rename to ansible/roles/emacs/tasks/main.yaml diff --git a/docs/cpp/Dockerfile b/docs/cpp/Dockerfile index 9e86e7b..94fea1c 100644 --- a/docs/cpp/Dockerfile +++ b/docs/cpp/Dockerfile @@ -1,15 +1,13 @@ -FROM ubuntu:22.04 +# syntax=docker/dockerfile:1 +FROM ubuntu:24.04 -# 18だとlspで関数の引数リストのsnippetが上手く出ないかも -ARG CLANG_VERSION=19 +ENV CC=clang +ENV CXX=clang++ -RUN apt-get update && apt-get install -y git curl wget lsb-release software-properties-common - -WORKDIR /tmp - -ADD --chown=root:root --chmod=777 https://apt.llvm.org/llvm.sh llvm.sh +ARG CLANG_VERSION=18 +ARG LIB_STDCPP_VERSION=13 -RUN ./llvm.sh ${CLANG_VERSION} +RUN apt-get update && apt-get install -y git curl wget lsb-release software-properties-common RUN apt-get update && apt-get install -y \ clang-${CLANG_VERSION} \ @@ -18,12 +16,10 @@ RUN apt-get update && apt-get install -y \ clangd-${CLANG_VERSION} \ clang-format-${CLANG_VERSION} \ libomp-${CLANG_VERSION}-dev \ - libstdc++-12-dev - -RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 18 -RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 18 -RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 18 -RUN update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-18 18 -RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 18 + libstdc++-${LIB_STDCPP_VERSION}-dev -WORKDIR /workspaces/ +RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} ${CLANG_VERSION} +RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} ${CLANG_VERSION} +RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} ${CLANG_VERSION} +RUN update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-${CLANG_VERSION} ${CLANG_VERSION} +RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${CLANG_VERSION} ${CLANG_VERSION}