···66 inherit (import ./default.nix) fold;
77 inherit (import ./strings.nix) concatStringsSep;
88 inherit (import ./lists.nix) concatMap concatLists all deepSeqList;
99- inherit (import ./misc.nix) maybeAttr;
109};
11101211rec {
···7675 => { foo = 1; }
7776 */
7877 filterAttrs = pred: set:
7979- listToAttrs (fold (n: ys: let v = set.${n}; in if pred n v then [(nameValuePair n v)] ++ ys else ys) [] (attrNames set));
7878+ listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
807981808281 /* foldAttrs: apply fold functions to values grouped by key. Eg accumulate values as list:
···8685 foldAttrs = op: nul: list_of_attrs:
8786 fold (n: a:
8887 fold (name: o:
8989- o // (listToAttrs [{inherit name; value = op n.${name} (maybeAttr name nul a); }])
8888+ o // (listToAttrs [{inherit name; value = op n.${name} (a.${name} or nul); }])
9089 ) a (attrNames n)
9190 ) {} list_of_attrs;
9291
···3838 in foldl' (length list - 1);
393940404141+ # Strict version of foldl.
4242+ foldl' = builtins.foldl' or foldl;
4343+4444+4145 # map with index: `imap (i: v: "${v}-${toString i}") ["a" "b"] ==
4246 # ["a-1" "b-2"]'
4347 imap = f: list:
···5963 # == [1 2 3 4 5]' and `flatten 1 == [1]'.
6064 flatten = x:
6165 if isList x
6262- then fold (x: y: (flatten x) ++ y) [] x
6666+ then foldl' (x: y: x ++ (flatten y)) [] x
6367 else [x];
64686569···86908791 # Return true iff function `pred' returns true for at least element
8892 # of `list'.
8989- any = pred: fold (x: y: if pred x then true else y) false;
9393+ any = builtins.any or (pred: fold (x: y: if pred x then true else y) false);
909491959296 # Return true iff function `pred' returns true for all elements of
9397 # `list'.
9494- all = pred: fold (x: y: if pred x then y else false) true;
9898+ all = builtins.all or (pred: fold (x: y: if pred x then y else false) true);
95999610097101 # Count how many times function `pred' returns true for the elements
98102 # of `list'.
9999- count = pred: fold (x: c: if pred x then c + 1 else c) 0;
103103+ count = pred: foldl' (c: x: if pred x then c + 1 else c) 0;
100104101105102106 # Return a singleton list or an empty list, depending on a boolean
-2
lib/misc.nix
lib/deprecated.nix
···203203 in
204204 work startSet [] [];
205205206206- genericClosure = builtins.genericClosure or lazyGenericClosure;
207207-208206 innerModifySumArgs = f: x: a: b: if b == null then (f a b) // x else
209207 innerModifySumArgs f x (a // b);
210208 modifySumArgs = f: x: innerModifySumArgs f x {};
+11-11
lib/modules.nix
···7676 else yieldConfig (prefix ++ [n]) v) set) ["_definedNames"];
7777 in
7878 if options._module.check.value && set ? _definedNames then
7979- fold (m: res:
8080- fold (name: res:
7979+ foldl' (res: m:
8080+ foldl' (res: name:
8181 if set ? ${name} then res else throw "The option `${showOption (prefix ++ [name])}' defined in `${m.file}' does not exist.")
8282 res m.names)
8383 res set._definedNames
···182182 let
183183 loc = prefix ++ [name];
184184 # Get all submodules that declare ‘name’.
185185- decls = concatLists (map (m:
185185+ decls = concatMap (m:
186186 if m.options ? ${name}
187187 then [ { inherit (m) file; options = m.options.${name}; } ]
188188 else []
189189- ) options);
189189+ ) options;
190190 # Get all submodules that define ‘name’.
191191- defns = concatLists (map (m:
191191+ defns = concatMap (m:
192192 if m.config ? ${name}
193193 then map (config: { inherit (m) file; inherit config; })
194194 (pushDownProperties m.config.${name})
195195 else []
196196- ) configs);
196196+ ) configs;
197197 nrOptions = count (m: isOption m.options) decls;
198198 # Extract the definitions for this loc
199199 defns' = map (m: { inherit (m) file; value = m.config.${name}; })
···225225 'opts' is a list of modules. Each module has an options attribute which
226226 correspond to the definition of 'loc' in 'opt.file'. */
227227 mergeOptionDecls = loc: opts:
228228- fold (opt: res:
228228+ foldl' (res: opt:
229229 if opt.options ? default && res ? default ||
230230 opt.options ? example && res ? example ||
231231 opt.options ? description && res ? description ||
···251251 else if opt.options ? options then map (coerceOption opt.file) options' ++ res.options
252252 else res.options;
253253 in opt.options // res //
254254- { declarations = [opt.file] ++ res.declarations;
254254+ { declarations = res.declarations ++ [opt.file];
255255 options = submodules;
256256 }
257257 ) { inherit loc; declarations = []; options = []; } opts;
···302302 in
303303 processOrder (processOverride (processIfAndMerge defs));
304304305305- # Type-check the remaining definitions, and merge them
306306- mergedValue = fold (def: res:
305305+ # Type-check the remaining definitions, and merge them.
306306+ mergedValue = foldl' (res: def:
307307 if type.check def.value then res
308308 else throw "The option value `${showOption loc}' in `${def.file}' is not a ${type.name}.")
309309 (type.merge loc defsFinal) defsFinal;
···384384 defaultPrio = 100;
385385 getPrio = def: if def.value._type or "" == "override" then def.value.priority else defaultPrio;
386386 min = x: y: if x < y then x else y;
387387- highestPrio = fold (def: prio: min (getPrio def) prio) 9999 defs;
387387+ highestPrio = foldl' (prio: def: min (getPrio def) prio) 9999 defs;
388388 strip = def: if def.value._type or "" == "override" then def // { value = def.value.content; } else def;
389389 in concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
390390
+5-7
lib/options.nix
···4455with import ./trivial.nix;
66with import ./lists.nix;
77-with import ./misc.nix;
87with import ./attrsets.nix;
98with import ./strings.nix;
109···5352 if length list == 1 then head list
5453 else if all isFunction list then x: mergeDefaultOption loc (map (f: f x) list)
5554 else if all isList list then concatLists list
5656- else if all isAttrs list then fold lib.mergeAttrs {} list
5757- else if all isBool list then fold lib.or false list
5555+ else if all isAttrs list then foldl' lib.mergeAttrs {} list
5656+ else if all isBool list then foldl' lib.or false list
5857 else if all isString list then lib.concatStrings list
5958 else if all isInt list && all (x: x == head list) list then head list
6059 else throw "Cannot merge definitions of `${showOption loc}' given in ${showFiles (getFiles defs)}.";
···6867 /* "Merge" option definitions by checking that they all have the same value. */
6968 mergeEqualOption = loc: defs:
7069 if defs == [] then abort "This case should never happen."
7171- else fold (def: val:
7070+ else foldl' (val: def:
7271 if def.value != val then
7372 throw "The option `${showOption loc}' has conflicting definitions, in ${showFiles (getFiles defs)}."
7473 else
···8382 optionAttrSetToDocList = optionAttrSetToDocList' [];
84838584 optionAttrSetToDocList' = prefix: options:
8686- fold (opt: rest:
8585+ concatMap (opt:
8786 let
8887 docOption = rec {
8988 name = showOption opt.loc;
···101100 let ss = opt.type.getSubOptions opt.loc;
102101 in if ss != {} then optionAttrSetToDocList' opt.loc ss else [];
103102 in
104104- # FIXME: expensive, O(n^2)
105105- [ docOption ] ++ subOptions ++ rest) [] (collect isOption options);
103103+ [ docOption ] ++ subOptions) (collect isOption options);
106104107105108106 /* This function recursively removes all derivation attributes from
+43-46
lib/strings.nix
···8899rec {
10101111- inherit (builtins) stringLength substring head tail isString;
1111+ inherit (builtins) stringLength substring head tail isString replaceStrings;
121213131414 # Concatenate a list of strings.
1515- concatStrings = lib.fold (x: y: x + y) "";
1515+ concatStrings =
1616+ if builtins ? concatStringsSep then
1717+ builtins.concatStringsSep ""
1818+ else
1919+ lib.foldl' (x: y: x + y) "";
162017211822 # Map a function over a list and concatenate the resulting strings.
···2529 intersperse = separator: list:
2630 if list == [] || length list == 1
2731 then list
2828- else [(head list) separator]
2929- ++ (intersperse separator (tail list));
3232+ else tail (lib.concatMap (x: [separator x]) list);
303331343235 # Concatenate a list of strings with a separator between each element, e.g.
3336 # concatStringsSep " " ["foo" "bar" "xyzzy"] == "foo bar xyzzy"
3434- concatStringsSep = separator: list:
3535- concatStrings (intersperse separator list);
3737+ concatStringsSep = builtins.concatStringsSep or (separator: list:
3838+ concatStrings (intersperse separator list));
36393740 concatMapStringsSep = sep: f: list: concatStringsSep sep (map f list);
3841 concatImapStringsSep = sep: f: list: concatStringsSep sep (lib.imap f list);
···61646265 # Determine whether a string has given prefix/suffix.
6366 hasPrefix = pref: str:
6464- eqStrings (substring 0 (stringLength pref) str) pref;
6767+ substring 0 (stringLength pref) str == pref;
6568 hasSuffix = suff: str:
6669 let
6770 lenStr = stringLength str;
6871 lenSuff = stringLength suff;
6972 in lenStr >= lenSuff &&
7070- eqStrings (substring (lenStr - lenSuff) lenStr str) suff;
7373+ substring (lenStr - lenSuff) lenStr str == suff;
717472757376 # Convert a string to a list of characters (i.e. singleton strings).
···7679 # will likely be horribly inefficient; Nix is not a general purpose
7780 # programming language. Complex string manipulations should, if
7881 # appropriate, be done in a derivation.
7979- stringToCharacters = s: let l = stringLength s; in
8080- if l == 0
8181- then []
8282- else map (p: substring p 1 s) (lib.range 0 (l - 1));
8282+ stringToCharacters = s:
8383+ map (p: substring p 1 s) (lib.range 0 (stringLength s - 1));
838484858585- # Manipulate a string charcater by character and replace them by strings
8686- # before concatenating the results.
8686+ # Manipulate a string charactter by character and replace them by
8787+ # strings before concatenating the results.
8788 stringAsChars = f: s:
8889 concatStrings (
8990 map f (stringToCharacters s)
9091 );
919292939393- # same as vim escape function.
9494- # Each character contained in list is prefixed by "\"
9595- escape = list : string :
9696- stringAsChars (c: if lib.elem c list then "\\${c}" else c) string;
9494+ # Escape occurrence of the elements of ‘list’ in ‘string’ by
9595+ # prefixing it with a backslash. For example, ‘escape ["(" ")"]
9696+ # "(foo)"’ returns the string ‘\(foo\)’.
9797+ escape = list: replaceChars list (map (c: "\\${c}") list);
979898999999- # still ugly slow. But more correct now
100100- # [] for zsh
100100+ # Escape all characters that have special meaning in the Bourne shell.
101101 escapeShellArg = lib.escape (stringToCharacters "\\ ';$`()|<>\t*[]");
102102103103104104- # replace characters by their substitutes. This function is equivalent to
105105- # the `tr' command except that one character can be replace by multiple
106106- # ones. e.g.,
107107- # replaceChars ["<" ">"] ["<" ">"] "<foo>" returns "<foo>".
108108- replaceChars = del: new: s:
104104+ # Obsolete - use replaceStrings instead.
105105+ replaceChars = builtins.replaceStrings or (
106106+ del: new: s:
109107 let
110108 substList = lib.zipLists del new;
111109 subst = c:
···115113 else
116114 found.snd;
117115 in
118118- stringAsChars subst s;
116116+ stringAsChars subst s);
119117120118121121- # Case conversion utilities
119119+ # Case conversion utilities.
122120 lowerChars = stringToCharacters "abcdefghijklmnopqrstuvwxyz";
123121 upperChars = stringToCharacters "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
124122 toLower = replaceChars upperChars lowerChars;
125123 toUpper = replaceChars lowerChars upperChars;
126124127127- # Appends string context from another string
128128- addContextFrom = a: b: substring 0 0 a + b;
129125130130- # Compares strings not requiring context equality
131131- # Obviously, a workaround but works on all Nix versions
132132- eqStrings = a: b: addContextFrom b a == addContextFrom a b;
126126+ # Appends string context from another string.
127127+ addContextFrom = a: b: substring 0 0 a + b;
133128134129135135- # Cut a string with a separator and produces a list of strings which were
136136- # separated by this separator. e.g.,
137137- # `splitString "." "foo.bar.baz"' returns ["foo" "bar" "baz"].
130130+ # Cut a string with a separator and produces a list of strings which
131131+ # were separated by this separator; e.g., `splitString "."
132132+ # "foo.bar.baz"' returns ["foo" "bar" "baz"].
138133 splitString = _sep: _s:
139134 let
140135 sep = addContextFrom _s _sep;
···177172 sufLen = stringLength suf;
178173 sLen = stringLength s;
179174 in
180180- if sufLen <= sLen && eqStrings suf (substring (sLen - sufLen) sufLen s) then
175175+ if sufLen <= sLen && suf == substring (sLen - sufLen) sufLen s then
181176 substring 0 (sLen - sufLen) s
182177 else
183178 s;
···196191197192198193 # Extract name with version from URL. Ask for separator which is
199199- # supposed to start extension
200200- nameFromURL = url: sep: let
201201- components = splitString "/" url;
202202- filename = lib.last components;
203203- name = builtins.head (splitString sep filename);
204204- in
205205- assert ! eqStrings name filename;
206206- name;
194194+ # supposed to start extension.
195195+ nameFromURL = url: sep:
196196+ let
197197+ components = splitString "/" url;
198198+ filename = lib.last components;
199199+ name = builtins.head (splitString sep filename);
200200+ in assert name != filename; name;
207201208202209203 # Create an --{enable,disable}-<feat> string that can be passed to
210204 # standard GNU Autoconf scripts.
211205 enableFeature = enable: feat: "--${if enable then "enable" else "disable"}-${feat}";
212206213213- # Create a fixed width string with additional prefix to match required width
207207+208208+ # Create a fixed width string with additional prefix to match
209209+ # required width.
214210 fixedWidthString = width: filler: str:
215211 let
216212 strw = lib.stringLength str;
···219215 assert strw <= width;
220216 if strw == width then str else filler + fixedWidthString reqWidth filler str;
221217222222- # Format a number adding leading zeroes up to fixed width
218218+219219+ # Format a number adding leading zeroes up to fixed width.
223220 fixedWidthNumber = width: n: fixedWidthString width "0" (toString n);
224221}
+1-1
lib/trivial.nix
···2222 inherit (builtins)
2323 pathExists readFile isBool isFunction
2424 isInt add sub lessThan
2525- seq deepSeq;
2525+ seq deepSeq genericClosure;
26262727 # Return the Nixpkgs version number.
2828 nixpkgsVersion =
···6677<title>Booting from a USB Drive</title>
8899-<para>For systems without CD drive, the NixOS livecd can be booted from
1010-a usb stick. For non-UEFI installations,
99+<para>For systems without CD drive, the NixOS live CD can be booted from
1010+a USB stick. For non-UEFI installations,
1111<link xlink:href="http://unetbootin.sourceforge.net/">unetbootin</link>
1212will work. For UEFI installations, you should mount the ISO, copy its contents
1313verbatim to your drive, then either:
+9-5
nixos/modules/installer/cd-dvd/iso-image.nix
···3030 # * COM32 entries (chainload, reboot, poweroff) are not recognized. They
3131 # result in incorrect boot entries.
32323333- baseIsolinuxCfg =
3434- ''
3333+ baseIsolinuxCfg = ''
3534 SERIAL 0 38400
3635 TIMEOUT ${builtins.toString syslinuxTimeout}
3736 UI vesamenu.c32
···4443 LINUX /boot/bzImage
4544 APPEND init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
4645 INITRD /boot/initrd
4747- '';
4646+ '';
48474948 isolinuxMemtest86Entry = ''
5049 LABEL memtest
···55545655 isolinuxCfg = baseIsolinuxCfg + (optionalString config.boot.loader.grub.memtest86.enable isolinuxMemtest86Entry);
57565858- # The efi boot image
5757+ # The EFI boot image.
5958 efiDir = pkgs.runCommand "efi-directory" {} ''
6059 mkdir -p $out/EFI/boot
6160 cp -v ${pkgs.gummiboot}/lib/gummiboot/gummiboot${targetArch}.efi $out/EFI/boot/boot${targetArch}.efi
6261 mkdir -p $out/loader/entries
6363- echo "title NixOS LiveCD" > $out/loader/entries/nixos-livecd.conf
6262+ echo "title NixOS Live CD" > $out/loader/entries/nixos-livecd.conf
6463 echo "linux /boot/bzImage" >> $out/loader/entries/nixos-livecd.conf
6564 echo "initrd /boot/initrd" >> $out/loader/entries/nixos-livecd.conf
6665 echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" >> $out/loader/entries/nixos-livecd.conf
···218217 system.boot.loader.kernelFile = "bzImage";
219218 environment.systemPackages = [ pkgs.grub2 pkgs.grub2_efi pkgs.syslinux ];
220219220220+ boot.consoleLogLevel = 7;
221221+221222 # In stage 1 of the boot, mount the CD as the root FS by label so
222223 # that we don't need to know its device. We pass the label of the
223224 # root filesystem on the kernel command line, rather than in
···229230 boot.kernelParams =
230231 [ "root=LABEL=${config.isoImage.volumeID}"
231232 "boot.shell_on_fail"
233233+ "nomodeset"
232234 ];
233235234236 fileSystems."/" =
···267269 };
268270269271 boot.initrd.availableKernelModules = [ "squashfs" "iso9660" "usb-storage" ];
272272+273273+ boot.blacklistedKernelModules = [ "nouveau" ];
270274271275 boot.initrd.kernelModules = [ "loop" ];
272276
···4040 example = literalExample "[ pkgs.gnome3.gpaste ]";
4141 description = "Additional list of packages to be added to the session search path.
4242 Useful for gnome shell extensions or gsettings-conditionated autostart.";
4343- apply = list: list ++ [ gnome3.gnome_shell ];
4343+ apply = list: list ++ [ gnome3.gnome_shell gnome3.gnome-shell-extensions ];
4444 };
45454646 environment.gnome3.packageSet = mkOption {
+2-3
nixos/modules/system/boot/kernel.nix
···4949 type = types.int;
5050 default = 4;
5151 description = ''
5252- The kernel console log level. Only log messages with a
5353- priority numerically less than this will appear on the
5454- console.
5252+ The kernel console log level. Log messages with a priority
5353+ numerically less than this will not appear on the console.
5554 '';
5655 };
5756
+21-21
nixos/modules/system/boot/loader/grub/grub.nix
···10101111 realGrub = if cfg.version == 1 then pkgs.grub
1212 else if cfg.zfsSupport then pkgs.grub2.override { zfsSupport = true; }
1313- else if cfg.enableTrustedboot then pkgs.trustedGrub
1313+ else if cfg.enableTrustedBoot then pkgs.trustedGrub
1414 else pkgs.grub2;
15151616 grub =
···112112 description = ''
113113 The devices on which the boot loader, GRUB, will be
114114 installed. Can be used instead of <literal>device</literal> to
115115- install grub into multiple devices (e.g., if as softraid arrays holding /boot).
115115+ install GRUB onto multiple devices.
116116 '';
117117 };
118118···135135 example = "/boot1";
136136 type = types.str;
137137 description = ''
138138- The path to the boot directory where grub will be written. Generally
139139- this boot parth should double as an efi path.
138138+ The path to the boot directory where GRUB will be written. Generally
139139+ this boot path should double as an EFI path.
140140 '';
141141 };
142142···166166 example = [ "/dev/sda" "/dev/sdb" ];
167167 type = types.listOf types.str;
168168 description = ''
169169- The path to the devices which will have the grub mbr written.
169169+ The path to the devices which will have the GRUB MBR written.
170170 Note these are typically device paths and not paths to partitions.
171171 '';
172172 };
···197197 type = types.lines;
198198 description = ''
199199 Additional bash commands to be run at the script that
200200- prepares the grub menu entries.
200200+ prepares the GRUB menu entries.
201201 '';
202202 };
203203···276276 example = "1024x768";
277277 type = types.str;
278278 description = ''
279279- The gfxmode to pass to grub when loading a graphical boot interface under efi.
279279+ The gfxmode to pass to GRUB when loading a graphical boot interface under EFI.
280280 '';
281281 };
282282···285285 example = "auto";
286286 type = types.str;
287287 description = ''
288288- The gfxmode to pass to grub when loading a graphical boot interface under bios.
288288+ The gfxmode to pass to GRUB when loading a graphical boot interface under BIOS.
289289 '';
290290 };
291291···330330 type = types.addCheck types.str
331331 (type: type == "uuid" || type == "label" || type == "provided");
332332 description = ''
333333- Determines how grub will identify devices when generating the
333333+ Determines how GRUB will identify devices when generating the
334334 configuration file. A value of uuid / label signifies that grub
335335 will always resolve the uuid or label of the device before using
336336- it in the configuration. A value of provided means that grub will
336336+ it in the configuration. A value of provided means that GRUB will
337337 use the device name as show in <command>df</command> or
338338 <command>mount</command>. Note, zfs zpools / datasets are ignored
339339 and will always be mounted using their labels.
···344344 default = false;
345345 type = types.bool;
346346 description = ''
347347- Whether grub should be build against libzfs.
347347+ Whether GRUB should be build against libzfs.
348348 ZFS support is only available for GRUB v2.
349349 This option is ignored for GRUB v1.
350350 '';
···354354 default = false;
355355 type = types.bool;
356356 description = ''
357357- Whether grub should be build with EFI support.
357357+ Whether GRUB should be build with EFI support.
358358 EFI support is only available for GRUB v2.
359359 This option is ignored for GRUB v1.
360360 '';
···364364 default = false;
365365 type = types.bool;
366366 description = ''
367367- Enable support for encrypted partitions. Grub should automatically
367367+ Enable support for encrypted partitions. GRUB should automatically
368368 unlock the correct encrypted partition and look for filesystems.
369369 '';
370370 };
371371372372- enableTrustedboot = mkOption {
372372+ enableTrustedBoot = mkOption {
373373 default = false;
374374 type = types.bool;
375375 description = ''
376376- Enable trusted boot. Grub will measure all critical components during
376376+ Enable trusted boot. GRUB will measure all critical components during
377377 the boot process to offer TCG (TPM) support.
378378 '';
379379 };
···429429 assertions = [
430430 {
431431 assertion = !cfg.zfsSupport || cfg.version == 2;
432432- message = "Only grub version 2 provides zfs support";
432432+ message = "Only GRUB version 2 provides ZFS support";
433433 }
434434 {
435435 assertion = cfg.mirroredBoots != [ ];
···441441 message = "You cannot have duplicated devices in mirroredBoots";
442442 }
443443 {
444444- assertion = !cfg.enableTrustedboot || cfg.version == 2;
444444+ assertion = !cfg.enableTrustedBoot || cfg.version == 2;
445445 message = "Trusted GRUB is only available for GRUB 2";
446446 }
447447 {
448448- assertion = !cfg.efiSupport || !cfg.enableTrustedboot;
448448+ assertion = !cfg.efiSupport || !cfg.enableTrustedBoot;
449449 message = "Trusted GRUB does not have EFI support";
450450 }
451451 {
452452- assertion = !cfg.zfsSupport || !cfg.enableTrustedboot;
452452+ assertion = !cfg.zfsSupport || !cfg.enableTrustedBoot;
453453 message = "Trusted GRUB does not have ZFS support";
454454 }
455455 {
456456- assertion = !cfg.enableTrustedboot;
456456+ assertion = !cfg.enableTrustedBoot;
457457 message = "Trusted GRUB can break your system. Remove assertion if you want to test trustedGRUB nevertheless.";
458458 }
459459 ] ++ flip concatMap cfg.mirroredBoots (args: [
···471471 }
472472 ] ++ flip map args.devices (device: {
473473 assertion = device == "nodev" || hasPrefix "/" device;
474474- message = "Grub devices must be absolute paths, not ${dev} in ${args.path}";
474474+ message = "GRUB devices must be absolute paths, not ${dev} in ${args.path}";
475475 }));
476476 })
477477
···77 if [ -z "$PGHOME" ] || [ ! -d "$PGHOME" ]; then
88- # default relative to this script, otherwise PGHOMEDEFAULT
99- MYDIR="`readlink --canonicalize "$0" | sed -ne 's,/bin/proofgeneral$,,p'`"
1010-- if [ -d "$MYDIR" ]; then
1010+- if [ -d "$MYDIR/generic" ]; then
1111- PGHOME="$MYDIR"
1212- elif [ -d "$PGHOMEDEFAULT" ]; then
1313+ if [ -d "$PGHOMEDEFAULT" ]; then
···6161 # Whether building a cross-compiler for GNU/Hurd.
6262 crossGNU = cross != null && cross.config == "i586-pc-gnu";
63636464- enableParallelBuilding = true;
6464+ # Builds of gfortran have failed with strange errors that we cannot reproduce
6565+ # (http://hydra.nixos.org/build/23951123). Our best guess is that the build
6666+ # system has bugs that are exposed by compiling with multiple threads.
6767+ enableParallelBuilding = !langFortran;
65686669 patches = [ ]
6770 ++ optional enableParallelBuilding ../parallel-bconfig.patch
···11--- a/src/zc/buildout/easy_install.py 2013-08-27 22:28:40.233718116 +0200
22+++ b/src/zc/buildout/easy_install.py 2013-10-07 00:29:31.077413935 +0200
33-@@ -508,16 +508,31 @@
44- self._dest, os.path.basename(dist.location))
33+@@ -227,6 +227,12 @@
5466- if os.path.isdir(dist.location):
77-- # we got a directory. It must have been
88-- # obtained locally. Just copy it.
99-- shutil.copytree(dist.location, newloc)
1010-+ # Replace links to garbage collected eggs in
1111-+ # /nix/store
1212-+ if os.path.islink(newloc):
1313-+ # It seems necessary to jump through these
1414-+ # hoops, otherwise we end up in an
1515-+ # infinite loop because
1616-+ # self._env.best_match fails to find the dist
1717-+ os.remove(newloc)
1818-+ dist = self._fetch(avail, tmp, self._download_cache)
1919-+ os.symlink(dist.location, newloc)
2020-+ newdist = pkg_resources.Distribution.from_filename(
2121-+ newloc)
2222-+ self._env.add(newdist)
2323-+ logger.info("Updated link to %s" %dist.location)
2424-+ # Symlink to the egg in /nix/store
2525-+ elif not os.path.exists(newloc):
2626-+ os.symlink(dist.location, newloc)
2727-+ logger.info("Created link to %s" %dist.location)
2828- else:
2929-3030-3131- setuptools.archive_util.unpack_archive(
3232- dist.location, newloc)
3333-3434-- redo_pyc(newloc)
3535-+ redo_pyc(newloc)
3636-3737- # Getting the dist from the environment causes the
3838- # distribution meta data to be read. Cloning isn't
55+ def _satisfied(self, req, source=None):
66+ dists = [dist for dist in self._env[req.project_name] if dist in req]
77++ try:
88++ dists = ([dist for dist in dists
99++ if dist.precedence == pkg_resources.DEVELOP_DIST]
1010++ + [pkg_resources.get_distribution(req.project_name)])
1111++ except pkg_resources.DistributionNotFound:
1212++ pass
1313+ if not dists:
1414+ logger.debug('We have no distributions for %s that satisfies %r.',
1515+ req.project_name, str(req))
···11+{ stdenv, fetchurl, pkgconfig, libusb1 }:
22+33+stdenv.mkDerivation rec {
44+ name="dfu-util-${version}";
55+ version = "0.8";
66+77+ nativeBuildInputs = [ pkgconfig ];
88+ buildInputs = [ libusb1 ];
99+1010+ src = fetchurl {
1111+ url = "mirror://debian/pool/main/d/dfu-util/dfu-util_0.8.orig.tar.gz";
1212+ sha256 = "0n7h08avlzin04j93m6hkq9id6hxjiiix7ff9gc2n89aw6dxxjsm";
1313+ };
1414+1515+ meta = with stdenv.lib; {
1616+ description = "Device firmware update (DFU) USB programmer";
1717+ longDescription = ''
1818+ dfu-util is a program that implements the host (PC) side of the USB
1919+ DFU 1.0 and 1.1 (Universal Serial Bus Device Firmware Upgrade) protocol.
2020+2121+ DFU is intended to download and upload firmware to devices connected over
2222+ USB. It ranges from small devices like micro-controller boards up to mobile
2323+ phones. With dfu-util you are able to download firmware to your device or
2424+ upload firmware from it.
2525+ '';
2626+ homepage = http://dfu-util.gnumonks.org/;
2727+ license = licenses.gpl2Plus;
2828+ platforms = platforms.unix;
2929+ maintainers = [ maintainers.fpletz ];
3030+ };
3131+}
+2-4
pkgs/development/tools/misc/gdb/default.nix
···8899let
10101111- basename = "gdb-7.9";
1111+ basename = "gdb-7.9.1";
12121313 # Whether (cross-)building for GNU/Hurd. This is an approximation since
1414 # having `stdenv ? cross' doesn't tell us if we're building `crossDrv' and
···27272828 src = fetchurl {
2929 url = "mirror://gnu/gdb/${basename}.tar.xz";
3030- sha256 = "14l3hhsy7fmpn2dk7ivc67gnbjdhkxlq90kxijpzfa35l58mcccv";
3030+ sha256 = "0h5sfg4ndhb8q4fxbq0hdxfjp35n6ih96f6x8yvb418s84x5976d";
3131 };
3232-3333- # patches = [ ./edit-signals.patch ];
34323533 # I think python is not a native input, but I leave it
3634 # here while I will not need it cross building
+22
pkgs/development/tools/omniorb/default.nix
···11+{ stdenv, fetchurl, python }:
22+stdenv.mkDerivation rec {
33+44+ name = "omniorb-${version}";
55+66+ version = "4.2.0";
77+88+ src = fetchurl rec {
99+ url = "http://sourceforge.net/projects/omniorb/files/omniORB/omniORB-${version}/omniORB-${version}.tar.bz2";
1010+ sha256 = "1g58xcw4641wyisp9wscrkzaqrz0vf123dgy52qq2a3wk7y77hkl";
1111+ };
1212+1313+ buildInputs = [ python ];
1414+1515+ meta = with stdenv.lib; {
1616+ description = "omniORB is a robust high performance CORBA ORB for C++ and Python. It is freely available under the terms of the GNU Lesser General Public License (for the libraries), and GNU General Public License (for the tools). omniORB is largely CORBA 2.6 compliant.";
1717+ homepage = "http://omniorb.sourceforge.net/";
1818+ license = licenses.gpl2Plus;
1919+ maintainers = with maintainers; [ smironov ];
2020+ platforms = platforms.unix;
2121+ };
2222+}
···11-{ stdenv, fetchgit }:
11+{ stdenv, fetchFromGitHub }:
2233stdenv.mkDerivation rec {
44 name = "firmware-linux-nonfree-${version}";
55- version = "2015-07-12";
55+ version = "2015-07-23";
6677- src = fetchgit {
88- url = "http://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git";
99- rev = "5e6d7a9d70b562c60471e234f78137020d65ccbf";
1010- sha256 = "06gvjdqpbayfv696hxn9xjkbzddj1hy6z9aahi156lvj96qb9z49";
77+ # This repo is built by merging the latest versions of
88+ # http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/
99+ # and
1010+ # http://git.kernel.org/cgit/linux/kernel/git/iwlwifi/linux-firmware.git/
1111+ # for any given date. This gives us up to date iwlwifi firmware as well as
1212+ # the usual set of firmware. firmware/linux-firmware usually lags kernel releases
1313+ # so iwlwifi cards will fail to load on newly released kernels.
1414+ src = fetchFromGitHub {
1515+ owner = "wkennington";
1616+ repo = "linux-firmware";
1717+ rev = "854b7f33e839ceea41034b45d6f755ea70c85486";
1818+ sha256 = "1hhqvb96adk64ljf6hp5qss8fhpic28y985gbggh5p2w9bsgs5zq";
1119 };
12201321 preInstall = ''
···2929 docdir=$out/share/doc/nixops mandir=$out/share/man
30303131 mkdir -p $out/share/nix/nixops
3232- cp -av nix/* $out/share/nix/nixops
3232+ cp -av "nix/"* $out/share/nix/nixops
33333434 # Add openssh to nixops' PATH. On some platforms, e.g. CentOS and RHEL
3535 # the version of openssh is causing errors when have big networks (40+)
+5-4
pkgs/tools/package-management/nixops/unstable.nix
···2626 sha256 = "01n2ykszrnqr3kqqdg1n2l8wm38yhri7r3d7b0abklsslz9dlvmy";
2727 };
28282929- buildInputs = [ pythonPackages.nose pythonPackages.coverage ];
2929+ buildInputs = [ /* libxslt */ pythonPackages.nose pythonPackages.coverage ];
30303131 propagatedBuildInputs =
3232 [ pythonPackages.prettytable
···4343 # Backward compatibility symlink.
4444 ln -s nixops $out/bin/charon
45454646- make -C doc/manual install \
4646+ # Documentation build is currently broken. Re-try with newer version.
4747+ : make -C doc/manual install nixops.1 docbookxsl=${docbook5_xsl}/xml/xsl/docbook \
4748 docdir=$out/share/doc/nixops mandir=$out/share/man
48494950 mkdir -p $out/share/nix/nixops
5050- cp -av nix/* $out/share/nix/nixops
5151+ cp -av "nix/"* $out/share/nix/nixops
51525253 # Add openssh to nixops' PATH. On some platforms, e.g. CentOS and RHEL
5354 # the version of openssh is causing errors when have big networks (40+)
5455 wrapProgram $out/bin/nixops --prefix PATH : "${openssh}/bin"
5555- ''; # */
5656+ '';
56575758 meta = {
5859 homepage = https://github.com/NixOS/nixops;