- Change into the directory of the package you want to install
- Run the following command to build the package
nix-build -E 'with import <nixpkgs> { }; callPackage ./default.nix { }'
- Add following lines to nixos configuration.
nixpkgs.config.packageOverrides = pkgs: {
<package> = pathToRepo/<package>/default.nix { };
};
- Then add your package to your system package list like any other package.