This page contains new modules for The Complete Computing Environment, my Emacs and NixOS automation environment. The CCE is designed to be modular, allowing me to intersperse code and documentation using Literate Programming facilities built in to org-mode which is then published to the web using The Arcology Project site engine.
A feed is generated from this page at https://cce.whatthefuck.computer/updates.xml and cross-posted to the Fediverse on my Fediverse instance.
Making
my NixOS system
deploys as simple as possible with Morph, a
hosts.toml
file, and my Morph Command Wrapper Nix
This weekend I tried setting up deploy-rs, and it and flakes are kind of not very good for what I am doing with my computers.
I spent some time today doing a think that I have wanted to do for a while, moving my "network topology" in to a data file which can be ingested by the tools themselves rather than declaring them in code.
This starts with defining a hosts.toml
file whose topology maps more-or-less to the one that Morph uses; a
network is a deployment entity which can have any number of hosts in
it:
[endpoints]
description = "my laptops and desktop"
enableRollback = true
config = "../roles/endpoint"
[endpoints.hosts.rose-quine]
# target = "rose-quine"
# stateVersion = "23.05"
# user = "rrix"
There are reasonable defaults in the host configurations so that
adding a new host is a single-line operation in the hosts.toml
file.
With that file in place, Deploying from my hosts.toml
defines a function that ingests
the networks and spits out a Nix attrset in the shape that Morph wants
to execute:
let
pkgs = import <nixpkgs> {};
allNetworks = pkgs.lib.importTOML ./hosts.toml;
mkNetwork = import ./mkNetwork.nix { inherit pkgs; networks = allNetworks; };
in mkNetwork "endpoints"
and from there i could say morph build $file_defined_above
and it would go
off and do that. then another invocation of morph deploy
with a grab-bag of arguments would
actually roll the system out to the host.
Taking things a step further is fun though. Why not make a simple
wrapper that can make this easier? Morph Command Wrapper does that and
allows me to just type deploy
to run a
change out to the host i'm sitting at, or deploy -b
to just build it, or deploy --all
to run it out everywhere.
Invoking deploy-targets
will print out
a list of all the hosts that the system knows about, which can then be
conveniently fed in to completing-read
"deploy-targets")
(->> (shell-command-to-string "\n")
(s-split append '("--all"))
("Which host do you want to deploy to? ")) (completing-read
And that can be used by the interactive emacs function arroyo-flood to automatically tangle the systems' org-mode role files, dynamically extracting a list of server, laptop, desktop, etc, modules from a sqlite cache along the way, and then deploying those! I'm pretty happy with this.
Hopefully
systemd-inhibit-mode
will keep me from
burning in my monitor and burning out my laptop battery.
When I watch a full-screen Video in Firefox
while using XMonad, it doesn't
properly disable DPMS so my screen blanks every five minutes in to the
video. Rather than try to figure out why that was, I would invoke systemd-inhibit
to inhibit screen blanking. This
was fine, but I'd run it in a terminal emulator which I would promptly
forget about. Cue my laptop having a dead battery or my monitor burning
in the lock-screen text overnight when I would manually lock the desktop
and head to bed.
systemd-inhibit-mode
is a dead-simple global
minor mode which exists to remind me via the modeline
that I have the inhibitor process
running:
It's 27 lines of code that, if you are interested in, you can copy to
your init.el
. 😊 I'm not terribly
motivated to stick stuff like this in MELPA. Anyways it's licensed under
the Hey Smell This license if
you are some sort of person who cares about licenses or think I do.
Moved my Org Site Engine-to-Fediverse cross-posting from feed2toot to Feediverse
Lately I have been working on integrating my org-mode site engine with my Fediverse presence. Following @garden@notes.whatthefuck.computer for technical work and @lionsrear@notes.whatthefuck.computer for creative/tea/philosophical crap should give a full view of what I am adding to my sites and keeping my main presence for 1-1 interactions with my fedi-friends.
There are Atom feeds available for headlines on various pages on the sites, and tying those to Fediverse posts should be pretty straightforward, but finding the right tool for the job is always the hard part when I am forging my own way forward.
Yesterday in the back of a rental car I added feed metadata to the
org-mode document for my 2023 Hawaii
Big Island Trip and wondered how I could get that on to my fedi
profile – i realized that it required my laptop to run the Morph deployment to ship a new NixOS system. a bit
overkill for what I want to do, especially when the data is already in
at least one sqlite
database!
So I modified Arcology's
Router to add an endpoint which returns all the feeds on the site in
a JSON document and then set to work making a script which wrapped feed2toot
to orchestrate this but quickly
felt that feed2toot
is a bit too
over-engineered for what I am asking it to do, especially when I set
about adding multi-account support to it; the configuration parser is
doing a lot more than I want to deal with. Feediverse is a simple single-file
script which I was able to easily modify to my needs, with a bit of
code-smell in the form of yaml.load
-based
configuration.
My fork of feediverse reads that feeds.json
document and iterates over every feed
looking for new posts. This lets me add new feeds to my cross-poster
without deploying The Wobserver
on my laptop. There is a slow pipeline that prevents me from using this
to Shitpost or live-toot things,
but I think that's basically okay. The idea is to use it to slowly ship
out things when I make new art, or have an end-of-day log, or publish a
site update, without having to think too hard about it. Most of the Arroyo Systems stuff (from adding software
to my laptop or server to adding pages to my site) is managed by adding
metadata keys to my org-mode documents,
and this is now no different, though perhaps a bit too "roundabout" for
it to be considered good engineering:
- add
ARCOLOGY_FEED
page keyword - add
ARCOLOGY_POST_VISIBILITY
page keyword - add
PUBDATE
andID
heading properties to entries on the page that will be published to the feed - wait for syncthing to copy files to my server
- wait for arcology inotify-watcher to reindex the site
- wait for Feediverse to run on the quarter-hour and post the new feed entries
But my axiom in writing the Arroyo Systems stuff and The Arcology Project as a whole is that Personal Software Can Be Shitty, and this certainly is, but it means I can post new feeds from my Astro Slide so who can say whether it's good or bad.
As much as I am not a fan of Pleroma, it's really nice to just be able to fire HTML right at my server and have it appear halfway decently on the Fediverse with inline links and even images working out just fine. Just have to keep my posts somewhat hsort. This is probably too long for Fedi already, bye.
First Update: A welcome return Emacs CCE Catchup
I noticed that my feed in the Planet Emacslife feed aggregator wasn't valid any more and am re-establishing a feed here for capturing my configuration-specific stuff. First-time readers may recognize me from the Emacs or Nix-Emacs Matrix.org rooms, or from building the first prototype of an Emacs Matrix Client which would later be taken and evolved and polished by alphapapa after I became frustrated with hauling bugs and implementing end-to-end encryption.
Right now most of the new functionality in my notebooks is centered on NixOS automation and the deployment of my Wobserver, but I also do increasingly silly hacks with org-roam and my own org-mode metadatabase called arroyo-db. If you haven't seen it before, my Arroyo Systems Management documents are brain-bending automation for dynamically a Concept Operating System from many org-mode docs. I have vague dreams to create a system where Emacs and NixOS users could bootstrap a minimal Linux operating system by referencing documents on the web & seamlessly pulling them in to their system, but this is a fair bit of the way off still.
All of this is published straight out of my org-roam knowledgebase
using a home-built web site engine called The Arcology Project
which exists to give me a way to publish these pages across multiple
domains, to arbitrary web paths, without having to line them all up on a
file-system. It's primarily written in Python but it uses Arroyo to
generate a sqlite
database which the
Python reads, and some custom lua
and
templates which Pandoc uses to render the org-mode docs to HTML.
I'll keep this feed up to date with new modules and interesting updates. Here are a few that have fallen between the cracks over the last 6 months or more:
- Dealing with Syncthing
Conflicts shows a function called
cce/syncthing-deconflict
which will open up ediff buffers for any "conflict" files created by Syncthing which can occur when I edit buffers while syncthing is sleeping on my phone for example. - I have a raft of Emacs functions for studying Japanese:
- a simple macro for defining Dynamic Org Captures, org-capture templates which have dynamic file names (for example date/week-stamped filenames) and automatic "top matter" like org-roam provides for. I use this to provide a handful of capture commands in to my Journal and other parts of my org-mode document hierarchy.
- CCE Nixos Core
defines a simple helper function
cce-find-nix-output-at-point
which will select andfind-file
an output for a Nix derivation path (a metadata-file showing all the inputs/outputs of a Nix expression) at-point.