﻿<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text" xml:lang="en">Nix</title>
  <link type="application/atom+xml" href="https://d.moonfire.us/tags/nix/atom.xml" rel="self" />
  <link type="text/html" href="https://d.moonfire.us/tags/nix/" rel="alternate" />
  <updated>2026-04-14T17:49:47Z</updated>
  <id>https://d.moonfire.us/tags/nix/</id>
  <author>
    <name>D. Moonfire</name>
  </author>
  <rights>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International</rights>
  <entry>
    <title>fedran-cli</title>
    <link rel="alternate" href="https://d.moonfire.us/blog/2022/01/16/fedran-cli/" />
    <updated>2022-01-16T06:00:00Z</updated>
    <id>https://d.moonfire.us/blog/2022/01/16/fedran-cli/</id>
    <category term="programming" scheme="https://d.moonfire.us/categories/" label="Programming" />
    <category term="writing" scheme="https://d.moonfire.us/categories/" label="Writing" />
    <category term="fedran-cli" scheme="https://d.moonfire.us/tags/" label="fedran-cli" />
    <category term="rust" scheme="https://d.moonfire.us/tags/" label="Rust" />
    <category term="nix" scheme="https://d.moonfire.us/tags/" label="Nix" />
    <category term="c-sharp" scheme="https://d.moonfire.us/tags/" label="C#" />
    <category term="fedran" scheme="https://d.moonfire.us/tags/" label="Fedran" />
    <category term="flight-of-the-scions" scheme="https://d.moonfire.us/tags/" label="Flight of the Scions" />
    <summary type="html">I started working on a small tool, `fedran-cli`, to help me manage and work with the growing cluster of stories and novel Git repositories and automated processes.
</summary>
    <content type="html">&lt;p&gt;Due to some random happenstance, I was presented the opportunity to get a sensitivity reader for &lt;a href="/tags/flight-of-the-scions/"&gt;Flight of the Scions&lt;/a&gt;. I've been thinking about doing this for a few years, ever since I realized I rewrote the novel for no-so-great reasons but had the misfortune of hanging much of the phase-1 stories off of events in that book.&lt;/p&gt;
