···16161717* [NixOS Manual](https://nixos.org/nixos/manual) - how to install, configure, and maintain a purely-functional Linux distribution
1818* [Nixpkgs Manual](https://nixos.org/nixpkgs/manual/) - contributing to Nixpkgs and using programming-language-specific Nix expressions
1919-* [Nix Package Manager Manual](https://nixos.org/nix/manual) - how to write Nix expresssions (programs), and how to use Nix command line tools
1919+* [Nix Package Manager Manual](https://nixos.org/nix/manual) - how to write Nix expressions (programs), and how to use Nix command line tools
20202121# Community
2222···27272828# Other Project Repositories
29293030-The sources of all offical Nix-related projects are in the [NixOS
3030+The sources of all official Nix-related projects are in the [NixOS
3131organization on GitHub](https://github.com/NixOS/). Here are some of
3232the main ones:
3333
···11+{ config, lib, pkgs, ... }:
22+33+with lib;
44+55+let cfg = config.programs.bandwhich;
66+in {
77+ meta.maintainers = with maintainers; [ filalex77 ];
88+99+ options = {
1010+ programs.bandwhich = {
1111+ enable = mkOption {
1212+ type = types.bool;
1313+ default = false;
1414+ description = ''
1515+ Whether to add bandwhich to the global environment and configure a
1616+ setcap wrapper for it.
1717+ '';
1818+ };
1919+ };
2020+ };
2121+2222+ config = mkIf cfg.enable {
2323+ environment.systemPackages = with pkgs; [ bandwhich ];
2424+ security.wrappers.bandwhich = {
2525+ source = "${pkgs.bandwhich}/bin/bandwhich";
2626+ capabilities = "cap_net_raw,cap_net_admin+ep";
2727+ };
2828+ };
2929+}
+1-1
nixos/modules/services/torrent/transmission.nix
···118118 # 1) Only the "transmission" user and group have access to torrents.
119119 # 2) Optionally update/force specific fields into the configuration file.
120120 serviceConfig.ExecStartPre = preStart;
121121- serviceConfig.ExecStart = "${pkgs.transmission}/bin/transmission-daemon -f --port ${toString config.services.transmission.port}";
121121+ serviceConfig.ExecStart = "${pkgs.transmission}/bin/transmission-daemon -f --port ${toString config.services.transmission.port} --config-dir ${settingsDir}";
122122 serviceConfig.ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
123123 serviceConfig.User = cfg.user;
124124 serviceConfig.Group = cfg.group;
+1-1
nixos/modules/services/web-apps/nextcloud.nix
···6262 https = mkOption {
6363 type = types.bool;
6464 default = false;
6565- description = "Enable if there is a TLS terminating proxy in front of nextcloud.";
6565+ description = "Use https for generated links.";
6666 };
67676868 maxUploadSize = mkOption {
+1-14
nixos/modules/virtualisation/containers.nix
···225225 fi
226226 ${concatStringsSep "\n" (mapAttrsToList renderExtraVeth cfg.extraVeths)}
227227 fi
228228-229229- # Get the leader PID so that we can signal it in
230230- # preStop. We can't use machinectl there because D-Bus
231231- # might be shutting down. FIXME: in systemd 219 we can
232232- # just signal systemd-nspawn to do a clean shutdown.
233233- machinectl show "$INSTANCE" | sed 's/Leader=\(.*\)/\1/;t;d' > "/run/containers/$INSTANCE.pid"
234228 ''
235229 );
236230···715709716710 postStart = postStartScript dummyConfig;
717711718718- preStop =
719719- ''
720720- pid="$(cat /run/containers/$INSTANCE.pid)"
721721- if [ -n "$pid" ]; then
722722- kill -RTMIN+4 "$pid"
723723- fi
724724- rm -f "/run/containers/$INSTANCE.pid"
725725- '';
712712+ preStop = "machinectl poweroff $INSTANCE";
726713727714 restartIfChanged = false;
728715
+22-22
pkgs/applications/editors/jetbrains/default.nix
···250250251251 clion = buildClion rec {
252252 name = "clion-${version}";
253253- version = "2019.2.5"; /* updated by script */
253253+ version = "2019.3.2"; /* updated by script */
254254 description = "C/C++ IDE. New. Intelligent. Cross-platform";
255255 license = stdenv.lib.licenses.unfree;
256256 src = fetchurl {
257257 url = "https://download.jetbrains.com/cpp/CLion-${version}.tar.gz";
258258- sha256 = "0p0shikhf73ayflv5bm212kz06hiy3brww9h9ijjp6lcadxc9pmf"; /* updated by script */
258258+ sha256 = "0aksix22cbbxny68650qxjbbm1fmgbsnp97qix5kl5nx4y4yvlii"; /* updated by script */
259259 };
260260 wmClass = "jetbrains-clion";
261261 update-channel = "CLion RELEASE"; # channel's id as in http://www.jetbrains.com/updates/updates.xml
···263263264264 datagrip = buildDataGrip rec {
265265 name = "datagrip-${version}";
266266- version = "2019.2.6"; /* updated by script */
266266+ version = "2019.3.1"; /* updated by script */
267267 description = "Your Swiss Army Knife for Databases and SQL";
268268 license = stdenv.lib.licenses.unfree;
269269 src = fetchurl {
270270 url = "https://download.jetbrains.com/datagrip/${name}.tar.gz";
271271- sha256 = "0g57njcklyskadxmvwb0r0z3ckq9qmcwh8qd80w396gj8fgbg50g"; /* updated by script */
271271+ sha256 = "1h7va6x625kxc2i22mnya64b1kb4vl5xgjxrv3lqwz725q5hkrxa"; /* updated by script */
272272 };
273273 wmClass = "jetbrains-datagrip";
274274 update-channel = "DataGrip RELEASE";
···276276277277 goland = buildGoland rec {
278278 name = "goland-${version}";
279279- version = "2019.2.4"; /* updated by script */
279279+ version = "2019.3.1"; /* updated by script */
280280 description = "Up and Coming Go IDE";
281281 license = stdenv.lib.licenses.unfree;
282282 src = fetchurl {
283283 url = "https://download.jetbrains.com/go/${name}.tar.gz";
284284- sha256 = "0rkyw3532qvr6jhr09m3h0ssdy5ilfgfvqqliyf0cacwzw9lfv0p"; /* updated by script */
284284+ sha256 = "1lj5i71nw2m9xwv6q48b86kipiwj927bxiwxppb4isqax2w6250d"; /* updated by script */
285285 };
286286 wmClass = "jetbrains-goland";
287287 update-channel = "GoLand RELEASE";
···289289290290 idea-community = buildIdea rec {
291291 name = "idea-community-${version}";
292292- version = "2019.2.4"; /* updated by script */
292292+ version = "2019.3.1"; /* updated by script */
293293 description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
294294 license = stdenv.lib.licenses.asl20;
295295 src = fetchurl {
296296 url = "https://download.jetbrains.com/idea/ideaIC-${version}.tar.gz";
297297- sha256 = "012vmclx6kg85gffgc9mr3fp1ffgx20dz7xvafk7c1iynawx8wgq"; /* updated by script */
297297+ sha256 = "0285jdh350dalvk76ajy57mi1yg1g905cnfhcjlb465bsxaw0z5n"; /* updated by script */
298298 };
299299 wmClass = "jetbrains-idea-ce";
300300 update-channel = "IntelliJ IDEA RELEASE";
···302302303303 idea-ultimate = buildIdea rec {
304304 name = "idea-ultimate-${version}";
305305- version = "2019.2.4"; /* updated by script */
305305+ version = "2019.3.1"; /* updated by script */
306306 description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
307307 license = stdenv.lib.licenses.unfree;
308308 src = fetchurl {
309309 url = "https://download.jetbrains.com/idea/ideaIU-${version}-no-jbr.tar.gz";
310310- sha256 = "09mz4dx3zbnqw0vh4iqr8sn2s8mvgr7zvn4k7kqivsiv8f79g90a"; /* updated by script */
310310+ sha256 = "0rb726nh2c7zxnpjcf6fyrpl29y9wgr6qhpb6hjxia2gzxab9jz0"; /* updated by script */
311311 };
312312 wmClass = "jetbrains-idea";
313313 update-channel = "IntelliJ IDEA RELEASE";
···315315316316 phpstorm = buildPhpStorm rec {
317317 name = "phpstorm-${version}";
318318- version = "2019.2.4"; /* updated by script */
318318+ version = "2019.3.1"; /* updated by script */
319319 description = "Professional IDE for Web and PHP developers";
320320 license = stdenv.lib.licenses.unfree;
321321 src = fetchurl {
322322 url = "https://download.jetbrains.com/webide/PhpStorm-${version}.tar.gz";
323323- sha256 = "1bx8s4hh96pjfyccldwfarwv5fky6kg2kyc0h2arhfzwq1pbaisl"; /* updated by script */
323323+ sha256 = "170ppd0inn3s1yxd5ybspzgx2il78838z900fpg2pznq2hi0rn2h"; /* updated by script */
324324 };
325325 wmClass = "jetbrains-phpstorm";
326326 update-channel = "PhpStorm RELEASE";
···328328329329 pycharm-community = buildPycharm rec {
330330 name = "pycharm-community-${version}";
331331- version = "2019.2.4"; /* updated by script */
331331+ version = "2019.3.1"; /* updated by script */
332332 description = "PyCharm Community Edition";
333333 license = stdenv.lib.licenses.asl20;
334334 src = fetchurl {
335335 url = "https://download.jetbrains.com/python/${name}.tar.gz";
336336- sha256 = "00dl3yx13lw8qyc23dirw96vm2d8c6zsx73ds1ha8zycfh6hkxf8"; /* updated by script */
336336+ sha256 = "1cph2v7gaxikrvvdaz7ihk17qgdzrn86jamik9fijb8sjli3695v"; /* updated by script */
337337 };
338338 wmClass = "jetbrains-pycharm-ce";
339339 update-channel = "PyCharm RELEASE";
···341341342342 pycharm-professional = buildPycharm rec {
343343 name = "pycharm-professional-${version}";
344344- version = "2019.2.4"; /* updated by script */
344344+ version = "2019.3.1"; /* updated by script */
345345 description = "PyCharm Professional Edition";
346346 license = stdenv.lib.licenses.unfree;
347347 src = fetchurl {
348348 url = "https://download.jetbrains.com/python/${name}.tar.gz";
349349- sha256 = "14ab1cvypanwwn0k1hrx3rl964av6pvridgc19z49idw5wpgxgw7"; /* updated by script */
349349+ sha256 = "1bjijwc5f1is2920b497d395ckswhpxilmxaljb6pjwq4a2k8yzx"; /* updated by script */
350350 };
351351 wmClass = "jetbrains-pycharm";
352352 update-channel = "PyCharm RELEASE";
···354354355355 rider = buildRider rec {
356356 name = "rider-${version}";
357357- version = "2019.2.3"; /* updated by script */
357357+ version = "2019.3.1"; /* updated by script */
358358 description = "A cross-platform .NET IDE based on the IntelliJ platform and ReSharper";
359359 license = stdenv.lib.licenses.unfree;
360360 src = fetchurl {
361361 url = "https://download.jetbrains.com/rider/JetBrains.Rider-${version}.tar.gz";
362362- sha256 = "13br6zmqpvi9hcd6wdnalkhj50gzr7cwrdh4v2bpda77iby2pz93"; /* updated by script */
362362+ sha256 = "0cs8fc3h6d2m84ppiqjy0f3xklpc5gf0i6c4bzv04y8ngh0cwgl2"; /* updated by script */
363363 };
364364 wmClass = "jetbrains-rider";
365365 update-channel = "Rider RELEASE";
···367367368368 ruby-mine = buildRubyMine rec {
369369 name = "ruby-mine-${version}";
370370- version = "2019.2.4"; /* updated by script */
370370+ version = "2019.3.1"; /* updated by script */
371371 description = "The Most Intelligent Ruby and Rails IDE";
372372 license = stdenv.lib.licenses.unfree;
373373 src = fetchurl {
374374 url = "https://download.jetbrains.com/ruby/RubyMine-${version}.tar.gz";
375375- sha256 = "1dqp222zvi8ikqdkprmqihyjxiq90vd0a0zl5935xjg1mzf8ald9"; /* updated by script */
375375+ sha256 = "0xadjx4szd9rk3bl3fqzhnfq744gmkbz9li80j5rqm27qhf4axfx"; /* updated by script */
376376 };
377377 wmClass = "jetbrains-rubymine";
378378 update-channel = "RubyMine RELEASE";
···380380381381 webstorm = buildWebStorm rec {
382382 name = "webstorm-${version}";
383383- version = "2019.2.4"; /* updated by script */
383383+ version = "2019.3.1"; /* updated by script */
384384 description = "Professional IDE for Web and JavaScript development";
385385 license = stdenv.lib.licenses.unfree;
386386 src = fetchurl {
387387 url = "https://download.jetbrains.com/webstorm/WebStorm-${version}.tar.gz";
388388- sha256 = "0iz9qgrbhn1rxr8n5q1y7klfs27j1f55pw8hqbl2ln4df94zqi5j"; /* updated by script */
388388+ sha256 = "0qjqd1a44mdlpvv3l4sx2n5clirwxialzh6s2dlb0dibx8zvnckp"; /* updated by script */
389389 };
390390 wmClass = "jetbrains-webstorm";
391391 update-channel = "WebStorm RELEASE";
···4040# They must be propagated to the environment of any executable linking with the library
4141, libraryFrameworkDepends ? [], executableFrameworkDepends ? []
4242, homepage ? "https://hackage.haskell.org/package/${pname}"
4343-, platforms ? with stdenv.lib.platforms; unix ++ windows # GHC can cross-compile
4343+, platforms ? with stdenv.lib.platforms; all # GHC can cross-compile
4444, hydraPlatforms ? null
4545, hyperlinkSource ? true
4646, isExecutable ? false, isLibrary ? !isExecutable
···131131 '';
132132133133 crossCabalFlags = [
134134- "--with-ghc=${ghc.targetPrefix}ghc"
134134+ "--with-ghc=${ghcCommand}"
135135 "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
136136- "--with-gcc=${stdenv.cc.targetPrefix}cc"
136136+ # Pass the "wrong" C compiler rather than none at all so packages that just
137137+ # use the C preproccessor still work, see
138138+ # https://github.com/haskell/cabal/issues/6466 for details.
139139+ "--with-gcc=${(if stdenv.hasCC then stdenv else buildPackages.stdenv).cc.targetPrefix}cc"
140140+ ] ++ optionals stdenv.hasCC [
137141 "--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
138142 "--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
139143 # use the one that comes with the cross compiler.
···156160 "--libsubdir=\\$abi/\\$libname"
157161 (optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
158162 (optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}")
163163+ ] ++ optionals stdenv.hasCC [
159164 "--with-gcc=$CC" # Clang won't work without that extra information.
165165+ ] ++ [
160166 "--package-db=$packageConfDir"
161167 (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}")
162168 (optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
+3-2
pkgs/development/haskell-modules/hoogle.nix
···2323# This will build mmorph and monadControl, and have the hoogle installation
2424# refer to their documentation via symlink so they are not garbage collected.
25252626-{ lib, stdenv, hoogle, writeText, ghc
2626+{ lib, stdenv, buildPackages
2727+, hoogle, writeText, ghc
2728, packages
2829}:
2930···5354 (map (lib.getOutput "doc") packages);
54555556in
5656-stdenv.mkDerivation {
5757+buildPackages.stdenv.mkDerivation {
5758 name = "hoogle-local-0.1";
5859 buildInputs = [ghc hoogle];
5960
+1-1
pkgs/development/interpreters/perl/default.nix
···146146 substituteInPlace "$out"/lib/perl5/*/*/Config_heavy.pl \
147147 --replace "${libcInc}" /no-such-path \
148148 --replace "${
149149- if stdenv.cc.cc or null != null then stdenv.cc.cc else "/no-such-path"
149149+ if stdenv.hasCC then stdenv.cc.cc else "/no-such-path"
150150 }" /no-such-path \
151151 --replace "${stdenv.cc}" /no-such-path \
152152 --replace "$man" /no-such-path
···121121 postStage = buildPackages: {
122122 __raw = true;
123123 stdenv.cc =
124124- if buildPackages.stdenv.cc.isClang or false
125125- then buildPackages.clang
126126- else buildPackages.gcc;
124124+ if buildPackages.stdenv.hasCC
125125+ then
126126+ if buildPackages.stdenv.cc.isClang or false
127127+ then buildPackages.clang
128128+ else buildPackages.gcc
129129+ else
130130+ # This will blow up if anything uses it, but that's OK. The `if
131131+ # buildPackages.stdenv.cc.isClang then ... else ...` would blow up
132132+ # everything, so we make sure to avoid that.
133133+ buildPackages.stdenv.cc;
127134 };
128135129136in dfold folder postStage (_: {}) withAllowCustomOverrides
+7-1
pkgs/stdenv/cross/default.nix
···5151 extraBuildInputs = [ ]; # Old ones run on wrong platform
5252 allowedRequisites = null;
53535454+ hasCC = !targetPlatform.isGhcjs;
5555+5456 cc = if crossSystem.useiOSPrebuilt or false
5557 then buildPackages.darwin.iosSdkPkgs.clang
5658 else if crossSystem.useAndroidPrebuilt or false
5759 then buildPackages."androidndkPkgs_${crossSystem.ndkVer}".clang
5860 else if targetPlatform.isGhcjs
5959- then null
6161+ # Need to use `throw` so tryEval for splicing works, ugh. Using
6262+ # `null` or skipping the attribute would cause an eval failure
6363+ # `tryEval` wouldn't catch, wrecking accessing previous stages
6464+ # when there is a C compiler and everything should be fine.
6565+ then throw "no C compiler provided for this platform"
6066 else if crossSystem.useLLVM or false
6167 then buildPackages.llvmPackages_8.lldClang
6268 else buildPackages.gcc;
+13-3
pkgs/stdenv/generic/default.nix
···11let lib = import ../../../lib; in lib.makeOverridable (
2233-{ name ? "stdenv", preHook ? "", initialPath, cc, shell
33+{ name ? "stdenv", preHook ? "", initialPath
44+55+, # If we don't have a C compiler, we might either have `cc = null` or `cc =
66+ # throw ...`, but if we do have a C compiler we should definiely have `cc !=
77+ # null`.
88+ #
99+ # TODO(@Ericson2314): Add assert without creating infinite recursion
1010+ hasCC ? cc != null, cc
1111+1212+, shell
413, allowedRequisites ? null, extraAttrs ? {}, overrides ? (self: super: {}), config
514615, # The `fetchurl' to use for downloading curl and its dependencies
···5766 ../../build-support/setup-hooks/move-sbin.sh
5867 ../../build-support/setup-hooks/move-lib64.sh
5968 ../../build-support/setup-hooks/set-source-date-epoch-to-latest.sh
6060- cc
6969+ # TODO use lib.optional instead
7070+ (if hasCC then cc else null)
6171 ];
62726373 defaultBuildInputs = extraBuildInputs;
···145155146156 inherit overrides;
147157148148- inherit cc;
158158+ inherit cc hasCC;
149159 }
150160151161 # Propagate any extra attributes. For instance, we use this to
+32
pkgs/tools/networking/bandwhich/default.nix
···11+{ stdenv, fetchFromGitHub, rustPlatform, Security }:
22+33+rustPlatform.buildRustPackage rec {
44+ pname = "bandwhich";
55+ version = "0.6.0";
66+77+ src = fetchFromGitHub {
88+ owner = "imsnif";
99+ repo = pname;
1010+ rev = version;
1111+ sha256 = "0jjqc8sysvw63mwy68z9p16vc1pygrm1wxyll6piwvbbnirpys1y";
1212+ };
1313+1414+ cargoSha256 = "1rixpljqddwhryddzni5l6m4sjyn1krrj0ig0rzc701am7srhg3a";
1515+1616+ buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
1717+1818+ meta = with stdenv.lib; {
1919+ description = "A CLI utility for displaying current network utilization";
2020+ longDescription = ''
2121+ bandwhich sniffs a given network interface and records IP packet size, cross
2222+ referencing it with the /proc filesystem on linux or lsof on MacOS. It is
2323+ responsive to the terminal window size, displaying less info if there is
2424+ no room for it. It will also attempt to resolve ips to their host name in
2525+ the background using reverse DNS on a best effort basis.
2626+ '';
2727+ homepage = "https://github.com/imsnif/bandwhich";
2828+ license = licenses.mit;
2929+ maintainers = with maintainers; [ filalex77 ];
3030+ platforms = platforms.unix;
3131+ };
3232+}