Using package `dvtm` with custom configuration

Hi,

I would like to use the package dvtm with a custom configuration, which is done by recompiling with a custom config.h file. According to PR #16560, this is possible.

Here is the nix expression for this package:

Unfortunately I do not understand where the file config.h should be placed, or how customConfig should be used. My question is as follows:

What should I add to my configuration.nix in order to use dvtm with a custom configuration file?

I realize this is a rather specific question, unfortunately I’m lacking some basic knowledge. Any help would be much appreciated.

You need to override the dvtm package (probably in your nixpkgs config file).

{
  packageOverrides = pkgs: rec {
        mydvtm =  pkgs.dvtm.override {
          customConfig = pkgs.lib.readFile ./dvtm-config.h;
        };
  };
}

(On mobile, sorry for terseness)

What @luke-clifton said should work. However, it’s simpler and clearer to just do the override where you’re referencing it rather than modifying the package set:

environment.systemPackages = with pkgs; [ …
  (dvtm.override {
     customConfig = builtins.readFile ./dvtm-config.h;
  })
… ]
1 Like

Thank you both, I used @lheckemann’s solution and it works!

1 Like