Commit graph

11955 commits

Author SHA1 Message Date
Eelco Dolstra
668fef2e4f
nix-shell: Overwrite environment variables
Need to remember that std::map::insert() and emplace() don't overwrite
existing entries...

This fixes a regression relative to 1.11 that in particular triggers
in nested nix-shells.

Before:

  $ nativeBuildInputs=/foo nix-shell -p hello --run 'hello'
  build input /foo does not exist

After:

  $ nativeBuildInputs=/foo nix-shell -p hello --run 'hello'
  Hello, world!
2017-02-24 13:31:46 +01:00
Dan Peebles
e7cb2847ab Explicitly model all settings and fail on unrecognized ones
Previously, the Settings class allowed other code to query for string
properties, which led to a proliferation of code all over the place making
up new options without any sort of central registry of valid options. This
commit pulls all those options back into the central Settings class and
removes the public get() methods, to discourage future abuses like that.

Furthermore, because we know the full set of options ahead of time, we
now fail loudly if someone enters an unrecognized option, thus preventing
subtle typos. With some template fun, we could probably also dump the full
set of options (with documentation, defaults, etc.) to the command line,
but I'm not doing that yet here.
2017-02-22 20:19:25 -05:00
Steven Allen
46e1d7a754 Use let instead of setq when setting exwm-input--line-mode-passthrough
That way, exwm won't clobber user modifications to this variable.
2017-02-22 10:05:41 -08:00
Eelco Dolstra
f023f64f40
RemoteStore::addToStore(): Pass content-addressability assertion
... and use this in Downloader::downloadCached(). This fixes

  $ nix-build https://nixos.org/channels/nixos-16.09-small/nixexprs.tar.xz -A hello
  error: cannot import path ‘/nix/store/csfbp1s60dkgmk9f8g0zk0mwb7hzgabd-nixexprs.tar.xz’ because it lacks a valid signature
2017-02-22 16:58:00 +01:00
Eelco Dolstra
fe2db1dae5
Doh 2017-02-22 15:39:17 +01:00
Eelco Dolstra
b8ce649a35
Fix 32-bit RPM/Deb builds
http://hydra.nixos.org/build/49130529
2017-02-22 13:54:11 +01:00
Eelco Dolstra
8b1b5f9a12
Handle CURLE_RECV_ERROR as a transient error
This fixes

  unable to download ‘https://cache.nixos.org/nar/077h8ji74y9b0qx7rjk71xd80vjqp6q5gy137r553jlvdlxdcdlk.nar.xz’: HTTP error 200 (curl error: Failure when receiving data from the peer)
