Skip to content

Commit 20b8e4b

Browse files
committedJul 30, 2017
Merge remote-tracking branch 'upstream/master' into HEAD
2 parents 69e24c0 + 9ea8535 commit 20b8e4b

File tree

37 files changed

+281
-119
lines changed

37 files changed

+281
-119
lines changed
 

‎doc/languages-frameworks/ruby.xml

+41-13
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44

55
<title>Ruby</title>
66

7-
<para>There currently is support to bundle applications that are packaged as Ruby gems. The utility "bundix" allows you to write a <filename>Gemfile</filename>, let bundler create a <filename>Gemfile.lock</filename>, and then convert
8-
this into a nix expression that contains all Gem dependencies automatically.</para>
7+
<para>There currently is support to bundle applications that are packaged as
8+
Ruby gems. The utility "bundix" allows you to write a
9+
<filename>Gemfile</filename>, let bundler create a
10+
<filename>Gemfile.lock</filename>, and then convert this into a nix
11+
expression that contains all Gem dependencies automatically.
12+
</para>
913

10-
<para>For example, to package sensu, we did:</para>
14+
<para>For example, to package sensu, we did:</para>
1115

1216
<screen>
1317
<![CDATA[$ cd pkgs/servers/monitoring
@@ -38,14 +42,20 @@ bundlerEnv rec {
3842
}]]>
3943
</screen>
4044

41-
<para>Please check in the <filename>Gemfile</filename>, <filename>Gemfile.lock</filename> and the <filename>gemset.nix</filename> so future updates can be run easily.
45+
<para>Please check in the <filename>Gemfile</filename>,
46+
<filename>Gemfile.lock</filename> and the
47+
<filename>gemset.nix</filename> so future updates can be run easily.
4248
</para>
4349

44-
<para>For tools written in Ruby - i.e. where the desire is to install a package and then execute e.g. <command>rake</command> at the command line, there is an alternative builder called <literal>bundlerApp</literal>. Set up the <filename>gemset.nix</filename> the same way, and then, for example:
50+
<para>For tools written in Ruby - i.e. where the desire is to install
51+
a package and then execute e.g. <command>rake</command> at the command
52+
line, there is an alternative builder called <literal>bundlerApp</literal>.
53+
Set up the <filename>gemset.nix</filename> the same way, and then, for
54+
example:
4555
</para>
4656

4757
<screen>
48-
<![CDATA[{ lib, bundlerApp }:
58+
<![CDATA[{ lib, bundlerApp }:
4959
5060
bundlerApp {
5161
pname = "corundum";
@@ -60,15 +70,33 @@ bundlerApp {
6070
platforms = platforms.unix;
6171
};
6272
}]]>
73+
</screen>
6374

64-
<para>The chief advantage of <literal>bundlerApp</literal> over <literal>bundlerEnv</literal> is the executables introduced in the environment are precisely those selected in the <literal>exes</literal> list, as opposed to <literal>bundlerEnv</literal> which adds all the executables made available by gems in the gemset, which can mean e.g. <command>rspec</command> or <command>rake</command> in unpredictable versions available from various packages.
75+
<para>The chief advantage of <literal>bundlerApp</literal> over
76+
<literal>bundlerEnv</literal> is the executables introduced in the
77+
environment are precisely those selected in the <literal>exes</literal>
78+
list, as opposed to <literal>bundlerEnv</literal> which adds all the
79+
executables made available by gems in the gemset, which can mean e.g.
80+
<command>rspec</command> or <command>rake</command> in unpredictable
81+
versions available from various packages.
82+
</para>
6583

66-
<para>Resulting derivations for both builders also have two helpful attributes, <literal>env</literal> and <literal>wrapper</literal>. The first one allows one to quickly drop into
67-
<command>nix-shell</command> with the specified environment present. E.g. <command>nix-shell -A sensu.env</command> would give you an environment with Ruby preset
68-
so it has all the libraries necessary for <literal>sensu</literal> in its paths. The second one can be used to make derivations from custom Ruby scripts which have
69-
<filename>Gemfile</filename>s with their dependencies specified. It is a derivation with <command>ruby</command> wrapped so it can find all the needed dependencies.
70-
For example, to make a derivation <literal>my-script</literal> for a <filename>my-script.rb</filename> (which should be placed in <filename>bin</filename>) you should
71-
run <command>bundix</command> as specified above and then use <literal>bundlerEnv</literal> like this:</para>
84+
<para>Resulting derivations for both builders also have two helpful
85+
attributes, <literal>env</literal> and <literal>wrapper</literal>.
86+
The first one allows one to quickly drop into
87+
<command>nix-shell</command> with the specified environment present.
88+
E.g. <command>nix-shell -A sensu.env</command> would give you an
89+
environment with Ruby preset so it has all the libraries necessary
90+
for <literal>sensu</literal> in its paths. The second one can be
91+
used to make derivations from custom Ruby scripts which have
92+
<filename>Gemfile</filename>s with their dependencies specified. It is
93+
a derivation with <command>ruby</command> wrapped so it can find all
94+
the needed dependencies. For example, to make a derivation
95+
<literal>my-script</literal> for a <filename>my-script.rb</filename>
96+
(which should be placed in <filename>bin</filename>) you should run
97+
<command>bundix</command> as specified above and then use
98+
<literal>bundlerEnv</literal> like this:
99+
</para>
72100

73101
<programlisting>
74102
<![CDATA[let env = bundlerEnv {

‎nixos/lib/make-ext4-fs.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pkgs.stdenv.mkDerivation {
3333
echo "Creating an EXT4 image of $bytes bytes (numInodes=$numInodes, numDataBlocks=$numDataBlocks)"
3434
3535
truncate -s $bytes $out
36-
faketime "1970-01-01 00:00:00" mkfs.ext4 -L ${volumeLabel} -U 44444444-4444-4444-8888-888888888888 $out
36+
faketime -f "1970-01-01 00:00:01" mkfs.ext4 -L ${volumeLabel} -U 44444444-4444-4444-8888-888888888888 $out
3737
3838
# Populate the image contents by piping a bunch of commands to the `debugfs` tool from e2fsprogs.
3939
# For example, to copy /nix/store/abcd...efg-coreutils-8.23/bin/sleep:
@@ -76,7 +76,7 @@ pkgs.stdenv.mkDerivation {
7676
7777
echo sif $file gid 30000 # chgrp to nixbld
7878
done
79-
) | faketime "1970-01-01 00:00:00" debugfs -w $out -f /dev/stdin > errorlog 2>&1
79+
) | faketime -f "1970-01-01 00:00:01" debugfs -w $out -f /dev/stdin > errorlog 2>&1
8080
8181
# The debugfs tool doesn't terminate on error nor exit with a non-zero status. Check manually.
8282
if egrep -q 'Could not allocate|File not found' errorlog; then

‎nixos/modules/config/users-groups.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ in {
527527
input.gid = ids.gids.input;
528528
};
529529

530-
system.activationScripts.users = stringAfter [ "etc" ]
530+
system.activationScripts.users = stringAfter [ "stdio" ]
531531
''
532532
${pkgs.perl}/bin/perl -w \
533533
-I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl \

‎nixos/modules/services/networking/tinc.nix

-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ in
164164
wantedBy = [ "multi-user.target" ];
165165
after = [ "network.target" ];
166166
path = [ data.package ];
167-
restartTriggers = [ config.environment.etc."tinc/${network}/tinc.conf".source ]
168-
++ mapAttrsToList (host: _ : config.environment.etc."tinc/${network}/hosts/${host}".source) data.hosts;
169167
serviceConfig = {
170168
Type = "simple";
171169
PIDFile = "/run/tinc.${network}.pid";

‎nixos/modules/services/web-servers/lighttpd/default.nix

+18-9
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ let
3737
"mod_rrdtool"
3838
"mod_accesslog"
3939
# Remaining list of modules, order assumed to be unimportant.
40+
"mod_authn_file"
41+
"mod_authn_mysql"
4042
"mod_cml"
41-
"mod_dirlisting"
43+
"mod_deflate"
4244
"mod_evasive"
4345
"mod_extforward"
4446
"mod_flv_streaming"
@@ -47,6 +49,7 @@ let
4749
"mod_scgi"
4850
"mod_setenv"
4951
"mod_trigger_b4_dl"
52+
"mod_uploadprogress"
5053
"mod_webdav"
5154
];
5255

@@ -86,14 +89,9 @@ let
8689
accesslog.use-syslog = "enable"
8790
server.errorlog-use-syslog = "enable"
8891
89-
mimetype.assign = (
90-
".html" => "text/html",
91-
".htm" => "text/html",
92-
".txt" => "text/plain",
93-
".jpg" => "image/jpeg",
94-
".png" => "image/png",
95-
".css" => "text/css"
96-
)
92+
${lib.optionalString cfg.enableUpstreamMimeTypes ''
93+
include "${pkgs.lighttpd}/share/lighttpd/doc/config/conf.d/mime.conf"
94+
''}
9795
9896
static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" )
9997
index-file.names = ( "index.html" )
@@ -165,6 +163,17 @@ in
165163
'';
166164
};
167165

166+
enableUpstreamMimeTypes = mkOption {
167+
type = types.bool;
168+
default = true;
169+
description = ''
170+
Whether to include the list of mime types bundled with lighttpd
171+
(upstream). If you disable this, no mime types will be added by
172+
NixOS and you will have to add your own mime types in
173+
<option>services.lighttpd.extraConfig</option>.
174+
'';
175+
};
176+
168177
mod_status = mkOption {
169178
default = false;
170179
type = types.bool;

‎nixos/modules/system/boot/networkd.nix

+30
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@ let
142142
(assertValueOneOf "EmitTimezone" boolValues)
143143
];
144144

145+
# .network files have a [Link] section with different options than in .netlink files
146+
checkNetworkLink = checkUnitConfig "Link" [
147+
(assertOnlyFields [
148+
"MACAddress" "MTUBytes" "ARP" "Unmanaged"
149+
])
150+
(assertMacAddress "MACAddress")
151+
(assertByteFormat "MTUBytes")
152+
(assertValueOneOf "ARP" boolValues)
153+
(assertValueOneOf "Unmanaged" boolValues)
154+
];
155+
156+
145157
commonNetworkOptions = {
146158

147159
enable = mkOption {
@@ -371,6 +383,18 @@ let
371383
'';
372384
};
373385

386+
linkConfig = mkOption {
387+
default = {};
388+
example = { Unmanaged = true; };
389+
type = types.addCheck (types.attrsOf unitOption) checkNetworkLink;
390+
description = ''
391+
Each attribute in this set specifies an option in the
392+
<literal>[Link]</literal> section of the unit. See
393+
<citerefentry><refentrytitle>systemd.network</refentrytitle>
394+
<manvolnum>5</manvolnum></citerefentry> for details.
395+
'';
396+
};
397+
374398
name = mkOption {
375399
type = types.nullOr types.str;
376400
default = null;
@@ -581,6 +605,12 @@ let
581605
{ inherit (def) enable;
582606
text = commonMatchText def +
583607
''
608+
${optionalString (def.linkConfig != { }) ''
609+
[Link]
610+
${attrsToSection def.linkConfig}
611+
612+
''}
613+
584614
[Network]
585615
${attrsToSection def.networkConfig}
586616
${concatStringsSep "\n" (map (s: "Address=${s}") def.address)}

‎nixos/modules/system/etc/etc.nix

+23-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ let
2020
sources = map (x: x.source) etc';
2121
targets = map (x: x.target) etc';
2222
modes = map (x: x.mode) etc';
23-
uids = map (x: x.uid) etc';
24-
gids = map (x: x.gid) etc';
23+
users = map (x: x.user) etc';
24+
groups = map (x: x.group) etc';
2525
};
2626

2727
in
@@ -108,6 +108,26 @@ in
108108
'';
109109
};
110110

111+
user = mkOption {
112+
default = "+${toString config.uid}";
113+
type = types.str;
114+
description = ''
115+
User name of created file.
116+
Only takes affect when the file is copied (that is, the mode is not 'symlink').
117+
Changing this option takes precedence over <literal>uid</literal>.
118+
'';
119+
};
120+
121+
group = mkOption {
122+
default = "+${toString config.gid}";
123+
type = types.str;
124+
description = ''
125+
Group name of created file.
126+
Only takes affect when the file is copied (that is, the mode is not 'symlink').
127+
Changing this option takes precedence over <literal>gid</literal>.
128+
'';
129+
};
130+
111131
};
112132

113133
config = {
@@ -130,7 +150,7 @@ in
130150

131151
system.build.etc = etc;
132152

133-
system.activationScripts.etc = stringAfter [ "stdio" ]
153+
system.activationScripts.etc = stringAfter [ "users" "groups" ]
134154
''
135155
# Set up the statically computed bits of /etc.
136156
echo "setting up /etc..."

‎nixos/modules/system/etc/make-etc.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ set -f
66
sources_=($sources)
77
targets_=($targets)
88
modes_=($modes)
9-
uids_=($uids)
10-
gids_=($gids)
9+
users_=($users)
10+
groups_=($groups)
1111
set +f
1212

1313
for ((i = 0; i < ${#targets_[@]}; i++)); do
@@ -36,9 +36,9 @@ for ((i = 0; i < ${#targets_[@]}; i++)); do
3636
fi
3737

3838
if test "${modes_[$i]}" != symlink; then
39-
echo "${modes_[$i]}" > $out/etc/$target.mode
40-
echo "${uids_[$i]}" > $out/etc/$target.uid
41-
echo "${gids_[$i]}" > $out/etc/$target.gid
39+
echo "${modes_[$i]}" > $out/etc/$target.mode
40+
echo "${users_[$i]}" > $out/etc/$target.uid
41+
echo "${groups_[$i]}" > $out/etc/$target.gid
4242
fi
4343

4444
fi

‎nixos/modules/system/etc/setup-etc.pl

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ sub link {
108108
my $uid = read_file("$_.uid"); chomp $uid;
109109
my $gid = read_file("$_.gid"); chomp $gid;
110110
copy "$static/$fn", "$target.tmp" or warn;
111+
$uid = getpwnam $uid unless $uid =~ /^\+/;
112+
$gid = getgrnam $gid unless $gid =~ /^\+/;
111113
chown int($uid), int($gid), "$target.tmp" or warn;
112114
chmod oct($mode), "$target.tmp" or warn;
113115
rename "$target.tmp", $target or warn;

‎pkgs/applications/audio/baudline/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{ stdenv, fetchurl, libXmu, libXt, libX11, libXext, libXxf86vm, jack
1+
{ stdenv, fetchurl, libXmu, libXt, libX11, libXext, libXxf86vm, libjack2
22
, makeWrapper
33
}:
44

55
let
66
rpath = stdenv.lib.makeLibraryPath
7-
[ libXmu libXt libX11 libXext libXxf86vm jack ];
7+
[ libXmu libXt libX11 libXext libXxf86vm libjack2 ];
88
in
99
stdenv.mkDerivation rec {
1010
name = "baudline-${version}";

‎pkgs/applications/editors/vim/configurable.nix

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ let
2424
let pluginname = substitute(d, ".*/", "", "")
2525
if !has_key(seen, pluginname)
2626
exec 'set runtimepath^='.d
27+
let after = d."/after"
28+
if isdirectory(after)
29+
exec 'set runtimepath^='.after
30+
endif
2731
let seen[pluginname] = 1
2832
endif
2933
endfor

‎pkgs/applications/graphics/ImageMagick/7.0.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ let
1313
else throw "ImageMagick is not supported on this platform.";
1414

1515
cfg = {
16-
version = "7.0.6-1";
17-
sha256 = "1i3gsc0ps7cbvfmnk6fbi5hng18jwh4x4dqbz90a45x85023w9vs";
16+
version = "7.0.6-4";
17+
sha256 = "0fvkx9lf8g0sa9bccd9s5qyhcy0g1mqnkbpqly55ryxyg1ywxqaz";
1818
patches = [];
1919
};
2020
in

‎pkgs/applications/graphics/ImageMagick/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ let
1313
else throw "ImageMagick is not supported on this platform.";
1414

1515
cfg = {
16-
version = "6.9.9-0";
17-
sha256 = "02xnvgjnmz2d4yv4iy1kh7an5w631p1s319jw23c8zpmqhfhk2ha";
16+
version = "6.9.9-3";
17+
sha256 = "1bfg334nxkxhsm6h0hb0vwd9aiz031qa0w8w8hmhdk8m4wawshrg";
1818
patches = [];
1919
}
2020
# Freeze version on mingw so we don't need to port the patch too often.

‎pkgs/applications/graphics/feh/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ with stdenv.lib;
66

77
stdenv.mkDerivation rec {
88
name = "feh-${version}";
9-
version = "2.19";
9+
version = "2.19.1";
1010

1111
src = fetchurl {
1212
url = "http://feh.finalrewind.org/${name}.tar.bz2";
13-
sha256 = "1sfhr6628xpj9p6bqihdq35y139x2gmrpydjlrwsl1rs77c2bgnf";
13+
sha256 = "1d4ycmai3dpajl0bdr9i56646g4h5j1lb95jjn0nckwcddcj927c";
1414
};
1515

1616
outputs = [ "out" "man" "doc" ];

0 commit comments

Comments
 (0)
Please sign in to comment.