···82828383- [ollama](https://ollama.ai), server for running large language models locally.
84848585+- [Mihomo](https://github.com/MetaCubeX/mihomo), a rule-based proxy in Go. Available as [services.mihomo.enable](#opt-services.mihomo.enable).
8686+8587- [hebbot](https://github.com/haecker-felix/hebbot), a Matrix bot to generate "This Week in X" like blog posts. Available as [services.hebbot](#opt-services.hebbot.enable).
86888789- [Python Matter Server](https://github.com/home-assistant-libs/python-matter-server), a
+87-12
nixos/lib/make-options-doc/default.nix
···11-/* Generate JSON, XML and DocBook documentation for given NixOS options.
11+/**
22+ Generates documentation for [nix modules](https://nix.dev/tutorials/module-system/module-system.html).
33+44+ It uses the declared `options` to generate documentation in various formats.
55+66+ # Outputs
77+88+ This function returns an attribute set with the following entries.
99+1010+ ## optionsCommonMark
1111+1212+ Documentation in CommonMark text format.
1313+1414+ ## optionsJSON
1515+1616+ All options in a JSON format suitable for further automated processing.
1717+1818+ `example.json`
1919+ ```json
2020+ {
2121+ ...
2222+ "fileSystems.<name>.options": {
2323+ "declarations": ["nixos/modules/tasks/filesystems.nix"],
2424+ "default": {
2525+ "_type": "literalExpression",
2626+ "text": "[\n \"defaults\"\n]"
2727+ },
2828+ "description": "Options used to mount the file system.",
2929+ "example": {
3030+ "_type": "literalExpression",
3131+ "text": "[\n \"data=journal\"\n]"
3232+ },
3333+ "loc": ["fileSystems", "<name>", "options"],
3434+ "readOnly": false,
3535+ "type": "non-empty (list of string (with check: non-empty))"
3636+ "relatedPackages": "- [`pkgs.tmux`](\n https://search.nixos.org/packages?show=tmux&sort=relevance&query=tmux\n )\n",
3737+ },
3838+ ...
3939+ }
4040+ ```
4141+4242+ ## optionsDocBook
4343+4444+ deprecated since 23.11 and will be removed in 24.05.
4545+4646+ ## optionsAsciiDoc
4747+4848+ Documentation rendered as AsciiDoc. This is useful for e.g. man pages.
4949+5050+ > Note: NixOS itself uses this ouput to to build the configuration.nix man page"
5151+5252+ ## optionsNix
5353+5454+ All options as a Nix attribute set value, with the same schema as `optionsJSON`.
25533- Minimal example:
5656+ # Example
45755- { pkgs, }:
5858+ ## Example: NixOS configuration
65977- let
88- eval = import (pkgs.path + "/nixos/lib/eval-config.nix") {
99- baseModules = [
1010- ../module.nix
1111- ];
1212- modules = [];
1313- };
1414- in pkgs.nixosOptionsDoc {
1515- options = eval.options;
6060+ ```nix
6161+ let
6262+ # Evaluate a NixOS configuration
6363+ eval = import (pkgs.path + "/nixos/lib/eval-config.nix") {
6464+ # Overriden explicitly here, this would include all modules from NixOS otherwise.
6565+ # See: docs of eval-config.nix for more details
6666+ baseModules = [];
6767+ modules = [
6868+ ./module.nix
6969+ ];
7070+ };
7171+ in
7272+ pkgs.nixosOptionsDoc {
7373+ inherit (eval) options;
1674 }
7575+ ```
7676+7777+ ## Example: non-NixOS modules
7878+7979+ `nixosOptionsDoc` can also be used to build documentation for non-NixOS modules.
17808181+ ```nix
8282+ let
8383+ eval = lib.evalModules {
8484+ modules = [
8585+ ./module.nix
8686+ ];
8787+ };
8888+ in
8989+ pkgs.nixosOptionsDoc {
9090+ inherit (eval) options;
9191+ }
9292+ ```
1893*/
1994{ pkgs
2095, lib
+59-26
nixos/modules/image/repart-image.nix
···22# NixOS module that can be imported.
3344{ lib
55+, stdenvNoCC
56, runCommand
66-, runCommandLocal
77, python3
88, black
99, ruff
···2626, xz
27272828 # arguments
2929+, name
3030+, version
2931, imageFileBasename
3032, compression
3133, fileSystems
3232-, partitions
3434+, partitionsJSON
3335, split
3436, seed
3537, definitionsDirectory
3638, sectorSize
3739, mkfsEnv ? {}
4040+, createEmpty ? true
3841}:
39424043let
···5255 mypy --strict $out
5356 '';
54575555- amendedRepartDefinitions = runCommandLocal "amended-repart.d" {} ''
5656- definitions=$(${amendRepartDefinitions} ${partitions} ${definitionsDirectory})
5757- cp -r $definitions $out
5858- '';
5959-6058 fileSystemToolMapping = {
6159 "vfat" = [ dosfstools mtools ];
6260 "ext4" = [ e2fsprogs.bin ];
···7876 "xz" = "xz --keep --verbose --threads=0 -${toString compression.level}";
7977 }."${compression.algorithm}";
8078in
8181-8282-runCommand imageFileBasename
8383-{
7979+ stdenvNoCC.mkDerivation (finalAttrs:
8080+ (if (version != null)
8181+ then { pname = name; inherit version; }
8282+ else { inherit name; }
8383+ ) // {
8484 __structuredAttrs = true;
85858686 nativeBuildInputs = [
8787 systemd
8888 fakeroot
8989 util-linux
9090+ ] ++ lib.optionals (compression.enable) [
9091 compressionPkg
9192 ] ++ fileSystemTools;
92939394 env = mkfsEnv;
94959696+ inherit partitionsJSON definitionsDirectory;
9797+9898+ # relative path to the repart definitions that are read by systemd-repart
9999+ finalRepartDefinitions = "repart.d";
100100+95101 systemdRepartFlags = [
96102 "--dry-run=no"
9797- "--empty=create"
98103 "--size=auto"
99104 "--seed=${seed}"
100100- "--definitions=${amendedRepartDefinitions}"
105105+ "--definitions=${finalAttrs.finalRepartDefinitions}"
101106 "--split=${lib.boolToString split}"
102107 "--json=pretty"
108108+ ] ++ lib.optionals createEmpty [
109109+ "--empty=create"
103110 ] ++ lib.optionals (sectorSize != null) [
104111 "--sector-size=${toString sectorSize}"
105112 ];
106113107107- passthru = {
108108- inherit amendRepartDefinitions amendedRepartDefinitions;
109109- };
110110-} ''
111111- mkdir -p $out
112112- cd $out
114114+ dontUnpack = true;
115115+ dontConfigure = true;
116116+ doCheck = false;
117117+118118+ patchPhase = ''
119119+ runHook prePatch
120120+121121+ amendedRepartDefinitionsDir=$(${amendRepartDefinitions} $partitionsJSON $definitionsDirectory)
122122+ ln -vs $amendedRepartDefinitionsDir $finalRepartDefinitions
123123+124124+ runHook postPatch
125125+ '';
126126+127127+ buildPhase = ''
128128+ runHook preBuild
113129114114- echo "Building image with systemd-repart..."
115115- unshare --map-root-user fakeroot systemd-repart \
116116- ''${systemdRepartFlags[@]} \
117117- ${imageFileBasename}.raw \
118118- | tee repart-output.json
130130+ echo "Building image with systemd-repart..."
131131+ unshare --map-root-user fakeroot systemd-repart \
132132+ ''${systemdRepartFlags[@]} \
133133+ ${imageFileBasename}.raw \
134134+ | tee repart-output.json
119135136136+ runHook postBuild
137137+ '';
138138+139139+ installPhase = ''
140140+ runHook preInstall
141141+142142+ mkdir -p $out
143143+ ''
120144 # Compression is implemented in the same derivation as opposed to in a
121145 # separate derivation to allow users to save disk space. Disk images are
122146 # already very space intensive so we want to allow users to mitigate this.
123123- if ${lib.boolToString compression.enable}; then
147147+ + lib.optionalString compression.enable
148148+ ''
124149 for f in ${imageFileBasename}*; do
125150 echo "Compressing $f with ${compression.algorithm}..."
126151 # Keep the original file when compressing and only delete it afterwards
127152 ${compressionCommand} $f && rm $f
128153 done
129129- fi
130130-''
154154+ '' + ''
155155+ mv -v repart-output.json ${imageFileBasename}* $out
156156+157157+ runHook postInstall
158158+ '';
159159+160160+ passthru = {
161161+ inherit amendRepartDefinitions;
162162+ };
163163+})
+26-16
nixos/modules/image/repart.nix
···211211 '';
212212 };
213213214214+ finalPartitions = lib.mkOption {
215215+ type = lib.types.attrs;
216216+ internal = true;
217217+ readOnly = true;
218218+ description = lib.mdDoc ''
219219+ Convenience option to access partitions with added closures.
220220+ '';
221221+ };
222222+214223 };
215224216225 config = {
···224233 "zstd" = ".zst";
225234 "xz" = ".xz";
226235 }."${cfg.compression.algorithm}";
236236+237237+ makeClosure = paths: pkgs.closureInfo { rootPaths = paths; };
238238+239239+ # Add the closure of the provided Nix store paths to cfg.partitions so
240240+ # that amend-repart-definitions.py can read it.
241241+ addClosure = _name: partitionConfig: partitionConfig // (
242242+ lib.optionalAttrs
243243+ (partitionConfig.storePaths or [ ] != [ ])
244244+ { closure = "${makeClosure partitionConfig.storePaths}/store-paths"; }
245245+ );
227246 in
228247 {
229248 name = lib.mkIf (config.system.image.id != null) (lib.mkOptionDefault config.system.image.id);
···239258 "xz" = 3;
240259 }."${cfg.compression.algorithm}";
241260 };
261261+262262+ finalPartitions = lib.mapAttrs addClosure cfg.partitions;
242263 };
243264244265 system.build.image =
···247268 (f: f != null)
248269 (lib.mapAttrsToList (_n: v: v.repartConfig.Format or null) cfg.partitions);
249270250250- makeClosure = paths: pkgs.closureInfo { rootPaths = paths; };
251251-252252- # Add the closure of the provided Nix store paths to cfg.partitions so
253253- # that amend-repart-definitions.py can read it.
254254- addClosure = _name: partitionConfig: partitionConfig // (
255255- lib.optionalAttrs
256256- (partitionConfig.storePaths or [ ] != [ ])
257257- { closure = "${makeClosure partitionConfig.storePaths}/store-paths"; }
258258- );
259259-260260- finalPartitions = lib.mapAttrs addClosure cfg.partitions;
261271262272 format = pkgs.formats.ini { };
263273264274 definitionsDirectory = utils.systemdUtils.lib.definitions
265275 "repart.d"
266276 format
267267- (lib.mapAttrs (_n: v: { Partition = v.repartConfig; }) finalPartitions);
277277+ (lib.mapAttrs (_n: v: { Partition = v.repartConfig; }) cfg.finalPartitions);
268278269269- partitions = pkgs.writeText "partitions.json" (builtins.toJSON finalPartitions);
279279+ partitionsJSON = pkgs.writeText "partitions.json" (builtins.toJSON cfg.finalPartitions);
270280271281 mkfsEnv = mkfsOptionsToEnv cfg.mkfsOptions;
272282 in
273283 pkgs.callPackage ./repart-image.nix {
274284 systemd = cfg.package;
275275- inherit (cfg) imageFileBasename compression split seed sectorSize;
276276- inherit fileSystems definitionsDirectory partitions mkfsEnv;
285285+ inherit (cfg) name version imageFileBasename compression split seed sectorSize;
286286+ inherit fileSystems definitionsDirectory partitionsJSON mkfsEnv;
277287 };
278288279279- meta.maintainers = with lib.maintainers; [ nikstur ];
289289+ meta.maintainers = with lib.maintainers; [ nikstur willibutz ];
280290281291 };
282292}
···2323 meta = with lib; {
2424 description = "A new look into listening and enjoying Apple Music in style and performance.";
2525 homepage = "https://github.com/ciderapp/Cider";
2626- license = licenses.agpl3;
2626+ license = licenses.agpl3Only;
2727 maintainers = [ maintainers.cigrainger ];
2828 platforms = [ "x86_64-linux" ];
2929 mainProgram = "cider";
···3838 description = "An easy to setup Open Source client/server backup system";
3939 longDescription = "An easy to setup Open Source client/server backup system, that through a combination of image and file backups accomplishes both data safety and a fast restoration time";
4040 homepage = "https://www.urbackup.org/index.html";
4141- license = licenses.agpl3;
4141+ license = licenses.agpl3Plus;
4242 platforms = platforms.linux;
4343 maintainers = [ maintainers.mgttlinger ];
4444 };
···9696 slices (layers), generates toolpaths to fill them and calculates the
9797 amount of material to be extruded.'';
9898 homepage = "https://slic3r.org/";
9999- license = licenses.agpl3;
9999+ license = licenses.agpl3Plus;
100100 platforms = platforms.linux;
101101 maintainers = with maintainers; [ bjornfor ];
102102 };
···196196 Just the build products, the libraries are passed via an env var in the wrapper, default.nix
197197 '';
198198 homepage = "https://www.kicad.org/";
199199- license = lib.licenses.agpl3;
199199+ license = lib.licenses.agpl3Plus;
200200 platforms = lib.platforms.all;
201201 };
202202}
···3737 meta = {
3838 description = "a federated blogging & chat platform that acts as a web front end for the XMPP protocol";
3939 homepage = "https://movim.eu";
4040- license = lib.licenses.agpl3;
4040+ license = lib.licenses.agpl3Plus;
4141 maintainers = with lib.maintainers; [ toastal ];
4242 };
4343})
···146146 --replace-quiet /bin/uname "${coreutils}/bin/uname" \
147147 --replace-quiet /bin/sh "${stdenv.shell}"
148148 )
149149+ # Official source release tarballs will have a version.lispexpr, but if you
150150+ # want to override { src = ... } it might not exist. It’s required for
151151+ # building, so create a mock version as a backup.
152152+ if [[ ! -a version.lisp-expr ]]; then
153153+ echo '"${version}.nixos"' > version.lisp-expr
154154+ fi
149155 '';
150156151157 preBuild = ''
···8996889968 meta = {
8996989969 description = "A T-SQL formatting utility in JS, transpiled from the C# library of the same name.";
8997089970 homepage = "https://github.com/TaoK/poor-mans-t-sql-formatter-npm-cli#readme";
8997189971- license = "AGPL-3.0";
8997189971+ license = "AGPL-3.0-only";
8997289972 };
8997389973 production = true;
8997489974 bypassCache = true;
···2222 meta = with lib; {
2323 homepage = "https://github.com/Unrud/RadicaleInfCloud/";
2424 description = "Integrate InfCloud into Radicale's web interface";
2525- license = with licenses; [ agpl3 gpl3 ];
2525+ license = with licenses; [ agpl3Plus gpl3 ];
2626 maintainers = with maintainers; [ erictapen ];
2727 };
2828}
+7-4
pkgs/development/python-modules/rpy2/default.nix
···22, lib
33, buildPythonPackage
44, fetchPypi
55+, fetchpatch
56, isPyPy
67, R
78, rWrapper
···3839 # R_LIBS_SITE is used by the nix r package to point to the installed R libraries.
3940 # This patch sets R_LIBS_SITE when rpy2 is imported.
4041 ./rpy2-3.x-r-libs-site.patch
4242+4343+ # https://github.com/rpy2/rpy2/pull/1094
4444+ (fetchpatch {
4545+ url = "https://github.com/rpy2/rpy2/commit/026d069a008163a62d12567bcb938410d0f9bf7a.diff";
4646+ hash = "sha256-x778upSY3zab5EiRyOcsbDpPj7vN/7XzefEs+wvkNg0=";
4747+ })
4148 ];
42494350 postPatch = ''
···8188 ];
82898390 doCheck = !stdenv.isDarwin;
8484-8585- # newlines in environment variables are a problem due to
8686- # https://github.com/rpy2/rpy2/issues/1066
8787- preCheck = "unset postPatch";
88918992 nativeCheckInputs = [
9093 pytestCheckHook
···4040 You must view the world as mario does, as a one dimensional line.
4141 '';
4242 homepage = "https://mar1d.com";
4343- license = licenses.agpl3;
4343+ license = licenses.agpl3Only;
4444 maintainers = with maintainers; [ taeer ];
4545 platforms = platforms.unix;
4646 };
···24242525 The name of the plugin in TT-RSS is 'ff_instagram'.
2626 '';
2727- license = licenses.agpl3;
2727+ license = licenses.agpl3Plus;
2828 homepage = "https://github.com/wltb/ff_instagram";
2929 maintainers = with maintainers; [ das_j ];
3030 platforms = platforms.all;
+1-1
pkgs/servers/web-apps/hedgedoc/default.nix
···108108109109 meta = {
110110 description = "Realtime collaborative markdown notes on all platforms";
111111- license = lib.licenses.agpl3;
111111+ license = lib.licenses.agpl3Only;
112112 homepage = "https://hedgedoc.org";
113113 mainProgram = "hedgedoc";
114114 maintainers = with lib.maintainers; [ SuperSandro2000 ];
+1-1
pkgs/servers/web-apps/jirafeau/default.nix
···25252626 meta = with lib; {
2727 description = "Website permitting upload of a file in a simple way and giving a unique link to it";
2828- license = licenses.agpl3;
2828+ license = licenses.agpl3Plus;
2929 homepage = "https://gitlab.com/mojo42/Jirafeau";
3030 platforms = platforms.all;
3131 maintainers = with maintainers; [ davidtwco ];
···298298 packages.ghc963
299299 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
300300 packages.ghc963
301301+ else if stdenv.hostPlatform.isDarwin then
302302+ # it seems like the GHC 9.6.* bindists are built with a different
303303+ # toolchain than we are using (which I'm guessing from the fact
304304+ # that 9.6.4 bindists pass linker flags our ld doesn't support).
305305+ # With both 9.6.3 and 9.6.4 binary it is impossible to link against
306306+ # the clock package (probably a hsc2hs problem).
307307+ packages.ghc963
301308 else
302309 packages.ghc963Binary;
303310 inherit (buildPackages.python3Packages) sphinx;
···316323 packages.ghc963
317324 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
318325 packages.ghc963
326326+ else if stdenv.hostPlatform.isDarwin then
327327+ # it seems like the GHC 9.6.* bindists are built with a different
328328+ # toolchain than we are using (which I'm guessing from the fact
329329+ # that 9.6.4 bindists pass linker flags our ld doesn't support).
330330+ # With both 9.6.3 and 9.6.4 binary it is impossible to link against
331331+ # the clock package (probably a hsc2hs problem).
332332+ packages.ghc963
319333 else
320334 packages.ghc963Binary;
321335 inherit (buildPackages.python3Packages) sphinx;
···334348 if stdenv.hostPlatform.isAarch32 then
335349 packages.ghc963
336350 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
351351+ packages.ghc963
352352+ else if stdenv.hostPlatform.isDarwin then
353353+ # it seems like the GHC 9.6.* bindists are built with a different
354354+ # toolchain than we are using (which I'm guessing from the fact
355355+ # that 9.6.4 bindists pass linker flags our ld doesn't support).
356356+ # With both 9.6.3 and 9.6.4 binary it is impossible to link against
357357+ # the clock package (probably a hsc2hs problem).
337358 packages.ghc963
338359 else
339360 packages.ghc963Binary;