2017-02-21 16:04:47 +01:00
Eelco Dolstra
8d7c6644c5
useChroot -> useSandbox 2017-02-21 15:21:56 +01:00
Eelco Dolstra
1a57f499b0
Drop some Ubuntu releases 2017-02-21 15:20:40 +01:00
Eelco Dolstra
c0a133876e
Revert "configure.ac: We require C++14 now"
This reverts commit 81c53fe8e5. This
check appears to be stricter than we need (it broke a bunch of
platforms that previously did build:
http://hydra.nixos.org/eval/1331921#tabs-now-fail).
2017-02-21 15:03:32 +01:00
Eelco Dolstra
b95ce3194d
Debian build: Use parallel make and add Ubuntu 16.10 2017-02-21 15:03:23 +01:00
Eelco Dolstra
e4dd7dadf4
RPM build: Use parallel make 2017-02-21 14:52:36 +01:00
Eelco Dolstra
bb6656b8a2
Build RPMs for Fedora 25
Disabled hardened build because it makes the linker fail with messages like

  relocation R_X86_64_PC32 against undefined symbol `BZ2_bzWriteOpen' can not be used when making a shared object; recompile with -fPIC

See https://fedoraproject.org/wiki/Changes/Harden_All_Packages.
2017-02-21 14:26:23 +01:00
Eelco Dolstra
99bbddedb1
Fix building without S3 support
http://hydra.nixos.org/build/49031196/nixlog/2/raw
2017-02-21 13:15:07 +01:00
Eelco Dolstra
79f4583f8a
Fix XML validity 2017-02-21 13:04:31 +01:00
Eelco Dolstra
df66d346df
Log AWS retries 2017-02-21 11:50:31 +01:00
Domen Kožar
5789b692d4 Merge pull request #1240 from lheckemann/tostring-doc
Document toString better
2017-02-20 15:31:41 +01:00
Linus Heckemann
b8564987a3 Document toString better 2017-02-20 14:23:48 +00:00
Vincent Ambo
45aee8257f style: Apply go fmt 2017-02-20 14:25:39 +01:00
Vincent Ambo
0b992c6156 fix pass: Trim leading & trailing whitespace 2017-02-20 14:25:24 +01:00
Eelco Dolstra
302386f775
Support netrc in <nix/fetchurl.nix>
This allows <nix/fetchurl.nix> to fetch private Git/Mercurial
repositories, e.g.

  import <nix/fetchurl.nix> {
    url = https://edolstra@bitbucket.org/edolstra/my-private-repo/get/80a14018daed.tar.bz2;
    sha256 = "1mgqzn7biqkq3hf2697b0jc4wabkqhmzq2srdymjfa6sb9zb6qs7";
  }

where /etc/nix/netrc contains:

  machine bitbucket.org
  login edolstra
  password blabla...

This works even when sandboxing is enabled.

To do: add unpacking support (i.e. fetchzip functionality).
2017-02-16 15:51:50 +01:00
Eelco Dolstra
cde4b60919
Move netrcFile to Settings
Also get rid of Settings::processEnvironment(), it appears to be
useless.
2017-02-16 14:50:41 +01:00
Eelco Dolstra
bd5388e7b2
Tweak netrc docs 2017-02-16 14:24:16 +01:00
Eelco Dolstra
b63f79175e
<nix/fetchurl.nix>: Remove unnecessary assertion 2017-02-16 14:06:47 +01:00
Eelco Dolstra
40f0e3b366
Include "curl" in the User-Agent header
Some sites (e.g. BitBucket) give a helpful 401 error when trying to
download a private archive if the User-Agent contains "curl", but give
a redirect to a login page otherwise (so for instance
"nix-prefetch-url" will succeed but produce useless output).
2017-02-16 13:55:43 +01:00
Eelco Dolstra
d1139ff36b Merge pull request #1215 from k0001/netrc-1
Add netrc-file support
2017-02-16 12:45:44 +01:00
Vincent Ambo
0147c3e13e feat ctx: Let sub-resource-sets inherit vars from parent
Users of kontemplate may expect variables defined on the parent resource to be
inherited by children.

This implements that functionality. Values defined twice are overwritten by the
child's definition.

Fixes #20
2017-02-14 19:12:53 +01:00
Vincent Ambo
f81fe551bc chore templater: Use new util.Merge func 2017-02-14 19:12:53 +01:00
Vincent Ambo
7a930aad11 feat util: Add silly map-merge function that should be in the stdlib 2017-02-14 19:12:53 +01:00
Eelco Dolstra
9ff9c3f2f8
Add support for s3:// URIs
This adds support for s3:// URIs in all places where Nix allows URIs,
e.g. in builtins.fetchurl, builtins.fetchTarball, <nix/fetchurl.nix>
and NIX_PATH. It allows fetching resources from private S3 buckets,
using credentials obtained from the standard places (i.e. AWS_*
environment variables, ~/.aws/credentials and the EC2 metadata
server). This may not be super-useful in general, but since we already
depend on aws-sdk-cpp, it's a cheap feature to add.
2017-02-14 14:20:00 +01:00
Eelco Dolstra
62ff5ad424 Merge pull request #1224 from dezgeg/configh
Unbreak 32-bit builds by always implicitly including config.h
2017-02-13 14:44:58 +01:00
Eelco Dolstra
77a78af678 Merge pull request #1233 from dezgeg/splice
nix-daemon: Don't splice with len=SIZE_MAX
2017-02-13 14:33:18 +01:00
Tuomas Tynkkynen
649a81bcd6 nix-daemon: Don't splice with len=SIZE_MAX
Currently, 'nix-daemon --stdio' is always failing for me, due to the
splice call always failing with (on a 32-bit host):

splice(0, NULL, 3, NULL, 4294967295, SPLICE_F_MOVE) = -1 EINVAL (Invalid argument)

With a bit of ftracing (and luck) the problem seems to be that splice()
always fails with EINVAL if the len cast as ssize_t is negative:
http://lxr.free-electrons.com/source/fs/read_write.c?v=4.4#L384

So use SSIZE_MAX instead of SIZE_MAX.
2017-02-13 15:14:44 +02:00
Vincent Ambo
1c3ea48da9 Merge pull request #2 from tazjin/fix/url-encode
fix urls: Escape values in URLs
2017-02-13 10:03:05 +01:00
Vincent Ambo
6dcb0f4b2b fix urls: Escape values in URLs
For usernames and passwords containing special characters the URL parameters
must be escaped.

Because the entire URI is just query parameters I've opted for using net/url.Values
for the entire URI.

Fixes #1
2017-02-13 09:55:24 +01:00
Chris Feng
0ae1e7327e Bump version to 0.13 2017-02-12 23:11:27 +08:00
Vincent Ambo
7824e0e7e3 docs: Add blog post to README 2017-02-11 17:34:09 +01:00
Vincent Ambo
dd1e6c3b36 fix: Two minor, silly fixes 2017-02-11 16:38:23 +01:00
Vincent Ambo
e4ee5a4526 fix: Portability of stdin 2017-02-11 16:33:16 +01:00
Vincent Ambo
4a85116b4a fix: Remove trailing newlines from input 2017-02-11 16:32:36 +01:00
Vincent Ambo
393cff4847 feat: Don't echo password while inputting 2017-02-11 16:30:23 +01:00
Vincent Ambo
e6c3212018 chore: Don't print URLs 2017-02-11 16:19:24 +01:00
Vincent Ambo
01ad38d532 docs: Add README 2017-02-11 13:17:55 +01:00
Vincent Ambo
98e81c2c0e
feat: Initial working implementation 2017-02-11 12:27:12 +01:00
Vincent Ambo
33174cbb80
Initial commit 2017-02-11 12:26:52 +01:00
Chris Feng
6723436052 Correct a renamed variable
* exwm-core.el (exwm--kmacro-map): Correct
`exwm-input--during-key-sequence' that was left out in 089afdc8.
2017-02-10 22:14:56 +08:00
Renzo Carbonara
e2257d4eeb Documentation. 2017-02-09 18:16:09 +01:00
Vincent Ambo
c181decd9d fix main: Add a forgotten error check 2017-02-09 15:50:22 +01:00
Vincent Ambo
2f6e008121 feat templater: Add 'pass' lookup function
This introduces support for looking up secret values in the 'pass' command line
tool (https://www.passwordstore.org/).

Values like passwords can be interpolated from pass and even more complex
structures like certificates for Kubernetes Secrets can be retrieved and base64-
encoded as necessary.

Fixes #2
2017-02-09 15:44:18 +01:00
Vincent Ambo
4713d565d3 fix templater: Don't fail with two identical stack traces 2017-02-09 15:44:18 +01:00