Skip to content

Commit

Permalink
nix: Add om init template params
Browse files Browse the repository at this point in the history
  • Loading branch information
srid authored Sep 19, 2024
1 parent 7f6a766 commit 92939a9
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions nix/modules/template.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,50 @@
{ inputs, ... }:

{
flake.templates.default = {
description = "A batteries-included Rust project template for Nix";
path = builtins.path { path = inputs.self; };
flake = rec {
templates.default = {
description = "A batteries-included Rust project template for Nix";
path = builtins.path { path = inputs.self; };
};

# https://omnix.page/om/init.html#spec
om.templates.rust-nix-template = {
template = templates.default;
params = [
{
name = "package-name";
description = "Name of the Rust package";
placeholder = "rust-nix-template";
}
{
name = "author";
description = "Author name";
placeholder = "Sridhar Ratnakumar";
}
{
name = "author-email";
description = "Author email";
placeholder = "srid@srid.ca";
}
{
name = "vscode";
description = "Include the VSCode settings folder (./.vscode)";
paths = [ ".vscode" ];
value = true;
}
{
name = "github-ci";
description = "Include GitHub Actions workflow configuration";
paths = [ ".github" ];
value = true;
}
{
name = "nix-template";
description = "Keep the flake template in the project";
paths = [ "**/template.nix" ];
value = false;
}
];
};
};
}

0 comments on commit 92939a9

Please sign in to comment.