﻿<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text" xml:lang="en">MfGames Project Setup Flake</title>
  <link type="application/atom+xml" href="https://mfgames.com/mfgames-project-setup-flake/atom.xml" rel="self" />
  <link type="text/html" href="https://mfgames.com/mfgames-project-setup-flake/" rel="alternate" />
  <updated>2026-04-18T17:43:18Z</updated>
  <id>https://mfgames.com/mfgames-project-setup-flake/</id>
  <author>
    <name>D. Moonfire</name>
  </author>
  <rights>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International</rights>
  <entry>
    <title>Breaking Changes (MfGames Project Setup Flake)</title>
    <link rel="alternate" href="https://mfgames.com/blog/2026/04/05/breaking-changes/" />
    <updated>2026-04-05T05:00:00Z</updated>
    <id>https://mfgames.com/blog/2026/04/05/breaking-changes/</id>
    <category term="mfgames-project-setup-flake" scheme="https://mfgames.com/categories/" label="MfGames Project Setup Flake" />
    <content type="html">&lt;p&gt;In the beginning, I wanted to use NixOS options with the flake instead of using
a &lt;code&gt;mkConfig&lt;/code&gt; function to generate the files and shell hooks. But, due to
complexities and struggling with Nix, I couldn't figure it out. But, after two
years of working on it, I finally got a working implementation that uses the
cleaner approach of options.&lt;/p&gt;
&lt;p&gt;So that means instead of using &lt;code&gt;mkLib&lt;/code&gt;, using
&lt;a href="//mfgames.com/mfgames-project-setup-flake/"&gt;mfgames-project-setup-flake&lt;/a&gt; means
adding it as an input (as before), importing the model (that's new), and then
using configuration settings (those are new).&lt;/p&gt;
&lt;p&gt;The flake still needs to be added as an input:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nix"&gt;inputs.mfgames-project-setup.url = &amp;quot;git+https://src.mfgames.com/nixos-contrib/mfgames-project-setup-flake.git&amp;quot;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It also now has a module which needs to be imported and then configured using
the same syntax that most other configurations are used.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nix"&gt;imports = [
    inputs.mfgames-project-setup.flakeModules.default
];

