Tom Willemse
03a13ca1c2
Executing the first code block in the file will get the configuration up and running. Also rename ‘config/index.org’ to ‘config/rincewind.org’ because for now this is the only literate configuration I have, but it won't be forever.
110 lines
4.7 KiB
Org Mode
110 lines
4.7 KiB
Org Mode
#+title: Oni Machine Interface
|
|
#+subtitle: My Literate Machine Configuration
|
|
#+options: num:nil
|
|
|
|
This is my latest attempt at a literate configuration.
|
|
|
|
#+begin_note
|
|
This is in the very early stages of an attempt to do this. And usually I get frustrated and give up quite early on. I'll try and get small bits and pieces in here one at a time.
|
|
#+end_note
|
|
|
|
Here is the command that converts this file into my home configuration. This calls [[file:../guix.org][Guix]] shell with /just/ the =emacs-next= package installed and runs [[file:../emacs.org][Emacs]] to tangle this file. When tangling is done it runs guix home to configure my environment.
|
|
|
|
#+begin_note
|
|
For the moment this doesn't do ~guix home reconfigure~ but ~guix home build~ instead. I'm still getting this up to the point where I can actually use it.
|
|
#+end_note
|
|
|
|
#+begin_src sh :results silent
|
|
guix shell --pure emacs-next -- emacs \
|
|
-quick -batch \
|
|
-load ob-tangle \
|
|
-visit rincewind.org \
|
|
-funcall org-babel-tangle
|
|
guix home build rincewind.scm
|
|
#+end_src
|
|
|
|
* Environment
|
|
|
|
This is a random assortment of environment variables that I like to have defined for various reasons.
|
|
|
|
The =LESS= environment variable specifies the default command-line arguments to pass in to =less= whenever it is run. I've gotten quite used to these:
|
|
|
|
#+ATTR_HTML: :class short-dl
|
|
- =F= :: Causes =less= to exit right away when there is less than one screen of text to display.
|
|
- =X= :: Prevents the screen from being cleared away when =less= exits (it does more, but this is why I use it)
|
|
- =R= :: Displays ANSI color escape sequences to be rendered as normal, instead of as readable characters. In other words it lets =less= display colored text instead of displaying escape sequences.
|
|
- =S= :: Truncates long lines instead of wrapping them. Makes it easier for me to read.
|
|
- =i= :: This causes any searches using =/= to become case-insensitive so that the search term “done” will match “done”, “Done”, “DONE”, and any other combination of upper- and lowercase letters.
|
|
|
|
#+begin_src scheme :noweb-ref environment-variables
|
|
("LESS" . "FXRSi")
|
|
#+end_src
|
|
|
|
I use the =MY_GUIX_CONFIGURED= just as an indication that [[file:../guix.org][Guix]] home actually configured my user profile. It's not actually necessary for anything.
|
|
|
|
#+begin_src scheme :noweb-ref environment-variables
|
|
("MY_GUIX_CONFIGURED" . "1")
|
|
#+end_src
|
|
|
|
This opts out of sending any telemetry to Microsoft whenever I play around with any .Net things.
|
|
|
|
#+begin_src scheme :noweb-ref environment-variables
|
|
("DOTNET_CLI_TELEMETRY_OPTOUT" . "1")
|
|
#+end_src
|
|
|
|
Turn on dark-mode for Calibre. I prefer dark mode everywhere.
|
|
|
|
#+begin_src scheme :noweb-ref environment-variables
|
|
("CALIBRE_USE_DARK_PALETTE" . "1")
|
|
#+end_src
|
|
|
|
Because I use [[file:../guix.org][Guix]] on top of another distribution, this variable needs to be set in order for locales to work properly for both package installed through Guix and ones installed by the host distribution.
|
|
|
|
#+begin_src scheme :noweb-ref environment-variables
|
|
("GUIX_LOCPATH" . "$HOME/.guix-home/profile/lib/locale")
|
|
#+end_src
|
|
|
|
Again because I use Guix on top of another distribution this variable ensures that the things I have stored away in my usual data directory get included, not just the ones Guix defines.
|
|
|
|
#+begin_src scheme :noweb-ref environment-variables
|
|
("XDG_DATA_DIRS"
|
|
. "${XDG_DATA_DIRS}${XDG_DATA_DIRS:+:}/usr/local/share:/usr/share")
|
|
#+end_src
|
|
|
|
I was working with =git= recently, splitting some utilities out into their own repository from a bigger repository using =filter-branch=. Apparently =filter-branch= has been deprecated because it's easy to make mistakes and there's better alternatives now. But =filter-branch= is what I know and my needs are simple, so I disable that warning.
|
|
|
|
#+begin_src scheme :noweb-ref environment-variables
|
|
("FILTER_BRANCH_SQUELCH_WARNING" . "1")
|
|
#+end_src
|
|
|
|
Putting it all together to define the service for my home configuration.
|
|
|
|
#+begin_src scheme :noweb yes :noweb-ref services
|
|
(define oni-environment-service
|
|
(simple-service
|
|
'home-environment-service
|
|
home-environment-variables-service-type
|
|
'(
|
|
<<environment-variables>>)))
|
|
#+end_src
|
|
|
|
* Home
|
|
|
|
This brings it all together. The =<<services>>= is where all the services defined throughout this document are placed, and the last few lines return my home environment.
|
|
|
|
#+begin_src scheme :tangle rincewind.scm :noweb tangle
|
|
(use-modules
|
|
(gnu services)
|
|
(gnu home services))
|
|
|
|
<<services>>
|
|
|
|
(home-environment
|
|
(services
|
|
(list
|
|
oni-environment-service)))
|
|
#+end_src
|
|
|
|
* Changelog
|
|
|
|
- [2022-11-16 Wed] :: Added a code block that tries to tangle this file and then build the result. And made the output an actual home environment.
|