feat(flake): use sentence case on descriptions

This commit is contained in:
Artur Manuel 2025-03-04 14:05:58 +00:00
commit a306e192a4
Signed by: amadaluzia
SSH key fingerprint: SHA256:Zwg7gBuZyaG48ucAZneJwltiXu0+tJb7c3lYt9AYlLg
3 changed files with 17 additions and 6 deletions

View file

@ -1,9 +1,20 @@
{
description = "Flake Template Hell";
outputs = _: {
outputs = _: let
stringToCharacters = str: builtins.genList (p: builtins.substring p 1 str) (builtins.stringLength str);
upperCase = stringToCharacters "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
lowerCase = stringToCharacters "abcdefghijklmnopqrstuvwxyz";
toUpper = builtins.replaceStrings lowerCase upperCase;
toLower = builtins.replaceStrings upperCase lowerCase;
addContextFrom = src: target: builtins.substring 0 0 src + target;
toSentenceCase = str: let
firstChar = builtins.substring 0 1 str;
restChars = builtins.substring 1 (builtins.stringLength str) str;
in addContextFrom str (toUpper firstChar + toLower restChars);
in {
templates = builtins.mapAttrs (name: _: {
path = ./templates/${name};
description = "Template for ${name} projects.";
description = "Template for ${toSentenceCase name} projects.";
}) (builtins.readDir ./templates);
};
}

View file

@ -3,8 +3,8 @@
}: let
ps = python3Packages;
in ps.buildPythonApplication {
pname = "sm64pcport-for-dummies";
version = "2025.03";
pname = "REPLACE_ME";
version = "REPLACE_VER";
src = builtins.filterSource (path: _: baseNameOf path != ".git") ../.;

View file

@ -1,7 +1,7 @@
[project]
name = "REPLACE_ME"
description = "Dumbed-down frontend for the SM64 PC Port compiler."
version = "2025.03"
description = "REPLACE DESC"
version = "REPLACE_VER"
[project.scripts]
REPLACE_ME = "REPLACE_ME.__main__:main"