I am developing a package on GitHub and would like to make it available to my own NixOS system. As such I am writing
# configuration.nix
...
environment.systemPackages = [
...
(callPackage (pkgs.fetchFromGitHub {
owner = "wgunderwood";
repo = "tex-fmt";
rev = "...";
sha256 = "...";
}) {})
...
];
This works fine, and the binary tex-fmt
becomes available in my path. However I would like the callPackage
code to be in another file to reduce clutter, and so tried
# configuration.nix
...
environment.systemPackages = [
...
(callPackage ./tex-fmt.nix {})
...
];
with a new file
# tex-fmt.nix
{pkgs ? import <nixpkgs> {}}:
pkgs.fetchFromGitHub {
owner = "wgunderwood";
repo = "tex-fmt";
rev = "...";
sha256 = "...";
}
This builds without error, but the binary tex-fmt
is not present in my path. Further, nix-tree
is unable to locate the tex-fmt
anywhere. The file tex-fmt.nix
is definitely being read as it requires a correct sha256
. The repository at https://github.com/WGUNDERWOOD/tex-fmt
contains a default.nix
which uses buildRustPackage
. Any ideas why these approaches differ, and how I can fix it?