Skip to content

Inject system dependency while still using common overrrides #87

@lokegustafsson

Description

@lokegustafsson

I have a flake.nix along the lines of

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
        myGems = pkgs.bundlerEnv {
          name = "somegems";
          ruby = pkgs.ruby;
          gemdir = ./.;
          # Uncommenting this breaks things by removing all default overrides. How can I avoid that?
          /*
          gemConfig.some-gem-without-default-override = attrs: {
            buildInputs = with pkgs; [ ... ]
          }
          */
        };
      in {
        devShell = pkgs.mkShell {
          nativeBuildInputs = [ pkgs.myGems ];
        };
      });
}

Where gemset.nix contains gems that require injecting native dependencies. Some of these have defined overrides in https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/ruby-modules/gem-config/default.nix, some do not. I want to define some overrides for packages that do not. My problem is that doing so disables all the universal overrides, and I have no interest in duplicating the entirety of that file in mine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions