Nixpkgs/Building RPM DEB with nixpkgs: Difference between revisions
imported>Matthiasbeyer Created page with initial information |
imported>Das-g m wikify inline code snippets. (Backticks are MarkDown syntax, not MediaWiki syntax.) |
||
Line 21: | Line 21: | ||
In the setting the author of this article used, the host machine was a CentOS 7 amd64 machine running in vmware. | In the setting the author of this article used, the host machine was a CentOS 7 amd64 machine running in vmware. | ||
On the machine, the nix package manager was installed via the | On the machine, the nix package manager was installed via the <code>curl->sh</code> provided on the nixos.org website. | ||
The configuration file | The configuration file <code>/etc/nix/nix.conf</code> was edited for the following contents: | ||
<syntaxHighlight> | <syntaxHighlight> | ||
sandbox = false | sandbox = false | ||
Line 36: | Line 36: | ||
The author used a simple approach: | The author used a simple approach: | ||
1. Clone the official nixpkgs repository into | 1. Clone the official nixpkgs repository into <code>~/nixpkgs</code> | ||
2. Add a file to the nixpkgs repository | 2. Add a file to the nixpkgs repository <code>./deb.nix</code> with the following contents: | ||
(In this scenario, ncurses was built for testing the whole approach) | (In this scenario, ncurses was built for testing the whole approach) | ||
Line 55: | Line 55: | ||
</syntaxHighlight> | </syntaxHighlight> | ||
and then this file was called: | and then this file was called: <code>nix-build ./deb.nix</code>. | ||
This loads the relevant disk images from the channel mirror and spins up the Qemu VM to build the package. | This loads the relevant disk images from the channel mirror and spins up the Qemu VM to build the package. | ||
The deb file (in this case, as we're building a deb with the expression from above) is located in ./result/debs/ after a successful build. | The deb file (in this case, as we're building a deb with the expression from above) is located in ./result/debs/ after a successful build. |