1
0
Fork 0
mirror of https://github.com/NixOS/nix.dev.git synced 2024-10-18 14:32:43 -04:00
nix.dev/source/faq.rst

121 lines
3.4 KiB
ReStructuredText
Raw Normal View History

2016-04-25 06:07:55 -04:00
Frequently Asked Questions
==========================
2016-05-20 11:24:40 -04:00
Nix
***
2016-04-25 06:07:55 -04:00
2016-12-06 05:45:47 -05:00
Secrets?
--------
2016-05-20 11:24:40 -04:00
How do I fix: error: querying path in database: database disk image is malformed
--------------------------------------------------------------------------------
Try:
sqlite3 /nix/var/nix/db/db.sqlite "pragma integrity_check"
Which will print the errors in the database. If the errors are due to missing
references, the following may work:
mv /nix/var/nix/db/db.sqlite /nix/var/nix/db/db.sqlite-bkp
sqlite3 /nix/var/nix/db/db.sqlite-bkp ".dump" | sqlite3 /nix/var/nix/db/db.sqlite
2016-05-20 11:53:05 -04:00
How nix decides which parts of the environment affect a derivation and its sha256 hash
2016-05-20 11:24:40 -04:00
--------------------------------------------------------------------------------------
2016-12-06 05:45:47 -05:00
How to build reverse dependencies of a package?
-----------------------------------------------
nox-review wip
I'm getting: writing to file: Connection reset by peer
------------------------------------------------------
Too big files in src, out of resources (HDD space, memory)
2016-05-20 11:53:05 -04:00
2016-05-20 11:24:40 -04:00
What are channels and different branches on github?
---------------------------------------------------
2016-12-06 05:45:47 -05:00
Subquestion: how stable is unstable?
2016-05-20 11:53:05 -04:00
2016-05-20 11:24:40 -04:00
How do I mirror tarballs?
-------------------------
2016-05-20 11:30:40 -04:00
We have a content-addressed tarball mirror at tarballs.nixos.org for this
2016-05-20 11:24:40 -04:00
purpose. "fetchurl" will automatically use this mirror to obtain files by hash.
However:
* The mirroring script was not running lately. I've revived it so 16.03 tarballs
are mirrored now
(https://github.com/NixOS/nixos-org-configurations/commit/a17ccf87deae4fb86639c8d34ab5938edd68d8c4).
2016-05-20 11:53:05 -04:00
2016-05-20 11:24:40 -04:00
* The mirroring script only copies tarballs of packages in the Nixpkgs Hydra
jobset. Since moreutils is not part of the jobset, it's not mirrored. This can
be fixed by adding a meta.platforms attribute to moreutils.
2016-05-20 11:53:05 -04:00
Are there some known impurities in builds?
------------------------------------------
Yes.
- CPU (we try hard to avoid compiling native instructions, but rather hardcode supported ones)
- current time/date
- FileSystem (ext4 has a known bug creating `empty files on power loss <https://github.com/NixOS/nixpkgs/issues/15581>`_)
- Kernel
- Timing behaviour of the build system (parallel Make not getting correct inputs in some cases)
2016-05-20 11:24:40 -04:00
2016-05-21 15:52:47 -04:00
2016-12-06 05:45:47 -05:00
What's the reccomended process for building custom packages. E.g. if I git clone nixpkgs how do I use the cloned repo to define new / updated packages?
--------------------------------------------------
2016-05-21 15:52:47 -04:00
NixOS
*****
How to build my own ISO?
------------------------
http://nixos.org/nixos/manual/index.html#sec-building-cd
2016-12-06 05:45:47 -05:00
How do I mix channels for packages?
-----------------------------------
2016-05-20 11:24:40 -04:00
Hydra
*****
What to do if Hydra is down or unreachable?
-------------------------------------------
2016-05-20 11:53:05 -04:00
It's best to set binary cache timeout:
.. code-block:: nix
nix.extraOptions = ''
connect-timeout = 10
'';
2016-05-20 11:24:40 -04:00
2016-12-06 05:45:47 -05:00
2016-05-20 11:24:40 -04:00
How do I add a new binary cache?
--------------------------------
Using `NixOS`:
2016-05-20 11:53:05 -04:00
.. code-block:: nix
trustedBinaryCaches = [ "https://cache.nixos.org" "https://hydra.snabb.co" ];
binaryCaches = trustedBinaryCaches;
binaryCachePublicKeys = [ "hydra.snabb.co-1:zPzKSJ1mynGtYEVbUR0QVZf9TLcaygz/OyzHlWo5AMM=" ];
2016-05-20 11:24:40 -04:00
Using `Nix`:
2016-05-20 11:53:05 -04:00
.. code-block:: bash
2016-05-20 11:24:40 -04:00
2016-05-20 11:53:05 -04:00
$ echo "trusted-binary-caches = https://hydra.snabb.co" >> /etc/nix/nix.conf
$ nix-build helpers/bench.nix --option extra-binary-caches https://hydra.snabb.co`
2016-05-20 11:24:40 -04:00