Hi everybody,
I’ve started using flake-based development shells (with nix-direnv
) using this pattern in flake.nix
:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in with pkgs; {
devShell = mkShell { buildInputs = [ hugo go ]; };
});
}
(and then use flake
in .envrc
).
This setup works really well for me, but I’m a bit annoyed about the amount of boilerplate that I have to add to every repository, if all I want is a few packages auto-installed.
Is there a way to write the same thing more concisely?
Mike