mfgames.project = {
    enable = true;
    rust.enable = true;
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then, in the &lt;code&gt;mkShell&lt;/code&gt; call, the various hooks are called to integrate it.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nix"&gt;devShells.default = pkgs.mkShell {
    packages = []
        ++ config.mfgames.project.packages;

    shellHook = config.mfgames.project.shellHook;
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I also refactored how
&lt;a href="//mfgames.com/mfgames-project-setup-flake/docs/options/"&gt;options&lt;/a&gt; where
documented and displayed. It is now a script-generated file that is rebuild
during the build process so I don't have to worry about getting it stale.&lt;/p&gt;
&lt;h2&gt;Versions&lt;/h2&gt;
&lt;p&gt;The old version is now &lt;code&gt;v0.5.0&lt;/code&gt; with the new version current at &lt;code&gt;v1.1.0&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Breaking Changes&lt;/h2&gt;
&lt;p&gt;Since this is a really breaks existing setups, I'm also taking the opportunity
to make other changes that have popped up in the last few years that I didn't
want to be disruptive but I think will benefit the project in the long run.&lt;/p&gt;
&lt;h3&gt;REUSE&lt;/h3&gt;
&lt;p&gt;Probably the biggest one is stumbling onto
&lt;a href="https://reuse.software/"&gt;REUSE Software&lt;/a&gt; and seeing a more nuanced (though
complicated) specification for handling licenses that differ across files even
in the same project. That is osmething I couldn't do but it resolved a number of
issues I had after trying to integrate
&lt;a href="https://mfgames.com/mfgames-writing-setup-flake/"&gt;mfgames-writing-project-setup&lt;/a&gt;
which is less code-oriented and more prose-oriented. After mulling over it, I
decided to remove looking over the differencesand reasoning, I decided to
integrate REUSE into the flake and remove the existing licensing handling.&lt;/p&gt;
&lt;p&gt;This means removing the following keys from before:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;creativeCommonsAttributionShareAlike.enable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;creativeCommonsAttributionNonCommercialShareAlike.enable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mit.enable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mit.filename&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And replacing it with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;mfgames.project.reuse.enable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mfgames.project.reuse.ignore-dot-config&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mfgames.project.reuse.annotations&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The most complicated part is that REUSE is &amp;ldquo;picky&amp;rdquo;. It requires every file to be
properly licensed, so I introduced the ability to create the &lt;code&gt;REUSE.toml&lt;/code&gt;
annotations from the flake file which will be suppelemented by the automatic
annotations from the generated files this flake produces.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nix"&gt;mfgames.project.reuse.annotations = [
    {
        path = [
            &amp;quot;docs/**/*.md&amp;quot;
            &amp;quot;news/**/*.md&amp;quot;
            &amp;quot;README.md&amp;quot;
        ];

        SPDX-FileCopyrightText = &amp;quot;2026 Dylan Moonfire &amp;lt;contact@mfgames.com&amp;gt;&amp;quot;;
        SPDX-License-Identifier = &amp;quot;CC-BY-4.0&amp;quot;;
    }
    {
        path = &amp;quot;src/**/*.nix&amp;quot;;
        SPDX-FileCopyrightText = &amp;quot;2026 Dylan Moonfire &amp;lt;contact@mfgames.com&amp;gt;&amp;quot;;
        SPDX-License-Identifier = &amp;quot;MIT&amp;quot;;
    }
];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I also consider most of the contents in &lt;code&gt;.config&lt;/code&gt; to be generated files, so an
annotation is added to mark all of those files as public domain unless turned
off with &lt;code&gt;mfgames.project.reuse.ignore-dot-config = false;&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Developer Certificate of Origin&lt;/h3&gt;
&lt;p&gt;I modified the setup so it adds the &amp;ldquo;Signed-off-by&amp;rdquo; to the bottom of Git commit
messages if `mfgames.project.developerCertificateOfOrigin.enable = true&amp;quot;.&lt;/p&gt;
&lt;h3&gt;Rust&lt;/h3&gt;
&lt;p&gt;I prefer a more vertical style of formatting in my code. That usually means I
want braces on their own line for almost everything, including if statements.
This was &amp;ldquo;on the same line&amp;rdquo; in the previous version, but now it defaults to
braces on their own line.&lt;/p&gt;
&lt;h2&gt;Non-Breaking Changes&lt;/h2&gt;
&lt;p&gt;I found a consistent logging program that gives useful messages:
&lt;a href="https://github.com/charmbracelet/gum"&gt;gum&lt;/a&gt;. While the colors are not exactly my
thing, I find it useful to have the same type of messages across the board. So
you'll see a variety of functions now use that for logging, when easily done.&lt;/p&gt;
&lt;h3&gt;Project UUID&lt;/h3&gt;
&lt;p&gt;A few years ago, I stumbled onto a blog post about creating a &amp;ldquo;power ID&amp;rdquo; for
projects. In effect, a UUIDv7 that uniquely identifies a project and make it
easier to distinguish projects of the same same (such as Gemini the Protocol,
Gemini the Cryptocurrency, and Gemini the LLM). That is why you see
&lt;code&gt;019530bd-5065-731f-925b-3961eb7aa613&lt;/code&gt; in almost every blog post and article I
write about &lt;code&gt;mfgames-project-setup-flake&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Since I've embraced that, I also modified this project to generate one if there
is no &lt;code&gt;.config/project-uuid.txt&lt;/code&gt; present in the project. This is intended to be
checked in since it shouldn't change.&lt;/p&gt;
&lt;p&gt;This functionality can be turned off with:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nix"&gt;mfgames.project.project-uuid.enable = false;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Shell Formatting and Checking&lt;/h3&gt;
&lt;p&gt;I also recently started using &lt;code&gt;shfmt&lt;/code&gt; and &lt;code&gt;shellcheck&lt;/code&gt; for my shell scripts.
I've introduced some options for this.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;mfgames.project.shell.enable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mfgames.project.shell.check&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mfgames.project.shell.format&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mfgames.project.shell.includes&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;check&lt;/code&gt; and &lt;code&gt;format&lt;/code&gt; use &lt;code&gt;enable&lt;/code&gt; if not defined. And &lt;code&gt;enable&lt;/code&gt; defaults to
&lt;code&gt;mfgames.project.enable&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;check&lt;/code&gt; is true, then &lt;code&gt;just check-shellcheck&lt;/code&gt; or &lt;code&gt;just check&lt;/code&gt; will run that
utility against the files.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;format&lt;/code&gt; is true, then &lt;code&gt;just format&lt;/code&gt; and &lt;code&gt;just format-shfmt&lt;/code&gt; will format the
shell script, as will commiting a file.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Adding File Ignoring (MfGames Project Setup Flake)</title>
    <link rel="alternate" href="https://mfgames.com/blog/2024/03/07/added-file-ignoring/" />
    <updated>2024-03-07T06:00:00Z</updated>
    <id>https://mfgames.com/blog/2024/03/07/added-file-ignoring/</id>
    <category term="mfgames-project-setup-flake" scheme="https://mfgames.com/categories/" label="MfGames Project Setup Flake" />
    <content type="html">&lt;p&gt;While using this flake, it became obvious that there were a few things that were
still rough around the edges. In specific, we didn't add &lt;code&gt;/.direnv/&lt;/code&gt; to the
&lt;code&gt;.gitignore&lt;/code&gt; file so if we weren't careful, we would be adding the entire
environment into the check-in.&lt;/p&gt;
&lt;p&gt;The other was that some of the generated files (&lt;code&gt;DGO.md&lt;/code&gt; in specific) would be
added via Nixago, then formatted as part of our &lt;code&gt;treefmt&lt;/code&gt; call in &lt;code&gt;lefthook&lt;/code&gt;,
then checked-in. As soon as someone went into the environment, Nixago would
notice that the file was different (because of formatting) and would regenerate
it, leading to an endless loop of generation/formatting.&lt;/p&gt;
&lt;p&gt;In both cases, we needed the ability to add files to various ignore files
(&lt;code&gt;.gitignore&lt;/code&gt; in the first case and &lt;code&gt;.prettierignore&lt;/code&gt; in the second). The v0.1.0
check-in does that, and also avoids reformatting the license files along the
way.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Changed the default .NET formatter (MfGames Project Setup Flake)</title>
    <link rel="alternate" href="https://mfgames.com/blog/2024/08/07/changed-default-dotnet-formatter/" />
    <updated>2024-08-07T05:00:00Z</updated>
    <id>https://mfgames.com/blog/2024/08/07/changed-default-dotnet-formatter/</id>
    <category term="mfgames-project-setup-flake" scheme="https://mfgames.com/categories/" label="MfGames Project Setup Flake" />
    <content type="html">&lt;p&gt;When we first introduced the .NET formatter for C# files, we picked
&lt;a href="https://csharpier.com/"&gt;csharpier&lt;/a&gt; because it was a lot faster than
&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-format"&gt;dotnet format&lt;/a&gt;.
Since then, the opinionated formatting that came with &lt;code&gt;csharpier&lt;/code&gt; was getting in
the way of our style and along with conflcits with
&lt;a href="https://www.jetbrains.com/resharper/"&gt;ReSharper&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The latest is breaking change that switches the default formatter out but
retains the &lt;code&gt;csharpier&lt;/code&gt; formatting for those who want it. To put it back:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nix"&gt;config = inputs.mfgames-project-setup.lib.mkConfig {
    inherit system pkgs;
    dotnet.enable = true;
    dotnet.csharpier = true;
    dotnet.format = false; # Defaults to false, so don't need it.
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To use &lt;code&gt;dotnet format&lt;/code&gt;, the setup would be:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nix"&gt;config = inputs.mfgames-project-setup.lib.mkConfig {
    inherit system pkgs;
    dotnet.enable = true;
    dotnet.format = true;
};
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Update to NixOS 25.05 and more (MfGames Project Setup Flake)</title>
    <link rel="alternate" href="https://mfgames.com/blog/2025/01/10/update-to-nixos-25.05-and-more/" />
    <updated>2025-01-10T06:00:00Z</updated>
    <id>https://mfgames.com/blog/2025/01/10/update-to-nixos-25.05-and-more/</id>
    <category term="mfgames-project-setup-flake" scheme="https://mfgames.com/categories/" label="MfGames Project Setup Flake" />
    <content type="html">&lt;p&gt;Well, it's about time to update the flake to
&lt;a href="https://nixos.org/blog/announcements/2025/nixos-2505/"&gt;NixOS 25.05&lt;/a&gt; just for
general maintenance. There wasn't really anything special with this one, but we
did have a couple minor and one big change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;conform&lt;/code&gt; settings did not put the scopes into the right place&lt;/li&gt;
&lt;li&gt;After experiencs, we added &lt;code&gt;.cache&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;When Rust is enabled, add &lt;code&gt;target&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The other big change is we are adding
&lt;a href="//mfgames.com/mfgames-conventional-commit-rs/"&gt;mfgames-conventional-commit&lt;/a&gt; as
part of the flake. That way, we have a consistent method for updating version
numbers based on conventional commits and it plays well with the intent we have
with &lt;code&gt;conform&lt;/code&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Update to NixOS 24.11 (MfGames Project Setup Flake)</title>
    <link rel="alternate" href="https://mfgames.com/blog/2025/01/10/update-to-nixos-24.11/" />
    <updated>2025-01-10T06:00:00Z</updated>
    <id>https://mfgames.com/blog/2025/01/10/update-to-nixos-24.11/</id>
    <category term="mfgames-project-setup-flake" scheme="https://mfgames.com/categories/" label="MfGames Project Setup Flake" />
    <content type="html">&lt;p&gt;An occasional chores, we've updated the flake to be based off
&lt;a href="https://nixos.org/blog/announcements/2024/nixos-2411/"&gt;NixOS 24.11&lt;/a&gt;. From our
understanding, the flake input could always be changed but this sets up a nice
default using the current, non-deprecated version of NixOS.&lt;/p&gt;
&lt;p&gt;This came with a couple surprising changes, mostly in behavior from our tools.
In specific, &lt;code&gt;treefmt&lt;/code&gt; got a lot noisier with 24.11 when it came to unknown
files in the repository (like &lt;code&gt;.php&lt;/code&gt; files we we don't have set up).
Modifications were made to the linked &lt;code&gt;treefmt.toml&lt;/code&gt; file to not report those to
avoid a wall of text when there were a lot of them.&lt;/p&gt;
</content>
  </entry>
</feed>
