Tips and tricks for one who wants to write expressions to contribute to NixOS/nixpkgs .
nix-build <PATH_TO_NIXPKGS> -A <PACKAGE>
# to build
nix-build -E "with import <nixpkgs>{}; <PACKAGE>.override { <PARAMETER> = <VALUE>; }"
# for a shell
nix-shell -p "with import <nixpkgs> {}; pkgs.<PACKAGE>.override{ <PARAMETER> = <VALUE>; }"
git diff > nixpkgs/pkgs/the/package/0001-changes.patch
{
packageOverrides = pkgs: {
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
repoOverrides = {
angr = import /home/pamplemousse/Workspace/angr/nixpkgs {};
};
};
};
}
git fetch nixos pull/<PR #>/head
cat << __EOF__ > mypkgs.nix && nix-build mypkgs.nix 2>/dev/null
{ pkgs ? import ./. {}
, maintainer ? "pamplemousse"
}:
with pkgs.lib;
filterAttrs (name: value:
(builtins.tryEval value).success &&
elem maintainers.\${maintainer} (value.meta.maintainers or [])
) pkgs
__EOF__
({ modulesPath, ...}: {
disabledModules = [
(modulesPath + "<path to the module in nixpkgs>.nix")
];
imports = [
<path to your module>.nix
];
})