···299 # This is useful to build environments for developing on that
300 # package.
301 getHaskellBuildInputs = p:
302- (p.override { mkDerivation = extractBuildInputs p.compiler;
303- }).haskellBuildInputs;
000304305 # Under normal evaluation, simply return the original package. Under
306 # nix-shell evaluation, return a nix-shell optimized environment.
···299 # This is useful to build environments for developing on that
300 # package.
301 getHaskellBuildInputs = p:
302+ (overrideCabal p (args: {
303+ passthru = (args.passthru or {}) // {
304+ _getHaskellBuildInputs = extractBuildInputs p.compiler args;
305+ };
306+ }))._getHaskellBuildInputs;
307308 # Under normal evaluation, simply return the original package. Under
309 # nix-shell evaluation, return a nix-shell optimized environment.
···167 "lutron_caseta" = ps: with ps; [ ];
168 "matrix" = ps: with ps; [ matrix-client ];
169 "maxcube" = ps: with ps; [ ];
170- "media_extractor" = ps: with ps; [ ];
171 "media_player.anthemav" = ps: with ps; [ ];
172 "media_player.aquostv" = ps: with ps; [ ];
173 "media_player.blackbird" = ps: with ps; [ ];
···276 "satel_integra" = ps: with ps; [ ];
277 "scene.hunterdouglas_powerview" = ps: with ps; [ ];
278 "scsgate" = ps: with ps; [ ];
279- "sensor.airvisual" = ps: with ps; [ ];
280 "sensor.alpha_vantage" = ps: with ps; [ ];
281 "sensor.bbox" = ps: with ps; [ ];
282 "sensor.bh1750" = ps: with ps; [ ];
···167 "lutron_caseta" = ps: with ps; [ ];
168 "matrix" = ps: with ps; [ matrix-client ];
169 "maxcube" = ps: with ps; [ ];
170+ "media_extractor" = ps: with ps; [ youtube-dl-light ];
171 "media_player.anthemav" = ps: with ps; [ ];
172 "media_player.aquostv" = ps: with ps; [ ];
173 "media_player.blackbird" = ps: with ps; [ ];
···276 "satel_integra" = ps: with ps; [ ];
277 "scene.hunterdouglas_powerview" = ps: with ps; [ ];
278 "scsgate" = ps: with ps; [ ];
279+ "sensor.airvisual" = ps: with ps; [ pyairvisual ];
280 "sensor.alpha_vantage" = ps: with ps; [ ];
281 "sensor.bbox" = ps: with ps; [ ];
282 "sensor.bh1750" = ps: with ps; [ ];
+23-12
pkgs/servers/home-assistant/parse-requirements.py
···25COMPONENT_PREFIX = GENERAL_PREFIX + 'components.'
26PKG_SET = 'python3Packages'
27000000028def get_version():
29 with open(os.path.dirname(sys.argv[0]) + '/default.nix') as f:
30 m = re.search('hassVersion = "([\\d\\.]+)";', f.read())
···59packages = json.loads(output)
6061def name_to_attr_path(req):
62- attr_paths = []
63 names = [req]
64 # E.g. python-mpd2 is actually called python3.6-mpd2
65 # instead of python-3.6-python-mpd2 inside Nixpkgs
···71 pattern = re.compile('^python\\d\\.\\d-{}-\\d'.format(name), re.I)
72 for attr_path, package in packages.items():
73 if pattern.match(package['name']):
74- attr_paths.append(attr_path)
000000075 # Let's hope there's only one derivation with a matching name
76 assert(len(attr_paths) <= 1)
77- if attr_paths:
78- return attr_paths[0]
79 else:
80 return None
81···86for component, reqs in OrderedDict(sorted(requirements.items())).items():
87 attr_paths = []
88 for req in reqs:
89- try:
90- name = req.split('==')[0]
91- attr_path = name_to_attr_path(name)
92- if attr_path is not None:
93- # Add attribute path without "python3Packages." prefix
94- attr_paths.append(attr_path[len(PKG_SET + '.'):])
95- except RequirementParseError:
96- continue
97 else:
98 build_inputs[component] = attr_paths
99
···25COMPONENT_PREFIX = GENERAL_PREFIX + 'components.'
26PKG_SET = 'python3Packages'
2728+# If some requirements are matched by multiple python packages,
29+# the following can be used to choose one of them
30+PKG_PREFERENCES = {
31+ # Use python3Packages.youtube-dl-light instead of python3Packages.youtube-dl
32+ 'youtube-dl': 'youtube-dl-light'
33+}
34+35def get_version():
36 with open(os.path.dirname(sys.argv[0]) + '/default.nix') as f:
37 m = re.search('hassVersion = "([\\d\\.]+)";', f.read())
···66packages = json.loads(output)
6768def name_to_attr_path(req):
69+ attr_paths = set()
70 names = [req]
71 # E.g. python-mpd2 is actually called python3.6-mpd2
72 # instead of python-3.6-python-mpd2 inside Nixpkgs
···78 pattern = re.compile('^python\\d\\.\\d-{}-\\d'.format(name), re.I)
79 for attr_path, package in packages.items():
80 if pattern.match(package['name']):
81+ attr_paths.add(attr_path)
82+ if len(attr_paths) > 1:
83+ for to_replace, replacement in PKG_PREFERENCES.items():
84+ try:
85+ attr_paths.remove(PKG_SET + '.' + to_replace)
86+ attr_paths.add(PKG_SET + '.' + replacement)
87+ except KeyError:
88+ pass
89 # Let's hope there's only one derivation with a matching name
90 assert(len(attr_paths) <= 1)
91+ if len(attr_paths) == 1:
92+ return attr_paths.pop()
93 else:
94 return None
95···100for component, reqs in OrderedDict(sorted(requirements.items())).items():
101 attr_paths = []
102 for req in reqs:
103+ name = req.split('==')[0]
104+ attr_path = name_to_attr_path(name)
105+ if attr_path is not None:
106+ # Add attribute path without "python3Packages." prefix
107+ attr_paths.append(attr_path[len(PKG_SET + '.'):])
000108 else:
109 build_inputs[component] = attr_paths
110
···1-{ fetchurl, stdenv, python, bash }:
23-let
04 version = "22.5.1";
5-in
6- stdenv.mkDerivation rec {
7- name = "autojump-${version}";
89- src = fetchurl {
10- url = "http://github.com/joelthelion/autojump/archive/release-v${version}.tar.gz";
11- name = "autojump-${version}.tar.gz";
12- sha256 = "17z9j9936x0nizwrzf664bngh60x5qbvrrf1s5qdzd0f2gdanpvn";
13- };
01415- buildInputs = [ python bash ];
16- dontBuild = true;
1718- installPhase = ''
19- python ./install.py -d $out -p ""
20- chmod +x $out/etc/profile.d/*
000002122- mkdir -p "$out/etc/bash_completion.d"
23- cp -v $out/share/autojump/autojump.bash "$out/etc/bash_completion.d"
00000002425- mkdir -p $out/share/fish/vendor_completions.d/
26- cp -v $out/share/autojump/autojump.fish "$out/share/fish/vendor_completions.d/autojump.fish"
00000002728- cat <<SCRIPT > $out/bin/autojump-share
29- #!/bin/sh
30- # Run this script to find the autojump shared folder where all the shell
31- # integration scripts are living.
32- echo $out/share/autojump
33- SCRIPT
34- chmod +x $out/bin/autojump-share
35 '';
36-37- meta = {
38- description = "A `cd' command that learns";
39- longDescription = ''
40- One of the most used shell commands is “cd”. A quick survey
41- among my friends revealed that between 10 and 20% of all
42- commands they type are actually cd commands! Unfortunately,
43- jumping from one part of your system to another with cd
44- requires to enter almost the full path, which isn’t very
45- practical and requires a lot of keystrokes.
46-47- Autojump is a faster way to navigate your filesystem. It
48- works by maintaining a database of the directories you use the
49- most from the command line. The jstat command shows you the
50- current contents of the database. You need to work a little
51- bit before the database becomes usable. Once your database
52- is reasonably complete, you can “jump” to a directory by
53- typing "j dirspec", where dirspec is a few characters of the
54- directory you want to jump to. It will jump to the most used
55- directory whose name matches the pattern given in dirspec.
56-57- Autojump supports tab-completion.
58- '';
59- homepage = http://wiki.github.com/joelthelion/autojump;
60- license = stdenv.lib.licenses.gpl3;
61- platforms = stdenv.lib.platforms.all;
62- maintainers = [ stdenv.lib.maintainers.domenkozar ];
63- };
64- }
···1+{ stdenv, fetchFromGitHub, python, bash }:
23+stdenv.mkDerivation rec {
4+ name = "autojump-${version}";
5 version = "22.5.1";
00067+ src = fetchFromGitHub {
8+ owner = "wting";
9+ repo = "autojump";
10+ rev = "release-v${version}";
11+ sha256 = "1l1278g3k1qfrz41pkpjdhsabassb9si2d1bfbcmvbv5h3wmlqk9";
12+ };
1314+ buildInputs = [ python bash ];
15+ dontBuild = true;
1617+ installPhase = ''
18+ python ./install.py -d "$out" -p "" -z "$out/share/zsh/site-functions/"
19+20+ chmod +x "$out/etc/profile.d/autojump.sh"
21+ install -Dt "$out/share/bash-completion/completions/" -m444 "$out/share/autojump/autojump.bash"
22+ install -Dt "$out/share/fish/vendor_conf.d/" -m444 "$out/share/autojump/autojump.fish"
23+ install -Dt "$out/share/zsh/site-functions/" -m444 "$out/share/autojump/autojump.zsh"
24+ '';
2526+ meta = with stdenv.lib; {
27+ description = "A `cd' command that learns";
28+ longDescription = ''
29+ One of the most used shell commands is “cd”. A quick survey
30+ among my friends revealed that between 10 and 20% of all
31+ commands they type are actually cd commands! Unfortunately,
32+ jumping from one part of your system to another with cd
33+ requires to enter almost the full path, which isn’t very
34+ practical and requires a lot of keystrokes.
3536+ Autojump is a faster way to navigate your filesystem. It
37+ works by maintaining a database of the directories you use the
38+ most from the command line. The jstat command shows you the
39+ current contents of the database. You need to work a little
40+ bit before the database becomes usable. Once your database
41+ is reasonably complete, you can “jump” to a directory by
42+ typing "j dirspec", where dirspec is a few characters of the
43+ directory you want to jump to. It will jump to the most used
44+ directory whose name matches the pattern given in dirspec.
4546+ Autojump supports tab-completion.
00000047 '';
48+ homepage = http://wiki.github.com/wting/autojump;
49+ license = licenses.gpl3;
50+ platforms = platforms.all;
51+ maintainers = with maintainers; [ domenkozar yurrriq ];
52+ };
53+}
00000000000000000000000
···1-{ stdenv, targetPlatform, fetchurl, buildPythonApplication
2, zip, ffmpeg, rtmpdump, phantomjs2, atomicparsley, pycryptodome, pandoc
3# Pandoc is required to build the package's man page. Release tarballs contain a
4# formatted man page already, though, it will still be installed. We keep the
···13, makeWrapper }:
1415with stdenv.lib;
16-buildPythonApplication rec {
1718 pname = "youtube-dl";
19 version = "2018.05.18";
···1+{ stdenv, targetPlatform, fetchurl, buildPythonPackage
2, zip, ffmpeg, rtmpdump, phantomjs2, atomicparsley, pycryptodome, pandoc
3# Pandoc is required to build the package's man page. Release tarballs contain a
4# formatted man page already, though, it will still be installed. We keep the
···13, makeWrapper }:
1415with stdenv.lib;
16+buildPythonPackage rec {
1718 pname = "youtube-dl";
19 version = "2018.05.18";
+4-4
pkgs/tools/networking/wireguard-go/default.nix
···23buildGoPackage rec {
4 name = "wireguard-go-${version}";
5- version = "0.0.20180514";
67 goPackagePath = "wireguard-go";
89 src = fetchzip {
10 url = "https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-${version}.tar.xz";
11- sha256 = "1i1w4vj8w353b92nfhs92k0f7fifrwi067qfmgckdk0kk76nv2id";
12 };
1314 goDeps = ./deps.nix;
···22 description = "Userspace Go implementation of WireGuard";
23 homepage = https://git.zx2c4.com/wireguard-go/about/;
24 license = licenses.gpl2;
25- maintainers = with maintainers; [ kirelagin ];
26- platforms = with platforms; linux ++ darwin ++ windows;
27 };
28}