Skip to content

Jinx on NixOS #103

Description

@patrl

Thanks for the awesome package!

If someone tries install jinx in emacs while running NixOS, pkg-config won't find libenchant, even if the enchant and pkg-config packages are installed at the system level. This is due to a quirk of how header files work on NixOS (https://nixos.wiki/wiki/C). In order to successfully compile jinx, I had to write a shell.nix file with the following contents, and placed it in the jinx build dir:

with import <nixpkgs> {};
stdenv.mkDerivation {
  name = "env";
  nativeBuildInputs = [ pkg-config ];
  buildInputs = [
    enchant
  ];
}

Entering into the nix shell then correctly sets the necessary environment variable for pkg-config, and jinx can be compiled using the script in jinx.el. In some sense the solution is very simple, but incorporating it into the package would involve an ad-hoc addition to the compilation script for NixOS, which I understand you may want to avoid. Some existing packages which use native compilation, such as pdf-tools, do exactly this - by using a more complicated build procedure which detects whether or not the user is running NixOS and enters into a shell as necessary; see, e.g., https://github.com/vedang/pdf-tools/blob/master/server/autobuild.

If you decide that this isn't a problem that the package should address, fair enough. Hopefully this will be useful to other NixOS users who encounter the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions