···11{ lib }:
2233rec {
44- /* Automatically convert an attribute set to command-line options.
44+ /**
55+ Automatically convert an attribute set to command-line options.
66+77+ This helps protect against malformed command lines and also to reduce
88+ boilerplate related to command-line construction for simple use cases.
99+1010+ `toGNUCommandLine` returns a list of nix strings.
51166- This helps protect against malformed command lines and also to reduce
77- boilerplate related to command-line construction for simple use cases.
1212+ `toGNUCommandLineShell` returns an escaped shell string.
1313+1414+1515+ # Inputs
1616+1717+ `options`
1818+1919+ : 1\. Function argument
2020+2121+ `attrs`
2222+2323+ : 2\. Function argument
82499- `toGNUCommandLine` returns a list of nix strings.
1010- `toGNUCommandLineShell` returns an escaped shell string.
2525+2626+ # Examples
2727+ :::{.example}
2828+ ## `lib.cli.toGNUCommandLineShell` usage example
2929+3030+ ```nix
3131+ cli.toGNUCommandLine {} {
3232+ data = builtins.toJSON { id = 0; };
3333+ X = "PUT";
3434+ retry = 3;
3535+ retry-delay = null;
3636+ url = [ "https://example.com/foo" "https://example.com/bar" ];
3737+ silent = false;
3838+ verbose = true;
3939+ }
4040+ => [
4141+ "-X" "PUT"
4242+ "--data" "{\"id\":0}"
4343+ "--retry" "3"
4444+ "--url" "https://example.com/foo"
4545+ "--url" "https://example.com/bar"
4646+ "--verbose"
4747+ ]
11481212- Example:
1313- cli.toGNUCommandLine {} {
1414- data = builtins.toJSON { id = 0; };
1515- X = "PUT";
1616- retry = 3;
1717- retry-delay = null;
1818- url = [ "https://example.com/foo" "https://example.com/bar" ];
1919- silent = false;
2020- verbose = true;
2121- }
2222- => [
2323- "-X" "PUT"
2424- "--data" "{\"id\":0}"
2525- "--retry" "3"
2626- "--url" "https://example.com/foo"
2727- "--url" "https://example.com/bar"
2828- "--verbose"
2929- ]
4949+ cli.toGNUCommandLineShell {} {
5050+ data = builtins.toJSON { id = 0; };
5151+ X = "PUT";
5252+ retry = 3;
5353+ retry-delay = null;
5454+ url = [ "https://example.com/foo" "https://example.com/bar" ];
5555+ silent = false;
5656+ verbose = true;
5757+ }
5858+ => "'-X' 'PUT' '--data' '{\"id\":0}' '--retry' '3' '--url' 'https://example.com/foo' '--url' 'https://example.com/bar' '--verbose'";
5959+ ```
30603131- cli.toGNUCommandLineShell {} {
3232- data = builtins.toJSON { id = 0; };
3333- X = "PUT";
3434- retry = 3;
3535- retry-delay = null;
3636- url = [ "https://example.com/foo" "https://example.com/bar" ];
3737- silent = false;
3838- verbose = true;
3939- }
4040- => "'-X' 'PUT' '--data' '{\"id\":0}' '--retry' '3' '--url' 'https://example.com/foo' '--url' 'https://example.com/bar' '--verbose'";
6161+ :::
4162 */
4263 toGNUCommandLineShell =
4364 options: attrs: lib.escapeShellArgs (toGNUCommandLine options attrs);
+221-80
lib/customisation.nix
···1515rec {
161617171818- /* `overrideDerivation drv f` takes a derivation (i.e., the result
1919- of a call to the builtin function `derivation`) and returns a new
2020- derivation in which the attributes of the original are overridden
2121- according to the function `f`. The function `f` is called with
2222- the original derivation attributes.
1818+ /**
1919+ `overrideDerivation drv f` takes a derivation (i.e., the result
2020+ of a call to the builtin function `derivation`) and returns a new
2121+ derivation in which the attributes of the original are overridden
2222+ according to the function `f`. The function `f` is called with
2323+ the original derivation attributes.
23242424- `overrideDerivation` allows certain "ad-hoc" customisation
2525- scenarios (e.g. in ~/.config/nixpkgs/config.nix). For instance,
2626- if you want to "patch" the derivation returned by a package
2727- function in Nixpkgs to build another version than what the
2828- function itself provides.
2525+ `overrideDerivation` allows certain "ad-hoc" customisation
2626+ scenarios (e.g. in ~/.config/nixpkgs/config.nix). For instance,
2727+ if you want to "patch" the derivation returned by a package
2828+ function in Nixpkgs to build another version than what the
2929+ function itself provides.
29303030- For another application, see build-support/vm, where this
3131- function is used to build arbitrary derivations inside a QEMU
3232- virtual machine.
3131+ For another application, see build-support/vm, where this
3232+ function is used to build arbitrary derivations inside a QEMU
3333+ virtual machine.
33343434- Note that in order to preserve evaluation errors, the new derivation's
3535- outPath depends on the old one's, which means that this function cannot
3636- be used in circular situations when the old derivation also depends on the
3737- new one.
3535+ Note that in order to preserve evaluation errors, the new derivation's
3636+ outPath depends on the old one's, which means that this function cannot
3737+ be used in circular situations when the old derivation also depends on the
3838+ new one.
38393939- You should in general prefer `drv.overrideAttrs` over this function;
4040- see the nixpkgs manual for more information on overriding.
4040+ You should in general prefer `drv.overrideAttrs` over this function;
4141+ see the nixpkgs manual for more information on overriding.
4242+4343+4444+ # Inputs
4545+4646+ `drv`
4747+4848+ : 1\. Function argument
4949+5050+ `f`
41514242- Example:
4343- mySed = overrideDerivation pkgs.gnused (oldAttrs: {
4444- name = "sed-4.2.2-pre";
4545- src = fetchurl {
4646- url = ftp://alpha.gnu.org/gnu/sed/sed-4.2.2-pre.tar.bz2;
4747- hash = "sha256-MxBJRcM2rYzQYwJ5XKxhXTQByvSg5jZc5cSHEZoB2IY=";
4848- };
4949- patches = [];
5050- });
5252+ : 2\. Function argument
5353+5454+ # Type
5555+5656+ ```
5757+ overrideDerivation :: Derivation -> ( Derivation -> AttrSet ) -> Derivation
5858+ ```
5959+6060+ # Examples
6161+ :::{.example}
6262+ ## `lib.customisation.overrideDerivation` usage example
6363+6464+ ```nix
6565+ mySed = overrideDerivation pkgs.gnused (oldAttrs: {
6666+ name = "sed-4.2.2-pre";
6767+ src = fetchurl {
6868+ url = ftp://alpha.gnu.org/gnu/sed/sed-4.2.2-pre.tar.bz2;
6969+ hash = "sha256-MxBJRcM2rYzQYwJ5XKxhXTQByvSg5jZc5cSHEZoB2IY=";
7070+ };
7171+ patches = [];
7272+ });
7373+ ```
51745252- Type:
5353- overrideDerivation :: Derivation -> ( Derivation -> AttrSet ) -> Derivation
7575+ :::
5476 */
5577 overrideDerivation = drv: f:
5678 let
···6789 });
689069917070- /* `makeOverridable` takes a function from attribute set to attribute set and
7171- injects `override` attribute which can be used to override arguments of
7272- the function.
9292+ /**
9393+ `makeOverridable` takes a function from attribute set to attribute set and
9494+ injects `override` attribute which can be used to override arguments of
9595+ the function.
73967474- Please refer to documentation on [`<pkg>.overrideDerivation`](#sec-pkg-overrideDerivation) to learn about `overrideDerivation` and caveats
7575- related to its use.
9797+ Please refer to documentation on [`<pkg>.overrideDerivation`](#sec-pkg-overrideDerivation) to learn about `overrideDerivation` and caveats
9898+ related to its use.
76997777- Example:
7878- nix-repl> x = {a, b}: { result = a + b; }
100100+101101+ # Inputs
102102+103103+ `f`
104104+105105+ : 1\. Function argument
106106+107107+ # Type
108108+109109+ ```
110110+ makeOverridable :: (AttrSet -> a) -> AttrSet -> a
111111+ ```
112112+113113+ # Examples
114114+ :::{.example}
115115+ ## `lib.customisation.makeOverridable` usage example
116116+117117+ ```nix
118118+ nix-repl> x = {a, b}: { result = a + b; }
791198080- nix-repl> y = lib.makeOverridable x { a = 1; b = 2; }
120120+ nix-repl> y = lib.makeOverridable x { a = 1; b = 2; }
811218282- nix-repl> y
8383- { override = «lambda»; overrideDerivation = «lambda»; result = 3; }
122122+ nix-repl> y
123123+ { override = «lambda»; overrideDerivation = «lambda»; result = 3; }
841248585- nix-repl> y.override { a = 10; }
8686- { override = «lambda»; overrideDerivation = «lambda»; result = 12; }
125125+ nix-repl> y.override { a = 10; }
126126+ { override = «lambda»; overrideDerivation = «lambda»; result = 12; }
127127+ ```
871288888- Type:
8989- makeOverridable :: (AttrSet -> a) -> AttrSet -> a
129129+ :::
90130 */
91131 makeOverridable = f:
92132 let
···120160 else result);
121161122162123123- /* Call the package function in the file `fn` with the required
163163+ /**
164164+ Call the package function in the file `fn` with the required
124165 arguments automatically. The function is called with the
125166 arguments `args`, but any missing arguments are obtained from
126167 `autoArgs`. This function is intended to be partially
···147188148189 <!-- TODO: Apply "Example:" tag to the examples above -->
149190150150- Type:
151151- callPackageWith :: AttrSet -> ((AttrSet -> a) | Path) -> AttrSet -> a
191191+192192+ # Inputs
193193+194194+ `autoArgs`
195195+196196+ : 1\. Function argument
197197+198198+ `fn`
199199+200200+ : 2\. Function argument
201201+202202+ `args`
203203+204204+ : 3\. Function argument
205205+206206+ # Type
207207+208208+ ```
209209+ callPackageWith :: AttrSet -> ((AttrSet -> a) | Path) -> AttrSet -> a
210210+ ```
152211 */
153212 callPackageWith = autoArgs: fn: args:
154213 let
···210269 else abort "lib.customisation.callPackageWith: ${error}";
211270212271213213- /* Like callPackage, but for a function that returns an attribute
214214- set of derivations. The override function is added to the
215215- individual attributes.
272272+ /**
273273+ Like callPackage, but for a function that returns an attribute
274274+ set of derivations. The override function is added to the
275275+ individual attributes.
216276217217- Type:
218218- callPackagesWith :: AttrSet -> ((AttrSet -> AttrSet) | Path) -> AttrSet -> AttrSet
277277+278278+ # Inputs
279279+280280+ `autoArgs`
281281+282282+ : 1\. Function argument
283283+284284+ `fn`
285285+286286+ : 2\. Function argument
287287+288288+ `args`
289289+290290+ : 3\. Function argument
291291+292292+ # Type
293293+294294+ ```
295295+ callPackagesWith :: AttrSet -> ((AttrSet -> AttrSet) | Path) -> AttrSet -> AttrSet
296296+ ```
219297 */
220298 callPackagesWith = autoArgs: fn: args:
221299 let
···233311 else mapAttrs mkAttrOverridable pkgs;
234312235313236236- /* Add attributes to each output of a derivation without changing
237237- the derivation itself and check a given condition when evaluating.
314314+ /**
315315+ Add attributes to each output of a derivation without changing
316316+ the derivation itself and check a given condition when evaluating.
317317+318318+319319+ # Inputs
320320+321321+ `condition`
238322239239- Type:
240240- extendDerivation :: Bool -> Any -> Derivation -> Derivation
323323+ : 1\. Function argument
324324+325325+ `passthru`
326326+327327+ : 2\. Function argument
328328+329329+ `drv`
330330+331331+ : 3\. Function argument
332332+333333+ # Type
334334+335335+ ```
336336+ extendDerivation :: Bool -> Any -> Derivation -> Derivation
337337+ ```
241338 */
242339 extendDerivation = condition: passthru: drv:
243340 let
···269366 outPath = assert condition; drv.outPath;
270367 };
271368272272- /* Strip a derivation of all non-essential attributes, returning
273273- only those needed by hydra-eval-jobs. Also strictly evaluate the
274274- result to ensure that there are no thunks kept alive to prevent
275275- garbage collection.
369369+ /**
370370+ Strip a derivation of all non-essential attributes, returning
371371+ only those needed by hydra-eval-jobs. Also strictly evaluate the
372372+ result to ensure that there are no thunks kept alive to prevent
373373+ garbage collection.
374374+375375+376376+ # Inputs
377377+378378+ `drv`
276379277277- Type:
278278- hydraJob :: (Derivation | Null) -> (Derivation | Null)
380380+ : 1\. Function argument
381381+382382+ # Type
383383+384384+ ```
385385+ hydraJob :: (Derivation | Null) -> (Derivation | Null)
386386+ ```
279387 */
280388 hydraJob = drv:
281389 let
···443551 };
444552 in self;
445553446446- /* backward compatibility with old uncurried form; deprecated */
554554+ /**
555555+ backward compatibility with old uncurried form; deprecated
556556+557557+558558+ # Inputs
559559+560560+ `splicePackages`
561561+562562+ : 1\. Function argument
563563+564564+ `newScope`
565565+566566+ : 2\. Function argument
567567+568568+ `otherSplices`
569569+570570+ : 3\. Function argument
571571+572572+ `keep`
573573+574574+ : 4\. Function argument
575575+576576+ `extra`
577577+578578+ : 5\. Function argument
579579+580580+ `f`
581581+582582+ : 6\. Function argument
583583+ */
447584 makeScopeWithSplicing =
448585 splicePackages: newScope: otherSplices: keep: extra: f:
449586 makeScopeWithSplicing'
450587 { inherit splicePackages newScope; }
451588 { inherit otherSplices keep extra f; };
452589453453- /* Like makeScope, but aims to support cross compilation. It's still ugly, but
454454- hopefully it helps a little bit.
590590+ /**
591591+ Like makeScope, but aims to support cross compilation. It's still ugly, but
592592+ hopefully it helps a little bit.
593593+594594+ # Type
455595456456- Type:
457457- makeScopeWithSplicing' ::
458458- { splicePackages :: Splice -> AttrSet
459459- , newScope :: AttrSet -> ((AttrSet -> a) | Path) -> AttrSet -> a
460460- }
461461- -> { otherSplices :: Splice, keep :: AttrSet -> AttrSet, extra :: AttrSet -> AttrSet }
462462- -> AttrSet
596596+ ```
597597+ makeScopeWithSplicing' ::
598598+ { splicePackages :: Splice -> AttrSet
599599+ , newScope :: AttrSet -> ((AttrSet -> a) | Path) -> AttrSet -> a
600600+ }
601601+ -> { otherSplices :: Splice, keep :: AttrSet -> AttrSet, extra :: AttrSet -> AttrSet }
602602+ -> AttrSet
463603464464- Splice ::
465465- { pkgsBuildBuild :: AttrSet
466466- , pkgsBuildHost :: AttrSet
467467- , pkgsBuildTarget :: AttrSet
468468- , pkgsHostHost :: AttrSet
469469- , pkgsHostTarget :: AttrSet
470470- , pkgsTargetTarget :: AttrSet
471471- }
604604+ Splice ::
605605+ { pkgsBuildBuild :: AttrSet
606606+ , pkgsBuildHost :: AttrSet
607607+ , pkgsBuildTarget :: AttrSet
608608+ , pkgsHostHost :: AttrSet
609609+ , pkgsHostTarget :: AttrSet
610610+ , pkgsTargetTarget :: AttrSet
611611+ }
612612+ ```
472613 */
473614 makeScopeWithSplicing' =
474615 { splicePackages
···68686969- [Guix](https://guix.gnu.org), a functional package manager inspired by Nix. Available as [services.guix](#opt-services.guix.enable).
70707171+- [PhotonVision](https://photonvision.org/), a free, fast, and easy-to-use computer vision solution for the FIRST® Robotics Competition.
7272+7173- [pyLoad](https://pyload.net/), a FOSS download manager written in Python. Available as [services.pyload](#opt-services.pyload.enable)
72747375- [maubot](https://github.com/maubot/maubot), a plugin-based Matrix bot framework. Available as [services.maubot](#opt-services.maubot.enable).
···7779- [GNS3](https://www.gns3.com/), a network software emulator. Available as [services.gns3-server](#opt-services.gns3-server.enable).
78807981- [pretalx](https://github.com/pretalx/pretalx), a conference planning tool. Available as [services.pretalx](#opt-services.pretalx.enable).
8282+8383+- [dnsproxy](https://github.com/AdguardTeam/dnsproxy), a simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support. Available as [services.dnsproxy](#opt-services.dnsproxy.enable).
80848185- [rspamd-trainer](https://gitlab.com/onlime/rspamd-trainer), script triggered by a helper which reads mails from a specific mail inbox and feeds them into rspamd for spam/ham training.
8286
···5858 # Hyper-V support.
5959 "hv_storvsc"
6060 ] ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch [
6161- # Most of the following falls into two categories:
6262- # - early KMS / early display
6363- # - early storage (e.g. USB) support
6464-6565- # Allows using framebuffer configured by the initial boot firmware
6666- "simplefb"
6767-6861 # Allwinner support
6969-7062 # Required for early KMS
7163 "sun4i-drm"
7264 "sun8i-mixer" # Audio, but required for kms
···7567 "pwm-sun4i"
76687769 # Broadcom
7878-7970 "vc4"
8071 ] ++ lib.optionals pkgs.stdenv.isAarch64 [
8172 # Most of the following falls into two categories:
···11-sane-desc does not include unsupported .desc entries like EPSON V300 PHOTO,
22-which can be supported by the (unfree) epkowa driver.
33-But we need those entries so that unprivileged users which have installed epkowa
44-can use the scanner.
55-diff --git a/tools/sane-desc.c b/tools/sane-desc.c
66-index 7a8645dea..9c9719fef 100644
77---- a/tools/sane-desc.c
88-+++ b/tools/sane-desc.c
99-@@ -3243,10 +3243,6 @@ create_usbids_table (void)
1010-1111- for (model = mfg->model; model; model = model->next)
1212- {
1313-- if ((model->status == status_unsupported)
1414-- || (model->status == status_unknown))
1515-- continue;
1616--
1717- if (model->usb_vendor_id && model->usb_product_id)
1818- {
1919- first_usbid = add_usbid (first_usbid, mfg->name,
···1515# Updates
161617171. Update the URL in `./fetch.sh`.
1818-2. Run `callPackage ./maintainers/scripts/fetch-kde-qt.sh pkgs/applications/maui`
1818+2. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/applications/maui`
1919 from the top of the Nixpkgs tree.
20203. Use `nixpkgs-review wip` to check that everything builds.
21214. Commit the changes and open a pull request.
···1515 buildHashes = builtins.fromJSON (builtins.readFile ./hashes.json);
16161717 # the version of infisical
1818- version = "0.19.0";
1818+ version = "0.19.1";
19192020 # the platform-specific, statically linked binary
2121 src =
···7878 extraNativeBuildInputs ? [],
7979 extraPropagatedBuildInputs ? [],
8080 extraCmakeFlags ? [],
8181+ excludeDependencies ? [],
8182 ...
8283 } @ args: let
8484+ depNames = dependencies.${pname} or [];
8585+ filteredDepNames = builtins.filter (dep: !(builtins.elem dep excludeDependencies)) depNames;
8686+8387 # FIXME(later): this is wrong for cross, some of these things really need to go into nativeBuildInputs,
8488 # but cross is currently very broken anyway, so we can figure this out later.
8585- deps = map (dep: self.${dep}) (dependencies.${pname} or []);
8989+ deps = map (dep: self.${dep}) filteredDepNames;
86908791 defaultArgs = {
8892 inherit version src;
···109113 "extraNativeBuildInputs"
110114 "extraPropagatedBuildInputs"
111115 "extraCmakeFlags"
116116+ "excludeDependencies"
112117 "meta"
113118 ];
114119
+4
pkgs/kde/plasma/discover/default.nix
···11111212 extraNativeBuildInputs = [pkg-config];
1313 extraBuildInputs = [qtwebview discount flatpak fwupd];
1414+1515+ # The PackageKit backend doesn't work for us and causes Discover
1616+ # to freak out when loading. Disable it to not confuse users.
1717+ excludeDependencies = ["packagekit-qt"];
1418}