Nix 1.12

Video thumbnail (Frame 0) Video thumbnail (Frame 5941) Video thumbnail (Frame 10605) Video thumbnail (Frame 11927) Video thumbnail (Frame 18087) Video thumbnail (Frame 22007) Video thumbnail (Frame 23231) Video thumbnail (Frame 25517) Video thumbnail (Frame 30136) Video thumbnail (Frame 32298) Video thumbnail (Frame 34765)
Video in TIB AV-Portal: Nix 1.12

Formal Metadata

Nix 1.12
Title of Series
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Release Date
Production Year

Content Metadata

Subject Area
In this talk I will give an overview of the new features in Nix 1.12, and the ongoing work on the "nix" command intended to replace the existing command-line interface.
Point (geometry) User interface Functional programming Randomization Common Language Infrastructure State of matter Multiplication sign Software developer Feedback Database Bit Database Mereology Function (mathematics) Mathematics Shooting method Personal digital assistant Order (biology) Flag Quicksort Data structure Flag
Randomization Greatest element Building Multiplication sign Set (mathematics) Bit rate Function (mathematics) Mereology Computer programming Substitute good Mathematics Computer configuration Military operation Phase transition Algebraic closure Pressure volume diagram Flag Local ring Source code Computer virus Common Language Infrastructure Building Data storage device Sound effect Instance (computer science) Price index Substitute good Virtual machine Type theory Computer configuration Configuration space Freeware Arithmetic progression Physical system Electric current Sigma-algebra Entire function Attribute grammar Latent heat Cache (computing) Term (mathematics) Configuration space Default (computer science) Default (computer science) Inheritance (object-oriented programming) Interface (computing) Line (geometry) Directory service Binary file Mixed reality Key (cryptography) Musical ensemble Flag
Demon Building Parameter (computer programming) Mereology Uniform resource locator Derivation (linguistics) Mathematics Computer configuration Different (Kate Ryan album) Algebraic closure Query language Flag Information Local ring Error message Descriptive statistics Physical system Social class Block (periodic table) Building Binary code Data storage device Electronic mailing list Parallel port Attribute grammar Price index Regulärer Ausdruck <Textverarbeitung> Substitute good Electronic signature Connected space Type theory Configuration space Data logger Quicksort Remote procedure call Freeware Arithmetic progression Physical system Electric current Spacetime Ocean current Slide rule Mapping Service (economics) Computer file Virtual machine Attribute grammar 2 (number) Cache (computing) Operator (mathematics) Reduction of order Router (computing) Address space Condition number Installation art Operations research Demon Information Line (geometry) Binary file Cache (computing) Uniform resource locator Algebraic closure Integrated development environment Query language Personal digital assistant Mixed reality Revision control Odds ratio Routing Abstraction Local ring
Building Scripting language Computer file Online help 2 (number) Mathematics Cache (computing) Gastropod shell Scripting language Computer virus Namespace Server (computing) Binary code Data storage device Cache (computing) Root Algebraic closure Mixed reality Revision control Software testing Right angle Gastropod shell Freeware Routing Local ring Row (database) Spacetime
Aliasing Asynchronous Transfer Mode Game controller Functional (mathematics) Building Correspondence (mathematics) Source code Function (mathematics) Computer font Field (computer science) Derivation (linguistics) Different (Kate Ryan album) Hash function Algebraic closure Flag Energy level Physical system Default (computer science) Scripting language Graph (mathematics) Run time (program lifecycle phase) Software developer Data storage device Database Instance (computer science) Substitute good Symbol table Electronic signature Derivation (linguistics) Cache (computing) Uniform resource locator Hash function Integrated development environment Algebraic closure Function (mathematics) Chain Order (biology) Formal verification Text editor Right angle
Keyboard shortcut Building Run time (program lifecycle phase) Multiplication sign Source code Set (mathematics) Function (mathematics) Mereology Formal language Software bug Derivation (linguistics) Mathematics CAN bus Different (Kate Ryan album) Hash function Repository (publishing) Modul <Datentyp> Bus (computing) Cloning Flag Cuboid Logic gate Information security Exception handling Injektivität Mapping Keyboard shortcut Binary code Electronic mailing list Data storage device Attribute grammar Substitute good Electronic signature Derivation (linguistics) Hash function Repository (publishing) Configuration space MiniDisc Right angle Quicksort Information security Freeware Asynchronous Transfer Mode Spacetime Functional (mathematics) Module (mathematics) Open source Divisor Computer file Control flow Valuation (algebra) Directory service Electronic mailing list Content (media) Attribute grammar Element (mathematics) 2 (number) Revision control Performance appraisal Internetworking Natural number Clef String (computer science) Energy level Speicherbereinigung Associative property Default (computer science) Module (mathematics) Boolean algebra Default (computer science) Polygon mesh Content (media) Line (geometry) Directory service Performance appraisal Cache (computing) Algebraic closure Integrated development environment Personal digital assistant Function (mathematics) Read-only memory Mixed reality Musical ensemble Window Computer worm
our next speaker is Elko dill straw invented Nick's wet 1314 years ago now very long time ago and thing I like to quote when people tell me how Nick so Nick's OS is so young I say no no no no it's it's very old and maybe it's just the fate of functional programming languages in general but I'm grateful that the community is starting to take off and yeah yeah so this talk is just a sort of random or overview of features in next 1.12 in a fairly random order so this is not Nix 2.0 yet it was kind of the goal at some point but so well let me start with the status so it's not actually released yet but I think it's in a fairly usable state so I would like to invite everybody to go and test it and discover things that break and report issues and then hopefully in a few weeks or so we might have an actual release after also updating the documentation which is currently lacking but again that's always the case early in new situation with the next manual so yeah well yeah of course you probably know how to upgrade it so if it does change the database schema but there's actually a hack in next 1.11 that makes it for it's compatible with that schema change so you shouldn't have to be afraid to try it out so yeah the main thing that were really the main goal of the development in the last well really since last Nix con was to come up with a new user interface because the the existing one so all these commands Nicks and explore and so on yeah I hadn't been really so much design has evolved so yeah there wasn't much structure or fought behind them so they're kind of a mess so the idea was to create a new command and that command exists but it's lacking things so it doesn't quite justify Nix 2.0 label yet so in particular one of really the main goal was to replace Nick's end with something more declarative but that doesn't exist yet so so maybe one if we have that then we could call it 2.0 so another thing to mention is that the syntax of the nix commands that we have at this point is still a bit experimental so things might change depending on feedback and other insights that might occur so the syntax might still change so another thing to mention is that it's a goal here that this command is more scripts friendly than the existing one so every command should have a JSON flag with the emphasis on shoot it's not actually the case yet but most of them have so yeah and so without a JSON flag the idea is that the intent is or the output is intended to be human consumable so it might change so yeah so the general
syntax is Nick's up command so it's like the gift free letter command and nice thing is that it's fully self documenting so all the flags for all the sub commands are queryable by a dash dash help it even has examples in the best just help so there are no man pages yet or anything like that but maybe maybe you don't need them also note the line at the note the line at the bottom that says this program is experimental so don't get too attached to it yeah another thing to say about the new comment line interface that all configuration options so next comm options are now supported as command line flags which is just a small convenience that makes them easier to type so instead of typing - - option sandbox true you say - - sandbox yeah oh and you can put configuration options in your home directory now in dot config slash Nick slashed Nick's Kampf so for instance if you have a user specific substitute or things like that you can put them in there yeah so now now if a bunch of random sub commands so there is a command called Nick's built so this is intended to replace mix - built and so the general syntax of most of these Nick's commands is that they get a set of so called installable which is well maybe not a great term but it's intended to be something that can evaluate to a store path so it might it can be a store path directly or assembling to a store path but it can also be a an attribute name like nick's packages dot hello so so another change in compared to Nick's and fish that we're trying to get rid of searching for packages using their name because that's super slow so the idea is that you reference packages by their attribute name which is I guess what most people were doing anyway with the - uppercase a option but so here it's the default and so command like Nick's builds as how if you say Nick's packages got hello it searches in a synthesized attribute set that consists or that's synthesized from your Nick's path so if you have any expected use in your Nick's path then the expected use will refer to that so next package is built hello refers to the hello attribute in Nick's packages so another nice thing is that it has a progress indicator so show that
here [Music] so so now it's building something and it indicates that it is in the configure face and well you don't see the so over there is the the last log line from the build and now it's finished okay so yeah the ideas it doesn't tries to follow the UNIX philosophy or part of it which is that if you have nothing interesting to say you should say nothing so most of the time well this output of Nix commands was not interesting so if you say the effect could be argued that the progress bar shouldn't be shown afterwards but yeah so yeah and other
commands also have this progress indicator so Francis makes copy so on the topic of building remote build configurations now a lot easier so just be that you had to set up machines dot Nick set up annex build who can environments very well set up some config options which is fine if you're only doing that once but especially for a sort of incidental use say I have I want to build something on a Mac and I want to forward it to a Mac machine that I have available so you can now just specify it on the comment line so you say mix builds - - builders and then had the ssh address and the machine type and it will start building and it will actually say that it is building a derivation on that machine so that's kind of nice yeah so as a example of how depth installable syntax is kind of used for almost all commands so there is a command called mix log which replaces sneak store - - read lock which shows you the the bill block for a derivation but this one also works on attributes so you can say Nix lock and expect adjust of hell and it will show you the log file for the hello package and not our new features that will get it from the binary cash if if if no log file is available locally okay so yeah I said we didn't have a replacement for Nik Sandford actually so there is a replacement for nixon's - QA and the big difference is that it has a cache so so you can type mixer it's blender and that takes 0.1 seconds and so yeah it's it's just a regular expression so it will match with or don't actually remember it was a regular expression or a substring search but it will look in attributes names and package names and descriptions for the argument that you specify so yeah it's a lot less strict than Nixon flesh QA of course now you have a cache coherence problem so right now the cache never gets updated to tell you unless you explicitly ask for it so yeah and that's the trade-off yeah so there is a command called nix path info which replaces next door - q and so one nice flag that it has is - uppercase s which shows you the closure size of a path so for example mix PAP info - RS on your current mix OS system if you pipe it through short it will show you the closure size of every path in an ecosystem sorted by size well that's a my kind of my obsession is closure size reduction so this is this is useful for that so another thing to mention so I'll come back to the next slide is there's a store parameter so you can specify which nick store you want to apply the query to so usually that's your local store there can also be a binary cash or binary cash is considered a store because it contains store paths and with references and signatures and stuff like that yeah yeah we're here in a more complicated example show every path whose closure size is bigger than 1 gigabyte sorted by closure sigh so a shout out to my favorite command in the world Jake you beautiful command yeah so on
the topic of those store URIs so it was always the case that in Nix there was this store abstraction so there was an abstract store class providing operations that you can do on an extraordinary vation querying information about a path but that really only adds two subclasses namely a local store which is if you're accessing it directly or a remote store which is if you're exiting through a for the mix demon but so we've kind of generalized this concept so things like substitute errs are now stores so substitute ORS are gone there are subclasses of that store API and also things like yeah Nick's copy closure copying things to the Nick store on a remote SSH remote machine fayez is H that was done in a totally ad hoc way so now that's also a store so so here's a list of available store service local there's remote there's also slash path so that's the same as local only it's it basically uses a change route or well I actually more a mountain named space that allows you to use a next door in a different location so there's HTTP and HTTPS HTTP and HTTPS so that's replaces download from binary cash so another very nice thing about Nick's 1.12 is thanks to the great work of che we got rid of the Pearl dependency so and this is part of that so another very nice feature is that it supports HTTP 2 which gives a huge performance difference because if your ethnics does your querying a binary cash for hundreds of tiny little files HP one doesn't like that you have to use dozens of parallel TCP connections and then router starts crashing and so HP two is much nicer and it's more reliable because we now retry a lot more error conditions so yeah but yeah other stores so there's file for a local binary cash as free for an S free binary cash and SSH for remote machines
so as an example of of that so there is a command called NICs copy which generalizes a whole bunch of commands so mix copy closure nix Bush and a bunch of scripts that we used to populate binary caches so for example NICs copy closure that's now just Nick's copy - - - and then an ssh host or conversely that's just from an ssh host and the excuse is just copying to a file binary cash and populating something like cash Nick's restore torque that's copy 2's free so yeah so if you want to have your own binary caching as free that's now really easy yeah so there's now this well ok so
like I said change would store is a misnomer but so what you can do here is this is nice if you don't have write access to slash but you still want to install Nick's and you want to be able to use have pre-built binaries for / Nick slash store so so you can just say dash dash store and then a path to which you do have right for me and then it will use that instead so this only works on Linux because it uses the magic of mount namespaces but yeah so now you might be thinking is okay so you can build things but that doesn't help you running them so there's also command called nix run which is mostly invented as a replacement for Nick shell - B but it also supports these change routes store so it will run the command in a mountain named space where slash Nick slash stories mounted to your local store so for example you can say Nick's run hello and you can run it yeah I mean if you do if you do this on next OS then nothing else will be present because you're mounting this next row on top of the regular one but so Nick's verify is
a comment that verifies whether store paths are modified and are signed so a new thing next one control is that store paths now have signatures so it used to be that only binary caches had signatures and these signatures were only checked during substitution so before downloading in our from a binary cash it would check whether they've had a trusted signature of a now these signatures are also stored in the in the local database so you can query later when our paths are trusted so for example a command like Nick's verify - are on the Thunderbird will verify the closure and see whether it has enough signatures so you can even pass flags like each path should have at least two different signatures or something like that so for instance here it shows that all paths except one are are trusted yeah there's a command called Nick's FL which replaces Nick's instantiate not much exciting about that there's a command called Nick's edit which those are not super exciting so it opens the source code of a package in your editor so it's actually four years I had an alias in my environment that Lucas in a happy way yeah so this is actually useful so there is a command called Nick's build - - hash so it doesn't yet I realized have a flag in the new Nick's field but so this is a built out that builds a derivation computes his hash and then moves it to the right location and Nick store if it were a fixed output derivation like fetch URL or fetch get or whatever so the idea is that this can replace all those Nick's prefix French prefetch scripts which are kind of annoying because so all those scripts basically do the same thing as the corresponding Nick's function only outside of the next outside of the Nick's build and then they do an extraordinary example if you have a derivation that's called fetch from github and you change its you change it so now you want to know the new sha hash you will do an X build - - hash on that thing and that would perform the build and it would give you the hash and it will move to the right location so you don't have to download it again afterwards so that's that's that so
command that I hacked up during story for the school font so command that I hacked up during the Amsterdam hackathon a few weeks ago is Nick's why depends probably needs a better name but it shows you why a path has an order path in its closure so if you're debugging closure size issues you often have the question of why do I have this dots deaf outputs in my clothes or why do you have GCC in my closure because that suddenly adds 50 megabytes so you can do things like Nix why depends so select run slash current system and the expected to stock you will see the death and that will show you the the path through the closure graph from the first path to the second one so here there is a chain of dependencies going from the top level path through system path through some debug path fruit GCC to gilepsy - death so here the problem that's going on is that I had some debug symbols in my environment and apparently those trigger a dependency on GCC which triggers a dependency on the GFC developer outputs so yeah so that was so now on to the
language changes so so probably the major one is built-in stuff fetch get which fetches a git repository at evaluation time and it doesn't need a Content hash so unlike imports from derivation on the fetch get colle where you have all sorts of problems that it doesn't work in read-only mode and you need to specify a hash so here you can just import so for example in Nix OS this makes it feasible to have Nick so as modules in different repositories so we always had this problem that well take Hydra so Hydra contains a mixed waste module but then Nick's packages contains pretty much an exact clone of that module which may or may not be insane with the upstream Hyderabad story so that that's now necessary you can get rid of that Hydra module and expected use and you can just import the right one directly so this allows sort of a more modular mix OS we don't have to put everything in mix OS yeah so and it's also possible to specify git repositories on the comment line so for example you can specify that next package it should be some particular get checked out
yeah another interesting thing is structured derivation attributes so there's always the case that derivation attributes gets flattened to to string name value pairs because they need to be passed through the environments but now you can pass basically anything except functions so attribute sets lists nested attributes as boolean snows integers floats you know passable so it all gets from that map to adjacent file and and then it's up to the Builder to do something with that so as a convenience to bash users any attributes that can be mapped can be squeezed into a mesh array or a bash associative array yeah that's so it will do that for you so for example your configure flags would actually be a bash array and so for example the fact that we have white space in the first element of that flag is no longer a problem so and and also things like for example with all these boolean flags for what's called the fortify flag so the hardening flags so that could now be done in a nice way like hardening dot fortify is true or some like that and that that would end up as a Bosch associative array now obviously this breaks everything so you have to opt into it by setting a magic attribute so maybe someday in the future we could convert standard answer to that and then set that for make derivation but yeah how am i doing on time okay yeah so yeah another minor features placeholder so this makes it possible to refer to your own outputs so for example if I want to say configure flex is prefix is that dollar out well you can't say dollar out there because that doesn't get evaluated so yeah so did this causes some magic that will actually cause a substitution that just before build time with the right value so so a bunch of minor improvements Knicks treble is now part of Knicks there is a special channel syntax that you can use in file names and so on it's a shortcut for those very long your eyes sandbox builds now use slash built instead of slash stamp as a temporary directory because that was a source of security bugs namely builds good accidentally store slap stab slash stamp directories and things like an our path and then somebody could recreate that path and inject things into other people's executions Sam Linux and box now provides Venus age by default base64 hashes oh yeah automated automatic garbage collections are there now a flag that Nix will automatically start garbage collection if during a build the free disk space drops below a certain level [Music] I'm actually all those not very interesting yeah binary cash signatures are now required by default that was already the case on Nexus and that's actually it so thank you [Music] question about didn't fetch get and you say this is taking place at a valuation time not instantiation time yeah that's the same it does not take place at build time okay sorry is there any caching involved yeah of course when you just clone mix packages then it takes at minute yeah yeah so it's cached and in fact it's there's some pretty aggressive caching so that I don't remember the users but I think there is even a time to live so it it won't even check whether there is a new version within a certain time window so if you run her built within five seconds of the Charter it's not going to check github twice so also about the gate support does that mean NYX has a runtime dependency on gift and is there a way to specify get via SSH so it currently has a loose dependence you don't get so it does not actually have given its closure it just calls get from via the path yeah last question yeah so a great talk I'm already really looking forward to use that so on the risk of opening a can of worms so the world bus factor sounds scary so I go for for island factor what happens if you decide to live on an island tomorrow without internet and you want to people the nature well it's open source so anybody can I would say that because we got rid of the Perl dependency the bus factor has gone it's all squishy has gone down or up its in any case there there are more people who could replace me that's because I checked the contributions that's in there scary