srid / srid/haskell-flake

`mkShellArgs.packages` does not work

Open
#436 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Nix
Stars
240
Forks
27
PR merge metrics
No merged PRs in 30d

Description

An application I'm writing uses an SQLite database, so I wanted to include the sqlite3 executable in the nix develop shell. I passed sqlite-interactive through mkShellArgs and the package is added to the nix store, but the PATH variable is not updated. My flake.nix looks like

{
  outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
    flake-parts.lib.mkFlake { inherit inputs; } {
      systems = nixpkgs.lib.systems.flakeExposed;
      imports = [ inputs.haskell-flake.flakeModule ];

      perSystem = { self', pkgs, ... }: {
        haskellProjects.default = {
          packages = { };
          devShell = {
            tools = hp: { };
            mkShellArgs = {
              packages = [ pkgs.sqlite-interactive ];
            };
          };
        };

        packages.default = self'.packages.imgr;
      };
    };

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    haskell-flake.url = "github:srid/haskell-flake";
  };
}

I currently use a shellHook as a work-around:

shellHook = "export PATH=$PATH:${pkgs.sqlite-interactive}/bin"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mkShellArgs configuration in the reported flake.nix and reproduce the issue with nix develop. Trace how packages is passed into the development shell, then verify that the resulting shell PATH includes the sqlite3 executable without relying on shellHook.

Written by the indexing model from the issue text.

Assessment

Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.