andir / npins

Nix dependency pinning. Very similar to Niv but has a few features that I personally wanted.
European Union Public License 1.2
164 stars 12 forks source link

make npins directory configurable in the package recipe #81

Closed fricklerhandwerk closed 1 month ago

fricklerhandwerk commented 1 month ago

this is convenient if you want to manage sources in a custom directory, and have npins in the shell environment for all contributors to use:

{ pkgs }:
let
  custom-npins = pkgs.npins.override { directory = "nix"; };
in
pkgs.mkShell { packages = [ custom-npins ]; }
piegamesde commented 1 month ago

I agree with making this an environment variable, but why at build time though? (Also nit but IMO this is not build time, but packaging time or something, as the actual binary is not affected by it)

fricklerhandwerk commented 1 month ago

Fixed the wording in the commit. The directory is already configurable through an environment variable. This change merely sets a customisable default value in the package recipe so the thing can be used in a shell without going lenghts as I did here, just to tell npins to work in ./nix:

piegamesde commented 1 month ago

hm then I don't fully understand your use case, why couldn't you just export an env variable in the shell hook?

fricklerhandwerk commented 1 month ago

🤦 Of course.


{ pkgs }:
pkgs.mkShell {
  packages = with pkgs; [
    npins
  ];
  env = {
    NPINS_DIRECTORY = "nix";
  };
}