This is an overview of the nix commands for now. Maybe this will grow into a bigger example.
First notice that the packages that we built are included in the environment.
hello_world
programspinsfast
python program is installed for the correct python version and included in our environmentnumpy
, scipy
, and jupyterlab
(along with all dependencies)Lets quickly inspect what we have
# check output of hello_world program
! hello_world
hello world
# notice how clean nix leaves our directory
# everything is copied to an isolated build directory
# for building
! ls ../
! ls ../example4/
! ls ../example4/hello_world/
default.nix example4 notebooks README.md hello_world spinsfast.nix default.nix hello_world.c Makefile
import spinsfast
import numpy
import scipy
import jupyterlab
import sys
print(sys.version)
3.6.6 (default, Jun 27 2018, 05:47:41) [GCC 7.3.0]
# here we learn the magic that nix does
# all nix builds are isolated (including network) and only provided the recources they specify as dependencies
# all nix builds are put in a flat directory `/nix/store/*`
# by sacrificing POSIX compatibility we get many useful features
# here nix sets `PYTHONPATH` to all of our python dependencies.
sys.path
['', '/nix/store/3aqb8gxmjy4bd98zh01as7nrcyszf3c2-python3.6-numpy-1.15.1/lib/python3.6/site-packages', '/nix/store/hy65mn4wjswqih75gfr6g4q3xgqdm325-python3-3.6.6/lib/python3.6/site-packages', '/nix/store/2a8lm8w8ihlhnwid4xq6amvi755dbyz7-python3.6-setuptools-40.2.0/lib/python3.6/site-packages', '/nix/store/w3424y8ggxky8wjy8axqi024gf7ivbi2-python3.6-scipy-1.1.0/lib/python3.6/site-packages', '/nix/store/irnrpx2lkzajhhbwki2rwqvbzmh75as1-python3.6-jupyterlab-0.34.6/lib/python3.6/site-packages', '/nix/store/bwi2i35g11a049832g0zzsqhqz45y7xm-python3.6-ipython_genutils-0.2.0/lib/python3.6/site-packages', '/nix/store/21lxdak14zn4z4p8pxb4nrsivxfc1xvv-python3.6-jupyterlab_launcher-0.13.1/lib/python3.6/site-packages', '/nix/store/vgsbzajx3wdallz9hb0yywzsc3ypypaq-python3.6-jsonschema-2.6.0/lib/python3.6/site-packages', '/nix/store/94vqszxlf8basd5s3ni8wf5bq3h8p6x4-python3.6-notebook-5.6.0/lib/python3.6/site-packages', '/nix/store/f7vh7y804vqlahfsq1f0f9afdrcbdyq3-python3.6-Jinja2-2.10/lib/python3.6/site-packages', '/nix/store/qv1d6n1lwiv7skfz89cnz1xkfk5x8j2q-python3.6-markupsafe-1.0/lib/python3.6/site-packages', '/nix/store/j8yd57mbs9fis0dacl5yjwypgvpyv9z4-python3.6-tornado-5.1/lib/python3.6/site-packages', '/nix/store/ca86qlq73gbrb9hb3nphxph6cqmrzwac-python3.6-backports_abc-0.5/lib/python3.6/site-packages', '/nix/store/qhla67d2vh6xmpksy4lb43rr00qkh5yg-python3.6-certifi-2018.8.24/lib/python3.6/site-packages', '/nix/store/q7v4yvj8gzh06mlgap8ca27daldwg3pc-python3.6-singledispatch-3.4.0.3/lib/python3.6/site-packages', '/nix/store/xh9mfh0rhd7wi8by6hn57d14qlyqnpph-python3.6-six-1.11.0/lib/python3.6/site-packages', '/nix/store/zna268428fij3yrg1vi6l3d1ivl7wqgb-python3.6-traitlets-4.3.2/lib/python3.6/site-packages', '/nix/store/i36bzblisbis3pfkn00s1msr809ryhv0-python3.6-decorator-4.3.0/lib/python3.6/site-packages', '/nix/store/38cfzhxpvk97kahaz525s8wf87a46cfi-python3.6-jupyter_core-4.4.0/lib/python3.6/site-packages', '/nix/store/j8f2cj0axqhvjgm39qpr3calibdc9fzn-python3.6-ipython-6.5.0/lib/python3.6/site-packages', '/nix/store/5jwwcflsjpl1zwwxzzvv42x3vh5pyq0l-python3.6-jedi-0.12.1/lib/python3.6/site-packages', '/nix/store/0dnaxfngc1za833za1jgsbz70m97b8zq-python3.6-parso-0.3.1/lib/python3.6/site-packages', '/nix/store/bj6yhk4zhi2h0qnac3fdznz2k6bpcdjs-python3.6-pickleshare-0.7.4/lib/python3.6/site-packages', '/nix/store/kzn4zbw5vk6xqcvyjjsrkz62jlkw6gni-python3.6-path.py-11.0.1/lib/python3.6/site-packages', '/nix/store/dw3d7q66b6j27hayv4dxggg0vicbh9gs-python3.6-simplegeneric-0.8.1/lib/python3.6/site-packages', '/nix/store/zdn5w039qxalhrpgcqxms1ah7s1hlrgm-python3.6-prompt_toolkit-1.0.15/lib/python3.6/site-packages', '/nix/store/w1bsp4r7ndcdjlw6qjj28h89srilpmpd-python3.6-docopt-0.6.2/lib/python3.6/site-packages', '/nix/store/im7qrqspgl291dhx8885dismj3s4lx25-python3.6-wcwidth-0.1.7/lib/python3.6/site-packages', '/nix/store/fxvb6bczjxnai4aakbfdi452h0y0i246-python3.6-Pygments-2.2.0/lib/python3.6/site-packages', '/nix/store/pzvnw72cgd57jmrnr3wqc18g6kd23505-python3.6-docutils-0.14/lib/python3.6/site-packages', '/nix/store/6zq887wbbk2zlqd7j0jpkfvap1lc90ln-python3.6-pexpect-4.6.0/lib/python3.6/site-packages', '/nix/store/48iw34820bi03qxajqadbkcbffppi9bn-python3.6-ptyprocess-0.6.0/lib/python3.6/site-packages', '/nix/store/rnywq4i7zjmr8kxjhkhs7jrbx5r6wrmd-python3.6-backcall-0.1.0/lib/python3.6/site-packages', '/nix/store/mjgi2rjn6npw2w4wrkm5l5gzqb2cz8j9-python3.6-Send2Trash-1.4.2/lib/python3.6/site-packages', '/nix/store/mldl2xklwa03zc4ppi8ms2p72gyac0r8-python3.6-jupyter_client-5.2.3/lib/python3.6/site-packages', '/nix/store/5kk1n0b1sdxqzs56y6galig2p1yvq8nz-python3.6-pyzmq-17.1.2/lib/python3.6/site-packages', '/nix/store/bccb8jmszflv9hnwiinqwrdb83bfmr4j-python3.6-py-1.5.4/lib/python3.6/site-packages', '/nix/store/k9c78j8z4q20j27vjyjs411w1nla0809-python3.6-python-dateutil-2.7.3/lib/python3.6/site-packages', '/nix/store/1sl7znqlhifw81i3da6w8whqgdrv2i8r-python3.6-setuptools_scm-3.1.0/lib/python3.6/site-packages', '/nix/store/fqndazrpdiqcms7ivcqxy8gnmbw3xswx-python3.6-nbformat-4.4.0/lib/python3.6/site-packages', '/nix/store/pq26z30kkyb8229l8an6l6asq1wi2h9m-python3.6-testpath-0.3/lib/python3.6/site-packages', '/nix/store/qdivvcm3cqii4bwf609gdpkpas45iapf-python3.6-nbconvert-5.3.1/lib/python3.6/site-packages', '/nix/store/rsdwsww06w728n1bz7cswpj1lvh85xb6-python3.6-entrypoints-0.2.3/lib/python3.6/site-packages', '/nix/store/008fss5alrk8wp0f2p2pj1wsk3vcrwdw-python3.6-bleach-2.1.4/lib/python3.6/site-packages', '/nix/store/3hqfvm2s3lmai5gw27lxpm02zi0m0xg1-python3.6-html5lib-1.0.1/lib/python3.6/site-packages', '/nix/store/kh44p1x4z8cwwhav29csrdig0jskzndr-python3.6-webencodings-0.5.1/lib/python3.6/site-packages', '/nix/store/3y6fkpzjfqcalq8z769i7l07cj4fj2cz-python3.6-mistune-0.8.3/lib/python3.6/site-packages', '/nix/store/d70vr7s8v2ncj53mbp2v4w6nb5bk8zzz-python3.6-ipykernel-4.8.2/lib/python3.6/site-packages', '/nix/store/vky6qk0p6bigzw0xfq6a2myp1dh3vbmh-python3.6-pandocfilters-1.4.1/lib/python3.6/site-packages', '/nix/store/ajm635nxfwwag11pxjzgcibk2y4h42qc-python3.6-terminado-0.8.1/lib/python3.6/site-packages', '/nix/store/wphh2s31x39mqhb7188zyjv7sp08l5xn-python3.6-urllib3-1.23/lib/python3.6/site-packages', '/nix/store/sndz163kpv95n1rw8v11v2xw66vac8xq-python3.6-idna-2.7/lib/python3.6/site-packages', '/nix/store/1dn5q7j2ascy368vwdr6q9b0kxzr216l-python3.6-asn1crypto-0.24.0/lib/python3.6/site-packages', '/nix/store/4q1wccglx7l7vvhfdr46bfq1a3z9as1r-python3.6-packaging-17.1/lib/python3.6/site-packages', '/nix/store/55lagsqjr0yjv491vc7ia3d64iwmfwi8-python3.6-pyparsing-2.2.0/lib/python3.6/site-packages', '/nix/store/qq0058w2ydsa0a0gk984z5dk36jc1qjs-python3.6-pycparser-2.18/lib/python3.6/site-packages', '/nix/store/x5v2d0mh41yxc146w4p34zf3ka4q0ddn-python3.6-cffi-1.11.5/lib/python3.6/site-packages', '/nix/store/fjkrgww4vi05lz5vdpa3wwg4q08h1bmv-python3.6-cryptography-2.3.1/lib/python3.6/site-packages', '/nix/store/0g4mvk847nq8r6gq83d90wm8lvvhhr3z-python3.6-pyasn1-0.4.4/lib/python3.6/site-packages', '/nix/store/gzrgq8xlxsxnh18v2wm4aq2bh33063g7-python3.6-pyOpenSSL-18.0.0/lib/python3.6/site-packages', '/nix/store/hx8njjmhccmh6ngazc4dq4fiqmqkqvn2-python3.6-pysocks-1.6.6/lib/python3.6/site-packages', '/nix/store/w98icbhliwcisj6w3r8dragj2b2j5a4b-python3.6-chardet-3.0.4/lib/python3.6/site-packages', '/nix/store/66614b4gc9cw1vdyly98ahqdf0aapgb8-python3.6-requests-2.19.1/lib/python3.6/site-packages', '/nix/store/nsvi389pycl03hj7m5m6yvzn2b6vss1p-python3.6-prometheus_client-0.3.1/lib/python3.6/site-packages', '/nix/store/yx187xakxfxm3m4yf1k1i06m0j9gbdiy-python3.6-spinsfast-unstable-528606f06d0dcd06c78de77cd2eeef404136f0ca/lib/python3.6/site-packages', '/nix/store/2a8lm8w8ihlhnwid4xq6amvi755dbyz7-python3.6-setuptools-40.2.0/lib/python3.6/site-packages/setuptools-40.2.0-py3.6.egg', '/nix/store/hy65mn4wjswqih75gfr6g4q3xgqdm325-python3-3.6.6/lib/python36.zip', '/nix/store/hy65mn4wjswqih75gfr6g4q3xgqdm325-python3-3.6.6/lib/python3.6', '/nix/store/hy65mn4wjswqih75gfr6g4q3xgqdm325-python3-3.6.6/lib/python3.6/lib-dynload', '/nix/store/j8f2cj0axqhvjgm39qpr3calibdc9fzn-python3.6-ipython-6.5.0/lib/python3.6/site-packages/IPython/extensions', '/home/costrouc/.ipython']
Repology stats on nixpkgs https://repology.org/repositories/statistics/total
Over 42,000 packages with 87% being the latest version.
! nix search prometheus-s
warning: using cached results; pass '-u' to update the cache * nixpkgs.prometheus-snmp-exporter (snmp_exporter-0.13.0) SNMP Exporter for Prometheus * nixpkgs.prometheus-statsd-bridge (statsd_exporter-0.4.0) Receives StatsD-style metrics and exports them to Prometheus * nixpkgs.prometheus-statsd-exporter (statsd_exporter-0.4.0) Receives StatsD-style metrics and exports them to Prometheus * nixpkgs.prometheus-surfboard-exporter (surfboard_exporter-2.0.0) Arris Surfboard signal metrics exporter
/nix/store/*
¶! du -sh /nix/store
24G /nix/store