Merge master into haskell-updates

This commit is contained in:
github-actions[bot] 2022-12-09 00:14:02 +00:00 committed by GitHub
commit 4368f0cb9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
276 changed files with 1862 additions and 1069 deletions

View File

@ -1,3 +1,14 @@
ajs124 <git@ajs124.de> <ajs124@users.noreply.github.com>
Anderson Torres <torres.anderson.85@protonmail.com>
Daniel Løvbrøtte Olsen <me@dandellion.xyz> <daniel.olsen99@gmail.com>
Fabian Affolter <mail@fabian-affolter.ch> <fabian@affolter-engineering.ch>
Janne Heß <janne@hess.ooo> <dasJ@users.noreply.github.com>
Jörg Thalheim <joerg@thalheim.io> <Mic92@users.noreply.github.com>
Martin Weinelt <hexa@darmstadt.ccc.de> <mweinelt@users.noreply.github.com>
R. RyanTM <ryantm-bot@ryantm.com>
Sandro <sandro.jaeckel@gmail.com>
Robert Hensing <robert@roberthensing.nl> <roberth@users.noreply.github.com>
Sandro Jäckel <sandro.jaeckel@gmail.com>
Sandro Jäckel <sandro.jaeckel@gmail.com> <sandro.jaeckel@sap.com>
superherointj <5861043+superherointj@users.noreply.github.com>
Vladimír Čunát <v@cunat.cz> <vcunat@gmail.com>
Vladimír Čunát <v@cunat.cz> <vladimir.cunat@nic.cz>

View File

@ -62,6 +62,8 @@ The above example will build a Docker image `redis/latest` from the given base i
- `config` is used to specify the configuration of the containers that will be started off the built image in Docker. The available options are listed in the [Docker Image Specification v1.2.0](https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions).
- `architecture` is _optional_ and used to specify the image architecture, this is useful for multi-architecture builds that don't need cross compiling. If not specified it will default to `hostPlatform`.
- `diskSize` is used to specify the disk size of the VM used to build the image in megabytes. By default it's 1024 MiB.
- `buildVMMemorySize` is used to specify the memory size of the VM to build the image in megabytes. By default it's 512 MiB.
@ -141,6 +143,8 @@ Create a Docker image with many of the store paths being on their own layer to i
`config` _optional_
`architecture` is _optional_ and used to specify the image architecture, this is useful for multi-architecture builds that don't need cross compiling. If not specified it will default to `hostPlatform`.
: Run-time configuration of the container. A full list of the options are available at in the [Docker Image Specification v1.2.0](https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions).
*Default:* `{}`

View File

@ -0,0 +1,93 @@
# Cue (Cuelang) {#cuelang}
[Cuelang](https://cuelang.org/) is a language to:
- describe schemas and validate backward-compatibility
- generate code and schemas in various formats (e.g. JSON Schema, OpenAPI)
- do configuration akin to [Dhall Lang](https://dhall-lang.org/)
- perform data validation
## Cuelang schema quick start
Cuelang schemas are similar to JSON, here is a quick cheatsheet:
- Default types includes: `null`, `string`, `bool`, `bytes`, `number`, `int`, `float`, lists as `[...T]` where `T` is a type.
- All structures, defined by: `myStructName: { <fields> }` are **open** -- they accept fields which are not specified.
- Closed structures can be built by doing `myStructName: close({ <fields> })` -- they are strict in what they accept.
- `#X` are **definitions**, referenced definitions are **recursively closed**, i.e. all its children structures are **closed**.
- `&` operator is the [unification operator](https://cuelang.org/docs/references/spec/#unification) (similar to a type-level merging operator), `|` is the [disjunction operator](https://cuelang.org/docs/references/spec/#disjunction) (similar to a type-level union operator).
- Values **are** types, i.e. `myStruct: { a: 3 }` is a valid type definition that only allows `3` as value.
- Read <https://cuelang.org/docs/concepts/logic/> to learn more about the semantics.
- Read <https://cuelang.org/docs/references/spec/> to learn about the language specification.
## `writeCueValidator`
Nixpkgs provides a `pkgs.writeCueValidator` helper, which will write a validation script based on the provided Cuelang schema.
Here is an example:
```
pkgs.writeCueValidator
(pkgs.writeText "schema.cue" ''
#Def1: {
field1: string
}
'')
{ document = "#Def1"; }
```
- The first parameter is the Cue schema file.
- The second paramter is an options parameter, currently, only: `document` can be passed.
`document` : match your input data against this fragment of structure or definition, e.g. you may use the same schema file but differents documents based on the data you are validating.
Another example, given the following `validator.nix` :
```
{ pkgs ? import <nixpkgs> {} }:
let
genericValidator = version:
pkgs.writeCueValidator
(pkgs.writeText "schema.cue" ''
#Version1: {
field1: string
}
#Version2: #Version1 & {
field1: "unused"
}''
)
{ document = "#Version${toString version}"; };
in
{
validateV1 = genericValidator 1;
validateV2 = genericValidator 2;
}
```
The result is a script that will validate the file you pass as the first argument against the schema you provided `writeCueValidator`.
It can be any format that `cue vet` supports, i.e. YAML or JSON for example.
Here is an example, named `example.json`, given the following JSON:
```
{ "field1": "abc" }
```
You can run the result script (named `validate`) as the following:
```console
$ nix-build validator.nix
$ ./result example.json
$ ./result-2 example.json
field1: conflicting values "unused" and "abc":
./example.json:1:13
../../../../../../nix/store/v64dzx3vr3glpk0cq4hzmh450lrwh6sg-schema.cue:5:11
$ sed -i 's/"abc"/3/' example.json
$ ./result example.json
field1: conflicting values 3 and string (mismatched types int and string):
./example.json:1:13
../../../../../../nix/store/v64dzx3vr3glpk0cq4hzmh450lrwh6sg-schema.cue:5:11
```
**Known limitations**
* The script will enforce **concrete** values and will not accept lossy transformations (strictness). You can add these options if you need them.

View File

@ -13,6 +13,7 @@
<xi:include href="coq.section.xml" />
<xi:include href="crystal.section.xml" />
<xi:include href="cuda.section.xml" />
<xi:include href="cuelang.section.xml" />
<xi:include href="dhall.section.xml" />
<xi:include href="dotnet.section.xml" />
<xi:include href="emscripten.section.xml" />

View File

@ -278,8 +278,11 @@ rec {
mapAny 0;
/* Pretty print a value, akin to `builtins.trace`.
* Should probably be a builtin as well.
*/
* Should probably be a builtin as well.
* The pretty-printed string should be suitable for rendering default values
* in the NixOS manual. In particular, it should be as close to a valid Nix expression
* as possible.
*/
toPretty = {
/* If this option is true, attrsets like { __pretty = fn; val = ; }
will use fn to convert val to a pretty printed representation.
@ -294,20 +297,25 @@ rec {
introSpace = if multiline then "\n${indent} " else " ";
outroSpace = if multiline then "\n${indent}" else " ";
in if isInt v then toString v
else if isFloat v then "~${toString v}"
# toString loses precision on floats, so we use toJSON instead. This isn't perfect
# as the resulting string may not parse back as a float (e.g. 42, 1e-06), but for
# pretty-printing purposes this is acceptable.
else if isFloat v then builtins.toJSON v
else if isString v then
let
# Separate a string into its lines
newlineSplits = filter (v: ! isList v) (builtins.split "\n" v);
# For a '' string terminated by a \n, which happens when the closing '' is on a new line
multilineResult = "''" + introSpace + concatStringsSep introSpace (lib.init newlineSplits) + outroSpace + "''";
# For a '' string not terminated by a \n, which happens when the closing '' is not on a new line
multilineResult' = "''" + introSpace + concatStringsSep introSpace newlineSplits + "''";
# For single lines, replace all newlines with their escaped representation
singlelineResult = "\"" + libStr.escape [ "\"" ] (concatStringsSep "\\n" newlineSplits) + "\"";
in if multiline && length newlineSplits > 1 then
if lib.last newlineSplits == "" then multilineResult else multilineResult'
else singlelineResult
lines = filter (v: ! isList v) (builtins.split "\n" v);
escapeSingleline = libStr.escape [ "\\" "\"" "\${" ];
escapeMultiline = libStr.replaceStrings [ "\${" "''" ] [ "''\${" "'''" ];
singlelineResult = "\"" + concatStringsSep "\\n" (map escapeSingleline lines) + "\"";
multilineResult = let
escapedLines = map escapeMultiline lines;
# The last line gets a special treatment: if it's empty, '' is on its own line at the "outer"
# indentation level. Otherwise, '' is appended to the last line.
lastLine = lib.last escapedLines;
in "''" + introSpace + concatStringsSep introSpace (lib.init escapedLines)
+ (if lastLine == "" then outroSpace else introSpace + lastLine) + "''";
in
if multiline && length lines > 1 then multilineResult else singlelineResult
else if true == v then "true"
else if false == v then "false"
else if null == v then "null"
@ -326,11 +334,11 @@ rec {
else "<function, args: {${showFnas}}>"
else if isAttrs v then
# apply pretty values if allowed
if attrNames v == [ "__pretty" "val" ] && allowPrettyValues
if allowPrettyValues && v ? __pretty && v ? val
then v.__pretty v.val
else if v == {} then "{ }"
else if v ? type && v.type == "derivation" then
"<derivation ${v.drvPath or "???"}>"
"<derivation ${v.name or "???"}>"
else "{" + introSpace
+ libStr.concatStringsSep introSpace (libAttr.mapAttrsToList
(name: value:

View File

@ -218,7 +218,7 @@ rec {
# the set generated with filterOptionSets.
optionAttrSetToDocList = optionAttrSetToDocList' [];
optionAttrSetToDocList' = prefix: options:
optionAttrSetToDocList' = _: options:
concatMap (opt:
let
docOption = rec {
@ -234,9 +234,8 @@ rec {
readOnly = opt.readOnly or false;
type = opt.type.description or "unspecified";
}
// optionalAttrs (opt ? example) { example = scrubOptionValue opt.example; }
// optionalAttrs (opt ? default) { default = scrubOptionValue opt.default; }
// optionalAttrs (opt ? defaultText) { default = opt.defaultText; }
// optionalAttrs (opt ? example) { example = renderOptionValue opt.example; }
// optionalAttrs (opt ? default) { default = renderOptionValue (opt.defaultText or opt.default); }
// optionalAttrs (opt ? relatedPackages && opt.relatedPackages != null) { inherit (opt) relatedPackages; };
subOptions =
@ -256,6 +255,9 @@ rec {
efficient: the XML representation of derivations is very large
(on the order of megabytes) and is not actually used by the
manual generator.
This function was made obsolete by renderOptionValue and is kept for
compatibility with out-of-tree code.
*/
scrubOptionValue = x:
if isDerivation x then
@ -265,6 +267,17 @@ rec {
else x;
/* Ensures that the given option value (default or example) is a `_type`d string
by rendering Nix values to `literalExpression`s.
*/
renderOptionValue = v:
if v ? _type && v ? text then v
else literalExpression (lib.generators.toPretty {
multiline = true;
allowPrettyValues = true;
} v);
/* For use in the `defaultText` and `example` option attributes. Causes the
given string to be rendered verbatim in the documentation as Nix code. This
is necessary for complex values, e.g. functions, or values that depend on

View File

@ -510,7 +510,7 @@ rec {
toUpper = replaceChars lowerChars upperChars;
/* Appends string context from another string. This is an implementation
detail of Nix.
detail of Nix and should be used carefully.
Strings in Nix carry an invisible `context` which is a list of strings
representing store paths. If the string is later used in a derivation
@ -533,13 +533,11 @@ rec {
splitString "/" "/usr/local/bin"
=> [ "" "usr" "local" "bin" ]
*/
splitString = _sep: _s:
splitString = sep: s:
let
sep = builtins.unsafeDiscardStringContext _sep;
s = builtins.unsafeDiscardStringContext _s;
splits = builtins.filter builtins.isString (builtins.split (escapeRegex sep) s);
splits = builtins.filter builtins.isString (builtins.split (escapeRegex (toString sep)) (toString s));
in
map (v: addContextFrom _sep (addContextFrom _s v)) splits;
map (addContextFrom s) splits;
/* Return a string without the specified prefix, if the prefix matches.

View File

@ -727,7 +727,7 @@ runTests {
float = 0.1337;
bool = true;
emptystring = "";
string = ''fno"rd'';
string = "fn\${o}\"r\\d";
newlinestring = "\n";
path = /. + "/foo";
null_ = null;
@ -735,16 +735,16 @@ runTests {
functionArgs = { arg ? 4, foo }: arg;
list = [ 3 4 function [ false ] ];
emptylist = [];
attrs = { foo = null; "foo bar" = "baz"; };
attrs = { foo = null; "foo b/ar" = "baz"; };
emptyattrs = {};
drv = deriv;
};
expected = rec {
int = "42";
float = "~0.133700";
float = "0.1337";
bool = "true";
emptystring = ''""'';
string = ''"fno\"rd"'';
string = ''"fn\''${o}\"r\\d"'';
newlinestring = "\"\\n\"";
path = "/foo";
null_ = "null";
@ -752,9 +752,9 @@ runTests {
functionArgs = "<function, args: {arg?, foo}>";
list = "[ 3 4 ${function} [ false ] ]";
emptylist = "[ ]";
attrs = "{ foo = null; \"foo bar\" = \"baz\"; }";
attrs = "{ foo = null; \"foo b/ar\" = \"baz\"; }";
emptyattrs = "{ }";
drv = "<derivation ${deriv.drvPath}>";
drv = "<derivation ${deriv.name}>";
};
};
@ -799,8 +799,8 @@ runTests {
newlinestring = "\n";
multilinestring = ''
hello
there
test
''${there}
te'''st
'';
multilinestring' = ''
hello
@ -827,8 +827,8 @@ runTests {
multilinestring = ''
'''
hello
there
test
'''''${there}
te''''st
''''';
multilinestring' = ''
'''

View File

@ -175,6 +175,15 @@
sudo and sources the environment variables.
</para>
</listitem>
<listitem>
<para>
The <literal>dnsmasq</literal> service now takes configuration
via the <literal>services.dnsmasq.settings</literal> attribute
set. The option
<literal>services.dnsmasq.extraConfig</literal> will be
deprecated when NixOS 22.11 reaches end of life.
</para>
</listitem>
<listitem>
<para>
A new <literal>virtualisation.rosetta</literal> module was

View File

@ -53,6 +53,11 @@ In addition to numerous new and upgraded packages, this release has the followin
- `services.mastodon` gained a tootctl wrapped named `mastodon-tootctl` similar to `nextcloud-occ` which can be executed from any user and switches to the configured mastodon user with sudo and sources the environment variables.
- The `dnsmasq` service now takes configuration via the
`services.dnsmasq.settings` attribute set. The option
`services.dnsmasq.extraConfig` will be deprecated when NixOS 22.11 reaches
end of life.
- A new `virtualisation.rosetta` module was added to allow running `x86_64` binaries through [Rosetta](https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment) inside virtualised NixOS guests on Apple silicon. This feature works by default with the [UTM](https://docs.getutm.app/) virtualisation [package](https://search.nixos.org/packages?channel=unstable&show=utm&from=0&size=1&sort=relevance&type=packages&query=utm).
- Resilio sync secret keys can now be provided using a secrets file at runtime, preventing these secrets from ending up in the Nix store.

View File

@ -26,7 +26,7 @@
# If you include more than one option list into a document, you need to
# provide different ids.
, variablelistId ? "configuration-variable-list"
# Strig to prefix to the option XML/HTML id attributes.
# String to prefix to the option XML/HTML id attributes.
, optionIdPrefix ? "opt-"
, revision ? "" # Specify revision for the options
# a set of options the docs we are generating will be merged into, as if by recursiveUpdate.
@ -45,28 +45,11 @@
}:
let
# Make a value safe for JSON. Functions are replaced by the string "<function>",
# derivations are replaced with an attrset
# { _type = "derivation"; name = <name of that derivation>; }.
# We need to handle derivations specially because consumers want to know about them,
# but we can't easily use the type,name subset of keys (since type is often used as
# a module option and might cause confusion). Use _type,name instead to the same
# effect, since _type is already used by the module system.
substSpecial = x:
if lib.isDerivation x then { _type = "derivation"; name = x.name; }
else if builtins.isAttrs x then lib.mapAttrs (name: substSpecial) x
else if builtins.isList x then map substSpecial x
else if lib.isFunction x then "<function>"
else x;
rawOpts = lib.optionAttrSetToDocList options;
transformedOpts = map transformOptions rawOpts;
filteredOpts = lib.filter (opt: opt.visible && !opt.internal) transformedOpts;
optionsList = lib.flip map filteredOpts
(opt: opt
// lib.optionalAttrs (opt ? example) { example = substSpecial opt.example; }
// lib.optionalAttrs (opt ? default) { default = substSpecial opt.default; }
// lib.optionalAttrs (opt ? type) { type = substSpecial opt.type; }
// lib.optionalAttrs (opt ? relatedPackages && opt.relatedPackages != []) { relatedPackages = genRelatedPackages opt.relatedPackages opt.name; }
);

View File

@ -138,82 +138,6 @@
</xsl:template>
<xsl:template match="string[contains(@value, '&#010;')]" mode="top">
<programlisting>
<xsl:text>''&#010;</xsl:text>
<xsl:value-of select='str:replace(str:replace(@value, "&apos;&apos;", "&apos;&apos;&apos;"), "${", "&apos;&apos;${")' />
<xsl:text>''</xsl:text>
</programlisting>
</xsl:template>
<xsl:template match="*" mode="top">
<literal><xsl:apply-templates select="." /></literal>
</xsl:template>
<xsl:template match="null">
<xsl:text>null</xsl:text>
</xsl:template>
<xsl:template match="string">
<xsl:choose>
<xsl:when test="(contains(@value, '&quot;') or contains(@value, '\')) and not(contains(@value, '&#010;'))">
<xsl:text>''</xsl:text><xsl:value-of select='str:replace(str:replace(@value, "&apos;&apos;", "&apos;&apos;&apos;"), "${", "&apos;&apos;${")' /><xsl:text>''</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>"</xsl:text><xsl:value-of select="str:replace(str:replace(str:replace(str:replace(@value, '\', '\\'), '&quot;', '\&quot;'), '&#010;', '\n'), '${', '\${')" /><xsl:text>"</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="int">
<xsl:value-of select="@value" />
</xsl:template>
<xsl:template match="bool[@value = 'true']">
<xsl:text>true</xsl:text>
</xsl:template>
<xsl:template match="bool[@value = 'false']">
<xsl:text>false</xsl:text>
</xsl:template>
<xsl:template match="list">
[
<xsl:for-each select="*">
<xsl:apply-templates select="." />
<xsl:text> </xsl:text>
</xsl:for-each>
]
</xsl:template>
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'literalExpression']]]">
<xsl:value-of select="attr[@name = 'text']/string/@value" />
</xsl:template>
<xsl:template match="attrs">
{
<xsl:for-each select="attr">
<xsl:value-of select="@name" />
<xsl:text> = </xsl:text>
<xsl:apply-templates select="*" /><xsl:text>; </xsl:text>
</xsl:for-each>
}
</xsl:template>
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'derivation']]]">
<replaceable>(build of <xsl:value-of select="attr[@name = 'name']/string/@value" />)</replaceable>
</xsl:template>
<xsl:template match="attr[@name = 'declarations' or @name = 'definitions']">
<simplelist>
<!--
@ -275,10 +199,4 @@
</simplelist>
</xsl:template>
<xsl:template match="function">
<xsl:text>λ</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@ -82,8 +82,8 @@ in {
kerberos = mkOption {
type = types.package;
default = pkgs.krb5Full;
defaultText = literalExpression "pkgs.krb5Full";
default = pkgs.krb5;
defaultText = literalExpression "pkgs.krb5";
example = literalExpression "pkgs.heimdal";
description = lib.mdDoc ''
The Kerberos implementation that will be present in

View File

@ -1,7 +1,7 @@
{
x86_64-linux = "/nix/store/xdlpraypxdimjyfrr4k06narrv8nmfgh-nix-2.11.1";
i686-linux = "/nix/store/acghbpn3aaj2q64mz3ljipsgf9d9qxlp-nix-2.11.1";
aarch64-linux = "/nix/store/0lrf6danhdqjsrhala134ak8vn0b9ghj-nix-2.11.1";
x86_64-darwin = "/nix/store/60sx4c6xflgqk11gvijwzlsczbxgxgwh-nix-2.11.1";
aarch64-darwin = "/nix/store/dmk5m3nlqp1awaqrp1f06qhhkh3l102n-nix-2.11.1";
x86_64-linux = "/nix/store/h88w1442c7hzkbw8sgpcsbqp4lhz6l5p-nix-2.12.0";
i686-linux = "/nix/store/j23527l1c3hfx17nssc0v53sq6c741zs-nix-2.12.0";
aarch64-linux = "/nix/store/zgzmdymyh934y3r4vqh8z337ba4cwsjb-nix-2.12.0";
x86_64-darwin = "/nix/store/wnlrzllazdyg1nrw9na497p4w0m7i7mm-nix-2.12.0";
aarch64-darwin = "/nix/store/7n5yamgzg5dpp5vb6ipdqgfh6cf30wmn-nix-2.12.0";
}

View File

@ -48,10 +48,15 @@ let
};
scrubDerivations = namePrefix: pkgSet: mapAttrs
(name: value:
let wholeName = "${namePrefix}.${name}"; in
if isAttrs value then
let
wholeName = "${namePrefix}.${name}";
guard = lib.warn "Attempt to evaluate package ${wholeName} in option documentation; this is not supported and will eventually be an error. Use `mkPackageOption` or `literalExpression` instead.";
in if isAttrs value then
scrubDerivations wholeName value
// (optionalAttrs (isDerivation value) { outPath = "\${${wholeName}}"; })
// optionalAttrs (isDerivation value) {
outPath = guard "\${${wholeName}}";
drvPath = guard drvPath;
}
else value
)
pkgSet;

View File

@ -9,7 +9,7 @@ in {
config = mkIf cfg.enable {
programs.bash.interactiveShellInit = mkBefore ''
source ${pkgs.blesh}/share/ble.sh
source ${pkgs.blesh}/share/blesh/ble.sh
'';
};
meta.maintainers = with maintainers; [ laalsaas ];

View File

@ -20,7 +20,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.htop;
defaultText = "pkgs.htop";
defaultText = lib.literalExpression "pkgs.htop";
description = lib.mdDoc ''
The htop package that should be used.
'';

View File

@ -29,7 +29,7 @@ in
package = mkOption {
type = package;
default = pkgs.weylus;
defaultText = "pkgs.weylus";
defaultText = lib.literalExpression "pkgs.weylus";
description = lib.mdDoc "Weylus package to install.";
};
};

View File

@ -74,7 +74,7 @@ in {
listen = {
port = mkOption {
type = types.int;
type = types.port;
description = lib.mdDoc "TCP port that will be used to accept client connections.";
default = 8000;
};

View File

@ -38,11 +38,13 @@ in
default = {};
example = {
myStream1 = "/etc/liquidsoap/myStream1.liq";
myStream2 = literalExpression "./myStream2.liq";
myStream3 = "out(playlist(\"/srv/music/\"))";
};
example = literalExpression ''
{
myStream1 = "/etc/liquidsoap/myStream1.liq";
myStream2 = ./myStream2.liq;
myStream3 = "out(playlist(\"/srv/music/\"))";
}
'';
type = types.attrsOf (types.either types.path types.str);
};

View File

@ -142,7 +142,7 @@ in {
};
port = mkOption {
type = types.int;
type = types.port;
default = 6600;
description = lib.mdDoc ''
This setting is the TCP port that is desired for the daemon to get assigned

View File

@ -171,7 +171,7 @@ in
port = mkOption {
description = lib.mdDoc "Kubernetes kubelet healthz port.";
default = 10248;
type = int;
type = port;
};
};
@ -204,7 +204,7 @@ in
port = mkOption {
description = lib.mdDoc "Kubernetes kubelet info server listening port.";
default = 10250;
type = int;
type = port;
};
seedDockerImages = mkOption {

View File

@ -43,7 +43,7 @@ in
port = mkOption {
description = lib.mdDoc "Kubernetes scheduler listening port.";
default = 10251;
type = int;
type = port;
};
verbosity = mkOption {

View File

@ -206,7 +206,7 @@ in {
port = mkOption {
default = 8010;
type = types.int;
type = types.port;
description = lib.mdDoc "Specifies port number on which the buildbot HTTP interface listens.";
};

View File

@ -16,7 +16,7 @@ with lib;
package = mkOption {
type = types.package;
default = pkgs.clickhouse;
defaultText = "pkgs.clickhouse";
defaultText = lib.literalExpression "pkgs.clickhouse";
description = lib.mdDoc ''
ClickHouse package to use.
'';

View File

@ -160,10 +160,12 @@ in
List of database names and their initial schemas that should be used to create databases on the first startup
of MySQL. The schema attribute is optional: If not specified, an empty database is created.
'';
example = [
{ name = "foodatabase"; schema = literalExpression "./foodatabase.sql"; }
{ name = "bardatabase"; }
];
example = literalExpression ''
[
{ name = "foodatabase"; schema = ./foodatabase.sql; }
{ name = "bardatabase"; }
]
'';
};
initialScript = mkOption {

View File

@ -16,7 +16,7 @@ let
# systemd/systemd#19604
description = ''
LDAP value - either a string, or an attrset containing
<literal>path</literal> or <literal>base64</literal> for included
`path` or `base64` for included
values or base-64 encoded values respectively.
'';
check = x: lib.isString x || (lib.isAttrs x && (x ? path || x ? base64));

View File

@ -57,7 +57,7 @@ in {
};
port = mkOption {
type = types.int;
type = types.port;
default = 8888;
description = lib.mdDoc ''
Port number Jupyter will be listening on.

View File

@ -43,12 +43,14 @@ in
web-ui = mkOption {
type = types.submodule {
options = {
enable = mkEnableOption
(lib.mdDoc "Wheter to start the web-ui. This is the preferred way of configuring things such as the steam guard token");
enable = mkEnableOption "" // {
description = lib.mdDoc "Whether to start the web-ui. This is the preferred way of configuring things such as the steam guard token.";
};
package = mkOption {
type = types.package;
default = pkgs.ArchiSteamFarm.ui;
defaultText = lib.literalExpression "pkgs.ArchiSteamFarm.ui";
description =
lib.mdDoc "Web-UI package to use. Contents must be in lib/dist.";
};
@ -56,7 +58,6 @@ in
};
default = {
enable = true;
package = pkgs.ArchiSteamFarm.ui;
};
example = {
enable = false;
@ -67,6 +68,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.ArchiSteamFarm;
defaultText = lib.literalExpression "pkgs.ArchiSteamFarm";
description =
lib.mdDoc "Package to use. Should always be the latest version, for security reasons, since this module uses very new features and to not get out of sync with the Steam API.";
};

View File

@ -116,7 +116,7 @@ in
openFirewall = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Wheter to open ports in the firewall";
description = lib.mdDoc "Whether to open ports in the firewall";
};
dataDir = mkOption {

View File

@ -9,7 +9,7 @@ in
package = lib.mkOption {
type = lib.types.package;
default = pkgs.argononed;
defaultText = "pkgs.argononed";
defaultText = lib.literalExpression "pkgs.argononed";
description = lib.mdDoc ''
The package implementing the Argon One driver
'';

View File

@ -14,7 +14,7 @@ with lib;
package = mkOption {
type = types.package;
default = pkgs.joycond;
defaultText = "pkgs.joycond";
defaultText = lib.literalExpression "pkgs.joycond";
description = lib.mdDoc ''
The joycond package to use.
'';

View File

@ -2,7 +2,7 @@
let
cfg = config.services.supergfxd;
ini = pkgs.formats.ini { };
json = pkgs.formats.json { };
in
{
options = {
@ -10,7 +10,7 @@ in
enable = lib.mkEnableOption (lib.mdDoc "Enable the supergfxd service");
settings = lib.mkOption {
type = lib.types.nullOr ini.type;
type = lib.types.nullOr json.type;
default = null;
description = lib.mdDoc ''
The content of /etc/supergfxd.conf.
@ -23,7 +23,7 @@ in
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.supergfxctl ];
environment.etc."supergfxd.conf" = lib.mkIf (cfg.settings != null) (ini.generate "supergfxd.conf" cfg.settings);
environment.etc."supergfxd.conf".source = lib.mkIf (cfg.settings != null) (json.generate "supergfxd.conf" cfg.settings);
services.dbus.enable = true;

View File

@ -435,6 +435,7 @@ in {
"august"
"august_ble"
"airthings_ble"
"aranet"
"bluemaestro"
"bluetooth"
"bluetooth_le_tracker"
@ -453,8 +454,11 @@ in {
"moat"
"oralb"
"qingping"
"ruuvitag_ble"
"sensirion_ble"
"sensorpro"
"sensorpush"
"shelly"
"snooz"
"switchbot"
"thermobeacon"

View File

@ -23,8 +23,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.matrix-conduit;
defaultText = "pkgs.matrix-conduit";
example = "pkgs.matrix-conduit";
defaultText = lib.literalExpression "pkgs.matrix-conduit";
description = lib.mdDoc ''
Package of the conduit matrix server to use.
'';

View File

@ -286,6 +286,7 @@ in {
log_config = mkOption {
type = types.path;
default = ./synapse-log_config.yaml;
defaultText = lib.literalExpression "nixos/modules/services/matrix/synapse-log_config.yaml";
description = lib.mdDoc ''
The file that holds the logging configuration.
'';

View File

@ -258,7 +258,7 @@ in {
type = hooksModule;
description = lib.mdDoc "Global hook scripts";
default = { };
example = ''
example = literalExpression ''
{
postswitch = {
"notify-i3" = "''${pkgs.i3}/bin/i3-msg restart";
@ -279,7 +279,7 @@ in {
exit 1
esac
echo "Xft.dpi: $DPI" | ''${pkgs.xorg.xrdb}/bin/xrdb -merge
'''
''';
};
}
'';

View File

@ -560,7 +560,7 @@ in {
description = lib.mdDoc "GitLab container registry host name.";
};
port = mkOption {
type = types.int;
type = types.port;
default = 4567;
description = lib.mdDoc "GitLab container registry port.";
};
@ -613,7 +613,7 @@ in {
};
port = mkOption {
type = types.int;
type = types.port;
default = 25;
description = lib.mdDoc "Port of the SMTP server for GitLab.";
};

View File

@ -28,8 +28,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.heisenbridge;
defaultText = "pkgs.heisenbridge";
example = "pkgs.heisenbridge.override { = ; }";
defaultText = lib.literalExpression "pkgs.heisenbridge";
description = lib.mdDoc ''
Package of the application to run, exposed for overriding purposes.
'';

View File

@ -15,6 +15,13 @@ in
services.libreddit = {
enable = mkEnableOption (lib.mdDoc "Private front-end for Reddit");
package = mkOption {
type = types.package;
default = pkgs.libreddit;
defaultText = literalExpression "pkgs.libreddit";
description = lib.mdDoc "Libreddit package to use.";
};
address = mkOption {
default = "0.0.0.0";
example = "127.0.0.1";
@ -45,7 +52,7 @@ in
after = [ "network.target" ];
serviceConfig = {
DynamicUser = true;
ExecStart = "${pkgs.libreddit}/bin/libreddit ${args}";
ExecStart = "${cfg.package}/bin/libreddit ${args}";
AmbientCapabilities = lib.mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
Restart = "on-failure";
RestartSec = "2s";

View File

@ -29,7 +29,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.portunus;
defaultText = "pkgs.portunus";
defaultText = lib.literalExpression "pkgs.portunus";
description = lib.mdDoc "The Portunus package to use.";
};
@ -108,7 +108,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.openldap;
defaultText = "pkgs.openldap";
defaultText = lib.literalExpression "pkgs.openldap";
description = lib.mdDoc "The OpenLDAP package to use.";
};

View File

@ -40,7 +40,7 @@ in {
port = mkOption {
description = lib.mdDoc "Ripple data api port";
default = 5993;
type = types.int;
type = types.port;
};
importMode = mkOption {
@ -77,7 +77,7 @@ in {
port = mkOption {
description = lib.mdDoc "Ripple data api redis port.";
default = 5984;
type = types.int;
type = types.port;
};
};
@ -91,7 +91,7 @@ in {
port = mkOption {
description = lib.mdDoc "Ripple data api couchdb port.";
default = 5984;
type = types.int;
type = types.port;
};
db = mkOption {

View File

@ -505,7 +505,7 @@ in
description = lib.mdDoc "Origin URL for API, 100 more than web.";
type = types.str;
default = "http://${cfg.listenAddress}:${toString (cfg.meta.port + 100)}";
defaultText = ''http://<xref linkend="opt-services.sourcehut.listenAddress"/>:''${toString (<xref linkend="opt-services.sourcehut.meta.port"/> + 100)}'';
defaultText = lib.literalMD ''`"http://''${`[](#opt-services.sourcehut.listenAddress)`}:''${toString (`[](#opt-services.sourcehut.meta.port)` + 100)}"`'';
};
webhooks = mkOption {
description = lib.mdDoc "The Redis connection used for the webhooks worker.";

View File

@ -16,7 +16,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.grafana-agent;
defaultText = "pkgs.grafana-agent";
defaultText = lib.literalExpression "pkgs.grafana-agent";
description = lib.mdDoc "The grafana-agent package to use.";
};
@ -49,17 +49,19 @@ in
};
default = { };
defaultText = ''
metrics = {
wal_directory = "\''${STATE_DIRECTORY}";
global.scrape_interval = "5s";
};
integrations = {
agent.enabled = true;
agent.scrape_integration = true;
node_exporter.enabled = true;
replace_instance_label = true;
};
defaultText = lib.literalExpression ''
{
metrics = {
wal_directory = "\''${STATE_DIRECTORY}";
global.scrape_interval = "5s";
};
integrations = {
agent.enabled = true;
agent.scrape_integration = true;
node_exporter.enabled = true;
replace_instance_label = true;
};
}
'';
example = {
metrics.global.remote_write = [{

View File

@ -225,7 +225,7 @@ in {
port = mkOption {
description = lib.mdDoc "Seyren listening port.";
default = 8081;
type = types.int;
type = types.port;
};
seyrenUrl = mkOption {

View File

@ -66,7 +66,7 @@ in
};
port = mkOption {
type = types.int;
type = types.port;
default = 9092;
description = lib.mdDoc "Port of Kapacitor";
};

View File

@ -107,7 +107,7 @@ in {
};
port = mkOption {
type = types.int;
type = types.port;
default = 9093;
description = lib.mdDoc ''
Port to listen on for the web interface and API.

View File

@ -13,9 +13,8 @@ in
package = mkOption {
type = types.package;
example = literalExpression "pkgs.uptime-kuma";
default = pkgs.uptime-kuma;
defaultText = "pkgs.uptime-kuma";
defaultText = literalExpression "pkgs.uptime-kuma";
description = lib.mdDoc "Uptime Kuma package to use.";
};

View File

@ -102,7 +102,7 @@ in
};
port = mkOption {
type = types.int;
type = types.port;
default = if cfg.database.type == "mysql" then mysql.port else pgsql.port;
defaultText = literalExpression ''
if config.${opt.database.type} == "mysql"

View File

@ -18,7 +18,7 @@ in
};
tub.port = mkOption {
default = 3458;
type = types.int;
type = types.port;
description = lib.mdDoc ''
The port on which the introducer will listen.
'';
@ -58,7 +58,7 @@ in
};
tub.port = mkOption {
default = 3457;
type = types.int;
type = types.port;
description = lib.mdDoc ''
The port on which the tub will listen.
@ -80,7 +80,7 @@ in
};
web.port = mkOption {
default = 3456;
type = types.int;
type = types.port;
description = lib.mdDoc ''
The port on which the Web server will listen.

View File

@ -71,7 +71,7 @@ with lib;
package = mkOption {
type = package;
default = pkgs.ddclient;
defaultText = "pkgs.ddclient";
defaultText = lib.literalExpression "pkgs.ddclient";
description = lib.mdDoc ''
The ddclient executable package run by the service.
'';

View File

@ -7,15 +7,27 @@ let
dnsmasq = pkgs.dnsmasq;
stateDir = "/var/lib/dnsmasq";
# True values are just put as `name` instead of `name=true`, and false values
# are turned to comments (false values are expected to be overrides e.g.
# mkForce)
formatKeyValue =
name: value:
if value == true
then name
else if value == false
then "# setting `${name}` explicitly set to false"
else generators.mkKeyValueDefault { } "=" name value;
settingsFormat = pkgs.formats.keyValue {
mkKeyValue = formatKeyValue;
listsAsDuplicateKeys = true;
};
# Because formats.generate is outputting a file, we use of conf-file. Once
# `extraConfig` is deprecated we can just use
# `dnsmasqConf = format.generate "dnsmasq.conf" cfg.settings`
dnsmasqConf = pkgs.writeText "dnsmasq.conf" ''
dhcp-leasefile=${stateDir}/dnsmasq.leases
${optionalString cfg.resolveLocalQueries ''
conf-file=/etc/dnsmasq-conf.conf
resolv-file=/etc/dnsmasq-resolv.conf
''}
${flip concatMapStrings cfg.servers (server: ''
server=${server}
'')}
conf-file=${settingsFormat.generate "dnsmasq.conf" cfg.settings}
${cfg.extraConfig}
'';
@ -23,6 +35,10 @@ in
{
imports = [
(mkRenamedOptionModule [ "services" "dnsmasq" "servers" ] [ "services" "dnsmasq" "settings" "server" ])
];
###### interface
options = {
@ -46,15 +62,6 @@ in
'';
};
servers = mkOption {
type = types.listOf types.str;
default = [];
example = [ "8.8.8.8" "8.8.4.4" ];
description = lib.mdDoc ''
The DNS servers which dnsmasq should query.
'';
};
alwaysKeepRunning = mkOption {
type = types.bool;
default = false;
@ -63,12 +70,49 @@ in
'';
};
settings = mkOption {
type = types.submodule {
freeformType = settingsFormat.type;
options.server = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "8.8.8.8" "8.8.4.4" ];
description = lib.mdDoc ''
The DNS servers which dnsmasq should query.
'';
};
};
default = { };
description = lib.mdDoc ''
Configuration of dnsmasq. Lists get added one value per line (empty
lists and false values don't get added, though false values get
turned to comments). Gets merged with
{
dhcp-leasefile = "${stateDir}/dnsmasq.leases";
conf-file = optional cfg.resolveLocalQueries "/etc/dnsmasq-conf.conf";
resolv-file = optional cfg.resolveLocalQueries "/etc/dnsmasq-resolv.conf";
}
'';
example = literalExpression ''
{
domain-needed = true;
dhcp-range = [ "192.168.0.2,192.168.0.254" ];
}
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = lib.mdDoc ''
Extra configuration directives that should be added to
`dnsmasq.conf`.
This option is deprecated, please use {option}`settings` instead.
'';
};
@ -81,6 +125,14 @@ in
config = mkIf cfg.enable {
warnings = lib.optional (cfg.extraConfig != "") "Text based config is deprecated, dnsmasq now supports `services.dnsmasq.settings` for an attribute-set based config";
services.dnsmasq.settings = {
dhcp-leasefile = mkDefault "${stateDir}/dnsmasq.leases";
conf-file = mkDefault (optional cfg.resolveLocalQueries "/etc/dnsmasq-conf.conf");
resolv-file = mkDefault (optional cfg.resolveLocalQueries "/etc/dnsmasq-resolv.conf");
};
networking.nameservers =
optional cfg.resolveLocalQueries "127.0.0.1";

View File

@ -17,10 +17,10 @@ in {
configFile = lib.mkOption {
type = lib.types.path;
default = (pkgs.formats.yaml {}).generate "ergo.conf" cfg.settings;
defaultText = "generated config file from <literal>.settings</literal>";
defaultText = lib.literalMD "generated config file from `settings`";
description = lib.mdDoc ''
Path to configuration file.
Setting this will skip any configuration done via `.settings`
Setting this will skip any configuration done via `settings`
'';
};

View File

@ -50,7 +50,7 @@ in
};
port = mkOption {
type = types.int;
type = types.port;
default = 3000;
description = lib.mdDoc "Listing port";
};

View File

@ -28,7 +28,7 @@ in {
type = package;
description = lib.mdDoc "multipath-tools package to use";
default = pkgs.multipath-tools;
defaultText = "pkgs.multipath-tools";
defaultText = lib.literalExpression "pkgs.multipath-tools";
};
devices = mkOption {

View File

@ -67,7 +67,7 @@ in
Additional plugins dir used to configure nomad.
'';
example = literalExpression ''
[ "<pluginDir>" "pkgs.<plugins-name>"]
[ "<pluginDir>" pkgs.<plugins-name> ]
'';
};

View File

@ -588,7 +588,7 @@ in
};
port = mkOption {
type = types.int;
type = types.port;
default = 53;
description = lib.mdDoc ''
Port the service should bind do.
@ -825,7 +825,7 @@ in
};
port = mkOption {
type = types.int;
type = types.port;
default = 8952;
description = lib.mdDoc ''
Port number for remote control operations (uses TLS over TCP).

View File

@ -81,7 +81,7 @@ let
};
port = mkOption {
type = types.int;
type = types.port;
default = 1080;
description = lib.mdDoc ''
What port to listen for client requests, default is 1080.

View File

@ -38,7 +38,7 @@ in {
};
dns.port = mkOption {
type = types.int;
type = types.port;
default = 53;
description = lib.mdDoc ''
Port number Recursor DNS server will bind to.
@ -67,7 +67,7 @@ in {
};
api.port = mkOption {
type = types.int;
type = types.port;
default = 8082;
description = lib.mdDoc ''
Port number Recursor REST API server will bind to.

View File

@ -81,7 +81,7 @@ in
};
port = mkOption {
type = types.int;
type = types.port;
default = 12345;
description = lib.mdDoc "Port on which redsocks should listen.";
};

View File

@ -20,7 +20,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.sabnzbd;
defaultText = "pkgs.sabnzbd";
defaultText = lib.literalExpression "pkgs.sabnzbd";
description = lib.mdDoc "The sabnzbd executable package run by the service.";
};

View File

@ -18,7 +18,7 @@ let
};
port = mkOption {
type = types.ints.u16;
type = types.port;
default = 6697;
description = lib.mdDoc ''
IRC server port.
@ -188,7 +188,7 @@ in
port = mkOption {
default = 5000;
type = types.int;
type = types.port;
description = lib.mdDoc ''
Specifies the port on which to listen.
'';

View File

@ -50,7 +50,7 @@ in {
};
port = mkOption {
description = lib.mdDoc "the port that elasticsearch is listening on";
type = types.int;
type = types.port;
default = 9200;
};
actionYAML = mkOption {

View File

@ -66,7 +66,7 @@ in
port = mkOption {
description = lib.mdDoc "Elasticsearch port to listen for HTTP traffic.";
default = 9200;
type = types.int;
type = types.port;
};
tcp_port = mkOption {

View File

@ -21,7 +21,7 @@ in
package = mkOption {
description = lib.mdDoc "The package to use for meilisearch. Use this if you require specific features to be enabled. The default package has no features.";
default = pkgs.meilisearch;
defaultText = "pkgs.meilisearch";
defaultText = lib.literalExpression "pkgs.meilisearch";
type = types.package;
};

View File

@ -91,7 +91,7 @@ in {
InterceptUnknown = mkOption {
type = types.bool;
description = mdDoc ''
Wheter to intercept spare connections.
Whether to intercept spare connections.
'';
};

View File

@ -33,7 +33,7 @@ let
in
{
config = mkIf (cfg.enable && kerberos == pkgs.krb5Full) {
config = mkIf (cfg.enable && kerberos == pkgs.krb5) {
systemd.services.kadmind = {
description = "Kerberos Administration Daemon";
wantedBy = [ "multi-user.target" ];

View File

@ -15,7 +15,7 @@ in {
package = mkOption {
default = pkgs.code-server;
defaultText = "pkgs.code-server";
defaultText = lib.literalExpression "pkgs.code-server";
description = lib.mdDoc "Which code-server derivation to use.";
type = types.package;
};

View File

@ -449,7 +449,7 @@ in
'';
};
port = mkOption {
type = types.int;
type = types.port;
default = 9000;
description = lib.mdDoc ''
Minio listen port.

View File

@ -151,7 +151,7 @@ in
package = lib.mkOption {
type = types.package;
default = pkgs.invidious;
defaultText = "pkgs.invidious";
defaultText = lib.literalExpression "pkgs.invidious";
description = lib.mdDoc "The Invidious package to use.";
};

View File

@ -49,7 +49,7 @@ in
};
port = mkOption {
type = types.int;
type = types.port;
default = if cfg.database.type == "pgsql" then 5442 else 3306;
defaultText = literalExpression "3306";
description = lib.mdDoc "Database host port.";

View File

@ -106,7 +106,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.mattermost;
defaultText = "pkgs.mattermost";
defaultText = lib.literalExpression "pkgs.mattermost";
description = lib.mdDoc "Mattermost derivation to use.";
};
@ -238,7 +238,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.matterircd;
defaultText = "pkgs.matterircd";
defaultText = lib.literalExpression "pkgs.matterircd";
description = lib.mdDoc "matterircd derivation to use.";
};
parameters = mkOption {

View File

@ -96,7 +96,7 @@ in
};
port = mkOption {
type = types.int;
type = types.port;
description = lib.mdDoc "Database host port.";
default = {
mysql = 3306;

View File

@ -29,7 +29,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.onlyoffice-documentserver;
defaultText = "pkgs.onlyoffice-documentserver";
defaultText = lib.literalExpression "pkgs.onlyoffice-documentserver";
description = lib.mdDoc "Which package to use for the OnlyOffice instance.";
};

View File

@ -51,7 +51,7 @@ in
server = {
port = mkOption {
type = types.int;
type = types.port;
description = lib.mdDoc "The port of the Zabbix server to connect to.";
default = 10051;
};
@ -78,7 +78,7 @@ in
};
port = mkOption {
type = types.int;
type = types.port;
default =
if cfg.database.type == "mysql" then config.services.mysql.port
else if cfg.database.type == "pgsql" then config.services.postgresql.port

View File

@ -137,7 +137,7 @@ in
package = mkOption {
default = pkgs.lighttpd;
defaultText = "pkgs.lighttpd";
defaultText = lib.literalExpression "pkgs.lighttpd";
type = types.package;
description = lib.mdDoc ''
lighttpd package to use.

View File

@ -29,7 +29,7 @@ with lib;
listen = mkOption {
type = with types; listOf (submodule { options = {
addr = mkOption { type = str; description = lib.mdDoc "IP address."; };
port = mkOption { type = int; description = lib.mdDoc "Port number."; default = 80; };
port = mkOption { type = port; description = lib.mdDoc "Port number."; default = 80; };
ssl = mkOption { type = bool; description = lib.mdDoc "Enable SSL."; default = false; };
extraParameters = mkOption { type = listOf str; description = lib.mdDoc "Extra parameters of this listen directive."; default = []; example = [ "backlog=1024" "deferred" ]; };
}; });

View File

@ -580,7 +580,7 @@ in
virtualisation.host.pkgs = mkOption {
type = options.nixpkgs.pkgs.type;
default = pkgs;
defaultText = "pkgs";
defaultText = literalExpression "pkgs";
example = literalExpression ''
import pkgs.path { system = "x86_64-darwin"; }
'';
@ -595,7 +595,8 @@ in
mkOption {
type = types.package;
default = cfg.host.pkgs.qemu_kvm;
example = "pkgs.qemu_test";
defaultText = literalExpression "config.virtualisation.host.pkgs.qemu_kvm";
example = literalExpression "pkgs.qemu_test";
description = lib.mdDoc "QEMU package to use.";
};
@ -721,7 +722,7 @@ in
firmware = mkOption {
type = types.path;
default = pkgs.OVMF.firmware;
defaultText = "pkgs.OVMF.firmware";
defaultText = literalExpression "pkgs.OVMF.firmware";
description =
lib.mdDoc ''
Firmware binary for EFI implementation, defaults to OVMF.
@ -731,7 +732,7 @@ in
variables = mkOption {
type = types.path;
default = pkgs.OVMF.variables;
defaultText = "pkgs.OVMF.variables";
defaultText = literalExpression "pkgs.OVMF.variables";
description =
lib.mdDoc ''
Platform-specific flash binary for EFI variables, implementation-dependent to the EFI firmware.

View File

@ -26,7 +26,7 @@ in {
};
services.dnsmasq.enable = true;
services.dnsmasq.servers = [ "127.0.0.1#${toString localProxyPort}" ];
services.dnsmasq.settings.server = [ "127.0.0.1#${toString localProxyPort}" ];
};
};

View File

@ -419,6 +419,20 @@ import ./make-test-python.nix ({ pkgs, ... }: {
"docker rmi layered-image-with-path",
)
with subtest("Ensure correct architecture is present in manifests."):
docker.succeed("""
docker load --input='${examples.build-image-with-architecture}'
docker inspect build-image-with-architecture \
| ${pkgs.jq}/bin/jq -er '.[] | select(.Architecture=="arm64").Architecture'
docker rmi build-image-with-architecture
""")
docker.succeed("""
${examples.layered-image-with-architecture} | docker load
docker inspect layered-image-with-architecture \
| ${pkgs.jq}/bin/jq -er '.[] | select(.Architecture=="arm64").Architecture'
docker rmi layered-image-with-architecture
""")
with subtest("etc"):
docker.succeed("${examples.etc} | docker load")
docker.succeed("docker run --rm etc | grep localhost")

View File

@ -9,7 +9,7 @@ import ../make-test-python.nix ({pkgs, ...}: {
};
krb5 = {
enable = true;
kerberos = pkgs.krb5Full;
kerberos = pkgs.krb5;
libdefaults = {
default_realm = "FOO.BAR";
};

View File

@ -11,7 +11,7 @@ import ../make-test-python.nix ({ pkgs, ...} : {
{ pkgs, ... }: {
krb5 = {
enable = true;
kerberos = pkgs.krb5Full;
kerberos = pkgs.krb5;
libdefaults = {
default_realm = "ATHENA.MIT.EDU";
};

View File

@ -69,7 +69,7 @@ let
extraConfiguration = { config, pkgs, lib, ... }: {
environment.systemPackages = [ pkgs.bind.host ];
services.dnsmasq.enable = true;
services.dnsmasq.servers = [
services.dnsmasq.settings.server = [
"/cluster.local/${config.services.kubernetes.addons.dns.clusterIp}#53"
];
};

View File

@ -82,9 +82,7 @@ import ./make-test-python.nix {
# Since we don't have internet here, use dnsmasq to provide MX records from /etc/hosts
services.dnsmasq = {
enable = true;
extraConfig = ''
selfmx
'';
settings.selfmx = true;
};
networking.extraHosts = ''

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "praat";
version = "6.3.01";
version = "6.3.02";
src = fetchFromGitHub {
owner = "praat";
repo = "praat";
rev = "v${version}";
sha256 = "sha256-BgfVbD/xQ3IaTMJhac6eSnbZQdBTDdqboruxSbKvbyE=";
sha256 = "sha256-sn/GWCw1bxtFjUUKkrPZVOe5qRQ5ATyII52CPHmlB3g=";
};
configurePhase = ''

View File

@ -22,14 +22,14 @@
stdenv.mkDerivation rec {
pname = "deja-dup";
version = "43.4";
version = "44.0";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "World";
repo = pname;
rev = version;
sha256 = "sha256-8eqrBQrMvS4cta5RP0ibo4Zc3B8hlkftxaRyvb6JuEY=";
sha256 = "sha256-dIH6VPgzJxvXEUtPAYQzpQ8I9R9MwsfeylV25ASfW/k=";
};
patches = [

View File

@ -2,7 +2,7 @@
python3.pkgs.buildPythonApplication rec {
pname = "unifi-protect-backup";
version = "0.7.4";
version = "0.8.3";
format = "pyproject";
@ -10,12 +10,14 @@ python3.pkgs.buildPythonApplication rec {
owner = "ep1cman";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-4Kpz89yqKmxHmnaPYpvJ2hx46yfcaCYjOioyya+38vE=";
hash = "sha256-3iOaJZAvkhjiWLKI1m2hmVkWLaNtq74nQZYIm/XCgeA=";
};
preBuild = ''
sed -i 's_click = "8.0.1"_click = "^8"_' pyproject.toml
sed -i 's_pyunifiprotect = .*_pyunifiprotect = "*"_' pyproject.toml
sed -i 's_aiorun = .*_aiorun = "*"_' pyproject.toml
sed -i '/pylint/d' pyproject.toml
'';
nativeBuildInputs = with python3.pkgs; [
@ -24,6 +26,8 @@ python3.pkgs.buildPythonApplication rec {
propagatedBuildInputs = with python3.pkgs; [
aiocron
aiorun
aiosqlite
click
pyunifiprotect
];

View File

@ -10,6 +10,7 @@
, protobuf
, rustPlatform
, Security
, CoreFoundation
, stdenv
, testers
, unzip
@ -17,7 +18,7 @@
rustPlatform.buildRustPackage rec {
pname = "lighthouse";
version = "3.2.1";
version = "3.3.0";
# lighthouse/common/deposit_contract/build.rs
depositContractSpecVersion = "0.12.1";
@ -27,10 +28,10 @@ rustPlatform.buildRustPackage rec {
owner = "sigp";
repo = "lighthouse";
rev = "v${version}";
sha256 = "sha256-Aqc3kk1rquhLKNZDlEun4bQpKI4Nsk7+Wr7E2IkJQEs=";
hash = "sha256-py64CWY3k5Z2mm9WduJ4Fh7lQ8b3sF6iIFsYYjndU5I=";
};
cargoSha256 = "sha256-wGEk7OfEmyeRW65kq5stvKCdnCjfssyXUmNWGkGq42M=";
cargoHash = "sha256-0gWTniLkhuPpgdUkE6gpF9uHYT6BeWWgH6Mu7KpFx9w=";
buildFeatures = [ "modern" "gnosis" ];
@ -38,6 +39,8 @@ rustPlatform.buildRustPackage rec {
buildInputs = lib.optionals stdenv.isDarwin [
Security
] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
CoreFoundation
];
depositContractSpec = fetchurl {

View File

@ -41,13 +41,13 @@
stdenv.mkDerivation rec {
pname = "gnome-builder";
version = "43.2";
version = "43.4";
outputs = [ "out" "devdoc" ];
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz";
sha256 = "dzIhF6ERsnR7zOitYFeKZ5wgIeSGkRz29OY0FjKKuzM=";
sha256 = "Hg1tZ4RcGb7J463VlpX5pTHXKg5UKyA6zJD7OBInwrw=";
};
patches = [

View File

@ -1,18 +1,19 @@
{ lib, stdenv, fetchFromGitHub, runCommand, ncurses, gettext
, pkg-config, cscope, ruby, tcl, perl, luajit
{ lib
, stdenv
, fetchFromGitHub
, runCommand
, ncurses
, gettext
, pkg-config
, cscope
, ruby
, tcl
, perl
, luajit
, darwin
, usePython27 ? false
, python27 ? null, python37 ? null
, python37
}:
let
python = if usePython27
then { pkg = python27; name = "python"; }
else { pkg = python37; name = "python3"; };
in
assert python.pkg != null;
let
# Building requires a few system tools to be in PATH.
# Some of these we could patch into the relevant source files (such as xcodebuild and
@ -40,7 +41,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [ pkg-config buildSymlinks ];
buildInputs = [
gettext ncurses cscope luajit ruby tcl perl python.pkg
gettext ncurses cscope luajit ruby tcl perl python37
];
patches = [ ./macvim.patch ];
@ -53,14 +54,14 @@ stdenv.mkDerivation {
"--enable-multibyte"
"--enable-nls"
"--enable-luainterp=dynamic"
"--enable-${python.name}interp=dynamic"
"--enable-python3interp=dynamic"
"--enable-perlinterp=dynamic"
"--enable-rubyinterp=dynamic"
"--enable-tclinterp=yes"
"--without-local-dir"
"--with-luajit"
"--with-lua-prefix=${luajit}"
"--with-${python.name}-command=${python.pkg}/bin/${python.name}"
"--with-python3-command=${python37}/bin/python3"
"--with-ruby-command=${ruby}/bin/ruby"
"--with-tclsh=${tcl}/bin/tclsh"
"--with-tlib=ncurses"
@ -158,7 +159,7 @@ stdenv.mkDerivation {
libperl=$(dirname $(find ${perl} -name "libperl.dylib"))
install_name_tool -add_rpath ${luajit}/lib $exe
install_name_tool -add_rpath ${tcl}/lib $exe
install_name_tool -add_rpath ${python.pkg}/lib $exe
install_name_tool -add_rpath ${python37}/lib $exe
install_name_tool -add_rpath $libperl $exe
install_name_tool -add_rpath ${ruby}/lib $exe

View File

@ -184,9 +184,9 @@ let
depsOfOptionalPlugins = lib.subtractLists opt (findDependenciesRecursively opt);
startWithDeps = findDependenciesRecursively start;
allPlugins = lib.unique (startWithDeps ++ depsOfOptionalPlugins);
python3Env = python3.withPackages (ps:
lib.flatten (builtins.map (plugin: (plugin.python3Dependencies or (_: [])) ps) allPlugins)
);
allPython3Dependencies = ps:
lib.flatten (builtins.map (plugin: (plugin.python3Dependencies or (_: [])) ps) allPlugins);
python3Env = python3.withPackages allPython3Dependencies;
packdirStart = vimFarm "pack/${packageName}/start" "packdir-start" allPlugins;
packdirOpt = vimFarm "pack/${packageName}/opt" "packdir-opt" opt;
@ -199,7 +199,7 @@ let
ln -s ${python3Env}/${python3Env.sitePackages} $out/pack/${packageName}/start/__python3_dependencies/python3
'';
in
[ packdirStart packdirOpt python3link ];
[ packdirStart packdirOpt ] ++ lib.optional (allPython3Dependencies python3.pkgs != []) python3link;
in
buildEnv {
name = "vim-pack-dir";

View File

@ -1468,8 +1468,8 @@ let
mktplcRef = {
name = "latex-workshop";
publisher = "James-Yu";
version = "9.1.0";
sha256 = "sha256-a/v8/5ztB9DXqYpGWMYSRIwZIj1D+iebG35fO0yDjQQ=";
version = "9.1.1";
sha256 = "sha256-Xt/z5r9R090Z9nP1v7k+jYm9EOcjy0GfYiYpc7jNid4=";
};
meta = with lib; {
changelog = "https://marketplace.visualstudio.com/items/James-Yu.latex-workshop/changelog";

View File

@ -24,7 +24,7 @@
, wxGTK30
, soundtouch
, miniupnpc
, mbedtls
, mbedtls_2
, curl
, lzo
, sfml
@ -104,7 +104,7 @@ stdenv.mkDerivation rec {
wxGTK30
soundtouch
miniupnpc
mbedtls
mbedtls_2
curl
lzo
sfml

View File

@ -20,7 +20,7 @@
, alsa-lib
, miniupnpc
, enet
, mbedtls
, mbedtls_2
, soundtouch
, sfml
, xz
@ -90,7 +90,7 @@ stdenv.mkDerivation rec {
hidapi
miniupnpc
enet
mbedtls
mbedtls_2
soundtouch
sfml
xz

View File

@ -29,7 +29,7 @@
, alsa-lib
, miniupnpc
, enet
, mbedtls
, mbedtls_2
, soundtouch
, sfml
, fmt
@ -87,7 +87,7 @@ stdenv.mkDerivation rec {
hidapi
miniupnpc
enet
mbedtls
mbedtls_2
soundtouch
sfml
fmt

View File

@ -35,13 +35,13 @@ in
stdenv.mkDerivation rec {
pname = "imagemagick";
version = "6.9.12-26";
version = "6.9.12-68";
src = fetchFromGitHub {
owner = "ImageMagick";
repo = "ImageMagick6";
rev = version;
sha256 = "sha256-oNorY/93jk1v5BS1T3wqctXuzV4o8JlyZtHnsNYmO4U=";
sha256 = "sha256-slQcA0cblxtG/1DiJx5swUh7Kfwgz5HG70eqJFLaQJI=";
};
outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big
@ -91,7 +91,7 @@ stdenv.mkDerivation rec {
++ lib.optional libXtSupport libXt
++ lib.optional libwebpSupport libwebp;
doCheck = false; # fails 6 out of 76 tests
doCheck = false; # fails 2 out of 76 tests
postInstall = ''
(cd "$dev/include" && ln -s ImageMagick* ImageMagick)

View File

@ -11,11 +11,11 @@
stdenv.mkDerivation rec {
pname = "drawio";
version = "20.3.0";
version = "20.6.1";
src = fetchurl {
url = "https://github.com/jgraph/drawio-desktop/releases/download/v${version}/drawio-x86_64-${version}.rpm";
sha256 = "bfcd363f549ce8dc13ae2287cec5099e4bf1d0d4b6f8deef40a81279f78817e1";
sha256 = "8d1e3d44e53e62dd6dc7f231af5b682c9ff0e798a6480528444ba52cce02b4c9";
};
nativeBuildInputs = [

View File

@ -12,12 +12,12 @@ let
if extension == "zip" then fetchzip args else fetchurl args;
pname = "1password-cli";
version = "2.7.3";
version = "2.9.1";
sources = rec {
aarch64-linux = fetch "linux_arm64" "sha256-FxApOWyExyfuRFQhxAVBWZGqQNmarBFBRB4jqsreWL0=" "zip";
i686-linux = fetch "linux_386" "sha256-Ta6mdmcsKnNRMz9vwEadZ/xXVBran5BIJQngzNz3PUs=" "zip";
x86_64-linux = fetch "linux_amd64" "sha256-Lvxnp5KmkIj9jnaWg02a27eRYIx7WTNSLx+RJ04Vt+g=" "zip";
aarch64-darwin = fetch "apple_universal" "sha256-6qrNgb5ae+qqlNsNDLbKNeWj0o/SRs+2G/4DfK5Wnhg=" "pkg";
aarch64-linux = fetch "linux_arm64" "sha256-sFh3jIGknR7RA3/pckvBkFvVoxYfXqYuyUJuc/AfecU=" "zip";
i686-linux = fetch "linux_386" "sha256-JbBjAdGRtpwkk1svoyNw22BGbslwD8ZuNJRihUoFMP4=" "zip";
x86_64-linux = fetch "linux_amd64" "sha256-yUo8LhT9iTl1z5+Cs9/E/YPMrnnimhFK9A1b1og0TSA=" "zip";
aarch64-darwin = fetch "apple_universal" "sha256-IFaLcMXOLc0oZIWVOaDuyUmUxJc+Keeg77RR/SlCGxI=" "pkg";
x86_64-darwin = aarch64-darwin;
};
platforms = builtins.attrNames sources;

View File

@ -30,7 +30,7 @@ in buildFHSUserEnv {
# DGen // TODO: libarchive is broken
# Dolphin
bluez ffmpeg gettext portaudio wxGTK30 miniupnpc mbedtls lzo sfml gsm
bluez ffmpeg gettext portaudio wxGTK30 miniupnpc mbedtls_2 lzo sfml gsm
wavpack orc nettle gmp pcre vulkan-loader
# DOSBox

View File

@ -1,4 +1,4 @@
{ lib, mkDerivation, fetchFromGitLab, qmake, libusb1, hidapi, pkg-config, coreutils, mbedtls }:
{ lib, mkDerivation, fetchFromGitLab, qmake, libusb1, hidapi, pkg-config, coreutils, mbedtls_2 }:
mkDerivation rec {
pname = "openrgb";
@ -12,7 +12,7 @@ mkDerivation rec {
};
nativeBuildInputs = [ qmake pkg-config ];
buildInputs = [ libusb1 hidapi mbedtls ];
buildInputs = [ libusb1 hidapi mbedtls_2 ];
installPhase = ''
runHook preInstall

Some files were not shown because too many files have changed in this diff Show More