···4949 '';
5050 };
51515252+ extraGitoliteRc = mkOption {
5353+ type = types.lines;
5454+ default = "";
5555+ example = literalExample ''
5656+ $RC{UMASK} = 0027;
5757+ $RC{SITE_INFO} = 'This is our private repository host';
5858+ push( @{$RC{ENABLE}}, 'Kindergarten' ); # enable the command/feature
5959+ @{$RC{ENABLE}} = grep { $_ ne 'desc' } @{$RC{ENABLE}}; # disable the command/feature
6060+ '';
6161+ description = ''
6262+ Extra configuration to append to the default <literal>~/.gitolite.rc</literal>.
6363+6464+ This should be Perl code that modifies the <literal>%RC</literal>
6565+ configuration variable. The default <literal>~/.gitolite.rc</literal>
6666+ content is generated by invoking <literal>gitolite print-default-rc</literal>,
6767+ and extra configuration from this option is appended to it. The result
6868+ is placed to Nix store, and the <literal>~/.gitolite.rc</literal> file
6969+ becomes a symlink to it.
7070+7171+ If you already have a customized (or otherwise changed)
7272+ <literal>~/.gitolite.rc</literal> file, NixOS will refuse to replace
7373+ it with a symlink, and the `gitolite-init` initialization service
7474+ will fail. In this situation, in order to use this option, you
7575+ will need to take any customizations you may have in
7676+ <literal>~/.gitolite.rc</literal>, convert them to appropriate Perl
7777+ statements, add them to this option, and remove the file.
7878+ '';
7979+ };
8080+5281 user = mkOption {
5382 type = types.str;
5483 default = "gitolite";
···5988 };
6089 };
61906262- config = mkIf cfg.enable {
9191+ config = mkIf cfg.enable (
9292+ let
9393+ manageGitoliteRc = cfg.extraGitoliteRc != "";
9494+ rcDir = pkgs.runCommand "gitolite-rc" { } rcDirScript;
9595+ rcDirScript =
9696+ ''
9797+ mkdir "$out"
9898+ export HOME=temp-home
9999+ mkdir -p "$HOME/.gitolite/logs" # gitolite can't run without it
100100+ '${pkgs.gitolite}'/bin/gitolite print-default-rc >>"$out/gitolite.rc.default"
101101+ cat <<END >>"$out/gitolite.rc"
102102+ # This file is managed by NixOS.
103103+ # Use services.gitolite options to control it.
104104+105105+ END
106106+ cat "$out/gitolite.rc.default" >>"$out/gitolite.rc"
107107+ '' +
108108+ optionalString (cfg.extraGitoliteRc != "") ''
109109+ echo -n ${escapeShellArg ''
110110+111111+ # Added by NixOS:
112112+ ${removeSuffix "\n" cfg.extraGitoliteRc}
113113+114114+ # per perl rules, this should be the last line in such a file:
115115+ 1;
116116+ ''} >>"$out/gitolite.rc"
117117+ '';
118118+ in {
63119 users.extraUsers.${cfg.user} = {
64120 description = "Gitolite user";
65121 home = cfg.dataDir;
···77133 serviceConfig.Type = "oneshot";
78134 serviceConfig.RemainAfterExit = true;
791358080- path = [ pkgs.gitolite pkgs.git pkgs.perl pkgs.bash config.programs.ssh.package ];
8181- script = ''
8282- cd ${cfg.dataDir}
8383- mkdir -p .gitolite/logs
8484- if [ ! -d repositories ]; then
8585- gitolite setup -pk ${pubkeyFile}
8686- fi
8787- if [ -n "${hooks}" ]; then
8888- cp ${hooks} .gitolite/hooks/common/
8989- chmod +x .gitolite/hooks/common/*
9090- fi
9191- gitolite setup # Upgrade if needed
9292- '';
136136+ path = [ pkgs.gitolite pkgs.git pkgs.perl pkgs.bash pkgs.diffutils config.programs.ssh.package ];
137137+ script =
138138+ let
139139+ rcSetupScriptIfCustomFile =
140140+ if manageGitoliteRc then ''
141141+ cat <<END
142142+ <3>ERROR: NixOS can't apply declarative configuration
143143+ <3>to your .gitolite.rc file, because it seems to be
144144+ <3>already customized manually.
145145+ <3>See the services.gitolite.extraGitoliteRc option
146146+ <3>in "man configuration.nix" for more information.
147147+ END
148148+ # Not sure if the line below addresses the issue directly or just
149149+ # adds a delay, but without it our error message often doesn't
150150+ # show up in `systemctl status gitolite-init`.
151151+ journalctl --flush
152152+ exit 1
153153+ '' else ''
154154+ :
155155+ '';
156156+ rcSetupScriptIfDefaultFileOrStoreSymlink =
157157+ if manageGitoliteRc then ''
158158+ ln -sf "${rcDir}/gitolite.rc" "$GITOLITE_RC"
159159+ '' else ''
160160+ [[ -L "$GITOLITE_RC" ]] && rm -f "$GITOLITE_RC"
161161+ '';
162162+ in
163163+ ''
164164+ cd ${cfg.dataDir}
165165+ mkdir -p .gitolite/logs
166166+167167+ GITOLITE_RC=.gitolite.rc
168168+ GITOLITE_RC_DEFAULT=${rcDir}/gitolite.rc.default
169169+ if ( [[ ! -e "$GITOLITE_RC" ]] && [[ ! -L "$GITOLITE_RC" ]] ) ||
170170+ ( [[ -f "$GITOLITE_RC" ]] && diff -q "$GITOLITE_RC" "$GITOLITE_RC_DEFAULT" >/dev/null ) ||
171171+ ( [[ -L "$GITOLITE_RC" ]] && [[ "$(readlink "$GITOLITE_RC")" =~ ^/nix/store/ ]] )
172172+ then
173173+ '' + rcSetupScriptIfDefaultFileOrStoreSymlink +
174174+ ''
175175+ else
176176+ '' + rcSetupScriptIfCustomFile +
177177+ ''
178178+ fi
179179+180180+ if [ ! -d repositories ]; then
181181+ gitolite setup -pk ${pubkeyFile}
182182+ fi
183183+ if [ -n "${hooks}" ]; then
184184+ cp ${hooks} .gitolite/hooks/common/
185185+ chmod +x .gitolite/hooks/common/*
186186+ fi
187187+ gitolite setup # Upgrade if needed
188188+ '';
93189 };
9419095191 environment.systemPackages = [ pkgs.gitolite pkgs.git ];
9696- };
192192+ });
97193}
···3333 default = [];
3434 example = ''[ "systemd" ]'';
3535 description = ''
3636- Collectors to enable, additionally to the defaults.
3636+ Collectors to enable. Only collectors explicitly listed here will be enabled.
3737 '';
3838 };
3939
···217217 # Add the mount helpers to the system path so that `mount' can find them.
218218 system.fsPackages = [ pkgs.dosfstools ];
219219220220- environment.systemPackages = [ pkgs.fuse ] ++ config.system.fsPackages;
220220+ environment.systemPackages = with pkgs; [ fuse3 fuse ] ++ config.system.fsPackages;
221221222222 environment.etc.fstab.text =
223223 let
···4444, hicolor_icon_theme
4545, shared_mime_info
46464747+# Whether to disable multiprocess support to work around crashing tabs
4848+# TODO: fix the underlying problem instead of this terrible work-around
4949+, disableContentSandbox ? true
5050+4751# Extra preferences
4852, extraPrefs ? ""
4953}:
···209213 // Defaults to creating $TBB_HOME/TorBrowser/Data/Tor/{socks,control}.socket
210214 lockPref("extensions.torlauncher.control_port_use_ipc", true);
211215 lockPref("extensions.torlauncher.socks_port_use_ipc", true);
216216+217217+ // Optionally disable multiprocess support. We always set this to ensure that
218218+ // toggling the pref takes effect.
219219+ lockPref("browser.tabs.remote.autostart.2", ${if disableContentSandbox then "false" else "true"});
212220213221 ${optionalString (extraPrefs != "") ''
214222 ${extraPrefs}
···4242 "ac_cv_path_SENDMAIL=sendmail"
4343 ];
44444545+ # Fix missing libidn in mutt;
4646+ # this fix is ugly since it links all binaries in mutt against libidn
4747+ # like pgpring, pgpewrap, ...
4848+ NIX_LDFLAGS = "-lidn";
4949+4550 configureScript = "./prepare";
46514752 enableParallelBuilding = true;
···1010 lib,
1111 pkgs,
1212 pigz,
1313+ nixUnstable,
1414+ perl,
1315 runCommand,
1416 rsync,
1517 shadow,
···2729rec {
28302931 examples = import ./examples.nix {
3030- inherit pkgs buildImage pullImage shadowSetup;
3232+ inherit pkgs buildImage pullImage shadowSetup buildImageWithNixDb;
3133 };
32343335 pullImage =
···237239 set -e
238240 export PATH=${coreutils}/bin:/bin
239241 ${text}
242242+ '';
243243+244244+ nixRegistration = contents: runCommand "nix-registration" {
245245+ buildInputs = [ nixUnstable perl ];
246246+ # For obtaining the closure of `contents'.
247247+ exportReferencesGraph =
248248+ let contentsList = if builtins.isList contents then contents else [ contents ];
249249+ in map (x: [("closure-" + baseNameOf x) x]) contentsList;
250250+ }
251251+ ''
252252+ mkdir $out
253253+ printRegistration=1 perl ${pkgs.pathsFromGraph} closure-* > $out/db.dump
254254+ perl ${pkgs.pathsFromGraph} closure-* > $out/storePaths
240255 '';
241256242257 # Create a "layer" (set of files).
···544559545560 in
546561 result;
562562+563563+ # Build an image and populate its nix database with the provided
564564+ # contents. The main purpose is to be able to use nix commands in
565565+ # the container.
566566+ # Be careful since this doesn't work well with multilayer.
567567+ buildImageWithNixDb = args@{ contents ? null, extraCommands ? "", ... }:
568568+ buildImage (args // {
569569+ extraCommands = ''
570570+ echo "Generating the nix database..."
571571+ echo "Warning: only the database of the deepest Nix layer is loaded."
572572+ echo " If you want to use nix commands in the container, it would"
573573+ echo " be better to only have one layer that contains a nix store."
574574+ # This requires Nix 1.12 or higher
575575+ export NIX_REMOTE=local?root=$PWD
576576+ ${nixUnstable}/bin/nix-store --load-db < ${nixRegistration contents}/db.dump
577577+578578+ # We fill the store in order to run the 'verify' command that
579579+ # generates hash and size of output paths.
580580+ # Note when Nix 1.12 is be the stable one, the database dump
581581+ # generated by the exportReferencesGraph function will
582582+ # contains sha and size. See
583583+ # https://github.com/NixOS/nix/commit/c2b0d8749f7e77afc1c4b3e8dd36b7ee9720af4a
584584+ storePaths=$(cat ${nixRegistration contents}/storePaths)
585585+ echo "Copying everything to /nix/store (will take a while)..."
586586+ cp -prd $storePaths nix/store/
587587+ ${nixUnstable}/bin/nix-store --verify --check-contents
588588+589589+ mkdir -p nix/var/nix/gcroots/docker/
590590+ for i in ${lib.concatStringsSep " " contents}; do
591591+ ln -s $i nix/var/nix/gcroots/docker/$(basename $i)
592592+ done;
593593+ '' + extraCommands;
594594+ });
547595}
+15-2
pkgs/build-support/docker/examples.nix
···77# $ nix-build '<nixpkgs>' -A dockerTools.examples.redis
88# $ docker load < result
991010-{ pkgs, buildImage, pullImage, shadowSetup }:
1010+{ pkgs, buildImage, pullImage, shadowSetup, buildImageWithNixDb }:
11111212rec {
1313 # 1. basic example
···8383 };
84848585 # 4. example of pulling an image. could be used as a base for other images
8686- nix = pullImage {
8686+ nixFromDockerHub = pullImage {
8787 imageName = "nixos/nix";
8888 imageTag = "1.11";
8989 # this hash will need change if the tag is updated at docker hub
···9999 pkgs.emacs
100100 pkgs.vim
101101 pkgs.nano
102102+ ];
103103+ };
104104+105105+ # 5. nix example to play with the container nix store
106106+ # docker run -it --rm nix nix-store -qR $(nix-build '<nixpkgs>' -A nix)
107107+ nix = buildImageWithNixDb {
108108+ name = "nix";
109109+ contents = [
110110+ # nix-store -qR uses the 'more' program which is not included in
111111+ # the pkgs.nix dependencies. We then have to manually get it
112112+ # from the 'eject' package:/
113113+ pkgs.eject
114114+ pkgs.nix
102115 ];
103116 };
104117}
+1-1
pkgs/desktops/lxde/core/lxappearance/default.nix
···2020 description = "A lightweight program for configuring the theme and fonts of gtk applications";
2121 homepage = http://lxde.org/;
2222 maintainers = [ stdenv.lib.maintainers.hinton ];
2323- platforms = stdenv.lib.platforms.all;
2323+ platforms = stdenv.lib.platforms.linux;
2424 license = stdenv.lib.licenses.gpl2;
2525 };
2626}
···720720 # It makes no sense to have intero-nix-shim in Hackage, so we publish it here only.
721721 intero-nix-shim = self.callPackage ../tools/haskell/intero-nix-shim {};
722722723723+ # vaultenv is not available from Hackage.
724724+ vaultenv = self.callPackage ../tools/haskell/vaultenv { };
725725+723726 # https://github.com/Philonous/hs-stun/pull/1
724727 # Remove if a version > 0.1.0.1 ever gets released.
725728 stunclient = overrideCabal super.stunclient (drv: {
+1-1
pkgs/development/libraries/dirac/default.nix
···2424 meta = with stdenv.lib; {
2525 homepage = http://sourceforge.net/projects/dirac;
2626 description = "A general-purpose video codec based on wavelets";
2727- platforms = platforms.all;
2727+ platforms = platforms.linux;
2828 license = with licenses; [ mpl11 gpl2 lgpl21 ];
2929 maintainer = maintainers.igsha;
3030 };
···11+--- a/nox/review.py 2017-09-23 04:04:37.322484753 +0200
22++++ a/nox/review.py 2017-09-23 04:18:31.582692181 +0200
33+@@ -84,7 +84,7 @@
44+ ctx.obj['dry_run'] = dry_run
55+66+77+-@cli.command(short_help='difference between working tree and a commit')
88++@cli.command('wip', short_help='difference between working tree and a commit')
99+ @click.option('--against', default='HEAD')
1010+ @click.pass_context
1111+ @setup_nixpkgs_config