std
Add definitions from the Standard DevOps framework to your flake.
It organizes and disciplines your Nix and thereby speeds you up. It also comes with great horizontal integrations of high quality vertical DevOps tooling crafted by the Nix Ecosystem.
Installation
To use these options, add to your flake inputs:
std.url = "github:divnix/std";
and inside the mkFlake
:
imports = [
inputs.std.flakeModule
];
Run nix flake lock
and you're set.
Options
std.grow
Orderly ‘grow’ a project from Standard Cells & Cell Blocks.
Find the glossary here.
Find a good walk-through here.
And the general documentation here.
Type: submodule
Declared by:
std.grow.cellBlocks
Declaration of all Cell Blocks used in the project.
Type: list of cell block
Example:
with std.blockTypes; [
(installables "packages" {ci.build = true;})
(devshells "devshells" {ci.build = true;})
(containers "containers" {ci.publish = true;})
]
Declared by:
std.grow.cellsFrom
Where Standard discovers Cells from.
Type: path
Example: ./nix
Declared by:
std.grow.nixpkgsConfig
Nixpkgs configuration applied to inputs.nixpkgs
(if that
input exists).
Type: attribute set
Example:
{ allowUnfree = true; }
Declared by:
std.harvest
Harvest Standard outputs into a Nix-CLI-compatible form (a.k.a. the ‘official’ flake schema).
Type: attribute set of harvest path(s) as a list of strings or a list of lists of strings
Example:
{
devShells = [ "toolchain" "devshells" ];
packages = [
# a list of lists can "harvest" from multiple cells
[ "app1" "packages" ]
[ "app2" "packages" ]
];
}
Declared by:
std.pick
Pick Standard outputs. Like harvest
but remove the
system for outputs that are system agnostic.
Type: attribute set of harvest path(s) as a list of strings or a list of lists of strings
Example:
{
lib = [ "utils" "library" ];
}
Declared by:
std.winnow
Winnow Standard outputs. Like harvest
, but with filters
from the predicates of winnowIf
.
Type: attribute set of harvest path(s) as a list of strings or a list of lists of strings
Example:
{
packages = [ "app3" "packages" ];
}
Declared by:
std.winnowIf
Set the predicates for winnow
.
Type: attribute set of function that evaluates to a(n) function that evaluates to a(n) boolean
Example:
{
packages = n: v: n == "foo";
}
Declared by: