Skip to content

Commit

Permalink
docs: Use defaultText
Browse files Browse the repository at this point in the history
This is a bit more useful and passes the stricter rules I apply
in flake-parts docs.
  • Loading branch information
roberth committed Jan 2, 2025
1 parent 8d13e1f commit e17a6a6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/outputs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
ncdu = pkgs.ncdu;
};
};
defaultText = lib.literalExpression ''
{
git = pkgs.git;
foo = {
ncdu = pkgs.ncdu;
};
}
'';
description = ''
Nix outputs for `devenv build` consumption.
'';
Expand Down
2 changes: 2 additions & 0 deletions src/modules/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ let
type = types.package;
description = "The package to use to run the script.";
default = pkgs.bash;
defaultText = lib.literalExpression "pkgs.bash";
};
binary = lib.mkOption {
type = types.str;
description = "Override the binary name if it doesn't match package name";
default = config.package.pname;
defaultText = lib.literalExpression "config.package.pname";
};
description = lib.mkOption {
type = types.str;
Expand Down
2 changes: 2 additions & 0 deletions src/modules/tasks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ let
type = types.str;
description = "Override the binary name if it doesn't match package name";
default = config.package.pname;
defaultText = lib.literalExpression "config.package.pname";
};
package = lib.mkOption {
type = types.package;
default = pkgs.bash;
defaultText = lib.literalExpression "pkgs.bash";
description = "Package to install for this task.";
};
command = lib.mkOption {
Expand Down
1 change: 1 addition & 0 deletions src/modules/top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ in
type = types.package;
description = "The stdenv to use for the developer environment.";
default = pkgs.stdenv;
defaultText = lib.literalExpression "pkgs.stdenv";
};

unsetEnvVars = lib.mkOption {
Expand Down

0 comments on commit e17a6a6

Please sign in to comment.