···49 '';
50 };
5152+ extraGitoliteRc = mkOption {
53+ type = types.lines;
54+ default = "";
55+ example = literalExample ''
56+ $RC{UMASK} = 0027;
57+ $RC{SITE_INFO} = 'This is our private repository host';
58+ push( @{$RC{ENABLE}}, 'Kindergarten' ); # enable the command/feature
59+ @{$RC{ENABLE}} = grep { $_ ne 'desc' } @{$RC{ENABLE}}; # disable the command/feature
60+ '';
61+ description = ''
62+ Extra configuration to append to the default <literal>~/.gitolite.rc</literal>.
63+64+ This should be Perl code that modifies the <literal>%RC</literal>
65+ configuration variable. The default <literal>~/.gitolite.rc</literal>
66+ content is generated by invoking <literal>gitolite print-default-rc</literal>,
67+ and extra configuration from this option is appended to it. The result
68+ is placed to Nix store, and the <literal>~/.gitolite.rc</literal> file
69+ becomes a symlink to it.
70+71+ If you already have a customized (or otherwise changed)
72+ <literal>~/.gitolite.rc</literal> file, NixOS will refuse to replace
73+ it with a symlink, and the `gitolite-init` initialization service
74+ will fail. In this situation, in order to use this option, you
75+ will need to take any customizations you may have in
76+ <literal>~/.gitolite.rc</literal>, convert them to appropriate Perl
77+ statements, add them to this option, and remove the file.
78+ '';
79+ };
80+81 user = mkOption {
82 type = types.str;
83 default = "gitolite";
···88 };
89 };
9091+ config = mkIf cfg.enable (
92+ let
93+ manageGitoliteRc = cfg.extraGitoliteRc != "";
94+ rcDir = pkgs.runCommand "gitolite-rc" { } rcDirScript;
95+ rcDirScript =
96+ ''
97+ mkdir "$out"
98+ export HOME=temp-home
99+ mkdir -p "$HOME/.gitolite/logs" # gitolite can't run without it
100+ '${pkgs.gitolite}'/bin/gitolite print-default-rc >>"$out/gitolite.rc.default"
101+ cat <<END >>"$out/gitolite.rc"
102+ # This file is managed by NixOS.
103+ # Use services.gitolite options to control it.
104+105+ END
106+ cat "$out/gitolite.rc.default" >>"$out/gitolite.rc"
107+ '' +
108+ optionalString (cfg.extraGitoliteRc != "") ''
109+ echo -n ${escapeShellArg ''
110+111+ # Added by NixOS:
112+ ${removeSuffix "\n" cfg.extraGitoliteRc}
113+114+ # per perl rules, this should be the last line in such a file:
115+ 1;
116+ ''} >>"$out/gitolite.rc"
117+ '';
118+ in {
119 users.extraUsers.${cfg.user} = {
120 description = "Gitolite user";
121 home = cfg.dataDir;
···133 serviceConfig.Type = "oneshot";
134 serviceConfig.RemainAfterExit = true;
135136+ path = [ pkgs.gitolite pkgs.git pkgs.perl pkgs.bash pkgs.diffutils config.programs.ssh.package ];
137+ script =
138+ let
139+ rcSetupScriptIfCustomFile =
140+ if manageGitoliteRc then ''
141+ cat <<END
142+ <3>ERROR: NixOS can't apply declarative configuration
143+ <3>to your .gitolite.rc file, because it seems to be
144+ <3>already customized manually.
145+ <3>See the services.gitolite.extraGitoliteRc option
146+ <3>in "man configuration.nix" for more information.
147+ END
148+ # Not sure if the line below addresses the issue directly or just
149+ # adds a delay, but without it our error message often doesn't
150+ # show up in `systemctl status gitolite-init`.
151+ journalctl --flush
152+ exit 1
153+ '' else ''
154+ :
155+ '';
156+ rcSetupScriptIfDefaultFileOrStoreSymlink =
157+ if manageGitoliteRc then ''
158+ ln -sf "${rcDir}/gitolite.rc" "$GITOLITE_RC"
159+ '' else ''
160+ [[ -L "$GITOLITE_RC" ]] && rm -f "$GITOLITE_RC"
161+ '';
162+ in
163+ ''
164+ cd ${cfg.dataDir}
165+ mkdir -p .gitolite/logs
166+167+ GITOLITE_RC=.gitolite.rc
168+ GITOLITE_RC_DEFAULT=${rcDir}/gitolite.rc.default
169+ if ( [[ ! -e "$GITOLITE_RC" ]] && [[ ! -L "$GITOLITE_RC" ]] ) ||
170+ ( [[ -f "$GITOLITE_RC" ]] && diff -q "$GITOLITE_RC" "$GITOLITE_RC_DEFAULT" >/dev/null ) ||
171+ ( [[ -L "$GITOLITE_RC" ]] && [[ "$(readlink "$GITOLITE_RC")" =~ ^/nix/store/ ]] )
172+ then
173+ '' + rcSetupScriptIfDefaultFileOrStoreSymlink +
174+ ''
175+ else
176+ '' + rcSetupScriptIfCustomFile +
177+ ''
178+ fi
179+180+ if [ ! -d repositories ]; then
181+ gitolite setup -pk ${pubkeyFile}
182+ fi
183+ if [ -n "${hooks}" ]; then
184+ cp ${hooks} .gitolite/hooks/common/
185+ chmod +x .gitolite/hooks/common/*
186+ fi
187+ gitolite setup # Upgrade if needed
188+ '';
189 };
190191 environment.systemPackages = [ pkgs.gitolite pkgs.git ];
192+ });
193}
···217 # Add the mount helpers to the system path so that `mount' can find them.
218 system.fsPackages = [ pkgs.dosfstools ];
219220- environment.systemPackages = [ pkgs.fuse ] ++ config.system.fsPackages;
221222 environment.etc.fstab.text =
223 let
···217 # Add the mount helpers to the system path so that `mount' can find them.
218 system.fsPackages = [ pkgs.dosfstools ];
219220+ environment.systemPackages = with pkgs; [ fuse3 fuse ] ++ config.system.fsPackages;
221222 environment.etc.fstab.text =
223 let
···1+{stdenv, fetchFromGitHub, cmake
2+,full, python, mesa, libXt }:
0000034stdenv.mkDerivation rec {
5+ name = "paraview-${version}";
6+ version = "5.4.0";
7+8+ # fetching from GitHub instead of taking an "official" source
9+ # tarball because of missing submodules there
10+ src = fetchFromGitHub {
11+ owner = "Kitware";
12+ repo = "ParaView";
13+ rev = "v${version}";
14+ sha256 = "0h1vkgwm10mc5mnr3djp81lxr5pi0hyj776z77hiib6xm5596q9n";
15+ fetchSubmodules = true;
16 };
1718+ cmakeFlags = [
19+ "-DPARAVIEW_ENABLE_PYTHON=ON"
20+ "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
21+ ];
000000000002223+ # During build, binaries are called that rely on freshly built
24+ # libraries. These reside in build/lib, and are not found by
25+ # default.
26+ preBuild = ''
27+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
28+ '';
2930 enableParallelBuilding = true;
3132+ buildInputs = [ cmake
33+ python
34+ mesa
35+ libXt
36+37+ # theoretically the following should be fine, but there is an error
38+ # due to missing libqminimal when not using qt5.full
39+40+ # qtbase qtx11extras qttools
41+ full
42+ ];
43+4445 meta = {
46 homepage = http://www.paraview.org/;
···44, hicolor_icon_theme
45, shared_mime_info
4647+# Whether to disable multiprocess support to work around crashing tabs
48+# TODO: fix the underlying problem instead of this terrible work-around
49+, disableContentSandbox ? true
50+51# Extra preferences
52, extraPrefs ? ""
53}:
···213 // Defaults to creating $TBB_HOME/TorBrowser/Data/Tor/{socks,control}.socket
214 lockPref("extensions.torlauncher.control_port_use_ipc", true);
215 lockPref("extensions.torlauncher.socks_port_use_ipc", true);
216+217+ // Optionally disable multiprocess support. We always set this to ensure that
218+ // toggling the pref takes effect.
219+ lockPref("browser.tabs.remote.autostart.2", ${if disableContentSandbox then "false" else "true"});
220221 ${optionalString (extraPrefs != "") ''
222 ${extraPrefs}
···42 "ac_cv_path_SENDMAIL=sendmail"
43 ];
4445+ # Fix missing libidn in mutt;
46+ # this fix is ugly since it links all binaries in mutt against libidn
47+ # like pgpring, pgpewrap, ...
48+ NIX_LDFLAGS = "-lidn";
49+50 configureScript = "./prepare";
5152 enableParallelBuilding = true;
···10 lib,
11 pkgs,
12 pigz,
13+ nixUnstable,
14+ perl,
15 runCommand,
16 rsync,
17 shadow,
···29rec {
3031 examples = import ./examples.nix {
32+ inherit pkgs buildImage pullImage shadowSetup buildImageWithNixDb;
33 };
3435 pullImage =
···239 set -e
240 export PATH=${coreutils}/bin:/bin
241 ${text}
242+ '';
243+244+ nixRegistration = contents: runCommand "nix-registration" {
245+ buildInputs = [ nixUnstable perl ];
246+ # For obtaining the closure of `contents'.
247+ exportReferencesGraph =
248+ let contentsList = if builtins.isList contents then contents else [ contents ];
249+ in map (x: [("closure-" + baseNameOf x) x]) contentsList;
250+ }
251+ ''
252+ mkdir $out
253+ printRegistration=1 perl ${pkgs.pathsFromGraph} closure-* > $out/db.dump
254+ perl ${pkgs.pathsFromGraph} closure-* > $out/storePaths
255 '';
256257 # Create a "layer" (set of files).
···559560 in
561 result;
562+563+ # Build an image and populate its nix database with the provided
564+ # contents. The main purpose is to be able to use nix commands in
565+ # the container.
566+ # Be careful since this doesn't work well with multilayer.
567+ buildImageWithNixDb = args@{ contents ? null, extraCommands ? "", ... }:
568+ buildImage (args // {
569+ extraCommands = ''
570+ echo "Generating the nix database..."
571+ echo "Warning: only the database of the deepest Nix layer is loaded."
572+ echo " If you want to use nix commands in the container, it would"
573+ echo " be better to only have one layer that contains a nix store."
574+ # This requires Nix 1.12 or higher
575+ export NIX_REMOTE=local?root=$PWD
576+ ${nixUnstable}/bin/nix-store --load-db < ${nixRegistration contents}/db.dump
577+578+ # We fill the store in order to run the 'verify' command that
579+ # generates hash and size of output paths.
580+ # Note when Nix 1.12 is be the stable one, the database dump
581+ # generated by the exportReferencesGraph function will
582+ # contains sha and size. See
583+ # https://github.com/NixOS/nix/commit/c2b0d8749f7e77afc1c4b3e8dd36b7ee9720af4a
584+ storePaths=$(cat ${nixRegistration contents}/storePaths)
585+ echo "Copying everything to /nix/store (will take a while)..."
586+ cp -prd $storePaths nix/store/
587+ ${nixUnstable}/bin/nix-store --verify --check-contents
588+589+ mkdir -p nix/var/nix/gcroots/docker/
590+ for i in ${lib.concatStringsSep " " contents}; do
591+ ln -s $i nix/var/nix/gcroots/docker/$(basename $i)
592+ done;
593+ '' + extraCommands;
594+ });
595}
+15-2
pkgs/build-support/docker/examples.nix
···7# $ nix-build '<nixpkgs>' -A dockerTools.examples.redis
8# $ docker load < result
910-{ pkgs, buildImage, pullImage, shadowSetup }:
1112rec {
13 # 1. basic example
···83 };
8485 # 4. example of pulling an image. could be used as a base for other images
86- nix = pullImage {
87 imageName = "nixos/nix";
88 imageTag = "1.11";
89 # this hash will need change if the tag is updated at docker hub
···99 pkgs.emacs
100 pkgs.vim
101 pkgs.nano
0000000000000102 ];
103 };
104}
···7# $ nix-build '<nixpkgs>' -A dockerTools.examples.redis
8# $ docker load < result
910+{ pkgs, buildImage, pullImage, shadowSetup, buildImageWithNixDb }:
1112rec {
13 # 1. basic example
···83 };
8485 # 4. example of pulling an image. could be used as a base for other images
86+ nixFromDockerHub = pullImage {
87 imageName = "nixos/nix";
88 imageTag = "1.11";
89 # this hash will need change if the tag is updated at docker hub
···99 pkgs.emacs
100 pkgs.vim
101 pkgs.nano
102+ ];
103+ };
104+105+ # 5. nix example to play with the container nix store
106+ # docker run -it --rm nix nix-store -qR $(nix-build '<nixpkgs>' -A nix)
107+ nix = buildImageWithNixDb {
108+ name = "nix";
109+ contents = [
110+ # nix-store -qR uses the 'more' program which is not included in
111+ # the pkgs.nix dependencies. We then have to manually get it
112+ # from the 'eject' package:/
113+ pkgs.eject
114+ pkgs.nix
115 ];
116 };
117}
+1-1
pkgs/desktops/lxde/core/lxappearance/default.nix
···20 description = "A lightweight program for configuring the theme and fonts of gtk applications";
21 homepage = http://lxde.org/;
22 maintainers = [ stdenv.lib.maintainers.hinton ];
23- platforms = stdenv.lib.platforms.all;
24 license = stdenv.lib.licenses.gpl2;
25 };
26}
···20 description = "A lightweight program for configuring the theme and fonts of gtk applications";
21 homepage = http://lxde.org/;
22 maintainers = [ stdenv.lib.maintainers.hinton ];
23+ platforms = stdenv.lib.platforms.linux;
24 license = stdenv.lib.licenses.gpl2;
25 };
26}
···26 description = "Library with common API for various MATE modules";
27 homepage = http://mate-desktop.org;
28 license = licenses.gpl2;
29- platforms = platforms.unix;
30 maintainers = [ maintainers.romildo ];
31 };
32}
···26 description = "Library with common API for various MATE modules";
27 homepage = http://mate-desktop.org;
28 license = licenses.gpl2;
29+ platforms = platforms.linux;
30 maintainers = [ maintainers.romildo ];
31 };
32}
+18-12
pkgs/development/compilers/dmd/2.067.1.nix
···43 # Compile with PIC to prevent colliding modules with binutils 2.28.
44 # https://issues.dlang.org/show_bug.cgi?id=17375
45 usePIC = "-fPIC";
04647 postPatch = ''
48 # Ugly hack so the dlopen call has a chance to succeed.
···67 --replace g++ $CXX
68 ''
6970- + stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
71- substituteInPlace dmd/src/root/port.c \
72- --replace "#include <bits/mathdef.h>" "#include <complex.h>"
73- ''
7475- + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
76- substituteInPlace dmd/src/posix.mak \
77- --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
07879- # Was not able to compile on darwin due to "__inline_isnanl"
80- # being undefined.
81- substituteInPlace dmd/src/root/port.c --replace __inline_isnanl __inline_isnan
82- '';
00008384 nativeBuildInputs = [ makeWrapper unzip which ];
85 buildInputs = [ curl tzdata ];
···96 cd ..
97 '';
9899- doCheck = true;
0100101 checkPhase = ''
102 cd dmd
···43 # Compile with PIC to prevent colliding modules with binutils 2.28.
44 # https://issues.dlang.org/show_bug.cgi?id=17375
45 usePIC = "-fPIC";
46+ ROOT_HOME_DIR = "$(echo ~root)";
4748 postPatch = ''
49 # Ugly hack so the dlopen call has a chance to succeed.
···68 --replace g++ $CXX
69 ''
7071+ + stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
72+ substituteInPlace dmd/src/root/port.c \
73+ --replace "#include <bits/mathdef.h>" "#include <complex.h>"
07475+ # See https://github.com/NixOS/nixpkgs/issues/29443
76+ substituteInPlace phobos/std/path.d \
77+ --replace "\"/root" "\"${ROOT_HOME_DIR}"
78+ ''
7980+ + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
81+ substituteInPlace dmd/src/posix.mak \
82+ --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
83+84+ # Was not able to compile on darwin due to "__inline_isnanl"
85+ # being undefined.
86+ substituteInPlace dmd/src/root/port.c --replace __inline_isnanl __inline_isnan
87+ '';
8889 nativeBuildInputs = [ makeWrapper unzip which ];
90 buildInputs = [ curl tzdata ];
···101 cd ..
102 '';
103104+ # disable check phase because some tests are not working with sandboxing
105+ doCheck = false;
106107 checkPhase = ''
108 cd dmd
+9-3
pkgs/development/compilers/dmd/default.nix
···1{ stdenv, fetchFromGitHub
2, makeWrapper, unzip, which
3-, curl, tzdata, gdb
4# Versions 2.070.2 and up require a working dmd compiler to build:
5, bootstrapDmd }:
6···73 --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
74 '';
7576- nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ];
0000077 buildInputs = [ curl tzdata ];
7879 # Buid and install are based on http://wiki.dlang.org/Building_DMD
···92 cd ..
93 '';
9495- doCheck = true;
09697 checkPhase = ''
98 cd dmd
···1{ stdenv, fetchFromGitHub
2, makeWrapper, unzip, which
3+, curl, tzdata, gdb, darwin
4# Versions 2.070.2 and up require a working dmd compiler to build:
5, bootstrapDmd }:
6···73 --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
74 '';
7576+ nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ]
77+78+ ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
79+ Foundation
80+ ]);
81+82 buildInputs = [ curl tzdata ];
8384 # Buid and install are based on http://wiki.dlang.org/Building_DMD
···97 cd ..
98 '';
99100+ # disable check phase because some tests are not working with sandboxing
101+ doCheck = false;
102103 checkPhase = ''
104 cd dmd
···720 # It makes no sense to have intero-nix-shim in Hackage, so we publish it here only.
721 intero-nix-shim = self.callPackage ../tools/haskell/intero-nix-shim {};
722000723 # https://github.com/Philonous/hs-stun/pull/1
724 # Remove if a version > 0.1.0.1 ever gets released.
725 stunclient = overrideCabal super.stunclient (drv: {
···720 # It makes no sense to have intero-nix-shim in Hackage, so we publish it here only.
721 intero-nix-shim = self.callPackage ../tools/haskell/intero-nix-shim {};
722723+ # vaultenv is not available from Hackage.
724+ vaultenv = self.callPackage ../tools/haskell/vaultenv { };
725+726 # https://github.com/Philonous/hs-stun/pull/1
727 # Remove if a version > 0.1.0.1 ever gets released.
728 stunclient = overrideCabal super.stunclient (drv: {
+1-1
pkgs/development/libraries/dirac/default.nix
···24 meta = with stdenv.lib; {
25 homepage = http://sourceforge.net/projects/dirac;
26 description = "A general-purpose video codec based on wavelets";
27- platforms = platforms.all;
28 license = with licenses; [ mpl11 gpl2 lgpl21 ];
29 maintainer = maintainers.igsha;
30 };
···24 meta = with stdenv.lib; {
25 homepage = http://sourceforge.net/projects/dirac;
26 description = "A general-purpose video codec based on wavelets";
27+ platforms = platforms.linux;
28 license = with licenses; [ mpl11 gpl2 lgpl21 ];
29 maintainer = maintainers.igsha;
30 };
···123124 mkdir -p "$NIX_QT5_TMP/nix-support"
125 for subdir in bin include lib mkspecs share; do
126- mkdir "$NIX_QT5_TMP/$subdir"
127 echo "$subdir/" >> "$NIX_QT5_TMP/nix-support/qt-inputs"
128 done
129
···123124 mkdir -p "$NIX_QT5_TMP/nix-support"
125 for subdir in bin include lib mkspecs share; do
126+ mkdir -p "$NIX_QT5_TMP/$subdir"
127 echo "$subdir/" >> "$NIX_QT5_TMP/nix-support/qt-inputs"
128 done
129
···1+--- a/nox/review.py 2017-09-23 04:04:37.322484753 +0200
2++++ a/nox/review.py 2017-09-23 04:18:31.582692181 +0200
3+@@ -84,7 +84,7 @@
4+ ctx.obj['dry_run'] = dry_run
5+6+7+-@cli.command(short_help='difference between working tree and a commit')
8++@cli.command('wip', short_help='difference between working tree and a commit')
9+ @click.option('--against', default='HEAD')
10+ @click.pass_context
11+ @setup_nixpkgs_config