Browse Source

Encrypt notes + dailies

main
parent
commit
394bedd649
  1. 18
      docs/daily/2021-02-03.org
  2. BIN
      docs/daily/2021-02-03.org.gpg
  3. 18
      docs/posts/hello.org
  4. BIN
      docs/posts/hello.org.gpg
  5. 79
      docs/posts/immutable-emacs.org
  6. BIN
      docs/posts/immutable-emacs.org.gpg

18
docs/daily/2021-02-03.org

@ -1,18 +0,0 @@
#+TITLE: 2021-02-03
#+AUTHOR: Christopher James Hayward
* Benefits of Literate Programming
In the textbook [[file:../notes/thinking-in-cpp.org][Thinking in C++]], *Eckel* uses a custom system for extracting and building all of the source code examples from the text, this is prefaced in the section *Begin and end comment tags*. I beleive he could have benefited here from a [[file:../notes/literate-programming.org][Literate Programming]] environment, automating much of this work without polluting the source code with tags.
* DONE Dotfiles cleanup
CLOSED: [2021-02-03 Wed 15:51] SCHEDULED: <2021-02-03 Wed>
I want to re-organize my [[roam:Dotfiles][Dotfiles]], namely move all ~org~ related directories to a ~docs~ subdirectory.
#+begin_src emacs-lisp
dotfiles/home
#+end_src
#+RESULTS:
: ~/.emacs.d/

BIN
docs/daily/2021-02-03.org.gpg

18
docs/posts/hello.org

@ -1,18 +0,0 @@
#+TITLE: Hello, world!
#+AUTHOR: Christopher James Hayward
#+DATE: 2021-01-17
#+ROAM_KEY: https://chrishayward.xyz/posts/hello
#+HUGO_BASE_DIR: ~/.local/source/website
#+HUGO_AUTO_SET_LASTMOD: t
#+HUGO_SECTION: posts
#+begin_src c
#include <stdio.h>
int main() {
printf("Hello, world!");
return 0;
}
#+end_src

BIN
docs/posts/hello.org.gpg

79
docs/posts/immutable-emacs.org

@ -1,79 +0,0 @@
#+TITLE: Immutable Emacs
#+AUTHOR: Christopher James Hayward
#+DATE: 2021-01-19
#+ROAM_KEY: https://chrishayward.xyz/posts/immutable-emacs/
#+HUGO_BASE_DIR: ~/.local/source/website
#+HUGO_AUTO_SET_LASTMOD: t
#+HUGO_SECTION: posts
You can easily create an *Immutable* and *100% Reproducible* custom Emacs configuration with very little effort. My inspiration for this came from the =Emacs From Scratch= series by [[https://youtube.com/c/SystemCrafters][System Crafters]].
* Getting started
Emacs created *lots* of files relative to ~user-emacs-directory~, which are *not* part of this configuration and do not belong in the same directory.
+ Disable lockfiles
+ Disable backup files
To acheive this functionality, before anything else happens we change this directory to ~~/.cache/emacs~, while keeping the old value of ~user-emacs-directory~ in our own variable.
#+begin_src emacs-lisp
(defvar dotfiles/home user-emacs-directory)
(defvar dotfiles/cache "~/.cache/emacs")
(setq create-lockfiles nil
make-backup-files nil
user-emacs-directory dotfiles/cache)
#+end_src
* Package management
[[https://github.com/raxod502/straight.el][Straight]] is a 100% functional package manager for Emacs, with integration for =use-package=, a common way to download / configure / install Emacs packages.
+ Use the development branch
+ Integrate with =use-package=
Apply the configurations prior to bootstrapping the package manager, by setting (writing) to the variables that =straight= will ultimately read from.
#+begin_src emacs-lisp
(setq straight-repository-branch "develop"
straight-use-package-by-default t)
#+end_src
Bootstrap the package manager, downloading, installing, or configuring depending on the state of the configuration. All packages are downloaded and built from source, and can be pinned to specific git commit hashes.
#+begin_src emacs-lisp
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(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))
#+end_src
Complete the integration with =use-package= by installing it with ~straight-use-package~:
#+begin_src emacs-lisp
(straight-use-package 'use-package)
#+end_src
* A E S T H E T I C S
If you've ever looked at default Emacs, you know that it's one of the ugliest GUI applications out of the box. Including a few packages, cherry picked from ~Doom~ can bring Emacs out of the eightes!
#+begin_src emacs-lisp
(use-package all-the-icons)
(use-package doom-modeline :init (doom-modeline-mode 1))
(use-package doom-themes :init (load-theme 'doom-one t))
#+end_src
* Conclusion
Now that the *stateful* and *immutable* files are seperated, and the default look has been improved *slightly* you're left with a clean, immutable, and reproducible Emacs configuration to continue hacking on.
Enjoy it!

BIN
docs/posts/immutable-emacs.org.gpg

Loading…
Cancel
Save