Compare commits
1 Commits
master
...
elpaca-mig
Author | SHA1 | Date | |
---|---|---|---|
0899a9a264 |
8
.travis.yml
Normal file
8
.travis.yml
Normal file
@ -0,0 +1,8 @@
|
||||
language: generic
|
||||
|
||||
script: bash ./gen-gh-pages/deploy.sh
|
||||
env:
|
||||
global:
|
||||
- ENCRYPTION_LABEL: "73e6c870aa87"
|
||||
- COMMIT_AUTHOR_EMAIL: "IvanMalison@gmail.com"
|
||||
- COMMIT_AUTHOR_NAME: "Ivan Malison"
|
@ -361,6 +361,8 @@ but provide support for writing custom elisp.
|
||||
*** shut-up
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package shut-up
|
||||
:demand t
|
||||
:ensure (:inherit t :wait t)
|
||||
:config
|
||||
(defun imalison:shut-up-around (function &rest args)
|
||||
(shut-up (apply function args))))
|
||||
@ -856,6 +858,7 @@ details.
|
||||
(directory-files filepath))))
|
||||
|
||||
(use-package eshell
|
||||
:ensure nil
|
||||
:commands (eshell-parse-colon-path imalison:get-executables-on-path)
|
||||
:config
|
||||
(defun imalison:get-executables-on-path ()
|
||||
@ -1233,6 +1236,7 @@ This makes ~forward-word~ and ~backward-word~ understand snake and camel case.
|
||||
proced is an top like utility that runs inside of emacs. The following sets auto updating automatically and makes the update interval faster.
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package proced
|
||||
:ensure nil
|
||||
:defer t
|
||||
:config
|
||||
(progn
|
||||
@ -1376,6 +1380,7 @@ Paradox is a package.el extension. I have no use for it now that I use straight.
|
||||
** server
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package server
|
||||
:ensure nil
|
||||
:demand t
|
||||
:config
|
||||
(progn
|
||||
@ -1444,19 +1449,6 @@ The file server file for this emacs instance no longer exists.")
|
||||
(use-package refine
|
||||
:disabled t)
|
||||
#+END_SRC
|
||||
** winner
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package winner
|
||||
:commands (winner-undo winner-redo)
|
||||
:bind ("C-c q" . imalison:winner-hydra/body)
|
||||
:config
|
||||
(progn
|
||||
(defhydra imalison:winner-hydra ()
|
||||
"Winner"
|
||||
("p" winner-undo "back")
|
||||
("n" winner-redo "forward" :exit t))
|
||||
(winner-mode 1)))
|
||||
#+END_SRC
|
||||
** eyebrowse
|
||||
I don't have any use for this now that I use frames mode, but its an interesting idea.
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
@ -1521,11 +1513,10 @@ custom-set-faces in your custom file.
|
||||
(use-package highlight-indent-guides
|
||||
:commands highlight-indent-guides-mode
|
||||
:diminish highlight-indent-guides-mode
|
||||
:preface
|
||||
(progn
|
||||
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode))
|
||||
:demand t
|
||||
:config
|
||||
(progn
|
||||
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
|
||||
(setq highlight-indent-guides-method 'fill)))
|
||||
#+END_SRC
|
||||
** man-mode
|
||||
@ -1534,6 +1525,7 @@ fixes that, but for now, it needs to be run manually, since I haven't figured
|
||||
out how to detect that a buffer is a man mode buffer.
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package man
|
||||
:ensure nil
|
||||
:config
|
||||
(progn
|
||||
(defun imalison:fontify-man-page-buffer ()
|
||||
@ -1759,6 +1751,7 @@ bind-key and global-set-key forms.
|
||||
#+END_SRC
|
||||
** projectile
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
|
||||
(use-package projectile
|
||||
:demand t
|
||||
:bind (:map projectile-mode-map
|
||||
@ -1772,7 +1765,7 @@ bind-key and global-set-key forms.
|
||||
(projectile-git-submodule-command nil)
|
||||
(project-vc-merge-submodules nil)
|
||||
(projectile-current-project-on-switch 'keep))
|
||||
:preface
|
||||
:config
|
||||
(progn
|
||||
(defmacro imalison:projectile-do-in-project (project-dir &rest forms)
|
||||
`(imalison:with-default-directory ,project-dir
|
||||
@ -1804,9 +1797,7 @@ bind-key and global-set-key forms.
|
||||
(write-region "" nil
|
||||
(expand-file-name
|
||||
(concat directory "/"
|
||||
(nth 0 file-info) "/.projectile")))))))
|
||||
:config
|
||||
(progn
|
||||
(nth 0 file-info) "/.projectile"))))))
|
||||
(projectile-global-mode)
|
||||
(diminish 'projectile-mode)))
|
||||
#+END_SRC
|
||||
@ -1855,7 +1846,8 @@ bind-key and global-set-key forms.
|
||||
** avy
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package avy
|
||||
:preface
|
||||
:after emit
|
||||
:config
|
||||
(progn
|
||||
(emit-prefix-selector imalison:avy
|
||||
avy-goto-word-1
|
||||
@ -1867,11 +1859,13 @@ bind-key and global-set-key forms.
|
||||
** ace-window
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package ace-window
|
||||
:preface
|
||||
:after emit
|
||||
:config
|
||||
(progn
|
||||
(emit-prefix-selector imalison:ace-window
|
||||
ace-select-window
|
||||
ace-swap-window)
|
||||
:config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
|
||||
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)))
|
||||
:bind ("C-c w" . imalison:ace-window))
|
||||
#+END_SRC
|
||||
** neotree
|
||||
@ -1897,7 +1891,7 @@ Neotree is useless with frame mode for now, so I've disabled it.
|
||||
* Completion
|
||||
** vertico
|
||||
#+begin_src emacs-lisp
|
||||
(use-package vertico
|
||||
(use-package vertico
|
||||
:demand t
|
||||
:config
|
||||
(progn
|
||||
@ -2026,10 +2020,12 @@ Neotree is useless with frame mode for now, so I've disabled it.
|
||||
** company
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package company
|
||||
:after emit
|
||||
:commands company-mode imalison:company
|
||||
:bind (("C-\\" . imalison:company))
|
||||
:config
|
||||
(progn
|
||||
(add-hook 'prog-mode-hook (lambda () (company-mode t)))
|
||||
(emit-prefix-selector imalison:company
|
||||
company-complete
|
||||
company-yasnippet)
|
||||
@ -2039,9 +2035,7 @@ Neotree is useless with frame mode for now, so I've disabled it.
|
||||
:demand t
|
||||
:config (company-prescient-mode +1))
|
||||
(global-company-mode)
|
||||
(diminish 'company-mode))
|
||||
:init
|
||||
(add-hook 'prog-mode-hook (lambda () (company-mode t))))
|
||||
(diminish 'company-mode)))
|
||||
#+END_SRC
|
||||
*** company-flx
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
@ -2214,6 +2208,7 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
|
||||
** align
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package align
|
||||
:ensure nil
|
||||
:bind ("C-c C-a" . imalison:align-regexp-hydra/body)
|
||||
:config
|
||||
(progn
|
||||
@ -2242,9 +2237,10 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package flycheck
|
||||
:commands flycheck-mode
|
||||
:init (add-hook 'prog-mode-hook 'flycheck-mode)
|
||||
:defer 1
|
||||
:config
|
||||
(progn
|
||||
(add-hook 'prog-mode-hook 'flycheck-mode)
|
||||
(use-package flycheck-package
|
||||
:disabled t
|
||||
:config (flycheck-package-setup))
|
||||
@ -2261,12 +2257,6 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
|
||||
(global-flycheck-mode))
|
||||
:diminish flycheck-mode)
|
||||
#+END_SRC
|
||||
* straight
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package straight
|
||||
:config
|
||||
(setq straight-vc-git-auto-fast-forward t))
|
||||
#+END_SRC
|
||||
* auth-source
|
||||
#+begin_src emacs-lisp
|
||||
(use-package auth-source
|
||||
@ -2318,96 +2308,96 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
|
||||
#+END_SRC
|
||||
*** go
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package go-mode
|
||||
:mode (("\\.go\\'" . go-mode))
|
||||
:preface
|
||||
(progn
|
||||
(defun imalison:glide-novendor ()
|
||||
(projectile-with-default-dir (projectile-project-root)
|
||||
(shell-command-to-string "glide novendor")))
|
||||
;; (use-package go-mode
|
||||
;; :mode (("\\.go\\'" . go-mode))
|
||||
;; :after emit
|
||||
;; :config
|
||||
;; (progn
|
||||
;; (defun imalison:glide-novendor ()
|
||||
;; (projectile-with-default-dir (projectile-project-root)
|
||||
;; (shell-command-to-string "glide novendor")))
|
||||
|
||||
(defun imalison:go-mode-create-imenu-index ()
|
||||
"Create and return an imenu index alist. Unlike the default
|
||||
alist created by go-mode, this method creates an alist where
|
||||
items follow a style that is consistent with other prog-modes."
|
||||
(let* ((patterns '(("type" "^type *\\([^ \t\n\r\f]*\\)" 1)))
|
||||
(type-index (imenu--generic-function patterns))
|
||||
(func-index))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward go-func-meth-regexp (point-max) t)
|
||||
(let* ((var (match-string-no-properties 1))
|
||||
(func (match-string-no-properties 2))
|
||||
(name (if var
|
||||
(concat (substring var 0 -1) "." func)
|
||||
func))
|
||||
(beg (match-beginning 0))
|
||||
(marker (copy-marker beg))
|
||||
(item (cons name marker)))
|
||||
(setq func-index (cons item func-index)))))
|
||||
(nconc type-index (list (cons "func" func-index)))))
|
||||
;; (defun imalison:go-mode-create-imenu-index ()
|
||||
;; "Create and return an imenu index alist. Unlike the default
|
||||
;; alist created by go-mode, this method creates an alist where
|
||||
;; items follow a style that is consistent with other prog-modes."
|
||||
;; (let* ((patterns '(("type" "^type *\\([^ \t\n\r\f]*\\)" 1)))
|
||||
;; (type-index (imenu--generic-function patterns))
|
||||
;; (func-index))
|
||||
;; (save-excursion
|
||||
;; (goto-char (point-min))
|
||||
;; (while (re-search-forward go-func-meth-regexp (point-max) t)
|
||||
;; (let* ((var (match-string-no-properties 1))
|
||||
;; (func (match-string-no-properties 2))
|
||||
;; (name (if var
|
||||
;; (concat (substring var 0 -1) "." func)
|
||||
;; func))
|
||||
;; (beg (match-beginning 0))
|
||||
;; (marker (copy-marker beg))
|
||||
;; (item (cons name marker)))
|
||||
;; (setq func-index (cons item func-index)))))
|
||||
;; (nconc type-index (list (cons "func" func-index)))))
|
||||
|
||||
(defun imalison:go-workspace-path ()
|
||||
(file-relative-name (projectile-project-root)
|
||||
(concat (file-name-as-directory
|
||||
(imalison:get-go-path)) "src")))
|
||||
;; (defun imalison:go-workspace-path ()
|
||||
;; (file-relative-name (projectile-project-root)
|
||||
;; (concat (file-name-as-directory
|
||||
;; (imalison:get-go-path)) "src")))
|
||||
|
||||
(defun imalison:install-current-go-project ()
|
||||
(interactive)
|
||||
(start-process
|
||||
"go install" "go install log" "go" "install"
|
||||
(concat (file-name-as-directory (imalison:go-workspace-path)) "...")))
|
||||
;; (defun imalison:install-current-go-project ()
|
||||
;; (interactive)
|
||||
;; (start-process
|
||||
;; "go install" "go install log" "go" "install"
|
||||
;; (concat (file-name-as-directory (imalison:go-workspace-path)) "...")))
|
||||
|
||||
(defun imalison:get-go-path ()
|
||||
(let ((environment-go-path (getenv "GOPATH")))
|
||||
(if environment-go-path
|
||||
(file-name-as-directory (car (s-split ":" environment-go-path)))
|
||||
"~/go")))
|
||||
;; (defun imalison:get-go-path ()
|
||||
;; (let ((environment-go-path (getenv "GOPATH")))
|
||||
;; (if environment-go-path
|
||||
;; (file-name-as-directory (car (s-split ":" environment-go-path)))
|
||||
;; "~/go")))
|
||||
|
||||
(defmacro imalison:get-go-src (&rest paths)
|
||||
`(imalison:join-paths (imalison:get-go-path) "src" ,@paths))
|
||||
;; (defmacro imalison:get-go-src (&rest paths)
|
||||
;; `(imalison:join-paths (imalison:get-go-path) "src" ,@paths))
|
||||
|
||||
(imalison:let-advise-around imalison:advise-normal-go-command
|
||||
(go-command "go"))
|
||||
;; (imalison:let-advise-around imalison:advise-normal-go-command
|
||||
;; (go-command "go"))
|
||||
|
||||
(defun imalison:go-mode-hook ()
|
||||
(go-eldoc-setup)
|
||||
(set (make-local-variable 'company-backends) '(company-go))
|
||||
(make-local-variable 'projectile-globally-ignored-files)
|
||||
(add-hook 'after-save-hook 'imalison:install-current-go-project nil
|
||||
'yes-do-local)
|
||||
(add-to-list 'projectile-globally-ignored-files
|
||||
"vendor")))
|
||||
:config
|
||||
(progn
|
||||
(use-package gotest
|
||||
:demand t
|
||||
:bind (:map go-mode-map
|
||||
("C-c t" . imalison:gotest))
|
||||
:preface
|
||||
(progn
|
||||
(emit-prefix-selector imalison:gotest
|
||||
go-test-current-test
|
||||
go-test-current-file)
|
||||
;; (defun imalison:go-mode-hook ()
|
||||
;; (go-eldoc-setup)
|
||||
;; (set (make-local-variable 'company-backends) '(company-go))
|
||||
;; (make-local-variable 'projectile-globally-ignored-files)
|
||||
;; (add-hook 'after-save-hook 'imalison:install-current-go-project nil
|
||||
;; 'yes-do-local)
|
||||
;; (add-to-list 'projectile-globally-ignored-files
|
||||
;; "vendor"))
|
||||
;; (use-package gotest
|
||||
;; :demand t
|
||||
;; :after emit
|
||||
;; :bind (:map go-mode-map
|
||||
;; ("C-c t" . imalison:gotest))
|
||||
;; :preface
|
||||
;; (progn
|
||||
;; (emit-prefix-selector imalison:gotest
|
||||
;; go-test-current-test
|
||||
;; go-test-current-file)
|
||||
|
||||
(defun imalison:add-expected-test-name-for-suite (suite-name test-name)
|
||||
(if (> (length suite-name) 0)
|
||||
(concat " -run Test" suite-name)
|
||||
"")))
|
||||
:config
|
||||
(progn
|
||||
(setq go-test-verbose t
|
||||
go-test-additional-arguments-function
|
||||
'imalison:add-expected-test-name-for-suite)))
|
||||
(use-package company-go
|
||||
:config (setq company-go-show-annotation t))
|
||||
;; (defun imalison:add-expected-test-name-for-suite (suite-name test-name)
|
||||
;; (if (> (length suite-name) 0)
|
||||
;; (concat " -run Test" suite-name)
|
||||
;; "")))
|
||||
;; :config
|
||||
;; (progn
|
||||
;; (setq go-test-verbose t
|
||||
;; go-test-additional-arguments-function
|
||||
;; 'imalison:add-expected-test-name-for-suite)))
|
||||
;; (use-package company-go
|
||||
;; :config (setq company-go-show-annotation t))
|
||||
|
||||
(advice-add 'go-import-add :around 'imalison:advise-normal-go-command)
|
||||
;; (advice-add 'go-import-add :around 'imalison:advise-normal-go-command)
|
||||
|
||||
(setq gofmt-command "goimports")
|
||||
;; (setq gofmt-command "goimports")
|
||||
|
||||
(add-hook 'go-mode-hook 'imalison:go-mode-hook)
|
||||
(add-hook 'before-save-hook 'gofmt-before-save t)))
|
||||
;; (add-hook 'go-mode-hook 'imalison:go-mode-hook)
|
||||
;; (add-hook 'before-save-hook 'gofmt-before-save t)))
|
||||
#+END_SRC
|
||||
**** Show diffs of testify output
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
@ -2449,13 +2439,25 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
|
||||
**** elisp-slime-nav
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package elisp-slime-nav
|
||||
:after emit
|
||||
:commands elisp-slime-nav-mode
|
||||
:config
|
||||
(progn
|
||||
(defvar imalison:check-parens nil)
|
||||
|
||||
(defun imalison:maybe-check-parens ()
|
||||
(if imalison:check-parens
|
||||
(check-parens)))
|
||||
|
||||
(defun imalison:emacs-lisp-hook ()
|
||||
(elisp-slime-nav-mode t)
|
||||
(add-hook 'write-file-functions 'imalison:maybe-check-parens nil t))
|
||||
|
||||
(add-hook 'emacs-lisp-mode-hook 'imalison:emacs-lisp-hook)
|
||||
(diminish 'elisp-slime-nav-mode)
|
||||
:preface
|
||||
(emit-prefix-selector imalison:elisp-slime-nav
|
||||
elisp-slime-nav-find-elisp-thing-at-point
|
||||
elisp-slime-nav-describe-elisp-thing-at-point)
|
||||
elisp-slime-nav-describe-elisp-thing-at-point))
|
||||
:bind (:map elisp-slime-nav-mode-map
|
||||
("M-." . imalison:elisp-slime-nav)))
|
||||
#+END_SRC
|
||||
@ -2465,6 +2467,7 @@ it's supposed to do, but instead uses its own collection of functions to control
|
||||
where the definition is popped up. This fixes that.
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package find-func
|
||||
:ensure nil
|
||||
:preface
|
||||
(progn
|
||||
(defun imalison:find-function-display-buffer (function)
|
||||
@ -2484,14 +2487,6 @@ Macrostep is an indespensible tool for writing emacs lisp macros. It lets you se
|
||||
:bind (:map lisp-mode-shared-map
|
||||
("C-c e" . macrostep-expand)))
|
||||
#+END_SRC
|
||||
**** emr
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package emr
|
||||
:bind ("M-RET" . emr-show-refactor-menu)
|
||||
:config
|
||||
(progn
|
||||
(add-hook 'prog-mode-hook 'emr-initialize)))
|
||||
#+END_SRC
|
||||
**** Editing configuration
|
||||
Reduce indentation for some functions
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
@ -2505,6 +2500,7 @@ Reduce indentation for some functions
|
||||
**** edebug
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package edebug
|
||||
:ensure nil
|
||||
:defer t
|
||||
:config
|
||||
(progn (setq edebug-trace t)))
|
||||
@ -2543,6 +2539,7 @@ Reduce indentation for some functions
|
||||
:commands (eros-mode)
|
||||
:config
|
||||
(progn
|
||||
(add-hook 'emacs-lisp-mode-hook 'eros-mode)
|
||||
(advice-add 'eval-defun :around 'eros-around-eval-defun)
|
||||
(advice-add 'eval-last-sexp :around 'eros-around-eval-last-sexp))
|
||||
:preface
|
||||
@ -2563,9 +2560,7 @@ Reduce indentation for some functions
|
||||
(save-excursion
|
||||
(end-of-defun)
|
||||
(point))))
|
||||
result))
|
||||
|
||||
(add-hook 'emacs-lisp-mode-hook 'eros-mode)))
|
||||
result))))
|
||||
#+END_SRC
|
||||
**** Reevalute defvars when running eval-last-sexp
|
||||
We noflet elisp--preceding-sexp to munge defvars into sexps only for
|
||||
@ -2583,27 +2578,10 @@ eval-last-sexp.
|
||||
#+END_SRC
|
||||
**** Init hook
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defvar imalison:check-parens nil)
|
||||
|
||||
(defun imalison:maybe-check-parens ()
|
||||
(if imalison:check-parens
|
||||
(check-parens)))
|
||||
|
||||
(defun imalison:emacs-lisp-hook ()
|
||||
(elisp-slime-nav-mode t)
|
||||
(add-hook 'write-file-functions 'imalison:maybe-check-parens nil t))
|
||||
|
||||
(add-hook 'emacs-lisp-mode-hook 'imalison:emacs-lisp-hook)
|
||||
#+END_SRC
|
||||
**** Keybinds
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(emit-compose
|
||||
imalison:copy-eval-last-sexp kill-new prin1-to-string eval-last-sexp)
|
||||
|
||||
(emit-prefix-selector imalison:eval-last-sexp
|
||||
eval-region-or-last-sexp
|
||||
imalison:copy-eval-last-sexp)
|
||||
|
||||
(define-key lisp-mode-shared-map (kbd "C-c C-c") 'eval-defun)
|
||||
(define-key lisp-mode-shared-map (kbd "C-x C-e") 'imalison:eval-last-sexp)
|
||||
(unbind-key "C-j" lisp-interaction-mode-map)
|
||||
@ -2704,11 +2682,6 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877
|
||||
cider-preferred-build-tool "boot")
|
||||
(add-hook 'clojure-mode-hook 'cider-mode)))
|
||||
#+END_SRC
|
||||
**** clj-refactor
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package clj-refactor
|
||||
:commands clj-refactor-mode)
|
||||
#+END_SRC
|
||||
*** scala
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package scala-mode
|
||||
@ -2892,10 +2865,6 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877
|
||||
:defer t
|
||||
:mode ("\\.kt\\'"))
|
||||
#+END_SRC
|
||||
*** swift
|
||||
#+begin_src emacs-lisp
|
||||
(use-package swift-mode)
|
||||
#+end_src
|
||||
*** groovy
|
||||
#+begin_src emacs-lisp
|
||||
(use-package groovy-mode)
|
||||
@ -2912,7 +2881,7 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877
|
||||
#+END_SRC
|
||||
*** C/C++
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package cc-mode)
|
||||
(use-package cc-mode :ensure nil)
|
||||
#+END_SRC
|
||||
*** C--
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
@ -3117,9 +3086,10 @@ My org-mode configuration now lives in its own file org-config.org.
|
||||
** magit
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package magit
|
||||
:after emit
|
||||
:commands magit-status
|
||||
:bind (("C-x g" . imalison:magit-status))
|
||||
:preface
|
||||
:config
|
||||
(progn
|
||||
(emit-let-around imalison:magit-status-traditional
|
||||
magit-status
|
||||
@ -3130,9 +3100,7 @@ My org-mode configuration now lives in its own file org-config.org.
|
||||
imalison:magit-status-traditional)
|
||||
(defun imalison:after-magit-visit-file (&rest args)
|
||||
(when (derived-mode-p 'org-mode)
|
||||
(org-show-context 'magit-goto))))
|
||||
:config
|
||||
(progn
|
||||
(org-show-context 'magit-goto)))
|
||||
(when frame-mode
|
||||
(setq magit-commit-show-diff t))
|
||||
(unbind-key "C-j" magit-status-mode-map)
|
||||
@ -3143,7 +3111,6 @@ My org-mode configuration now lives in its own file org-config.org.
|
||||
magit-display-buffer-function
|
||||
'magit-display-buffer-same-window-except-diff-v1)
|
||||
(magit-auto-revert-mode)
|
||||
|
||||
(add-to-list 'org-show-context-detail '(magit-goto . lineage))
|
||||
(advice-add 'magit-diff-visit-file :after 'imalison:after-magit-visit-file)
|
||||
(add-hook 'magit-popup-mode-hook 'imalison:disable-show-trailing-whitespace)))
|
||||
@ -3154,20 +3121,6 @@ My org-mode configuration now lives in its own file org-config.org.
|
||||
:disabled t
|
||||
:after magit)
|
||||
#+end_src
|
||||
** vc
|
||||
#+begin_src emacs-lisp
|
||||
(use-package vc
|
||||
:config
|
||||
(progn
|
||||
(defun vc-find-revision-of-file (revision)
|
||||
(interactive
|
||||
(list (vc-read-revision
|
||||
"Revision to visit: "
|
||||
(list (imalison:join-paths (magit-toplevel) (car (magit-list-files)))))))
|
||||
(let* ((file (completing-read "Select file to visit: " (magit-revision-files revision)))
|
||||
(full-file (imalison:join-paths (magit-toplevel) file)))
|
||||
(switch-to-buffer (vc-find-revision full-file revision))))))
|
||||
#+end_src
|
||||
** git-link
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package git-link
|
||||
@ -3292,14 +3245,6 @@ modeline and with excessive http requests to github.
|
||||
gist-unstar gist-list-starred gist-fork))
|
||||
#+END_SRC
|
||||
* Programming
|
||||
** emr
|
||||
emr (emacs refactor) provides support for refactoring in many programming languages
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package emr
|
||||
:bind (:map prog-mode-map
|
||||
("M-RET" . emr-show-refactor-menu))
|
||||
:config (emr-initialize))
|
||||
#+END_SRC
|
||||
** semantic
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package semantic
|
||||
@ -3365,6 +3310,7 @@ in term-mode. This makes term-mode 1000% more useful
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package term
|
||||
:demand t
|
||||
:ensure nil
|
||||
:preface
|
||||
(progn
|
||||
(defun imalison:avy-term (arg)
|
||||
@ -3429,6 +3375,7 @@ in term-mode. This makes term-mode 1000% more useful
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package term-projectile
|
||||
:bind ("C-c 7" . imalison:term-hydra-global/body)
|
||||
:after emit
|
||||
:commands
|
||||
(term-projectile-backward
|
||||
term-projectile-create-new
|
||||
@ -3600,6 +3547,7 @@ I don't use iedit directly, but it is used by [[*emr][emr]] and I need to disabl
|
||||
** narrow-indirect
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package narrow-indirect
|
||||
:ensure nil
|
||||
:init
|
||||
(progn
|
||||
(define-key ctl-x-4-map "nd" 'ni-narrow-to-defun-indirect-other-window)
|
||||
@ -3635,9 +3583,9 @@ I had to disable this mode because something that it does messes with coding set
|
||||
(interactive)
|
||||
(setq dtrt-indent-original-indent nil)
|
||||
(dtrt-indent-adapt)))
|
||||
:init (add-hook 'prog-mode-hook 'dtrt-indent-mode)
|
||||
:config
|
||||
(progn
|
||||
(add-hook 'prog-mode-hook 'dtrt-indent-mode)
|
||||
(setq dtrt-indent-active-mode-line-info " [⟼]")))
|
||||
#+END_SRC
|
||||
** indent-guide
|
||||
@ -3678,7 +3626,9 @@ Disabled because it makes it hard to redo things
|
||||
** recentf
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package recentf
|
||||
:ensure nil
|
||||
:demand t
|
||||
:after shut-up
|
||||
:config
|
||||
(progn
|
||||
(setq recentf-max-saved-items 1000
|
||||
@ -3774,6 +3724,7 @@ Not really sure what this is
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package epg
|
||||
:after shut-up
|
||||
:ensure nil
|
||||
:config
|
||||
(shut-up
|
||||
(epa-file-enable)))
|
||||
@ -3796,113 +3747,6 @@ Not really sure what this is
|
||||
:disabled t ;; fails to load eieio on startup
|
||||
)
|
||||
#+END_SRC
|
||||
** mu4e
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
;; (eval-when-compile
|
||||
;; (require 's)
|
||||
;; (defvar mu4e-elisp-directory
|
||||
;; (s-trim (shell-command-to-string "mu4e_directory"))))
|
||||
(use-package mu4e
|
||||
:disabled t
|
||||
:load-path mu4e-elisp-directory
|
||||
:straight nil
|
||||
:commands (mu4e mu4e-view-message-with-msgid mu4e-update-index email)
|
||||
:bind ("C-c 0" . email)
|
||||
:config
|
||||
(progn
|
||||
(defun email (&optional arg)
|
||||
(interactive "P")
|
||||
(if (string-equal (persp-name persp-curr) "email")
|
||||
(progn (delete-other-windows) (mu4e))
|
||||
(progn
|
||||
(persp-switch "email")
|
||||
(when (or (not (mu4e-running-p)) arg)
|
||||
(delete-other-windows) (mu4e)))))
|
||||
;; enable inline images
|
||||
(setq mu4e-view-show-images t)
|
||||
;; show images
|
||||
(setq mu4e-show-images t)
|
||||
;; Try to display html as text
|
||||
(setq mu4e-view-prefer-html nil)
|
||||
|
||||
(setq mu4e-html2text-command "html2text -width 80 -nobs -utf8")
|
||||
|
||||
;; use imagemagick, if available
|
||||
(when (fboundp 'imagemagick-register-types)
|
||||
(imagemagick-register-types))
|
||||
(setq mail-user-agent 'mu4e-user-agent)
|
||||
(require 'org-mu4e)
|
||||
(setq mu4e-compose-complete-only-after nil)
|
||||
(setq mu4e-maildir "~/Mail")
|
||||
|
||||
(setq mu4e-drafts-folder "/[Gmail].Drafts")
|
||||
(setq mu4e-sent-folder "/[Gmail].Sent Mail")
|
||||
(setq mu4e-trash-folder "/[Gmail].Trash")
|
||||
|
||||
(setq mu4e-sent-messages-behavior 'delete)
|
||||
(setq mu4e-headers-skip-duplicates t)
|
||||
(setq mu4e-update-interval (* 60 20))
|
||||
(setq message-kill-buffer-on-exit t)
|
||||
(setq mail-user-agent 'mu4e-user-agent) ;; make mu4e the default mail client
|
||||
|
||||
;; don't save message to Sent Messages, Gmail/IMAP takes care of this
|
||||
(setq mu4e-sent-messages-behavior 'delete)
|
||||
|
||||
;; allow for updating mail using 'U' in the main view:
|
||||
(setq mu4e-get-mail-command "timeout 60 offlineimap")
|
||||
|
||||
(add-hook 'mu4e-compose-mode-hook
|
||||
(defun my-do-compose-stuff () (flyspell-mode)))
|
||||
|
||||
(add-to-list 'mu4e-headers-actions '("view in browser" . mu4e-action-view-in-browser))
|
||||
(add-to-list 'mu4e-view-actions '("view in browser" . mu4e-action-view-in-browser))
|
||||
|
||||
(defun mu4e-view (msg headersbuf)
|
||||
"Display the message MSG in a new buffer, and keep in sync with HDRSBUF.
|
||||
'In sync' here means that moving to the next/previous message in
|
||||
the the message view affects HDRSBUF, as does marking etc.
|
||||
|
||||
As a side-effect, a message that is being viewed loses its 'unread'
|
||||
marking if it still had that."
|
||||
(let* ((embedded ;; is it as an embedded msg (ie. message/rfc822 att)?
|
||||
(when (gethash (mu4e-message-field msg :path)
|
||||
mu4e~path-parent-docid-map) t))
|
||||
(buf
|
||||
(if embedded
|
||||
(mu4e~view-embedded-winbuf)
|
||||
(get-buffer-create mu4e~view-buffer-name))))
|
||||
;; note: mu4e~view-mark-as-read will pseudo-recursively call mu4e-view again
|
||||
;; by triggering mu4e~view again as it marks the message as read
|
||||
(with-current-buffer buf
|
||||
(switch-to-buffer buf)
|
||||
(setq mu4e~view-msg msg)
|
||||
;;(or embedded (not (mu4e~view-mark-as-read msg)))
|
||||
(when (or (mu4e~view-mark-as-read msg) t)
|
||||
(let ((inhibit-read-only t))
|
||||
(erase-buffer)
|
||||
(mu4e~delete-all-overlays)
|
||||
(insert (mu4e-view-message-text msg))
|
||||
(goto-char (point-min))
|
||||
(mu4e~fontify-cited)
|
||||
(mu4e~fontify-signature)
|
||||
(mu4e~view-make-urls-clickable)
|
||||
(mu4e~view-show-images-maybe msg)
|
||||
(setq
|
||||
mu4e~view-buffer buf
|
||||
mu4e~view-headers-buffer headersbuf)
|
||||
(when embedded (local-set-key "q" 'kill-buffer-and-window))
|
||||
(mu4e-view-mode))))))
|
||||
|
||||
(require 'smtpmail)
|
||||
|
||||
;; alternatively, for emacs-24 you can use:
|
||||
(setq message-send-mail-function 'smtpmail-send-it
|
||||
smtpmail-stream-type 'starttls
|
||||
smtpmail-default-smtp-server "smtp.gmail.com"
|
||||
smtpmail-smtp-server "smtp.gmail.com"
|
||||
smtpmail-smtp-service 587)))
|
||||
|
||||
#+END_SRC
|
||||
** gmail-message-mode
|
||||
This is useful with server mode when editing gmail messages. I think that it is not currently working, or it may need to be manually enabled.
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
@ -3937,56 +3781,6 @@ This is useful with server mode when editing gmail messages. I think that it is
|
||||
:notifier 'imalison:windows-toast-notify)
|
||||
(setq alert-default-style 'windows-toast))))
|
||||
#+END_SRC
|
||||
** sauron
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package sauron
|
||||
:disabled t
|
||||
:defer 5
|
||||
:commands (sauron-start sauron-start-hidden)
|
||||
:init
|
||||
(progn
|
||||
(when (eq system-type 'darwin)
|
||||
(setq sauron-modules '(sauron-erc sauron-org sauron-notifications
|
||||
sauron-twittering sauron-jabber sauron-identica))
|
||||
(defun sauron-dbus-start ()
|
||||
nil)
|
||||
(makunbound 'dbus-path-emacs)))
|
||||
:config
|
||||
(progn
|
||||
(sauron-start-hidden)
|
||||
;; This should really check (featurep 'dbus) but for some reason
|
||||
;; this is always true even if support is not there.
|
||||
(setq sauron-prio-sauron-started 2)
|
||||
(setq sauron-min-priority 3)
|
||||
;; (setq sauron-dbus-cookie t) ;; linux only?
|
||||
(setq sauron-separate-frame nil)
|
||||
(setq sauron-nick-insensitivity 1)
|
||||
(defun sauron:jabber-notify (origin priority message &optional properties)
|
||||
(funcall notify-function "gtalk" message))
|
||||
(defun sauron:erc-notify (origin priority message &optional properties)
|
||||
(let ((event (plist-get properties :event)))
|
||||
(funcall notify-function "IRC" message)))
|
||||
(defun sauron:mu4e-notify (origin priority message &optional properties)
|
||||
nil)
|
||||
(defun sauron:dbus-notify (origin priority message &optional properties)
|
||||
(funcall notify-function "GMail" message))
|
||||
(defun sauron:dispatch-notify (origin priority message &optional properties)
|
||||
(let ((handler (cond ((string= origin "erc") 'sauron:erc-notify)
|
||||
((string= origin "jabber") 'sauron:jabber-notify)
|
||||
((string= origin "mu4e") 'sauron:mu4e-notify)
|
||||
((string= origin "dbus") 'sauron:dbus-notify)
|
||||
(t (lambda (&rest r) nil)))))
|
||||
(funcall handler origin priority message properties)))
|
||||
;; Prefering alert.el for now ;; (add-hook 'sauron-event-added-functions 'sauron:dispatch-notify)
|
||||
(sauron-start-hidden)
|
||||
(add-hook 'sauron-event-added-functions 'sauron-alert-el-adapter)))
|
||||
|
||||
#+END_SRC
|
||||
** screenshot
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package screenshot
|
||||
:commands screenshot)
|
||||
#+END_SRC
|
||||
** libmpdee
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package libmpdee
|
||||
@ -4117,20 +3911,16 @@ This also adds syntax highlighting for gradle
|
||||
** jsx-mode
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package jsx-mode
|
||||
:ensure nil
|
||||
:defer t)
|
||||
#+END_SRC
|
||||
** css
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package css-mode
|
||||
:ensure nil
|
||||
:mode (("\\.css\\'" . css-mode)
|
||||
("\\.rasi\\'" . css-mode)))
|
||||
#+END_SRC
|
||||
** sgml-mode
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package sgml-mode
|
||||
;; :bind ("C-c b" . web-beautify-html) TODO: mode specific, change binding
|
||||
:commands sgml-mode)
|
||||
#+END_SRC
|
||||
** evil
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package evil
|
||||
@ -4159,6 +3949,9 @@ Ensure all themes that I use are installed:
|
||||
(progn
|
||||
(setq solarized-high-contrast-mode-line t)))
|
||||
|
||||
(defun elpaca-function (pkg)
|
||||
(eval `(elpaca ,pkg)))
|
||||
|
||||
(defvar-setq packages-appearance
|
||||
'(monokai-theme zenburn-theme base16-theme molokai-theme moe-theme
|
||||
tango-2-theme gotham-theme sublime-themes rainbow-delimiters
|
||||
@ -4167,7 +3960,7 @@ Ensure all themes that I use are installed:
|
||||
forest-blue-theme flatland-theme afternoon-theme
|
||||
cyberpunk-theme dracula-theme))
|
||||
|
||||
(mapcar 'straight-use-package packages-appearance)
|
||||
(mapcar 'elpaca-function packages-appearance)
|
||||
|
||||
(use-package doom-themes
|
||||
:defer t)
|
||||
@ -4322,14 +4115,15 @@ load-theme hook (See the heading below).
|
||||
(unless imalison:appearance-setup-done
|
||||
(unless (member imalison:dark-theme custom-enabled-themes)
|
||||
(load-theme imalison:dark-theme t))
|
||||
(doom-modeline-mode +1)
|
||||
(apply 'imalison:appearance args)
|
||||
(message "running appearance")
|
||||
(doom-modeline-mode +1)
|
||||
(setq imalison:default-font-size-pt (face-attribute 'default :height))
|
||||
(setq imalison:appearance-setup-done t)))
|
||||
|
||||
(add-hook 'after-make-frame-functions 'imalison:appearance-setup-hook)
|
||||
(add-hook 'after-init-hook 'imalison:appearance-setup-hook)
|
||||
(add-hook 'elpaca-after-init-hook
|
||||
(lambda () (add-hook 'after-make-frame-functions 'imalison:appearance-setup-hook)))
|
||||
(add-hook 'elpaca-after-init-hook 'imalison:appearance-setup-hook)
|
||||
#+END_SRC
|
||||
* Post Init Custom
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
|
@ -1,41 +1,28 @@
|
||||
;; -*- no-byte-compile: t -*-
|
||||
|
||||
(let ((bootstrap-file (concat user-emacs-directory "straight/bootstrap.el"))
|
||||
(bootstrap-version 2))
|
||||
(unless (file-exists-p bootstrap-file)
|
||||
(with-current-buffer
|
||||
(url-retrieve-synchronously
|
||||
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
|
||||
'silent 'inhibit-cookies)
|
||||
(goto-char (point-max))
|
||||
(eval-print-last-sexp)))
|
||||
(load bootstrap-file nil 'nomessage))
|
||||
|
||||
(setq native-comp-deferred-compilation-deny-list '("magit"))
|
||||
(setq native-comp-always-compile t)
|
||||
(setq load-no-native t)
|
||||
(setq no-native-compile t)
|
||||
(setq warning-minimum-level :emergency)
|
||||
(setq straight-disable-native-compile t)
|
||||
|
||||
;; This is a workaround for an issue in emacs28 with symlinks. See https://github.com/radian-software/straight.el/issues/701
|
||||
(defun my-patch-package-find-file-visit-truename (oldfun &rest r)
|
||||
(let ((find-file-visit-truename nil))
|
||||
(apply oldfun r)))
|
||||
|
||||
(advice-add #'straight--build-autoloads :around
|
||||
#'my-patch-package-find-file-visit-truename)
|
||||
|
||||
(setq package-enable-at-startup nil
|
||||
straight-use-package-by-default t
|
||||
straight-vc-git-default-protocol 'ssh)
|
||||
(straight-use-package 'use-package)
|
||||
|
||||
(require 'use-package)
|
||||
(setq use-package-enable-imenu-support t)
|
||||
(setq use-package-ensure-function 'straight-use-package-ensure-function)
|
||||
(setq use-package-always-ensure t)
|
||||
|
||||
(defvar imalison:do-benchmark nil)
|
||||
|
||||
(defun emacs-directory-filepath (filename)
|
||||
(concat (file-name-directory load-file-name) filename))
|
||||
|
||||
(load (emacs-directory-filepath "elpaca.el"))
|
||||
|
||||
(setq use-package-always-ensure t)
|
||||
|
||||
(let ((bench-file (concat (file-name-directory user-init-file) "benchmark.el")))
|
||||
(when (file-exists-p bench-file) (load bench-file)))
|
||||
|
||||
@ -55,6 +42,9 @@
|
||||
(setq mac-option-modifier 'meta)
|
||||
(setq mac-command-modifier 'super))
|
||||
|
||||
(use-package transient
|
||||
:demand t)
|
||||
|
||||
;; See https://github.com/magit/magit/discussions/4997 . Without this magit is broken.
|
||||
(use-package magit
|
||||
:demand t)
|
||||
@ -62,29 +52,56 @@
|
||||
;; This seems to fix issues with helm not explicitly declaring its dependency on async
|
||||
(use-package async :demand t)
|
||||
|
||||
(use-package s :demand t)
|
||||
|
||||
;; Without this, org can behave very strangely
|
||||
(use-package org
|
||||
:straight
|
||||
:ensure
|
||||
(org :type git :host github :repo "colonelpanic8/org-mode" :local-repo "org"
|
||||
:branch "my-main"
|
||||
:depth full :pre-build (straight-recipes-org-elpa--build) :build
|
||||
:depth full
|
||||
:build
|
||||
:wait t
|
||||
(:not autoloads) :files
|
||||
(:defaults "lisp/*.el" ("etc/styles/" "etc/styles/*")))
|
||||
:defer t)
|
||||
(:defaults "lisp/*.el" ("etc/styles/" "etc/styles/*"))))
|
||||
|
||||
(use-package dash :demand t)
|
||||
|
||||
(use-package emit
|
||||
:ensure (emit :type git :host github :repo "colonelpanic8/emit")
|
||||
:demand t
|
||||
:config
|
||||
(progn
|
||||
(emit-prefix-selector imalison:mark-ring mark-ring)
|
||||
(emit-prefix-selector imalison:shell-command-on-region
|
||||
imalison:copy-shell-command-on-region
|
||||
imalison:shell-command-on-region-replace
|
||||
imalison:jq-replace)
|
||||
|
||||
(defun imalison:jq-replace (start end)
|
||||
(interactive (region-if-active-otherwise-buffer))
|
||||
(imalison:shell-command-on-region-replace start end "jq ."))
|
||||
(emit-compose
|
||||
imalison:copy-eval-last-sexp kill-new prin1-to-string eval-last-sexp)
|
||||
|
||||
(emit-prefix-selector imalison:eval-last-sexp
|
||||
eval-region-or-last-sexp
|
||||
imalison:copy-eval-last-sexp)))
|
||||
|
||||
(use-package s
|
||||
:ensure (:inherit t :wait t)
|
||||
:config
|
||||
(when (or (equal (s-trim (shell-command-to-string "whoami")) "kat")
|
||||
imalison:kat-mode)
|
||||
(let ((debug-on-error t))
|
||||
(org-babel-load-file
|
||||
(concat (file-name-directory load-file-name) "kat-mode.org")))))
|
||||
|
||||
(let ((debug-on-error t))
|
||||
(org-babel-load-file
|
||||
(concat (file-name-directory load-file-name) "README.org")))
|
||||
|
||||
(when (or (equal (s-trim (shell-command-to-string "whoami")) "kat")
|
||||
imalison:kat-mode)
|
||||
(let ((debug-on-error t))
|
||||
(org-babel-load-file
|
||||
(concat (file-name-directory load-file-name) "kat-mode.org"))))
|
||||
|
||||
(when imalison:do-benchmark (benchmark-init/deactivate))
|
||||
;; (when imalison:do-benchmark (benchmark-init/deactivate))
|
||||
|
||||
;; Local Variables:
|
||||
;; flycheck-disabled-checkers: (emacs-lisp-checkdoc)
|
||||
|
@ -803,7 +803,7 @@ alphanumeric characters only."
|
||||
** Use org-tempo to allow inserting templates using e.g. <s
|
||||
#+begin_src emacs-lisp
|
||||
(use-package org-tempo
|
||||
:straight nil
|
||||
:ensure nil
|
||||
:after org)
|
||||
#+end_src
|
||||
* Packages
|
||||
@ -938,9 +938,6 @@ alphanumeric characters only."
|
||||
#+end_src
|
||||
***** ui
|
||||
#+begin_src emacs-lisp
|
||||
(use-package emacs-http-server
|
||||
:demand t)
|
||||
|
||||
(use-package org-roam-ui
|
||||
:after org-roam
|
||||
:custom
|
||||
|
@ -1,376 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"agenix": {
|
||||
"inputs": {
|
||||
"darwin": "darwin",
|
||||
"home-manager": "home-manager_2",
|
||||
"nixpkgs": [
|
||||
"railbird-secrets",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1707830867,
|
||||
"narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=",
|
||||
"owner": "ryantm",
|
||||
"repo": "agenix",
|
||||
"rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ryantm",
|
||||
"repo": "agenix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"brew-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1718075954,
|
||||
"narHash": "sha256-4TeUhv5VLEufP+Z/NkKnUk4NUaf59cMsj6NvsVbE+8w=",
|
||||
"owner": "Homebrew",
|
||||
"repo": "brew",
|
||||
"rev": "3f08c75e7b950d4340dab462f3e7f77e8093fa2b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Homebrew",
|
||||
"ref": "4.3.5",
|
||||
"repo": "brew",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"railbird-secrets",
|
||||
"agenix",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1700795494,
|
||||
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lnl7",
|
||||
"ref": "master",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709126324,
|
||||
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1723399884,
|
||||
"narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "086f619dd991a4d355c07837448244029fc2d9ab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"railbird-secrets",
|
||||
"agenix",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1703113217,
|
||||
"narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"homebrew-cask": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1722820732,
|
||||
"narHash": "sha256-Y8TBYxYeUVvgYFylqBUtWxFuOZVstXW+yylI2wz2eQ0=",
|
||||
"owner": "homebrew",
|
||||
"repo": "homebrew-cask",
|
||||
"rev": "9e3db5dd3130f9bf388409f39ce1706ca7b59efe",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "homebrew",
|
||||
"repo": "homebrew-cask",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"homebrew-core": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1722823168,
|
||||
"narHash": "sha256-3sKYVUrhuS1fZJkrYAtB+O67dvaKyTvXXI9UqjAgI8A=",
|
||||
"owner": "homebrew",
|
||||
"repo": "homebrew-core",
|
||||
"rev": "dd20841f7fe7375738708bc2f458152906a71f1d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "homebrew",
|
||||
"repo": "homebrew-core",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722609272,
|
||||
"narHash": "sha256-Kkb+ULEHVmk07AX+OhwyofFxBDpw+2WvsXguUS2m6e4=",
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "f7142b8024d6b70c66fd646e1d099d3aa5bfec49",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-darwin_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1716329735,
|
||||
"narHash": "sha256-ap51w+VqG21vuzyQ04WrhI2YbWHd3UGz0e7dc/QQmoA=",
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "eac4f25028c1975a939c8f8fba95c12f8a25e01c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-homebrew": {
|
||||
"inputs": {
|
||||
"brew-src": "brew-src",
|
||||
"flake-utils": "flake-utils",
|
||||
"nix-darwin": "nix-darwin_2",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719720211,
|
||||
"narHash": "sha256-FNK5ZxmNC+V/wOuioc5HqkUy0ld4eW3NqcsZHLYg9HI=",
|
||||
"owner": "zhaofengli-wip",
|
||||
"repo": "nix-homebrew",
|
||||
"rev": "0afc51fd86693c73e4b60be8ed8c782c4c09b4cc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "zhaofengli-wip",
|
||||
"repo": "nix-homebrew",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1687274257,
|
||||
"narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=",
|
||||
"path": "/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source",
|
||||
"rev": "2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1716330097,
|
||||
"narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1722640603,
|
||||
"narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "81610abc161d4021b29199aa464d6a1a521e0cc9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1709703039,
|
||||
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"railbird-secrets": {
|
||||
"inputs": {
|
||||
"agenix": "agenix",
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722639965,
|
||||
"narHash": "sha256-ZRe5Z5s/UNaXI2piyncQ3YrFl5q3GryZAfFTyeJ/vhM=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "9a92b83c3ad376620db3556c33e51a4300c5badd",
|
||||
"revCount": 73,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@dev.railbird.ai:1123/railbird/secrets-flake.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@dev.railbird.ai:1123/railbird/secrets-flake.git"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"homebrew-cask": "homebrew-cask",
|
||||
"homebrew-core": "homebrew-core",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nix-homebrew": "nix-homebrew",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"railbird-secrets": "railbird-secrets"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_3": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
@ -1,168 +0,0 @@
|
||||
{
|
||||
description = "Example Darwin system flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
nix-darwin.url = "github:LnL7/nix-darwin";
|
||||
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||
railbird-secrets = {
|
||||
url = "git+ssh://gitea@dev.railbird.ai:1123/railbird/secrets-flake.git";
|
||||
};
|
||||
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
|
||||
|
||||
# Optional: Declarative tap management
|
||||
homebrew-core = {
|
||||
url = "github:homebrew/homebrew-core";
|
||||
flake = false;
|
||||
};
|
||||
homebrew-cask = {
|
||||
url = "github:homebrew/homebrew-cask";
|
||||
flake = false;
|
||||
};
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, ... }:
|
||||
let
|
||||
libDir = ../dotfiles/lib;
|
||||
configuration = { pkgs, config, ... }: {
|
||||
networking.hostName = "mac-demarco-mini";
|
||||
imports = [ (import ./gitea-actions-runner.nix) ];
|
||||
services.gitea-actions-runner = {
|
||||
user = "gitearunner";
|
||||
instances.nix = {
|
||||
enable = true;
|
||||
name = config.networking.hostName;
|
||||
url = "https://dev.railbird.ai";
|
||||
token = "H0A7YXAWsKSp9QzvMymfJI12hbxwR7UerEHpCJUe";
|
||||
labels = [
|
||||
"nix-darwin-${pkgs.system}:host"
|
||||
"macos-aarch64-darwin"
|
||||
"nix:host"
|
||||
];
|
||||
settings = {
|
||||
cache = {
|
||||
enabled = true;
|
||||
};
|
||||
host = {
|
||||
workdir_parent = "/var/lib/gitea-runner/action-cache-dir";
|
||||
};
|
||||
};
|
||||
hostPackages = with pkgs; [
|
||||
bash
|
||||
coreutils
|
||||
curl
|
||||
direnv
|
||||
gawk
|
||||
git-lfs
|
||||
gitFull
|
||||
gnused
|
||||
ncdu
|
||||
nixFlakes
|
||||
nodejs
|
||||
openssh
|
||||
wget
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
launchd.daemons.gitea-runner-nix.serviceConfig.EnvironmentVariables = {
|
||||
XDG_CONFIG_HOME = "/var/lib/gitea-runner";
|
||||
XDG_CACHE_HOME = "/var/lib/gitea-runner/.cache";
|
||||
};
|
||||
nixpkgs.overlays = [(import ../nixos/overlay.nix)];
|
||||
environment.systemPackages = with pkgs; [
|
||||
python-with-my-packages
|
||||
emacs
|
||||
alejandra
|
||||
cocoapods
|
||||
gitFull
|
||||
just
|
||||
tmux
|
||||
htop
|
||||
nodePackages.prettier
|
||||
nodejs
|
||||
ripgrep
|
||||
slack
|
||||
typescript
|
||||
vim
|
||||
yarn
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
|
||||
# Auto upgrade nix package and the daemon service.
|
||||
services.nix-daemon.enable = true;
|
||||
launchd.user.envVariables.PATH = config.environment.systemPath;
|
||||
|
||||
programs.direnv.enable = true;
|
||||
|
||||
# Necessary for using flakes on this system.
|
||||
nix.settings.experimental-features = "nix-command flakes";
|
||||
|
||||
|
||||
# Set Git commit hash for darwin-version.
|
||||
system.configurationRevision = self.rev or self.dirtyRev or null;
|
||||
|
||||
# Used for backwards compatibility, please read the changelog before changing
|
||||
system.stateVersion = 4;
|
||||
|
||||
# The platform the configuration will be used on.
|
||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||
users.users.kat.openssh.authorizedKeys.keys = inputs.railbird-secrets.keys.kanivanKeys;
|
||||
users.users.gitea-runner = {
|
||||
name = "gitea-runner";
|
||||
isHidden = false;
|
||||
home = "/Users/gitea-runner";
|
||||
createHome = false;
|
||||
};
|
||||
|
||||
home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true;
|
||||
|
||||
users.users.kat = {
|
||||
name = "kat";
|
||||
home = "/Users/kat";
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
shellInit = ''
|
||||
fpath+="${libDir}/functions"
|
||||
for file in "${libDir}/functions/"*
|
||||
do
|
||||
autoload "''${file##*/}"
|
||||
done
|
||||
'';
|
||||
interactiveShellInit = ''
|
||||
# eval "$(register-python-argcomplete prb)"
|
||||
# eval "$(register-python-argcomplete prod-prb)"
|
||||
# eval "$(register-python-argcomplete railbird)"
|
||||
# [ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"
|
||||
|
||||
autoload -Uz bracketed-paste-magic
|
||||
zle -N bracketed-paste bracketed-paste-magic
|
||||
'';
|
||||
};
|
||||
|
||||
home-manager.users.kat = {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
};
|
||||
home.stateVersion = "24.05";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
darwinConfigurations."mac-demarco-mini" = nix-darwin.lib.darwinSystem {
|
||||
modules = [
|
||||
home-manager.darwinModules.home-manager
|
||||
configuration
|
||||
];
|
||||
};
|
||||
|
||||
# Expose the package set, including overlays, for convenience.
|
||||
darwinPackages = self.darwinConfigurations."Kats-Mac-mini".pkgs;
|
||||
};
|
||||
}
|
@ -1,174 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.gitea-actions-runner;
|
||||
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
|
||||
hasDockerScheme = instance:
|
||||
instance.labels == [] || any (label: hasInfix ":docker:" label) instance.labels;
|
||||
wantsContainerRuntime = any hasDockerScheme (attrValues cfg.instances);
|
||||
|
||||
hasHostScheme = instance: any (label: hasSuffix ":host" label) instance.labels;
|
||||
|
||||
tokenXorTokenFile = instance:
|
||||
(instance.token == null && instance.tokenFile != null) ||
|
||||
(instance.token != null && instance.tokenFile == null);
|
||||
|
||||
in {
|
||||
options.services.gitea-actions-runner = {
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.gitea-actions-runner;
|
||||
defaultText = literalExpression "pkgs.gitea-actions-runner";
|
||||
description = "The gitea-actions-runner package to use.";
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "gitea-runner";
|
||||
description = "The user account under which the Gitea Actions Runner should run.";
|
||||
};
|
||||
|
||||
instances = mkOption {
|
||||
default = {};
|
||||
description = "Gitea Actions Runner instances.";
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Gitea Actions Runner instance";
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
example = "my-runner";
|
||||
description = "The name identifying the runner instance towards the Gitea/Forgejo instance.";
|
||||
};
|
||||
|
||||
url = mkOption {
|
||||
type = types.str;
|
||||
example = "https://forge.example.com";
|
||||
description = "Base URL of your Gitea/Forgejo instance.";
|
||||
};
|
||||
|
||||
token = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "Plain token to register at the configured Gitea/Forgejo instance.";
|
||||
};
|
||||
|
||||
tokenFile = mkOption {
|
||||
type = types.nullOr (types.either types.str types.path);
|
||||
default = null;
|
||||
description = "Path to a file containing the token to register at the configured Gitea/Forgejo instance.";
|
||||
};
|
||||
|
||||
labels = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
example = [ "macos:host" "x86_64:host" ];
|
||||
description = "Labels used to map jobs to their runtime environment.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
description = "Configuration for `act_runner daemon`.";
|
||||
type = types.submodule {
|
||||
freeformType = settingsFormat.type;
|
||||
};
|
||||
default = { };
|
||||
};
|
||||
|
||||
hostPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = with pkgs; [
|
||||
bash
|
||||
coreutils
|
||||
curl
|
||||
gawk
|
||||
git
|
||||
gnused
|
||||
nodejs
|
||||
wget
|
||||
openssh
|
||||
];
|
||||
description = "List of packages available to actions when the runner is configured with a host execution label.";
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.instances != {}) {
|
||||
assertions = [
|
||||
{
|
||||
assertion = all tokenXorTokenFile (attrValues cfg.instances);
|
||||
message = "Instances of gitea-actions-runner can have `token` or `tokenFile`, not both.";
|
||||
}
|
||||
];
|
||||
|
||||
users.users.${cfg.user} = {
|
||||
name = cfg.user;
|
||||
description = "Gitea Actions Runner user";
|
||||
};
|
||||
|
||||
launchd.daemons = mapAttrs' (name: instance:
|
||||
nameValuePair "gitea-runner-${name}" {
|
||||
serviceConfig = {
|
||||
ProgramArguments = [
|
||||
"${pkgs.writeShellScript "gitea-runner-start-${name}" ''
|
||||
echo "home is $HOME"
|
||||
mkdir -p /var/log/gitea-runner/
|
||||
chown -R ${cfg.user} /var/log/gitea-runner
|
||||
chmod 755 /var/log/gitea-runner
|
||||
|
||||
mkdir -p /var/lib/gitea-runner/${name}
|
||||
chown -R ${cfg.user} /var/lib/gitea-runner
|
||||
chmod 755 /var/lib/gitea-runner
|
||||
|
||||
sudo su - ${cfg.user}
|
||||
echo "STARTING"
|
||||
|
||||
# Register the runner if not already registered
|
||||
if [ ! -e "$HOME/.runner" ]; then
|
||||
${cfg.package}/bin/act_runner register --no-interactive \
|
||||
--instance ${escapeShellArg instance.url} \
|
||||
--token "$TOKEN" \
|
||||
--name ${escapeShellArg instance.name} \
|
||||
--labels ${escapeShellArg (concatStringsSep "," instance.labels)} \
|
||||
--config ${settingsFormat.generate "config.yaml" instance.settings}
|
||||
fi
|
||||
|
||||
# Start the runner
|
||||
exec ${cfg.package}/bin/act_runner daemon --config ${settingsFormat.generate "config.yaml" instance.settings}
|
||||
''}"
|
||||
];
|
||||
KeepAlive = true;
|
||||
RunAtLoad = true;
|
||||
SessionCreate = true;
|
||||
UserName = cfg.user;
|
||||
GroupName = "staff";
|
||||
WorkingDirectory = "/var/lib/gitea-runner/${name}";
|
||||
EnvironmentVariables = {
|
||||
PATH = (lib.makeBinPath (instance.hostPackages ++ [ cfg.package ])) + ":/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin";
|
||||
} // optionalAttrs (instance.token != null) {
|
||||
TOKEN = instance.token;
|
||||
};
|
||||
} // optionalAttrs (instance.tokenFile != null) {
|
||||
EnvironmentVariables.__TokenFile = instance.tokenFile;
|
||||
};
|
||||
}
|
||||
) cfg.instances;
|
||||
|
||||
system.activationScripts.gitea-runner-setup = {
|
||||
text = ''
|
||||
mkdir -p /var/log/gitea-runner/
|
||||
mkdir -p /var/lib/gitea-runner/${name}
|
||||
chown -R ${cfg.user} /var/log/gitea-runner
|
||||
chmod 755 /var/log/gitea-runner
|
||||
|
||||
chown -R ${cfg.user} /var/lib/gitea-runner
|
||||
chmod 755 /var/lib/gitea-runner
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
switch:
|
||||
nix run nix-darwin -- switch --flake .#
|
@ -23,7 +23,6 @@ rec {
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOVGIGnpkU7HNQ/zl/Ffi562M+laWY9/yIjB63BCMiTS kat@nixcomp.local"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO3tlMePru6ZlSuf8yUii3N1dy3WwJnSQAt3EgETkctK kat@jay-lenovo.local"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFrOYD3ReFc2+xFUylBFHREcm1lO7BRJGW5JrOoY3I8s ivanm@strixi-minaj"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINYy93265G59aA1ksckjqlfeHq0vpEpzC8BwqCrpeXdh kat@Kats-Mac-mini.local"
|
||||
];
|
||||
deanKeys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICDvbEVL+y7eV4+mtxOuHwyomBBQ6uYMesctstua20+e deanwenstrand@deans-mbp-2.lan"
|
||||
|
Loading…
Reference in New Issue
Block a user