From 9b96ed7a25666bc987f9d76f676f4f44f867ca11 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Mon, 19 Jan 2026 14:36:06 -0500 Subject: [PATCH 1/2] docs: make template descriptions nicer --- flake.nix | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index ac9ebb7..d645373 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,15 @@ concatMapAttrs = func: attr: foldl' (x: y: x // y) {} (map func attr); + # Display names of languages for template descriptions + display-names = { + bash = "Bash"; + fish = "Fish"; + c = "C"; + python = "Python"; + rust = "Rust"; + }; + # Template Aliases # Used to pick default template for each language aliases = { @@ -33,19 +42,18 @@ map (l: [ subd ] ++ l) (flakeSubdirs /${dir}/${subd})) (subdirs dir); - generateDesc = subds: - "${head subds} template - ${concatStringsSep ", " (tail subds)}"; + generateDesc = fields: + let + lang = head fields; + in "${display-names.${lang} or lang} template (${concatStringsSep ", " (tail fields)})"; in { - templates = concatMapAttrs (subds: { - ${concatStringsSep "_" subds} = { - description = generateDesc subds; + templates = concatMapAttrs (fields: { + ${concatStringsSep "_" fields} = { + description = generateDesc fields; path = filterSource (p: _: !(elem (baseNameOf p) template-ignore)) - (foldl' (dir: subd: /${dir}/${subd}) ./. subds); + (foldl' (dir: subd: /${dir}/${subd}) ./. fields); }; - }) (flakeSubdirs ./.) // mapAttrs (from: to: - self.templates.${to} // { - description = generateDesc (filter (p: p != []) (split "_" to)); - }) aliases; + }) (flakeSubdirs ./.) // mapAttrs (from: to: self.templates.${to}) aliases; }; } From 13fb093d33306341b175d5221bf77996bb9f947e Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Mon, 19 Jan 2026 14:38:14 -0500 Subject: [PATCH 2/2] docs: update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a74ecfd..c2a3e12 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ this is just the name of the programming language you want to use; the repository will pick a recommended default template for that language. If you want more control over the generated repository, you may select a -specific template instead. Templates names are organized by underscore-separated +specific template instead. Template names are made of underscore (`_`) separated *fields*; the number of fields may very depending on the language, but typically there are three or four: