Hello I am trying to nix for a dev env and for ci. I’d like to declare the common packages just once rather than in each shell. Im just not “getting it” - the flowing error on “infinite recursion encountered” at the with pkgs; [
line.
What is the right way to do this?
{
inputs.devshell.url = "github:numtide/devshell";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = github:nixos/nixpkgs/nixos-22.11;
outputs = { self, flake-utils, devshell, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlay ];
} //
with pkgs; [
dprint
nodejs
];
in {
devShells.default = pkgs.devshell.mkShell {
imports = [ (pkgs.devshell.importTOML ./devshell.toml) ];
};
devShells.ci = pkgs.devshell.mkShell {
imports = [ (pkgs.devshell.importTOML ./devshell-ci.toml) ];
};
}
);
}