1{ inputs, ... }:
2
3{
4 flake = rec {
5 templates.default = {
6 description = "A batteries-included Rust project template for Nix";
7 path = builtins.path { path = inputs.self; };
8 };
9
10 # https://omnix.page/om/init.html#spec
11 om.templates.jacquard = {
12 template = templates.default;
13 params = [
14 {
15 name = "package-name";
16 description = "Name of the Rust package";
17 placeholder = "jacquard";
18 }
19 {
20 name = "author";
21 description = "Author name";
22 placeholder = "Orual";
23 }
24 {
25 name = "author-email";
26 description = "Author email";
27 placeholder = "orual@nonbinary.computer";
28 }
29 {
30 name = "vscode";
31 description = "Include the VSCode settings folder (./.vscode)";
32 paths = [ ".vscode" ];
33 value = true;
34 }
35 {
36 name = "github-ci";
37 description = "Include GitHub Actions workflow configuration";
38 paths = [ ".github" ];
39 value = true;
40 }
41 {
42 name = "nix-template";
43 description = "Keep the flake template in the project";
44 paths = [ "**/template.nix" ];
45 value = false;
46 }
47 ];
48 tests = {
49 default = {
50 params = {
51 package-name = "qux";
52 author = "John";
53 author-email = "john@example.com";
54 };
55 asserts = {
56 source = {
57 "Cargo.toml" = true;
58 "flake.nix" = true;
59 ".github/workflows/ci.yml" = true;
60 ".vscode" = true;
61 "nix/modules/template.nix" = false;
62 };
63 packages.default = {
64 "bin/qux" = true;
65 };
66 };
67 };
68 };
69 };
70 };
71}