Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make npins directory configurable in the package recipe #81

Closed

Conversation

fricklerhandwerk
Copy link
Contributor

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 ]; }

@fricklerhandwerk fricklerhandwerk force-pushed the override-directory branch 2 times, most recently from cfc1619 to 240c1ed Compare June 2, 2024 21:25
@piegamesde
Copy link
Collaborator

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 fricklerhandwerk changed the title make npins directory configurable at build time make npins directory configurable in the package recipe Jun 3, 2024
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:

```nix
{ pkgs }:
let
  custom-npins = pkgs.npins.override { directory = "nix"; };
in
pkgs.mkShell { packages = [ custom-npins ]; }

```
@fricklerhandwerk
Copy link
Contributor Author

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
Copy link
Collaborator

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

@fricklerhandwerk
Copy link
Contributor Author

🤦 Of course.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants