Nix
Basic shell.nix
snippet
{pkgs ? import <nixpkgs> {}}:
with pkgs; let
in
mkShell {
buildInputs = [
elixir
rebar3
erlang_26
gleam
];
}
nix fmt
a file
In order to use nix fmt
, I needed to have a flake.nix
with a specification for the formatterThis snippet comes from here. Retrieved 2024-04-20:
{
outputs = { nixpkgs, self }: {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
};
}
Then I can invoke a file like this:
nix fmt shell.nix