&lt;p&gt;This forced me to integrate the edits I've been avoiding for the last six months and get them into the site. So, the version currently on my website would be the latest, but at the moment, there is a bug preventing me from actually showing them.&lt;/p&gt;
&lt;p&gt;I know that &lt;em&gt;Flight&lt;/em&gt; has been hanging around for decades (it was supposed to be my first published novel) but this is a step that I've been feeling like I need to do. Of course, my anxiety helpfully suggests that the reader is going to find the novel complete and utter trash so there is that. I'm hoping it isn't but I've never had a sensitivity reader before and I'm not sure what to expect.&lt;/p&gt;
&lt;p&gt;To distract myself from the impending complete rejection of my project, I needed to distract myself. I have a writing commission that I needed to finish, but that was limited to off-hours because of the concentration required and I couldn't do it with the kids.&lt;/p&gt;
&lt;p&gt;To do something, and hopefully get a dopamine hit, I dug up a project that I had started a few times but failed: a program to help me work with my &lt;a href="/tags/fedran/"&gt;Fedran&lt;/a&gt; projects. In specific, something that would let me update and add &lt;a href="https://fedran.com/sources/"&gt;characters and volumes sources&lt;/a&gt; easily.&lt;/p&gt;
&lt;p&gt;Along the way, I figured I'd include a few other items that have been bothering me. One of the biggest, which is needed for the fedran.com rewrite was to be able to check out the Git repositories in a single shot. That requires me to identify my stories, which is going to get more complicated since I recently (last year) decided that I was going to be purely one repository per story to handle versioning better.&lt;/p&gt;
&lt;p&gt;According to my sources page, I have exactly eighty stories and novels. That means I need a central place to keep track of eighty repositories. I could maintain them in the website folder, but I thought tying it into my &lt;code&gt;identifiers.json&lt;/code&gt; (formerly YAML) would be a good way of centralizing all the information about the sources in a single place.&lt;/p&gt;
&lt;p&gt;Hence, I'm working on &lt;code&gt;fedran-cli&lt;/code&gt; which is a CLI for working with the Fedran ecosystem. Since I recently started playing with &lt;a href="/tags/nix/"&gt;Nix&lt;/a&gt;, I wanted to figure out a way of integrating &lt;code&gt;fedran-cli&lt;/code&gt; into that whole mess without me needing to do some formal release process. Originally, I tried a &lt;span class="missing-link" data-path="/tags/csharp/"&gt;C#&lt;/span&gt; version because I can't get C# to play with my new libraries in Nix. However, I could make it work in &lt;a href="/tags/rust/"&gt;Rust&lt;/a&gt; so I banged up a basic program that lets me choose the existing character and volume for a given project.&lt;/p&gt;
&lt;p&gt;(I was going to upload a GIF to this post, but I helpfully used the &lt;code&gt;rm&lt;/code&gt; command instead of &lt;code&gt;mv&lt;/code&gt;, so here is a &lt;a href="https://octodon.social/@dmoonfire/107616954866735580"&gt;link to the post with a video including alt text&lt;/a&gt; on my social page).&lt;/p&gt;
&lt;p&gt;For a non-trivial Rust application, I was pretty happy with the results. I have a number of other commands I need to write for basic functionality and what I consider minimum viable product.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;fedran-cli characters add&lt;/code&gt; to add new characters.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fedran-cli volumes add&lt;/code&gt; to add new volumes.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fedran-cli project sync&lt;/code&gt; to upload a subset of information to the identifiers file including the Git repository.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fedran-cli git clone --all&lt;/code&gt; to basically clone the eighty sources into the current directory based on the identifier file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is kind of an untethered project for me. The CLI doesn't really have an end, just an &amp;ldquo;end for now&amp;rdquo;. But, I think if I focus on getting to the &lt;code&gt;git clone --all&lt;/code&gt;, I should have something that can help me.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>generator-mfgames-nix-project v1.4.1 and generator-mfgames-writing 1.0.0</title>
    <link rel="alternate" href="https://d.moonfire.us/blog/2021/12/19/yeoman-generators/" />
    <updated>2021-12-19T06:00:00Z</updated>
    <id>https://d.moonfire.us/blog/2021/12/19/yeoman-generators/</id>
    <category term="programming" scheme="https://d.moonfire.us/categories/" label="Programming" />
    <category term="asdf" scheme="https://d.moonfire.us/tags/" label="asdf" />
    <category term="commitlint" scheme="https://d.moonfire.us/tags/" label="commitlint" />
    <category term="conventional-commits" scheme="https://d.moonfire.us/tags/" label="Conventional Commits" />
    <category term="direnv" scheme="https://d.moonfire.us/tags/" label="direnv" />
    <category term="editorconfig" scheme="https://d.moonfire.us/tags/" label="EditorConfig" />
    <category term="generator-mfgames-nix-project" scheme="https://d.moonfire.us/tags/" label="generator-mfgames-nix-project" />
    <category term="generator-mfgames-writing" scheme="https://d.moonfire.us/tags/" label="generator-mfgames-writing" />
    <category term="husky" scheme="https://d.moonfire.us/tags/" label="Husky" />
    <category term="mfgames-writing" scheme="https://d.moonfire.us/tags/" label="MfGames Writing" />
    <category term="nix" scheme="https://d.moonfire.us/tags/" label="Nix" />
    <category term="prettier" scheme="https://d.moonfire.us/tags/" label="Prettier" />
    <category term="semantic-release" scheme="https://d.moonfire.us/tags/" label="semantic-release" />
    <category term="typescript" scheme="https://d.moonfire.us/tags/" label="TypeScript" />
    <category term="yeoman" scheme="https://d.moonfire.us/tags/" label="Yeoman" />
    <summary type="html">A new Yeoman generator and a refresh on a second one.
</summary>
    <content type="html">&lt;p&gt;I create a lot of projects. I think between Github and Gitlab, I have a few hundred now. Much if it is because I started pushing toward strictly being one story per repository (OSPR). This means I have a lot of common patterns that not only do I have to set up but also maintain as my skills and knowledge evolve. The problem comes when I figure out a new pattern, I have to update a couple hundred repositories if I want to keep them consistent. Needless to say, this is one drawback of a monorepo but there are a lot of advantages of OSPR.&lt;/p&gt;
&lt;p&gt;A lot of my inspiration comes from Larry Wall's Three Virtues of a Great Programmer:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Laziness: The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful and document what you wrote so you don't have to answer so many questions about it.&lt;/li&gt;
&lt;li&gt;Impatience: The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least pretend to.&lt;/li&gt;
&lt;li&gt;Hubris: The quality that makes you write (and maintain) programs that other people won't want to say bad things about.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This means, instead of manually doing it, I want to find a nice automated way (virtue one) that I can script and have it run across everything at once (virtue two).&lt;/p&gt;
&lt;p&gt;Previously, I had used &lt;a href="https://yeoman.io/"&gt;Yeoman&lt;/a&gt; but I was wondering if I needed to break out of that to work on a &amp;ldquo;me-specific&amp;rdquo; CLI tool. That line of thought came down because so many of the tools I'm using all package their own custom CLIs. While I do enjoy writing a good CLI, I don't want to write one if I can't.&lt;/p&gt;
&lt;p&gt;In the process of finding an alternative, I finally understood how to compose Yeoman generators together. That means I could create a generic project generator and then layer the &lt;a href="/tags/mfgames-writing/"&gt;writing&lt;/a&gt; one on top of it.&lt;/p&gt;
&lt;p&gt;At the same time, I could migrate away from &lt;a href="/tags/asdf/"&gt;asdf&lt;/a&gt; and onto my preferred infrastructure du jour, &lt;a href="/tags/nix/"&gt;Nix&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Side Note: Let me be honest, I'm constantly evolving my structures and they change as I learn new tools and my processes change with me. I won't be on Nix forever, but right now, Nix works out very nicely for what I want it to do.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This weekend I pulled something together and actually got a working version by tonight. This involves three projects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/mfgames-writing/mfgames-writing-js/"&gt;mfgames-writing&lt;/a&gt;: My publishing framework for Markdown and YAML files.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/mfgames-js/generator-mfgames-nix-project"&gt;generator-mfgames-nix-project&lt;/a&gt;: A Yeoman generator for creating a basic project layout.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/mfgames-writing/generator-mfgames-writing-js"&gt;generator-mfgames-writing&lt;/a&gt;: A Yeoman generator for setting up a writing project.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;generator-mfgames-nix-project v1.4.1&lt;/h1&gt;
&lt;p&gt;I pulled out the basic project stuff from &lt;code&gt;generator-mfgames-writing&lt;/code&gt; and made it a dedicated generator while improving it. It still asks a bunch of questions, but mainly it does the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set up &lt;a href="/tags/semantic-release/"&gt;semantic-release&lt;/a&gt; to handle non-romantic releases. &amp;ldquo;Non-romantic&amp;rdquo; meaning automated and every time I push up to &lt;code&gt;main&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set up &lt;a href="/tags/conventional-commits/"&gt;Conventional Commits&lt;/a&gt; to drive the semantic release process. This is why my check-ins start with &lt;code&gt;feat:&lt;/code&gt;, &lt;code&gt;fix:&lt;/code&gt;, or something other tag. That way, I can just focus on a given commit being a new feature, fixing something, or breaking everything.&lt;/li&gt;
&lt;li&gt;Set up &lt;a href="/tags/commitlint/"&gt;commitlint&lt;/a&gt; to make sure the commits are properly handled for the semantic releasing.&lt;/li&gt;
&lt;li&gt;Set up &lt;a href="/tags/husky/"&gt;Husky&lt;/a&gt; to make sure commitlint is automatically handled.&lt;/li&gt;
&lt;li&gt;Configure &lt;a href="/tags/prettier/"&gt;Prettier&lt;/a&gt; to make everything pretty and normalized. This mostly helps if someone ever contributes, but I like things being consistent and neat. While I disagree with Prettier on many things, it does a fantastic job.&lt;/li&gt;
&lt;li&gt;Set up a &lt;a href="/tags/nix/"&gt;Nix flake&lt;/a&gt; to represent all the build tools needed to build the project.&lt;/li&gt;
&lt;li&gt;Set up &lt;a href="/tags/direnv/"&gt;direnv&lt;/a&gt; to automatically &amp;lsquo;enter&amp;rsquo; the environment when you go into the directory.&lt;/li&gt;
&lt;li&gt;Write out the files needed to run &lt;a href="/tags/gitlab/"&gt;Gitlab's CI/CD&lt;/a&gt; on push and generate all the files and automatically release.&lt;/li&gt;
&lt;li&gt;Set up &lt;a href="/tags/editorconfig/"&gt;EditorConfig&lt;/a&gt; for normalized formatting.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That's a lot of work and it was getting tedious as I migrated/created new projects over the last month or so as I figured out the pattern. I like it, though it is opinionated. Previously, I hated that word, but this is honestly how &lt;em&gt;I&lt;/em&gt; work and I think it's a reasonable pattern for any writing or coding project.&lt;/p&gt;
&lt;p&gt;Running it is pretty simple:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ npm install -g generator-mfgames-nix-project yo
$ mkdir name-of-project
$ cd name-of-project
$ yo mfgames-nix-project
... lots of prompting
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Overall, I like the resulting project and I'm going to be testing it fairly heavily in the new few weeks.&lt;/p&gt;
&lt;h1&gt;generator-mfgames-writing v1.0.0&lt;/h1&gt;
&lt;p&gt;Most of the intial work for &lt;code&gt;generator-mfgames-nix-project&lt;/code&gt; came from &lt;code&gt;generator-mfgames-writing&lt;/code&gt;, but I ended up also expanding that over the weekend to ask better questions about theme, author information, and the release process. It works the same as the project generator.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ npm install -g generator-mfgames-writing yo
$ mkdir name-of-project
$ cd name-of-project
$ yo mfgames-writing
... a different set of questions
$ npm run build
... lots of noise
$ ls *.epub *.pdf
name-of-project-0.0.1.epub
name-of-project-0.0.1.pdf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This one bypasses some questions that the project one does (build, test, and release questions) and adds some other ones (theme, configuration file format, title of the work), but otherwise works the same as the other. The end result is something you should be able to build and get the output immediately.&lt;/p&gt;
&lt;p&gt;I honestly think that is really cool.&lt;/p&gt;
&lt;h1&gt;mfgames-writing&lt;/h1&gt;
&lt;p&gt;There were a bunch of versions with this, but I needed to tweak some processes because I found some bugs in these tools while writing the generators. Sadly, a &amp;ldquo;simple&amp;rdquo; fix of moving &lt;code&gt;rimraf&lt;/code&gt; from a developer dependency to a normal dependency required me to upgrade &lt;a href="/tags/typescript/"&gt;TypeScript&lt;/a&gt; to the last version and accept a wall of warnings because some of the linting tools don't like the latest version.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Using Nix</title>
    <link rel="alternate" href="https://d.moonfire.us/blog/2021/11/30/nix/" />
    <updated>2021-11-30T06:00:00Z</updated>
    <id>https://d.moonfire.us/blog/2021/11/30/nix/</id>
    <category term="programming" scheme="https://d.moonfire.us/categories/" label="Programming" />
    <category term="asdf" scheme="https://d.moonfire.us/tags/" label="asdf" />
    <category term="nix" scheme="https://d.moonfire.us/tags/" label="Nix" />
    <category term="covid" scheme="https://d.moonfire.us/tags/" label="Covid" />
    <category term="derecho-2020" scheme="https://d.moonfire.us/tags/" label="Derecho 2020" />
    <category term="merger-of-evil" scheme="https://d.moonfire.us/tags/" label="Merger of Evil" />
    <category term="minion-of-evil" scheme="https://d.moonfire.us/tags/" label="Minion of Evil" />
    <category term="second-hand-dresses" scheme="https://d.moonfire.us/tags/" label="Second-Hand Dresses" />
    <category term="flight-of-the-scions" scheme="https://d.moonfire.us/tags/" label="Flight of the Scions" />
    <category term="flood-2008" scheme="https://d.moonfire.us/tags/" label="Flood 2008" />
    <category term="kingdom-of-loathing" scheme="https://d.moonfire.us/tags/" label="Kingdom of Loathing" />
    <category term="entanglement-2021" scheme="https://d.moonfire.us/tags/" label="Entanglement 2021" />
    <summary type="html">Today, I finished putting the final touches on additional features for `generator-mfgames-writing`, my scaffolding generator for Yeoman that lets me set up writing projects quickly.
</summary>
    <content type="html">&lt;p&gt;Apparently, it's been a few months since I've blogged about anything. That isn't to say I wasn't thinking about it. I would find myself working on a little bit of code and think &amp;ldquo;this would be something interesting to talk about&amp;rdquo; or come up on a post about elitism that I want to respond. But then&amp;hellip; it didn't happen.&lt;/p&gt;
&lt;p&gt;The last four month have been probably one of the hardest I've had in a long time, even over the struggles of 2020's derecho and pandemic. It started with just a bit of stress at work, but then something got dumped on top of it. And then something on top of that, then on that, and then on that. At one point, for every time I took off my task list, two more were added.&lt;/p&gt;
&lt;p&gt;A good example is while I was fixing Partner's toilet that wasn't flushing (just a simple stalk replacement) and our youngest comes up the stairs because the downstairs toilet basically exploded (water pouring out of the bottom, ruptured wax seal, no longer flushing, soaking the carpet). I've been trying to get around to it for almost two months and &lt;em&gt;just&lt;/em&gt; removed the carpet today to find out how much drywall damage was done.&lt;/p&gt;
&lt;p&gt;There was a lot more, but going through them just turns into a story like &lt;a href="https://www.imdb.com/title/tt0310357/"&gt;Willard (2003)&lt;/a&gt; where the main character starts off in the dump, for a brief moment sees hope, and then plunges even further into the hole. Since I try to keep my blog posts positive, let's just go with that.&lt;/p&gt;
&lt;p&gt;One of those bright points was getting &lt;a href="https://weirdauthor.com/merger"&gt;Merger of Evil&lt;/a&gt; published. Shannon has always been a fantastic author and I'm glad I got to see the sequel to &lt;a href="https://weirdauthor.com/evil"&gt;Minion of Evil&lt;/a&gt; in print. Plus, the cover is fantastic (even if I didn't do it).&lt;/p&gt;
&lt;p&gt;My brother says my life is frequently a &amp;ldquo;that's good, that's bad&amp;rdquo; game. while I was able to do my part in getting &lt;em&gt;Merger of Evil&lt;/em&gt; out, I was unable to finish &lt;a href="/tags/second-hand-dresses/"&gt;Second-Hand Dresses&lt;/a&gt; or &lt;a href="/tags/flight-of-the-scions/"&gt;Flight of the Scions&lt;/a&gt; out this year, which I wanted to. The reasons are worth of a different post, but basically I had to scoop things off my pile to avoid drowning.&lt;/p&gt;
&lt;p&gt;Working on &lt;em&gt;Merger of Evil&lt;/em&gt; hit a couple of technical annoyances. A few months ago, I started using &lt;a href="/tags/asdf/"&gt;asdf&lt;/a&gt; to let me switch environments more fluidly. The project for &lt;em&gt;Merger&lt;/em&gt; seemed like a great place to use that, but somewhere in that time, there were some updates to Node and various packages that turned a minor maintenance task into something far more complicated simply because I couldn't get into the right head space.&lt;/p&gt;
&lt;p&gt;As a side note, when I was forced from my apartment in 2008 because of the flood in Cedar Rapids, I had a few months of high stress that also made things difficult to function. Much like the the last few months, minor problems became complicated when there were dozens of other things competition for my time and attention. When I got back to my apartment, I found that my old life didn't quite fit anymore. My daily ritual of going through 20-30 web comics and sites then seemed pointless so I purged my RSS feed, I stopped playing &lt;a href="https://www.kingdomofloathing.com/"&gt;Kingdom of Loathing&lt;/a&gt;, and basically had to review what &amp;ldquo;sparked joy&amp;rdquo; in my life.&lt;/p&gt;
&lt;p&gt;Those technical annoyances got me to thinking about improvements. Yeah, I had a bunch of other things demanding my attention, but &lt;em&gt;optimizing a process&lt;/em&gt; is one of the ways I reduce stress (along with &lt;em&gt;rewriting problems&lt;/em&gt;) and I desperately needed that distraction. As things were, someone on my social feed started talking about migrating from asdf to &lt;a href="https://nixos.org/"&gt;Nix&lt;/a&gt;. Nix is a lot like the old GNU &lt;a href="https://www.gnu.org/software/stow/"&gt;Stow&lt;/a&gt; but had a much better package management and, more importantly, allowed me to have seamless transitions to different versions. Nix also is more of a holistic approach since one could use &lt;a href="https://nixos.wiki/wiki/Flakes"&gt;flakes&lt;/a&gt; to wrap everything including specific Node, Python, and C# packages into a single unified whole.&lt;/p&gt;
&lt;p&gt;After a few weeks of using Nix, I can say that it definitely solves the little nits and scratches that asdf had plus handles my need for reproducible/consistent builds. I'm sure there are other problems with it, starting with the complexity of the setup files and the fact the featuers I want are still in beta, but I think I'm going to stay with it and see if it works out.&lt;/p&gt;
&lt;p&gt;Things are still in flux and life is still heaping up on my shoulders, which means there is only one thing I can do: break apart the problems as much as I can and then focus on one thing at a time.&lt;/p&gt;
</content>
  </entry>
</feed>
