Changes to dockerfile + more intricate .emacs file
All checks were successful
Build the docker image / build (push) Successful in 7m24s
All checks were successful
Build the docker image / build (push) Successful in 7m24s
This commit is contained in:
@ -12,4 +12,5 @@ jobs:
|
||||
run: |
|
||||
cd ${{ gitea.workspace }}
|
||||
docker build . -t emacs-c
|
||||
|
||||
#- name: Upload image to gitea package repository.
|
||||
|
||||
|
17
Dockerfile
17
Dockerfile
@ -1,10 +1,21 @@
|
||||
FROM debian
|
||||
|
||||
# install emacs + clang + clangd as LSP.
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt update && \
|
||||
apt install -y emacs clang clangd && \
|
||||
apt clean all
|
||||
apt install -y emacs build-essential git make cmake clang clang-format clangd && \
|
||||
apt clean all && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# copy emacs config
|
||||
COPY emacs-init /root/.emacs
|
||||
|
||||
# install emacs packages by running once beforehand,
|
||||
# so we don't have to that every start-up
|
||||
RUN emacs --batch -l /root/.emacs \
|
||||
--eval "(package-refresh-contents)" \
|
||||
--eval "(package-install-selected-packages)"
|
||||
|
||||
|
||||
ENTRYPOINT ["/bin/emacs" "-nw"]
|
||||
ENTRYPOINT ["/bin/emacs", "-nw"]
|
||||
|
52
emacs-init
52
emacs-init
@ -1,8 +1,48 @@
|
||||
;; Require Emacs' package functionality
|
||||
;; Package management
|
||||
(require 'package)
|
||||
|
||||
;; Add the Melpa repository to the list of package sources
|
||||
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
|
||||
|
||||
;; Initialise the package system.
|
||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
||||
(package-initialize)
|
||||
|
||||
;; Install use-package if missing
|
||||
(unless (package-installed-p 'use-package)
|
||||
(package-refresh-contents)
|
||||
(package-install 'use-package))
|
||||
|
||||
;; Core setup
|
||||
(setq inhibit-startup-screen t)
|
||||
(electric-pair-mode 1)
|
||||
(show-paren-mode 1)
|
||||
|
||||
;; Packages
|
||||
(use-package eglot
|
||||
:ensure t
|
||||
:hook ((c-mode c++-mode) . eglot-ensure))
|
||||
|
||||
(use-package company
|
||||
:ensure t
|
||||
:config
|
||||
(global-company-mode)
|
||||
(setq company-idle-delay 0.1))
|
||||
|
||||
(use-package flycheck
|
||||
:ensure t
|
||||
:init (global-flycheck-mode))
|
||||
|
||||
(use-package clang-format
|
||||
:ensure t
|
||||
:bind ("C-c f" . clang-format-buffer))
|
||||
|
||||
(use-package projectile
|
||||
:ensure t
|
||||
:init (projectile-mode))
|
||||
|
||||
(use-package which-key
|
||||
:ensure t
|
||||
:init (which-key-mode))
|
||||
|
||||
;; C-specific settings
|
||||
(add-hook 'c-mode-hook
|
||||
(lambda ()
|
||||
(setq c-basic-offset 4)
|
||||
(setq tab-width 4)
|
||||
(setq indent-tabs-mode nil)))
|
||||
|
Reference in New Issue
Block a user