by: zimbatm https://zimbatm.com
slide: https://zimbatm.com/talks/howto-package-with-nix
https://github.com/NixOS/nixpkgs
{ name
, system
, builder
, args ? [ ]
, outputs ? [ "out" ]
, __structuredAttrs ? false
, outputHash ? null
, outputHashAlgo ? null
, outputHashMode ? null
, allowedReferences ? null
, disallowedReferences ? null
, allowedRequisites ? null
, disallowedRequisites ? null
, maxSize ? null
, maxClosureSize ? null
, ...
}@drvAttrs:
let
self = {
all = [ self ];
name = name;
outPath = ...;
drvPath = ..."
drvAttrs = drvAttrs
type = "derivation";
outputName = "out";
};
in
self
pkgs/stdenv/generic/setup.sh
{ pname ? null
, version ? null
, name = "${pname}-${version}"
, buildInputs ? []
, nativeBuildInputs ? []
, phases = [
"unpackPhase"
"patchPhase"
"configurePhase"
"buildPhase"
"checkPhase"
"installPhase"
"fixupPhase"
"installCheckPhase"
"distPhase"
]
, meta = {}
, passthru ? {}
}: ...
{
# unpackPhase
, src ? null
# patchPhase
, patches ? []
# configurePhase
, configureFlags ? []
, cmakeFlags ? []
# checkPhase
, doCheck ? false
# installPhase
, outputs ? [ "out" ]
# installCheckPhase
, doInstallCheck ? false
}: ...
{
buildInputs = [ cmake ];
}
search for make
cntr support
breakpointHook
{ buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
name = "vgo2nix-${version}";
version = "example";
src = fetchFromGitHub { ... }; # Incomplete
goDeps = ./deps.nix;
}
_____ < EOF > ----- \ (\/) \ (_o | / | \ \______ \ )o /|----- | \| /|