···604604 ({
605605 name :: String,
606606 type :: String,
607607+ hasExt :: String -> Bool,
607608 ...
608609 } -> Bool)
609610 -> Path
···614615 fileFilter (file: file.name == "default.nix") ./.
615616616617 # Include all non-Nix files from the current directory
617617- fileFilter (file: ! hasSuffix ".nix" file.name) ./.
618618+ fileFilter (file: ! file.hasExt "nix") ./.
618619619620 # Include all files that start with a "." in the current directory
620621 fileFilter (file: hasPrefix "." file.name) ./.
···633634634635 - `type` (String, one of `"regular"`, `"symlink"` or `"unknown"`): The type of the file.
635636 This matches result of calling [`builtins.readFileType`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-readFileType) on the file's path.
637637+638638+ - `hasExt` (String -> Bool): Whether the file has a certain file extension.
639639+ `hasExt ext` is true only if `hasSuffix ".${ext}" name`.
640640+641641+ This also means that e.g. for a file with name `.gitignore`,
642642+ `hasExt "gitignore"` is true.
636643637644 Other attributes may be added in the future.
638645 */
+4-1
lib/fileset/internal.nix
···5252 concatStringsSep
5353 substring
5454 stringLength
5555+ hasSuffix
5556 ;
56575758in
···797798 if
798799 predicate {
799800 inherit name type;
801801+ hasExt = ext: hasSuffix ".${ext}" name;
802802+800803 # To ensure forwards compatibility with more arguments being added in the future,
801804 # adding an attribute which can't be deconstructed :)
802802- "lib.fileset.fileFilter: The predicate function passed as the first argument must be able to handle extra attributes for future compatibility. If you're using `{ name, file }:`, use `{ name, file, ... }:` instead." = null;
805805+ "lib.fileset.fileFilter: The predicate function passed as the first argument must be able to handle extra attributes for future compatibility. If you're using `{ name, file, hasExt }:`, use `{ name, file, hasExt, ... }:` instead." = null;
803806 }
804807 then
805808 type
+34-1
lib/fileset/tests.sh
···847847848848# The predicate must be able to handle extra attributes
849849touch a
850850-expectFailure 'toSource { root = ./.; fileset = fileFilter ({ name, type }: true) ./.; }' 'called with unexpected argument '\''"lib.fileset.fileFilter: The predicate function passed as the first argument must be able to handle extra attributes for future compatibility. If you'\''re using `\{ name, file \}:`, use `\{ name, file, ... \}:` instead."'\'
850850+expectFailure 'toSource { root = ./.; fileset = fileFilter ({ name, type, hasExt }: true) ./.; }' 'called with unexpected argument '\''"lib.fileset.fileFilter: The predicate function passed as the first argument must be able to handle extra attributes for future compatibility. If you'\''re using `\{ name, file, hasExt \}:`, use `\{ name, file, hasExt, ... \}:` instead."'\'
851851rm -rf -- *
852852853853# .name is the name, and it works correctly, even recursively
···894894 'toSource { root = ./.; fileset = fileFilter (file: file.type != "unknown") ./.; }' \
895895 'toSource { root = ./.; fileset = union ./d/a ./d/b; }'
896896rm -rf -- *
897897+898898+# Check that .hasExt checks for the file extension
899899+# The empty extension is the same as a file ending with a .
900900+tree=(
901901+ [a]=0
902902+ [a.]=1
903903+ [a.b]=0
904904+ [a.b.]=1
905905+ [a.b.c]=0
906906+)
907907+checkFileset 'fileFilter (file: file.hasExt "") ./.'
908908+909909+# It can check for the last extension
910910+tree=(
911911+ [a]=0
912912+ [.a]=1
913913+ [.a.]=0
914914+ [.b.a]=1
915915+ [.b.a.]=0
916916+)
917917+checkFileset 'fileFilter (file: file.hasExt "a") ./.'
918918+919919+# It can check for any extension
920920+tree=(
921921+ [a.b.c.d]=1
922922+)
923923+checkFileset 'fileFilter (file:
924924+ all file.hasExt [
925925+ "b.c.d"
926926+ "c.d"
927927+ "d"
928928+ ]
929929+) ./.'
897930898931# It's lazy
899932tree=(
+98-5
nixos/doc/manual/release-notes/rl-2311.section.md
···364364365365- `networking.networkmanager.firewallBackend` was removed as NixOS is now using iptables-nftables-compat even when using iptables, therefore Networkmanager now uses the nftables backend unconditionally.
366366367367-- [`lib.lists.foldl'`](https://nixos.org/manual/nixpkgs/stable#function-library-lib.lists.foldl-prime) now always evaluates the initial accumulator argument first.
368368- If you depend on the lazier behavior, consider using [`lib.lists.foldl`](https://nixos.org/manual/nixpkgs/stable#function-library-lib.lists.foldl) or [`builtins.foldl'`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-foldl') instead.
369369-370370-- [`lib.attrsets.foldlAttrs`](https://nixos.org/manual/nixpkgs/stable#function-library-lib.attrsets.foldlAttrs) now always evaluates the initial accumulator argument first.
371371-372367- `rome` was removed because it is no longer maintained and is succeeded by `biome`.
373368374369- The `prometheus-knot-exporter` was migrated to a version maintained by CZ.NIC. Various metric names have changed, so checking existing rules is recommended.
···612607- Docker now defaults to 24, as 20.10 is stopping to receive security updates and bug fixes after [December 10, 2023](https://github.com/moby/moby/discussions/45104).
613608614609- There is a new NixOS option when writing NixOS tests `testing.initrdBackdoor`, that enables `backdoor.service` in initrd. Requires `boot.initrd.systemd.enable` to be enabled. Boot will pause in stage 1 at `initrd.target`, and will listen for commands from the `Machine` python interface, just like stage 2 normally does. This enables commands to be sent to test and debug stage 1. Use `machine.switch_root()` to leave stage 1 and proceed to stage 2.
610610+611611+## Nixpkgs library changes {#sec-release-23.11-lib}
612612+613613+### Breaking changes {#sec-release-23.11-lib-breaking}
614614+615615+- [`lib.lists.foldl'`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.lists.foldl-prime)
616616+ now always evaluates the initial accumulator argument first.
617617+ If you depend on the lazier behavior, consider using [`lib.lists.foldl`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.lists.foldl)
618618+ or [`builtins.foldl'`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-foldl') instead.
619619+- [`lib.attrsets.foldlAttrs`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.attrsets.foldlAttrs)
620620+ now always evaluates the initial accumulator argument first.
621621+- Now that the internal NixOS transition to Markdown documentation is complete,
622622+ `lib.options.literalDocBook` has been removed after deprecation in 22.11.
623623+- `lib.types.string` is now fully deprecated and gives a warning when used.
624624+625625+### Additions and improvements {#sec-release-23.11-lib-additions-improvements}
626626+627627+- [`lib.fileset`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-fileset):
628628+ A new sub-library to select local files to use for sources,
629629+ designed to be easy and safe to use.
630630+631631+ This aims to be a replacement for `lib.sources`-based filtering.
632632+ To learn more about it, see [the tutorial](https://nix.dev/tutorials/file-sets).
633633+634634+- [`lib.gvariant`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-gvariant):
635635+ A partial and basic implementation of GVariant formatted strings.
636636+ See [GVariant Format Strings](https://docs.gtk.org/glib/gvariant-format-strings.html) for details.
637637+638638+ :::{.warning}
639639+ This API is not considered fully stable and it might therefore
640640+ change in backwards incompatible ways without prior notice.
641641+ :::
642642+643643+- [`lib.asserts`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-asserts): New function:
644644+ [`assertEachOneOf`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.asserts.assertEachOneOf).
645645+- [`lib.attrsets`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-attrsets): New function:
646646+ [`attrsToList`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.attrsets.attrsToList).
647647+- [`lib.customisation`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-customisation): New function:
648648+ [`makeScopeWithSplicing'`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.customisation.makeScopeWithSplicing-prime).
649649+- [`lib.fixedPoints`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-fixedPoints): Documentation improvements for
650650+ [`lib.fixedPoints.fix`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.fixedPoints.fix).
651651+- `lib.generators`: New functions:
652652+ [`mkDconfKeyValue`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.generators.mkDconfKeyValue),
653653+ [`toDconfINI`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.generators.toDconfINI).
654654+655655+ `lib.generators.toKeyValue` now supports the `indent` attribute in its first argument.
656656+- [`lib.lists`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-lists): New functions:
657657+ [`findFirstIndex`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.lists.findFirstIndex),
658658+ [`hasPrefix`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.lists.hasPrefix),
659659+ [`removePrefix`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.lists.removePrefix),
660660+ [`commonPrefix`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.lists.commonPrefix),
661661+ [`allUnique`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.lists.allUnique).
662662+663663+ Documentation improvements for
664664+ [`lib.lists.foldl'`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.lists.foldl-prime).
665665+- [`lib.meta`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-meta): Documentation of functions now gets rendered
666666+- [`lib.path`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-path): New functions:
667667+ [`hasPrefix`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.path.hasPrefix),
668668+ [`removePrefix`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.path.removePrefix),
669669+ [`splitRoot`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.path.splitRoot),
670670+ [`subpath.components`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.path.subpath.components).
671671+- [`lib.strings`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-strings): New functions:
672672+ [`replicate`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.strings.replicate),
673673+ [`cmakeOptionType`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.strings.cmakeOptionType),
674674+ [`cmakeBool`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.strings.cmakeBool),
675675+ [`cmakeFeature`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.strings.cmakeFeature).
676676+- [`lib.trivial`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-trivial): New function:
677677+ [`mirrorFunctionArgs`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.trivial.mirrorFunctionArgs).
678678+- `lib.systems`: New function:
679679+ [`equals`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.systems.equals).
680680+- [`lib.options`](https://nixos.org/manual/nixpkgs/unstable#sec-functions-library-options): Improved documentation for
681681+ [`mkPackageOption`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.options.mkPackageOption).
682682+683683+ [`mkPackageOption`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.options.mkPackageOption).
684684+ now also supports the `pkgsText` attribute.
685685+686686+Module system:
687687+- Options in the `options` module argument now have the `declarationPositions` attribute
688688+ containing the position where the option was declared:
689689+ ```
690690+ $ nix repl -f '<nixpkgs/nixos>'
691691+ [...]
692692+ nix-repl> :p options.environment.systemPackages.declarationPositions
693693+ [ {
694694+ column = 7;
695695+ file = "/nix/store/vm9zf9wvfd628cchj0hdij1g4hzjrcz9-source/nixos/modules/config/system-path.nix";
696696+ line = 62;
697697+ } ]
698698+ ```
699699+ Not to be confused with `definitionsWithLocations`, which is the same but for option _definitions_.
700700+- Improved error message for option declarations missing `mkOption`
701701+702702+### Deprecations {#sec-release-23.11-lib-deprecations}
703703+704704+- `lib.meta.getExe pkg` (also available as `lib.getExe`) now gives a warning if `pkg.meta.mainProgram` is not set,
705705+ but it continues to default to the derivation name.
706706+ Nixpkgs accepts PRs that set `meta.mainProgram` on packages where it makes sense.
707707+ Use `lib.getExe' pkg "some-command"` to avoid the warning and/or select a different executable.
+10-1
nixos/modules/hardware/video/nvidia.nix
···261261 ];
262262 boot = {
263263 blacklistedKernelModules = ["nouveau" "nvidiafb"];
264264- kernelModules = [ "nvidia-uvm" ];
264264+265265+ # Don't add `nvidia-uvm` to `kernelModules`, because we want
266266+ # `nvidia-uvm` be loaded only after `udev` rules for `nvidia` kernel
267267+ # module are applied.
268268+ #
269269+ # Instead, we use `softdep` to lazily load `nvidia-uvm` kernel module
270270+ # after `nvidia` kernel module is loaded and `udev` rules are applied.
271271+ extraModprobeConfig = ''
272272+ softdep nvidia post: nvidia-uvm
273273+ '';
265274 };
266275 systemd.tmpfiles.rules =
267276 lib.optional config.virtualisation.docker.enableNvidia
+1
nixos/modules/tasks/filesystems/bcachefs.nix
···2020 printf "waiting for device to appear $path"
2121 for try in $(seq 10); do
2222 if [ -e $path ]; then
2323+ target=$(readlink -f $path)
2324 success=true
2425 break
2526 else
···2121 # Whether to force the usage of Git dependencies that have install scripts, but not a lockfile.
2222 # Use with care.
2323, forceGitDeps ? false
2424+ # Whether to force allow an empty dependency cache.
2525+ # This can be enabled if there are truly no remote dependencies, but generally an empty cache indicates something is wrong.
2626+, forceEmptyCache ? false
2427 # Whether to make the cache writable prior to installing dependencies.
2528 # Don't set this unless npm tries to write to the cache directory, as it can slow down the build.
2629, makeCacheWritable ? false
···4245, npmWorkspace ? null
4346, nodejs ? topLevelArgs.nodejs
4447, npmDeps ? fetchNpmDeps {
4545- inherit forceGitDeps src srcs sourceRoot prePatch patches postPatch;
4848+ inherit forceGitDeps forceEmptyCache src srcs sourceRoot prePatch patches postPatch;
4649 name = "${name}-npm-deps";
4750 hash = npmDepsHash;
4851}
···14141515pub mod lock;
16161717-pub fn lockfile(content: &str, force_git_deps: bool) -> anyhow::Result<Vec<Package>> {
1717+pub fn lockfile(
1818+ content: &str,
1919+ force_git_deps: bool,
2020+ force_empty_cache: bool,
2121+) -> anyhow::Result<Vec<Package>> {
1822 let mut packages = lock::packages(content)
1923 .context("failed to extract packages from lockfile")?
2024 .into_par_iter()
···2428 Package::from_lock(p).with_context(|| format!("failed to parse data for {n}"))
2529 })
2630 .collect::<anyhow::Result<Vec<_>>>()?;
3131+3232+ if packages.is_empty() && !force_empty_cache {
3333+ bail!("No cacheable dependencies were found. Please inspect the upstream `package-lock.json` file and ensure that remote dependencies have `resolved` URLs and `integrity` hashes. If the lockfile is missing this data, attempt to get upstream to fix it via a tool like <https://github.com/jeslie0/npm-lockfile-fix>. If generating an empty cache is intentional and you would like to do it anyways, set `forceEmptyCache = true`.");
3434+ }
27352836 let mut new = Vec::new();
2937···6472 }
65736674 if let Ok(lockfile_contents) = lockfile_contents {
6767- new.append(&mut lockfile(&lockfile_contents, force_git_deps)?);
7575+ new.append(&mut lockfile(
7676+ &lockfile_contents,
7777+ force_git_deps,
7878+ // force_empty_cache is turned on here since recursively parsed lockfiles should be
7979+ // allowed to have an empty cache without erroring by default
8080+ true,
8181+ )?);
6882 }
6983 }
7084
+2-2
pkgs/development/interpreters/php/8.1.nix
···2233let
44 base = callPackage ./generic.nix (_args // {
55- version = "8.1.25";
66- hash = "sha256-qGqIwYQMG8gyvP0vvsO4oZQsgxTaXf9T8J+cmNDBLoo=";
55+ version = "8.1.26";
66+ hash = "sha256-g73iSchKoaBDqMjQ7qCTRcLK5puXhM3wIin8kW+7nqA=";
77 });
8899in
+2-2
pkgs/development/interpreters/php/8.2.nix
···2233let
44 base = callPackage ./generic.nix (_args // {
55- version = "8.2.12";
66- hash = "sha256-cEMl9WsbTBf5+VHh/+9cZOFIiWBT804mJhUsuqLwWJM=";
55+ version = "8.2.13";
66+ hash = "sha256-ZlKfQ7ITEx5rJTxWAr7wXwSUWNISknMPzNY7SKBtZ7o=";
77 });
8899in
···3232 disabled = pythonOlder "3.6";
3333 src = rootSource;
34343535- patches = [
3636- # workaround for apparent rustc bug
3737- # remove when we're at Rust 1.73
3838- # https://github.com/pola-rs/polars/issues/12050
3939- ./all_horizontal.patch
4040- ];
4141-4235 # Cargo.lock file is sometimes behind actual release which throws an error,
4336 # thus the `sed` command
4437 # Make sure to check that the right substitutions are made when updating the package
···14141515 meta = {
1616 description = "This is a PEP 561 type stub package for the appdirs package. It can be used by type-checking tools like mypy, pyright, pytype, PyCharm, etc. to check code that uses appdirs. ";
1717- homepage = "https://pypi.org/project/types-appdirss";
1717+ homepage = "https://pypi.org/project/types-appdirs";
1818 license = lib.licenses.asl20;
1919 maintainers = with lib.maintainers; [ ];
2020 };
···2121 description = "A program that converts CD images in BIN/CUE format into a set of ISO and CDR tracks";
2222 platforms = platforms.unix;
2323 license = licenses.gpl2;
2424+ mainProgram = "bchunk";
2425 };
2526}
···2929 license = licenses.unfree; # No license specified upstream
3030 platforms = [ "x86_64-linux" ]; # Should work on Darwin as well, but this is untested. aarch64-linux fails.
3131 maintainers = [ maintainers.ivar ];
3232+ mainProgram = "nx2elf";
3233 };
3334}
···3636 platforms = lib.platforms.unix;
3737 # never built on aarch64-darwin, x86_64-darwin since first introduction in nixpkgs
3838 broken = stdenv.isDarwin;
3939+ mainProgram = "esshader";
3940 };
4041}
+1
pkgs/tools/graphics/exif/default.nix
···4141 description = "A utility to read and manipulate EXIF data in digital photographs";
4242 platforms = platforms.unix;
4343 license = licenses.lgpl21Plus;
4444+ mainProgram = "exif";
4445 };
4546}
···2020 description = "Small utility to convert a set of PNG images to Microsoft ICO format";
2121 license = lib.licenses.gpl2Plus;
2222 platforms = with lib.platforms; linux;
2323+ mainProgram = "pngtoico";
2324 };
2425}
···3030 changelog = "https://github.com/typst/hayagriva/releases/tag/v${version}";
3131 license = with licenses; [ asl20 mit ];
3232 maintainers = with maintainers; [ figsoda ];
3333+ mainProgram = "hayagriva";
3334 };
3435}
+1
pkgs/tools/typesetting/htmldoc/default.nix
···3838 generates corresponding HTML, PostScript, or PDF files with an optional
3939 table of contents.
4040 '';
4141+ mainProgram = "htmldoc";
4142 };
4243}