Skip to content
Snippets Groups Projects
  1. Feb 01, 2014
  2. Jan 30, 2014
  3. Jan 21, 2014
  4. Jan 20, 2014
  5. Jan 15, 2014
  6. Jan 14, 2014
  7. Jan 13, 2014
  8. Jan 09, 2014
  9. Jan 08, 2014
    • Eelco Dolstra's avatar
      Fix signed-binary-caches test · f4013b61
      Eelco Dolstra authored
      f4013b61
    • Eelco Dolstra's avatar
    • Eelco Dolstra's avatar
      Fix checking of NAR hashes · 11cb4bfb
      Eelco Dolstra authored
      *headdesk*
      *headdesk*
      *headdesk*
      
      So since commit 22144afa, Nix hasn't
      actually checked whether the content of a downloaded NAR matches the
      hash specified in the manifest / NAR info file.  Urghhh...
      11cb4bfb
    • Eelco Dolstra's avatar
      Support cryptographically signed binary caches · 0fdf4da0
      Eelco Dolstra authored
      NAR info files in binary caches can now have a cryptographic signature
      that Nix will verify before using the corresponding NAR file.
      
      To create a private/public key pair for signing and verifying a binary
      cache, do:
      
        $ openssl genrsa -out ./cache-key.sec 2048
        $ openssl rsa -in ./cache-key.sec -pubout > ./cache-key.pub
      
      You should also come up with a symbolic name for the key, such as
      "cache.example.org-1".  This will be used by clients to look up the
      public key.  (It's a good idea to number keys, in case you ever need
      to revoke/replace one.)
      
      To create a binary cache signed with the private key:
      
        $ nix-push --dest /path/to/binary-cache --key ./cache-key.sec --key-name cache.example.org-1
      
      The public key (cache-key.pub) should be distributed to the clients.
      They should have a nix.conf should contain something like:
      
        signed-binary-caches = *
        binary-cache-public-key-cache.example.org-1 = /path/to/cache-key.pub
      
      If all works well, then if Nix fetches something from the signed
      binary cache, you will see a message like:
      
        *** Downloading ‘http://cache.example.org/nar/7dppcj5sc1nda7l54rjc0g5l1hamj09j-subversion-1.7.11’ (signed by ‘cache.example.org-1’) to ‘/nix/store/7dppcj5sc1nda7l54rjc0g5l1hamj09j-subversion-1.7.11’...
      
      On the other hand, if the signature is wrong, you get a message like
      
        NAR info file `http://cache.example.org/7dppcj5sc1nda7l54rjc0g5l1hamj09j.narinfo' has an invalid signature; ignoring
      
      Signatures are implemented as a single line appended to the NAR info
      file, which looks like this:
      
        Signature: 1;cache.example.org-1;HQ9Xzyanq9iV...muQ==
      
      Thus the signature has 3 fields: a version (currently "1"), the ID of
      key, and the base64-encoded signature of the SHA-256 hash of the
      contents of the NAR info file up to but not including the Signature
      line.
      
      Issue #75.
      0fdf4da0
  10. Jan 06, 2014
  11. Dec 31, 2013
    • Shea Levy's avatar
      Don't use any syntactic sugar for dynamic attrs · cd49fe4f
      Shea Levy authored
      
      This doesn't change any functionality but moves some behavior out of the
      parser and into the evaluator in order to simplify the code.
      
      Signed-off-by: default avatarShea Levy <shea@shealevy.com>
      cd49fe4f
    • Shea Levy's avatar
      Fold dynamic binds handling into addAttr · 6f3a5180
      Shea Levy authored
      
      Since addAttr has to iterate through the AttrPath we pass it, it makes
      more sense to just iterate through the AttrNames in addAttr instead. As
      an added bonus, this allows attrsets where two dynamic attribute paths
      have the same static leading part (see added test case for an example
      that failed previously).
      
      Signed-off-by: default avatarShea Levy <shea@shealevy.com>
      6f3a5180
    • Shea Levy's avatar
      Dynamic attrs · 18fefacf
      Shea Levy authored
      
      This adds new syntax for attribute names:
      
      * attrs."${name}" => getAttr name attrs
      * attrs ? "${name}" => isAttrs attrs && hasAttr attrs name
      * attrs."${name}" or def => if attrs ? "${name}" then attrs."${name}" else def
      * { "${name}" = value; } => listToAttrs [{ inherit name value; }]
      
      Of course, it's a bit more complicated than that. The attribute chains
      can be arbitrarily long and contain combinations of static and dynamic
      parts (e.g. attrs."${foo}".bar."${baz}" or qux), which is relatively
      straightforward for the getAttrs/hasAttrs cases but is more complex for
      the listToAttrs case due to rules about duplicate attribute definitions.
      
      For attribute sets with dynamic attribute names, duplicate static
      attributes are detected at parse time while duplicate dynamic attributes
      are detected when the attribute set is forced. So, for example, { a =
      null; a.b = null; "${"c"}" = true; } will be a parse-time error, while
      { a = {}; "${"a"}".b = null; c = true; } will be an eval-time error
      (technically that case could theoretically be detected at parse time,
      but the general case would require full evaluation). Moreover, duplicate
      dynamic attributes are not allowed even in cases where they would be
      with static attributes ({ a.b.d = true; a.b.c = false; } is legal, but {
      a."${"b"}".d = true; a."${"b"}".c = false; } is not). This restriction
      might be relaxed in the future in cases where the static variant would
      not be an error, but it is not obvious that that is desirable.
      
      Finally, recursive attribute sets with dynamic attributes have the
      static attributes in scope but not the dynamic ones. So rec { a = true;
      "${"b"}" = a; } is equivalent to { a = true; b = true; } but rec {
      "${"a"}" = true; b = a; } would be an error or use a from the
      surrounding scope if it exists.
      
      Note that the getAttr, getAttr or default, and hasAttr are all
      implemented purely in the parser as syntactic sugar, while attribute
      sets with dynamic attribute names required changes to the AST to be
      implemented cleanly.
      
      This is an alternative solution to and closes #167
      
      Signed-off-by: default avatarShea Levy <shea@shealevy.com>
      18fefacf
    • Shea Levy's avatar
      Add the ExprBuiltin Expr type to the AST · 136f2f70
      Shea Levy authored
      
      Certain desugaring schemes may require the parser to use some builtin
      function to do some of the work (e.g. currently `throw` is used to
      lazily cause an error if a `<>`-style path is not in the search path)
      Unfortunately, these names are not reserved keywords, so an expression
      that uses such a syntactic sugar will not see the expected behavior
      (see tests/lang/eval-okay-redefine-builtin.nix for an example).
      
      This adds the ExprBuiltin AST type, which when evaluated uses the value
      from the rootmost variable scope (which of course is initialized
      internally and can't shadow any of the builtins).
      
      Signed-off-by: default avatarShea Levy <shea@shealevy.com>
      136f2f70
  12. Dec 30, 2013
  13. Dec 20, 2013
    • Eelco Dolstra's avatar
      Revert "Scan /proc/<pid>/cmdline for GC roots" · b352fe27
      Eelco Dolstra authored
      This reverts commit 194e3374.
      Checking the command line for GC roots means that
      
        $ nix-store --delete $path
      
      will fail because $path is now a root because it's mentioned on the
      command line.
      b352fe27
    • Eelco Dolstra's avatar
      Doh · 8931bf71
      Eelco Dolstra authored
      8931bf71
    • Petr Rockai's avatar
      perl: Call loadConfFile() in doInit to avoid screwing sqlite journal mode. · f1e5dedb
      Petr Rockai authored
      If the database is opened through perl bindings (and even though nix.conf has
      use-sqlite-wal set to false), the database is automatically converted into WAL
      mode. This makes the next nix process to access the database convert it back to
      "truncate". If the database is still open at the time in wal mode by the perl
      program, this fails and crashes the nix doing the wal -> truncate conversion.
      f1e5dedb
Loading