Nixpkgs/Create and debug packages: Difference between revisions

Artturin (talk | contribs)
Peasant (talk | contribs)
m Updated old link to remove need for redirect
 
(3 intermediate revisions by 3 users not shown)
Line 3: Line 3:
There is a chapter about hacking packages and modules in the NixOS manual: [http://nixos.org/nixos/manual/index.html#ch-development development]
There is a chapter about hacking packages and modules in the NixOS manual: [http://nixos.org/nixos/manual/index.html#ch-development development]


Writing packages is covered in [https://nixos.org/manual/nixpkgs/stable/#chap-quick-start quick start] and writing modules is covered in the [http://nixos.org/nixos/manual manual]
Writing packages is covered in [https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md nixpkgs/blob/master/pkgs/README.md] and writing modules is covered in the [http://nixos.org/nixos/manual manual]


If you've read the manual and still don't know how to go about creating a package, read on.
If you've read the manual and still don't know how to go about creating a package, read on.
Line 16: Line 16:


# Fork the repo (e.g. click the fork button on https://github.com/nixos/nixpkgs).
# Fork the repo (e.g. click the fork button on https://github.com/nixos/nixpkgs).
# Clone your fork <code><nowiki>git clone --depth 1 https://github.com/YOURNAME/nixpkgs.git</nowiki></code>
# Clone your fork <code>git clone --filter=blob:none <nowiki>https://github.com/YOURNAME/nixpkgs.git</nowiki></code>
# Hack hack hack
# Hack hack hack
# Push your changes to your fork
# Push your changes to your fork
Line 249: Line 249:
</syntaxhighlight>
</syntaxhighlight>


{{Note|you do not need to run $preConfigurePhase explicitly as it is run, when running configurePhase already.}}
{{Note|You do not need to run $preConfigurePhase explicitly, as it will already be run implicitly when running configurePhase.}}


To list all functions which are declared in '''set''':
To list all functions which are declared in '''set''':
Line 396: Line 396:
   }:
   }:
   stdenv.mkDerivation {
   stdenv.mkDerivation {
    pname = "something";
    version = "1";
     strictDeps = true;
     strictDeps = true;
     # host/target agnostic programs
     # host/target agnostic programs