diff --git a/flake.nix b/flake.nix index 6b77cf0..f4690dd 100644 --- a/flake.nix +++ b/flake.nix @@ -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); }; } diff --git a/templates/python/flake/package.nix b/templates/python/flake/package.nix index d0fffa9..b90e4ed 100644 --- a/templates/python/flake/package.nix +++ b/templates/python/flake/package.nix @@ -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") ../.; diff --git a/templates/python/pyproject.toml b/templates/python/pyproject.toml index ed4737a..0a1ba34 100644 --- a/templates/python/pyproject.toml +++ b/templates/python/pyproject.toml @@ -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"