lorri icon indicating copy to clipboard operation
lorri copied to clipboard

Can lorri shell pass attributes to the nix-shell?

Open schonfinkel opened this issue 5 years ago • 1 comments

This is an example shell.nix:

{ pkgs ? import <nixpkgs> {} }:

let
  env = python: pkgs.poetry2nix.mkPoetryEnv {
    python = python;
    pyproject = ./pyproject.toml;
    poetrylock = ./poetry.lock;
  };
in
{
  py38 = env pkgs.python38;
}

I can spawn a Python 3.8 shell with nix-shell -A py38, can the same be achieved with lorri shell? There doesn't seem to be as many options.

$ lorri shell --help                                                 
lorri-shell 1.1.1
Graham Christensen <[email protected]>
Open a new project shell

USAGE:
    lorri shell [FLAGS] [OPTIONS]

FLAGS:
        --cached     If true, load environment from cache
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --shell-file <nix_file>    The .nix file in the current directory to use [default: shell.nix]

schonfinkel avatar Aug 05 '20 22:08 schonfinkel

We could add an --attr attribute to mirror the one in nix-shell.

On Thu, Aug 6, 2020 at 12:16 AM Marcos Benevides [email protected] wrote:

This is an example shell.nix:

{ pkgs ? import {} }:

let makePoetryEnv = python: pkgs.poetry2nix.mkPoetryEnv { python = python; pyproject = ./pyproject.toml; poetrylock = ./poetry.lock; editablePackageSources = { app = ./app; }; }; makeDevEnv = python: pkgs.mkShell { buildInputs = [ (makePoetryEnv python) ]; PATH = "$PWD/.venv/bin:$PATH"; }; in { py38 = makeDevEnv pkgs.python38; }

I can spawn a Python 3.8 shell with nix-shell -A py38, can the same be achieved with lorri shell? There doesn't seem to be as many options.

$ lorri shell --help lorri-shell 1.1.1 Graham Christensen [email protected] Open a new project shell

USAGE: lorri shell [FLAGS] [OPTIONS]

FLAGS: --cached If true, load environment from cache -h, --help Prints help information -V, --version Prints version information

OPTIONS: --shell-file <nix_file> The .nix file in the current directory to use [default: shell.nix]

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/target/lorri/issues/461, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYB5ZSGOW3IWTIRCIWRHLLR7HK3VANCNFSM4PV6ULYQ .

Profpatsch avatar Aug 06 '20 12:08 Profpatsch