This is the sequel of this question.
I've a bash list of command that generated a file nix directory when these commands are executed.
mkdir nix
rm -fr node_module
node2nix -16 --development --input package.json --lock package-lock.json --node-env ./nix/node-env.nix --composition ./nix/default.nix --output ./nix/node-package.nix
I have flake.nix file that use nix to create an envirnoment.
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
#npm_pack = import (./nix );
npm_pack = import ./nix { inherit pkgs ;};
in with pkgs;{
#devShell = mkShell { buildInputs = [ npm_pack.package ];};
devShell = npm_pack.shell;
});
}
It is executed with this command:
nix develop --extra-experimental-features nix-command --extra-experimental-features flakes --ignore-environment
Is there a way to modify the flake.nix file to create the nix directory and then do the work it has to do with nix directory.
I know that I could ONE create bash file (see the in answer why I don't like it)
In order to create the flake.nix I thinking about using something like a sheelhook in the beginning.I need too to be sure that node and node2nix are installed. Therefore I need those line
node2nix.url ="github:svanderburg/node2nix"; # in the input
nodejs = pkgs.nodejs-16_x; #in the output