···833833- `pythonRemoveBinBytecode` to remove bytecode from the `/bin` folder.
834834- `setuptoolsBuildHook` to build a wheel using `setuptools`.
835835- `setuptoolsCheckHook` to run tests with `python setup.py test`.
836836+- `venvShellHook` to source a Python 3 `venv` at the `venvDir` location. A `venv` is created if it does not yet exist.
836837- `wheelUnpackHook` to move a wheel to the correct folder so it can be installed with the `pipInstallHook`.
837838838839### Development mode
+11-7
doc/languages-frameworks/rust.section.md
···32323333```
3434rustPlatform.buildRustPackage rec {
3535- name = "ripgrep-${version}";
3636- version = "0.4.0";
3535+ pname = "ripgrep";
3636+ version = "11.0.2";
37373838 src = fetchFromGitHub {
3939 owner = "BurntSushi";
4040- repo = "ripgrep";
4141- rev = "${version}";
4242- sha256 = "0y5d1n6hkw85jb3rblcxqas2fp82h3nghssa4xqrhqnz25l799pj";
4040+ repo = pname;
4141+ rev = version;
4242+ sha256 = "1iga3320mgi7m853la55xip514a3chqsdi1a1rwv25lr9b1p7vd3";
4343 };
44444545- cargoSha256 = "0q68qyl2h6i0qsz82z840myxlnjay8p1w5z7hfyr8fqp7wgwa9cx";
4545+ cargoSha256 = "17ldqr3asrdcsh4l29m3b5r37r5d0b3npq1lrgjmxb6vlx6a36qh";
4646 verifyCargoDeps = true;
47474848 meta = with stdenv.lib; {
···6666build-time.
67676868When `verifyCargoDeps` is set to `true`, the build will also verify that the
6969-`cargoSha256` is not out of date by comparing the `Cargo.lock` file in both the `cargoDeps` and `src`. Note that this option changes the value of `cargoSha256` since it also copies the `Cargo.lock` in it. To avoid breaking backward-compatibility this option is not enabled by default but hopefully will be in the future.
6969+`cargoSha256` is not out of date by comparing the `Cargo.lock` file in both the
7070+`cargoDeps` and `src`. Note that this option changes the value of `cargoSha256`
7171+since it also copies the `Cargo.lock` in it. To avoid breaking
7272+backward-compatibility this option is not enabled by default but hopefully will
7373+be in the future.
70747175### Building a crate for a different target
7276
···99 # Returns true if the path exists and is a directory, false otherwise
1010 pathIsDirectory = p: if builtins.pathExists p then (pathType p) == "directory" else false;
11111212+ # Returns true if the path exists and is a regular file, false otherwise
1313+ pathIsRegularFile = p: if builtins.pathExists p then (pathType p) == "regular" else false;
1414+1215 # Bring in a path as a source, filtering out all Subversion and CVS
1316 # directories, as well as backup files (*~).
1417 cleanSourceFilter = name: type: let baseName = baseNameOf (toString name); in ! (
···110113 with builtins;
111114 let fileName = toString path + "/" + file;
112115 packedRefsName = toString path + "/packed-refs";
113113- in if lib.pathExists fileName
116116+ in if pathIsRegularFile path
117117+ # Resolve git worktrees. See gitrepository-layout(5)
118118+ then
119119+ let m = match "^gitdir: (.*)$" (lib.fileContents path);
120120+ in if m == null
121121+ then throw ("File contains no gitdir reference: " + path)
122122+ else
123123+ let gitDir = lib.head m;
124124+ commonDir' = if pathIsRegularFile "${gitDir}/commondir"
125125+ then lib.fileContents "${gitDir}/commondir"
126126+ else gitDir;
127127+ commonDir = if lib.hasPrefix "/" commonDir'
128128+ then commonDir'
129129+ else toString (/. + "${gitDir}/${commonDir'}");
130130+ refFile = lib.removePrefix "${commonDir}/" "${gitDir}/${file}";
131131+ in readCommitFromFile refFile commonDir
132132+133133+ else if pathIsRegularFile fileName
134134+ # Sometimes git stores the commitId directly in the file but
135135+ # sometimes it stores something like: «ref: refs/heads/branch-name»
114136 then
115137 let fileContent = lib.fileContents fileName;
116116- # Sometimes git stores the commitId directly in the file but
117117- # sometimes it stores something like: «ref: refs/heads/branch-name»
118138 matchRef = match "^ref: (.*)$" fileContent;
119119- in if matchRef == null
139139+ in if matchRef == null
120140 then fileContent
121141 else readCommitFromFile (lib.head matchRef) path
142142+143143+ else if pathIsRegularFile packedRefsName
122144 # Sometimes, the file isn't there at all and has been packed away in the
123145 # packed-refs file, so we have to grep through it:
124124- else if lib.pathExists packedRefsName
125146 then
126147 let fileContent = readFile packedRefsName;
127148 matchRef = match (".*\n([^\n ]*) " + file + "\n.*") fileContent;
128128- in if matchRef == null
149149+ in if matchRef == null
129150 then throw ("Could not find " + file + " in " + packedRefsName)
130151 else lib.head matchRef
152152+131153 else throw ("Not a .git directory: " + path);
132154 in readCommitFromFile "HEAD";
133155
···174174checkConfigOutput "true" config.submodule.outer ./declare-submoduleWith-modules.nix
175175176176## Paths should be allowed as values and work as expected
177177-# Temporarily disabled until https://github.com/NixOS/nixpkgs/pull/76861
178178-#checkConfigOutput "true" config.submodule.enable ./declare-submoduleWith-path.nix
177177+checkConfigOutput "true" config.submodule.enable ./declare-submoduleWith-path.nix
179178180179# Check that disabledModules works recursively and correctly
181180checkConfigOutput "true" config.enable ./disable-recursive/main.nix
+1-1
lib/trivial.nix
···191191 let
192192 revisionFile = "${toString ./..}/.git-revision";
193193 gitRepo = "${toString ./..}/.git";
194194- in if lib.pathIsDirectory gitRepo
194194+ in if builtins.pathExists gitRepo
195195 then lib.commitIdFromGitRepo gitRepo
196196 else if lib.pathExists revisionFile then lib.fileContents revisionFile
197197 else default;
+64-12
lib/types.nix
···340340 let
341341 padWidth = stringLength (toString (length def.value));
342342 unnamed = i: unnamedPrefix + fixedWidthNumber padWidth i;
343343+ anyString = placeholder "name";
344344+ nameAttrs = [
345345+ { path = [ "environment" "etc" ];
346346+ name = "target";
347347+ }
348348+ { path = [ "containers" anyString "bindMounts" ];
349349+ name = "mountPoint";
350350+ }
351351+ { path = [ "programs" "ssh" "knownHosts" ];
352352+ # hostNames is actually a list so we would need to handle it only when singleton
353353+ name = "hostNames";
354354+ }
355355+ { path = [ "fileSystems" ];
356356+ name = "mountPoint";
357357+ }
358358+ { path = [ "boot" "specialFileSystems" ];
359359+ name = "mountPoint";
360360+ }
361361+ { path = [ "services" "znapzend" "zetup" ];
362362+ name = "dataset";
363363+ }
364364+ { path = [ "services" "znapzend" "zetup" anyString "destinations" ];
365365+ name = "label";
366366+ }
367367+ { path = [ "services" "geoclue2" "appConfig" ];
368368+ name = "desktopID";
369369+ }
370370+ ];
371371+ matched = let
372372+ equals = a: b: b == anyString || a == b;
373373+ fallback = { name = "name"; };
374374+ in findFirst ({ path, ... }: all (v: v == true) (zipListsWith equals loc path)) fallback nameAttrs;
375375+ nameAttr = matched.name;
376376+ nameValueOld = value:
377377+ if isList value then
378378+ if length value > 0 then
379379+ "[ " + concatMapStringsSep " " escapeNixString value + " ]"
380380+ else
381381+ "[ ]"
382382+ else
383383+ escapeNixString value;
384384+ nameValueNew = value: unnamed:
385385+ if isList value then
386386+ if length value > 0 then
387387+ head value
388388+ else
389389+ unnamed
390390+ else
391391+ value;
343392 res =
344393 { inherit (def) file;
345394 value = listToAttrs (
346395 imap1 (elemIdx: elem:
347347- { name = elem.name or (unnamed elemIdx);
396396+ { name = nameValueNew (elem.${nameAttr} or (unnamed elemIdx)) (unnamed elemIdx);
348397 value = elem;
349398 }) def.value);
350399 };
351400 option = concatStringsSep "." loc;
352401 sample = take 3 def.value;
353353- list = concatMapStrings (x: ''{ name = "${x.name or "unnamed"}"; ...} '') sample;
354354- set = concatMapStrings (x: ''${x.name or "unnamed"} = {...}; '') sample;
402402+ more = lib.optionalString (length def.value > 3) "... ";
403403+ list = concatMapStrings (x: ''{ ${nameAttr} = ${nameValueOld (x.${nameAttr} or "unnamed")}; ...} '') sample;
404404+ set = concatMapStrings (x: ''${nameValueNew (x.${nameAttr} or "unnamed") "unnamed"} = {...}; '') sample;
355405 msg = ''
356406 In file ${def.file}
357407 a list is being assigned to the option config.${option}.
···359409 See https://git.io/fj2zm for more information.
360410 Do
361411 ${option} =
362362- { ${set}...}
412412+ { ${set}${more}}
363413 instead of
364414 ${option} =
365365- [ ${list}...]
415415+ [ ${list}${more}]
366416 '';
367417 in
368418 lib.warn msg res
···430480 else unify (if shorthandOnlyDefinesConfig then { config = value; } else value);
431481432482 allModules = defs: modules ++ imap1 (n: { value, file }:
433433- # Annotate the value with the location of its definition for better error messages
434434- coerce (lib.modules.unifyModuleSyntax file "${toString file}-${toString n}") value
483483+ if isAttrs value || isFunction value then
484484+ # Annotate the value with the location of its definition for better error messages
485485+ coerce (lib.modules.unifyModuleSyntax file "${toString file}-${toString n}") value
486486+ else value
435487 ) defs;
436488437489 in
438490 mkOptionType rec {
439491 name = "submodule";
440440- check = x: isAttrs x || isFunction x;
492492+ check = x: isAttrs x || isFunction x || path.check x;
441493 merge = loc: defs:
442494 (evalModules {
443495 modules = allModules defs;
···538590 tail' = tail ts;
539591 in foldl' either head' tail';
540592541541- # Either value of type `finalType` or `coercedType`, the latter is
593593+ # Either value of type `coercedType` or `finalType`, the former is
542594 # converted to `finalType` using `coerceFunc`.
543595 coercedTo = coercedType: coerceFunc: finalType:
544596 assert lib.assertMsg (coercedType.getSubModules == null)
···547599 mkOptionType rec {
548600 name = "coercedTo";
549601 description = "${finalType.description} or ${coercedType.description} convertible to it";
550550- check = x: finalType.check x || (coercedType.check x && finalType.check (coerceFunc x));
602602+ check = x: (coercedType.check x && finalType.check (coerceFunc x)) || finalType.check x;
551603 merge = loc: defs:
552604 let
553605 coerceVal = val:
554554- if finalType.check val then val
555555- else coerceFunc val;
606606+ if coercedType.check val then coerceFunc val
607607+ else val;
556608 in finalType.merge loc (map (def: def // { value = coerceVal def.value; }) defs);
557609 emptyValue = finalType.emptyValue;
558610 getSubOptions = finalType.getSubOptions;
···257257 <listitem>
258258 <para>
259259 A set of sub options <replaceable>o</replaceable>.
260260- <replaceable>o</replaceable> can be an attribute set or a function
261261- returning an attribute set. Submodules are used in composed types to
262262- create modular options. This is equivalent to
260260+ <replaceable>o</replaceable> can be an attribute set, a function
261261+ returning an attribute set, or a path to a file containing such a value. Submodules are used in
262262+ composed types to create modular options. This is equivalent to
263263 <literal>types.submoduleWith { modules = toList o; shorthandOnlyDefinesConfig = true; }</literal>.
264264 Submodules are detailed in
265265 <xref
···391391 <link xlink:href="https://github.com/NixOS/nixpkgs/pull/63103">PR #63103</link>.
392392 </para>
393393 </listitem>
394394+ <listitem>
395395+ <para>
396396+ For NixOS modules, the types <literal>types.submodule</literal> and <literal>types.submoduleWith</literal> now support
397397+ paths as allowed values, similar to how <literal>imports</literal> supports paths.
398398+ Because of this, if you have a module that defines an option of type
399399+ <literal>either (submodule ...) path</literal>, it will break since a path
400400+ is now treated as the first type instead of the second. To fix this, change
401401+ the type to <literal>either path (submodule ...)</literal>.
402402+ </para>
403403+ </listitem>
394404 </itemizedlist>
395405 </section>
396406
+2-1
nixos/lib/test-driver/test-driver.py
···704704705705 def process_serial_output() -> None:
706706 for _line in self.process.stdout:
707707- line = _line.decode("unicode_escape").replace("\r", "").rstrip()
707707+ # Ignore undecodable bytes that may occur in boot menus
708708+ line = _line.decode(errors="ignore").replace("\r", "").rstrip()
708709 eprint("{} # {}".format(self.name, line))
709710 self.logger.enqueue({"msg": line, "machine": self.name})
710711
···2121 ###### implementation
22222323 config = mkIf config.hardware.usbWwan.enable {
2424+ # Attaches device specific handlers.
2425 services.udev.packages = with pkgs; [ usb-modeswitch-data ];
2626+2727+ # Triggered by udev, usb-modeswitch creates systemd services via a
2828+ # template unit in the usb-modeswitch package.
2929+ systemd.packages = with pkgs; [ usb-modeswitch ];
3030+3131+ # The systemd service requires the usb-modeswitch-data. The
3232+ # usb-modeswitch package intends to discover this via the
3333+ # filesystem at /usr/share/usb_modeswitch, and merge it with user
3434+ # configuration in /etc/usb_modeswitch.d. Configuring the correct
3535+ # path in the package is difficult, as it would cause a cyclic
3636+ # dependency.
3737+ environment.etc."usb_modeswitch.d".source = "${pkgs.usb-modeswitch-data}/share/usb_modeswitch";
2538 };
2639}
+2-2
nixos/modules/misc/version.nix
···9191 # These defaults are set here rather than up there so that
9292 # changing them would not rebuild the manual
9393 version = mkDefault (cfg.release + cfg.versionSuffix);
9494- revision = mkIf (pathIsDirectory gitRepo) (mkDefault gitCommitId);
9595- versionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));
9494+ revision = mkIf (pathExists gitRepo) (mkDefault gitCommitId);
9595+ versionSuffix = mkIf (pathExists gitRepo) (mkDefault (".git." + gitCommitId));
9696 };
97979898 # Generate /etc/os-release. See
···100100 '' + stdenv.lib.optionalString verifyCargoDeps ''
101101 if ! diff source/Cargo.lock $cargoDeps/Cargo.lock ; then
102102 echo
103103- echo "ERROR: cargoSha256 is out of date."
103103+ echo "ERROR: cargoSha256 is out of date"
104104 echo
105105- echo "Cargo.lock is not the same in $cargoDeps."
105105+ echo "Cargo.lock is not the same in $cargoDeps"
106106 echo
107107 echo "To fix the issue:"
108108 echo '1. Use "1111111111111111111111111111111111111111111111111111" as the cargoSha256 value'
+2-2
pkgs/data/fonts/victor-mono/default.nix
···2233let
44 pname = "victor-mono";
55- version = "1.3.0";
55+ version = "1.3.1";
66in fetchFromGitHub rec {
77 name = "${pname}-${version}";
88···2626 unzip -j VictorMonoAll.zip \*.otf -d $out/share/fonts/opentype/${pname}
2727 '';
28282929- sha256 = "1lv2x7kfspabnhvm8z79n165fw3awvzj1r8f0g5zn26wgdalgw69";
2929+ sha256 = "1yj91rhs9pd705406r4lqabdfzjclbz837nzm6z1rziy6mbpd61s";
30303131 meta = with lib; {
3232 description = "Free programming font with cursive italics and ligatures";
···99 sha256 = "1ygahl3r26r38ai8yyblq9nhf3v5i6n6r6672p5wf88wg5h9n0rz";
1010 };
11111212- inherit (usb-modeswitch) makeFlags;
1212+ makeFlags = [
1313+ "PREFIX=$(out)"
1414+ "DESTDIR=$(out)"
1515+ ];
13161417 prePatch = ''
1515- sed -i 's@usb_modeswitch@${usb-modeswitch}/bin/usb_modeswitch@g' 40-usb_modeswitch.rules
1818+ sed -i 's@usb_modeswitch@${usb-modeswitch}/lib/udev/usb_modeswitch@g' 40-usb_modeswitch.rules
1619 '';
17201821 # we add tcl here so we can patch in support for new devices by dropping config into
···3636 sed -e "s@/etc/@$out/etc/@g" -e "/chmod u+s/d" -i Makefile
3737 '';
38383939- # We need to set the directory for the .local override files back to
3939+ # We need to set the directory for the .local override files to
4040 # /etc/firejail so we can actually override them
4141 postInstall = ''
4242- sed -E -e 's@^include (.*)(/firejail/.*.local)$@include /etc\2@g' -i $out/etc/firejail/*.profile
4242+ sed -E -e 's@^include (.*.local)$@include /etc/firejail/\1@g' -i $out/etc/firejail/*.profile
4343 '';
44444545 # At high parallelism, the build sometimes fails with:
+2-2
pkgs/os-specific/linux/kernel/linux-4.14.nix
···33with stdenv.lib;
4455buildLinux (args // rec {
66- version = "4.14.163";
66+ version = "4.14.164";
7788 # modDirVersion needs to be x.y.z, will automatically add .0 if needed
99 modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
···13131414 src = fetchurl {
1515 url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
1616- sha256 = "0jdh54rqdsb3b908v2q4xjn8y45b7rdnwgab0s4qf5alznfcqagb";
1616+ sha256 = "0jzbgpxlfy64q7zaqix87k8ci1fr9lkx1xr9m5zjniziydhi00x2";
1717 };
1818} // (args.argsOverride or {}))
+2-2
pkgs/os-specific/linux/kernel/linux-4.19.nix
···33with stdenv.lib;
4455buildLinux (args // rec {
66- version = "4.19.94";
66+ version = "4.19.95";
7788 # modDirVersion needs to be x.y.z, will automatically add .0 if needed
99 modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
···13131414 src = fetchurl {
1515 url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
1616- sha256 = "0rvlz94mjl7ygpmhz0yn2whx9dq9fmy0w1472bj16hkwbaki0an6";
1616+ sha256 = "1c2g5wcf4zgy5q51qrf0s4hf3pr1j8gi8gn27w8cafn1xqrcmvaa";
1717 };
1818} // (args.argsOverride or {}))