There's a few reasons this is useful:
- it makes it easier to override the unit temporarily with, say,
`systemctl edit --runtime update-locatedb.service` because you can see
the actual command that's in use -- this was my initial motivation
- it removes an unnecessary layer of indirection when systemd executes
the updatedb command
- it permits using locate with a bashless image
- not strictly necessary -- we could have done this with the bash script
as well -- but the change is a chance to make sure every argument is
properly escaped
In passing, update the type for the `services.locate.output` to
`externalPath`. This prevents specifying a path in the Nix store to
house the locate database, since updatedb is never going to be able to
rewrite the database when running as a systemd unit. We could revert
this if we somehow find a way and a use case for having the database
created while building a NixOS image, but that seems unlikely to me.
Co-authored-by: SandaruKasa <SandaruKasa@ya.ru>
On GNOME 50, if you go to Settings - System - About - System Details you
will see a blank OS Build field. That is because IMAGE_VERSION is set to
the empty string in /etc/os-release. Use null for IMAGE_VERSION if
config.system.image.version is null.
Switch the option type to `deferredModuleWith`, which collects definitions without evaluating them.
The raw definitions are forwarded to nixpkgs function via a new internal `_configDefinitions` parameter.
`apply` on the option returns `finalPkgs.config`, preserving
backwards compatibility for external readers of `config.nixpkgs.config`
This makes it so that the `nixpkgs.config` options can be merged with the module system
It also makes the defined options show up in search and the manual.
Include the moved-out modular service infrastructure into the set of
files to evaluate during the docs build.
This was previously unnecessary because even the portable parts were
stored inside the nixos tree.
Move the portable modular service base from
nixos/modules/system/service/portable/ to lib/services/, making it
importable by any module system (home-manager, nix-darwin) without
reaching into the nixos/ tree.
Moved files: service.nix, lib.nix, config-data.nix, config-data-item.nix,
test.nix. All external references updated (systemd/system.nix,
doc/manual/default.nix, assertions.nix, README.md).
No functional changes - only import paths differ.
Move the inline modularServicesModule to a separate file so the module
system sets _file automatically from the file path, removing the need
for __curPos.
default.target is an alias[1] to either multi-user.target or
graphical.target. It makes a bit more sense to trigger mandb
generation by multi-user.target since the generation does not depend
on graphics.
[1]: man bootup
Enables faster and fully asynchronous generation of the cache at runtime
by maintaining a separate copy of `cfg.manualPages` with appropriate
timestamps so that mandb can pick up relevant changes without having to
re-generate the full cache on nearly every system rebuild.
Nixpkgs config, for defining things like which licenses are
permitted, can either be an attrset or a function that is passed a
`pkgs` argument. Evaluating that `pkgs` argument requires computing the
Nixpkgs fixpoint, which requires checking whether the derivations used
in the Nixpkgs bootstrap have valid licenses. This works provided
nothing tries to use Nixpkgs functions to validate or merge anything
included in the configuration.
f5deefd463 (config: add and document {allow,block}listedLicenses,
2025-08-31), in #437723, added type checking and merging to the lists of
permitted/forbidden licenses. That resulted in a recursion loop if a
list of licenses included, say, `pkgs.lib.licenses.bsd0`.
To allow licenses to be specified from Nixpkgs' library, pass `lib` as
well as `pkgs` to any config function. Computing `lib` doesn't require
working out the full Nixpkgs fixpoint. The change in #437723 will still
break things for some people, but it at least provides a sensible route
to getting the config working again.
Fixes#456994.
Inspired by https://github.com/NixOS/nixpkgs/issues/197325 this adds a
new option nixpkgs.allowUnfreePackages, which merges additively and can
thus be defined in multiple modules close to where the unfree package is
installed.
I would have liked ot name this option
nixpkgs.config.allowUnfreePackages, to define it closer to where the
allowUnfree and allowUnfreePredicate are defined, but I didn't see how
this could be achived. I would welcome some guidance on how to do this.
Currently the defaultText of nixpkgs.pkgs uses the cfg variable. The search.nixos.org page is not able to resolve that variable.
Replacing "cfg" within this docs text with the non-aliased "config.nixpkgs".
When we _must_ build, prefer building locally since we probably already have the manpages here. Otherwise, Nix would send all the manpages to a remote builder which isn't likely to be much faster since building the DB is single-threaded. Hopefully a best-of-both worlds between keeping or removing https://github.com/NixOS/nixpkgs/commit/39e63f110e2b8607e4142e1461d08fb20b36497e.