Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Feb 3, 2018
2 parents 10c8e6d + b99c86f commit 55e0f12
Show file tree
Hide file tree
Showing 16 changed files with 715 additions and 57 deletions.
36 changes: 31 additions & 5 deletions nixos/modules/services/misc/home-assistant.nix
Expand Up @@ -6,6 +6,19 @@ let
cfg = config.services.home-assistant;

configFile = pkgs.writeText "configuration.yaml" (builtins.toJSON cfg.config);

availableComponents = pkgs.home-assistant.availableComponents;

# Returns whether component is used in config
useComponent = component: hasAttrByPath (splitString "." component) cfg.config;

# List of components used in config
extraComponents = filter useComponent availableComponents;

package = if cfg.autoExtraComponents
then (cfg.package.override { inherit extraComponents; })
else cfg.package;

in {
meta.maintainers = with maintainers; [ dotlambda ];

Expand All @@ -29,6 +42,7 @@ in {
};
frontend = { };
http = { };
feedreader.urls = [ "https://nixos.org/blogs.xml" ];
}
'';
description = ''
Expand All @@ -48,10 +62,22 @@ in {
'';
description = ''
Home Assistant package to use.
Most Home Assistant components require additional dependencies,
which are best specified by overriding <literal>pkgs.home-assistant</literal>.
You can find the dependencies by searching for failed imports in your log or by looking at this list:
<link xlink:href="https://github.com/home-assistant/home-assistant/blob/master/requirements_all.txt"/>
Override <literal>extraPackages</literal> in order to add additional dependencies.
'';
};

autoExtraComponents = mkOption {
default = true;
type = types.bool;
description = ''
If set to <literal>true</literal>, the components used in <literal>config</config>
are set as the specified package's <literal>extraComponents</literal>.
This in turn adds all packaged dependencies to the derivation.
You might still see import errors in your log.
In this case, you will need to package the necessary dependencies yourself
or ask for someone else to package them.
If a dependency is packaged but not automatically added to this list,
you might need to specify it in <literal>extraPackages</literal>.
'';
};
};
Expand All @@ -67,7 +93,7 @@ in {
'';
serviceConfig = {
ExecStart = ''
${cfg.package}/bin/hass --config "${cfg.configDir}"
${package}/bin/hass --config "${cfg.configDir}"
'';
User = "hass";
Group = "hass";
Expand Down
7 changes: 6 additions & 1 deletion nixos/tests/home-assistant.nix
Expand Up @@ -17,13 +17,16 @@ in {
homeassistant = {
name = "Home";
time_zone = "UTC";
latitude = "0.0";
longitude = "0.0";
elevation = 0;
};
frontend = { };
http = { };
};
};
};
};
};

testScript = ''
startAll;
Expand All @@ -37,5 +40,7 @@ in {
$hass->waitForOpenPort(8123);
$hass->succeed("curl --fail http://localhost:8123/states");
$hass->succeed("curl --fail http://localhost:8123/api/ | grep 'API running'");
$hass->fail("cat ${configDir}/home-assistant.log | grep -qF ERROR");
'';
})
4 changes: 2 additions & 2 deletions pkgs/applications/networking/cluster/terraform/default.nix
Expand Up @@ -100,8 +100,8 @@ in rec {
terraform_0_10-full = terraform_0_10.withPlugins lib.attrValues;

terraform_0_11 = pluggable (generic {
version = "0.11.1";
sha256 = "04qyhlif3b3kjs3m6c3mx45sgr5r13x55aic638zzlrhbpmqiih1";
version = "0.11.3";
sha256 = "0637x7jcm62pdnivmh4rggly6dmlvdh3jpsd1z4vba15gbm203nz";
patches = [ ./provider-path.patch ];
passthru = { inherit plugins; };
});
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/cluster/terragrunt/default.nix
Expand Up @@ -2,15 +2,15 @@

buildGoPackage rec {
name = "terragrunt-${version}";
version = "0.13.23";
version = "0.14.0";

goPackagePath = "github.com/gruntwork-io/terragrunt";

src = fetchFromGitHub {
rev = "v${version}";
owner = "gruntwork-io";
repo = "terragrunt";
sha256 = "1xx3kw38vr563x3bn0rrg1iq4r51rl0qci2magwwng62cgh3zaiy";
sha256 = "1fz4ny7jmwr1xp68bmzlb6achird7jwbb6n6zim6c1w0qybxiqg9";
};

goDeps = ./deps.nix;
Expand Down
24 changes: 12 additions & 12 deletions pkgs/applications/networking/cluster/terragrunt/deps.nix
Expand Up @@ -5,8 +5,8 @@
fetch = {
type = "git";
url = "https://github.com/aws/aws-sdk-go";
rev = "d0cb8551ac28d362e77ea475e5b7b2ebaec06b6b";
sha256 = "1546kb49wb1qjx6pz7aj4iygmqsjps70npb5csm5q08wxk63vhls";
rev = "00cca3f093a8236a93fbbeeae7d28ad83811683c";
sha256 = "1x2frsin6d9drx9k65pv0r0l0asj16fzj815s2a9db2mxh8jycsp";
};
}
{
Expand Down Expand Up @@ -41,8 +41,8 @@
fetch = {
type = "git";
url = "https://github.com/hashicorp/go-getter";
rev = "994f50a6f071b07cfbea9eca9618c9674091ca51";
sha256 = "1v2whvi9rnrkz4ji3b3sinvv3ahr5s4iyzchz00wjw0q2kdvj1zj";
rev = "285374cdfad63de2c43d7562f49ced6dde5a7ba0";
sha256 = "0xmwxfb0vm20ga1j1r3lavxm15vwqdkisdkshw1nia7byhwmb4xm";
};
}
{
Expand All @@ -68,8 +68,8 @@
fetch = {
type = "git";
url = "https://github.com/mattn/go-zglob";
rev = "4b74c24375b3b1ee226867156e01996f4e19a8d6";
sha256 = "1qc502an4q3wgvrd9zw6zprgm28d90d2f98bdamdf4js03jj22xn";
rev = "4959821b481786922ac53e7ef25c61ae19fb7c36";
sha256 = "0rwkdw143kphpmingsrw1zp030zf3p08f64h347jpdm4lz8z5449";
};
}
{
Expand All @@ -95,17 +95,17 @@
fetch = {
type = "git";
url = "https://github.com/mitchellh/mapstructure";
rev = "06020f85339e21b2478f756a78e295255ffa4d6a";
sha256 = "12zb5jh7ri4vna3f24y9g10nzrnz9wbvwnk29wjk3vg0ljia64s9";
rev = "b4575eea38cca1123ec2dc90c26529b5c5acfcff";
sha256 = "1x80f3kcb1wd2mdxks3wcsp26q9g7ahr8b18z1anl5igg6zl61kf";
};
}
{
goPackagePath = "github.com/stretchr/testify";
fetch = {
type = "git";
url = "https://github.com/stretchr/testify";
rev = "2aa2c176b9dab406a6970f6a55f513e8a8c8b18f";
sha256 = "1j92x4291flz3i4pk6bi3y59nnsi6lj34zmyfp7axf68fd8vm5ml";
rev = "12b6f73e6084dad08a7c6e575284b177ecafbc71";
sha256 = "01f80s0q64pw5drfgqwwk1wfwwkvd2lhbs56lhhkff4ni83k73fd";
};
}
{
Expand All @@ -122,8 +122,8 @@
fetch = {
type = "git";
url = "https://github.com/urfave/cli";
rev = "39908eb08fee7c10d842622a114a5c133fb0a3c6";
sha256 = "1s0whq54xmcljdg94g6sghpf6mkhf6fdxxb18zg0yzzj6fz9yj8j";
rev = "75104e932ac2ddb944a6ea19d9f9f26316ff1145";
sha256 = "13iagavgqq3sn9m3sck0chydwy5rcbhj0ylvc1169vs8q2m13yh9";
};
}
]
19 changes: 11 additions & 8 deletions pkgs/development/python-modules/aiohttp/default.nix
Expand Up @@ -6,30 +6,33 @@
, multidict
, async-timeout
, yarl
, idna-ssl
, pytest
, gunicorn
, pytest-raisesregexp
, pytest-mock
}:

buildPythonPackage rec {
pname = "aiohttp";
version = "2.3.9";
version = "2.3.10";

src = fetchPypi {
inherit pname version;
sha256 = "6003bed78dc591d31bd89ef16e630a1c4fd97a3cd17b975ec945c0f46d6fc881";
sha256 = "8adda6583ba438a4c70693374e10b60168663ffa6564c5c75d3c7a9055290964";
};

disabled = pythonOlder "3.4";

doCheck = false; # Too many tests fail.
checkInputs = [ pytest gunicorn pytest-raisesregexp pytest-mock ];

checkInputs = [ pytest gunicorn pytest-raisesregexp ];
propagatedBuildInputs = [ async-timeout chardet multidict yarl ];
propagatedBuildInputs = [ async-timeout chardet multidict yarl ]
++ lib.optional (pythonOlder "3.7") idna-ssl;

meta = {
description = "Http client/server for asyncio";
license = with lib.licenses; [ asl20 ];
meta = with lib; {
description = "Asynchronous HTTP Client/Server for Python and asyncio";
license = licenses.asl20;
homepage = https://github.com/KeepSafe/aiohttp/;
maintainers = with maintainers; [ dotlambda ];
};
}
23 changes: 23 additions & 0 deletions pkgs/development/python-modules/idna-ssl/default.nix
@@ -0,0 +1,23 @@
{ lib, buildPythonPackage, fetchPypi, idna }:

buildPythonPackage rec {
pname = "idna_ssl";
version = "1.0.0";

src = fetchPypi {
inherit pname version;
sha256 = "1227e44039bd31e02adaeafdbba61281596d623d222643fb021f87f2144ea147";
};

propagatedBuildInputs = [ idna ];

# Infinite recursion: tests require aiohttp, aiohttp requires idna-ssl
doCheck = false;

meta = with lib; {
description = "Patch ssl.match_hostname for Unicode(idna) domains support";
homepage = https://github.com/aio-libs/idna-ssl;
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}
37 changes: 37 additions & 0 deletions pkgs/development/python-modules/rdflib/default.nix
@@ -0,0 +1,37 @@
{ lib
, buildPythonPackage
, fetchPypi
, isodate
, html5lib
, SPARQLWrapper
, networkx
, nose
, python
}:

buildPythonPackage rec {
pname = "rdflib";
version = "4.2.2";

src = fetchPypi {
inherit pname version;
sha256 = "0398c714znnhaa2x7v51b269hk20iz073knq2mvmqp2ma92z27fs";
};

propagatedBuildInputs = [isodate html5lib SPARQLWrapper ];

checkInputs = [ networkx nose ];

# Python 2 syntax
# Failing doctest
doCheck = false;

checkPhase = ''
${python.interpreter} run_tests.py
'';

meta = {
description = "A Python library for working with RDF, a simple yet powerful language for representing information";
homepage = http://www.rdflib.net/;
};
}

0 comments on commit 55e0f12

Please sign in to comment.