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> 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> 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). - `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. - `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. - `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_ `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). : 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:* `{}` *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="coq.section.xml" />
<xi:include href="crystal.section.xml" /> <xi:include href="crystal.section.xml" />
<xi:include href="cuda.section.xml" /> <xi:include href="cuda.section.xml" />
<xi:include href="cuelang.section.xml" />
<xi:include href="dhall.section.xml" /> <xi:include href="dhall.section.xml" />
<xi:include href="dotnet.section.xml" /> <xi:include href="dotnet.section.xml" />
<xi:include href="emscripten.section.xml" /> <xi:include href="emscripten.section.xml" />

View File

@ -278,8 +278,11 @@ rec {
mapAny 0; mapAny 0;
/* Pretty print a value, akin to `builtins.trace`. /* 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 = { toPretty = {
/* If this option is true, attrsets like { __pretty = fn; val = ; } /* If this option is true, attrsets like { __pretty = fn; val = ; }
will use fn to convert val to a pretty printed representation. will use fn to convert val to a pretty printed representation.
@ -294,20 +297,25 @@ rec {
introSpace = if multiline then "\n${indent} " else " "; introSpace = if multiline then "\n${indent} " else " ";
outroSpace = if multiline then "\n${indent}" else " "; outroSpace = if multiline then "\n${indent}" else " ";
in if isInt v then toString v 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 else if isString v then
let let
# Separate a string into its lines lines = filter (v: ! isList v) (builtins.split "\n" v);
newlineSplits = filter (v: ! isList v) (builtins.split "\n" v); escapeSingleline = libStr.escape [ "\\" "\"" "\${" ];
# For a '' string terminated by a \n, which happens when the closing '' is on a new line escapeMultiline = libStr.replaceStrings [ "\${" "''" ] [ "''\${" "'''" ];
multilineResult = "''" + introSpace + concatStringsSep introSpace (lib.init newlineSplits) + outroSpace + "''"; singlelineResult = "\"" + concatStringsSep "\\n" (map escapeSingleline lines) + "\"";
# For a '' string not terminated by a \n, which happens when the closing '' is not on a new line multilineResult = let
multilineResult' = "''" + introSpace + concatStringsSep introSpace newlineSplits + "''"; escapedLines = map escapeMultiline lines;
# For single lines, replace all newlines with their escaped representation # The last line gets a special treatment: if it's empty, '' is on its own line at the "outer"
singlelineResult = "\"" + libStr.escape [ "\"" ] (concatStringsSep "\\n" newlineSplits) + "\""; # indentation level. Otherwise, '' is appended to the last line.
in if multiline && length newlineSplits > 1 then lastLine = lib.last escapedLines;
if lib.last newlineSplits == "" then multilineResult else multilineResult' in "''" + introSpace + concatStringsSep introSpace (lib.init escapedLines)
else singlelineResult + (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 true == v then "true"
else if false == v then "false" else if false == v then "false"
else if null == v then "null" else if null == v then "null"
@ -326,11 +334,11 @@ rec {
else "<function, args: {${showFnas}}>" else "<function, args: {${showFnas}}>"
else if isAttrs v then else if isAttrs v then
# apply pretty values if allowed # apply pretty values if allowed
if attrNames v == [ "__pretty" "val" ] && allowPrettyValues if allowPrettyValues && v ? __pretty && v ? val
then v.__pretty v.val then v.__pretty v.val
else if v == {} then "{ }" else if v == {} then "{ }"
else if v ? type && v.type == "derivation" then else if v ? type && v.type == "derivation" then
"<derivation ${v.drvPath or "???"}>" "<derivation ${v.name or "???"}>"
else "{" + introSpace else "{" + introSpace
+ libStr.concatStringsSep introSpace (libAttr.mapAttrsToList + libStr.concatStringsSep introSpace (libAttr.mapAttrsToList
(name: value: (name: value:

View File

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

View File

@ -510,7 +510,7 @@ rec {
toUpper = replaceChars lowerChars upperChars; toUpper = replaceChars lowerChars upperChars;
/* Appends string context from another string. This is an implementation /* 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 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 representing store paths. If the string is later used in a derivation
@ -533,13 +533,11 @@ rec {
splitString "/" "/usr/local/bin" splitString "/" "/usr/local/bin"
=> [ "" "usr" "local" "bin" ] => [ "" "usr" "local" "bin" ]
*/ */
splitString = _sep: _s: splitString = sep: s:
let let
sep = builtins.unsafeDiscardStringContext _sep; splits = builtins.filter builtins.isString (builtins.split (escapeRegex (toString sep)) (toString s));
s = builtins.unsafeDiscardStringContext _s;
splits = builtins.filter builtins.isString (builtins.split (escapeRegex sep) s);
in in
map (v: addContextFrom _sep (addContextFrom _s v)) splits; map (addContextFrom s) splits;
/* Return a string without the specified prefix, if the prefix matches. /* Return a string without the specified prefix, if the prefix matches.

View File

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

View File

@ -175,6 +175,15 @@
sudo and sources the environment variables. sudo and sources the environment variables.
</para> </para>
</listitem> </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> <listitem>
<para> <para>
A new <literal>virtualisation.rosetta</literal> module was 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. - `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). - 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. - 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 # If you include more than one option list into a document, you need to
# provide different ids. # provide different ids.
, variablelistId ? "configuration-variable-list" , 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-" , optionIdPrefix ? "opt-"
, revision ? "" # Specify revision for the options , revision ? "" # Specify revision for the options
# a set of options the docs we are generating will be merged into, as if by recursiveUpdate. # a set of options the docs we are generating will be merged into, as if by recursiveUpdate.
@ -45,28 +45,11 @@
}: }:
let 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; rawOpts = lib.optionAttrSetToDocList options;
transformedOpts = map transformOptions rawOpts; transformedOpts = map transformOptions rawOpts;
filteredOpts = lib.filter (opt: opt.visible && !opt.internal) transformedOpts; filteredOpts = lib.filter (opt: opt.visible && !opt.internal) transformedOpts;
optionsList = lib.flip map filteredOpts optionsList = lib.flip map filteredOpts
(opt: opt (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; } // lib.optionalAttrs (opt ? relatedPackages && opt.relatedPackages != []) { relatedPackages = genRelatedPackages opt.relatedPackages opt.name; }
); );

View File

@ -138,82 +138,6 @@
</xsl:template> </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']"> <xsl:template match="attr[@name = 'declarations' or @name = 'definitions']">
<simplelist> <simplelist>
<!-- <!--
@ -275,10 +199,4 @@
</simplelist> </simplelist>
</xsl:template> </xsl:template>
<xsl:template match="function">
<xsl:text>λ</xsl:text>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

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

View File

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

View File

@ -48,10 +48,15 @@ let
}; };
scrubDerivations = namePrefix: pkgSet: mapAttrs scrubDerivations = namePrefix: pkgSet: mapAttrs
(name: value: (name: value:
let wholeName = "${namePrefix}.${name}"; in let
if isAttrs value then 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 scrubDerivations wholeName value
// (optionalAttrs (isDerivation value) { outPath = "\${${wholeName}}"; }) // optionalAttrs (isDerivation value) {
outPath = guard "\${${wholeName}}";
drvPath = guard drvPath;
}
else value else value
) )
pkgSet; pkgSet;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@ with lib;
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.clickhouse; default = pkgs.clickhouse;
defaultText = "pkgs.clickhouse"; defaultText = lib.literalExpression "pkgs.clickhouse";
description = lib.mdDoc '' description = lib.mdDoc ''
ClickHouse package to use. 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 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. of MySQL. The schema attribute is optional: If not specified, an empty database is created.
''; '';
example = [ example = literalExpression ''
{ name = "foodatabase"; schema = literalExpression "./foodatabase.sql"; } [
{ name = "bardatabase"; } { name = "foodatabase"; schema = ./foodatabase.sql; }
]; { name = "bardatabase"; }
]
'';
}; };
initialScript = mkOption { initialScript = mkOption {

View File

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

View File

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

View File

@ -43,12 +43,14 @@ in
web-ui = mkOption { web-ui = mkOption {
type = types.submodule { type = types.submodule {
options = { options = {
enable = mkEnableOption enable = mkEnableOption "" // {
(lib.mdDoc "Wheter to start the web-ui. This is the preferred way of configuring things such as the steam guard token"); 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 { package = mkOption {
type = types.package; type = types.package;
default = pkgs.ArchiSteamFarm.ui; default = pkgs.ArchiSteamFarm.ui;
defaultText = lib.literalExpression "pkgs.ArchiSteamFarm.ui";
description = description =
lib.mdDoc "Web-UI package to use. Contents must be in lib/dist."; lib.mdDoc "Web-UI package to use. Contents must be in lib/dist.";
}; };
@ -56,7 +58,6 @@ in
}; };
default = { default = {
enable = true; enable = true;
package = pkgs.ArchiSteamFarm.ui;
}; };
example = { example = {
enable = false; enable = false;
@ -67,6 +68,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.ArchiSteamFarm; default = pkgs.ArchiSteamFarm;
defaultText = lib.literalExpression "pkgs.ArchiSteamFarm";
description = 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."; 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 { openFirewall = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = lib.mdDoc "Wheter to open ports in the firewall"; description = lib.mdDoc "Whether to open ports in the firewall";
}; };
dataDir = mkOption { dataDir = mkOption {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -258,7 +258,7 @@ in {
type = hooksModule; type = hooksModule;
description = lib.mdDoc "Global hook scripts"; description = lib.mdDoc "Global hook scripts";
default = { }; default = { };
example = '' example = literalExpression ''
{ {
postswitch = { postswitch = {
"notify-i3" = "''${pkgs.i3}/bin/i3-msg restart"; "notify-i3" = "''${pkgs.i3}/bin/i3-msg restart";
@ -279,7 +279,7 @@ in {
exit 1 exit 1
esac esac
echo "Xft.dpi: $DPI" | ''${pkgs.xorg.xrdb}/bin/xrdb -merge 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."; description = lib.mdDoc "GitLab container registry host name.";
}; };
port = mkOption { port = mkOption {
type = types.int; type = types.port;
default = 4567; default = 4567;
description = lib.mdDoc "GitLab container registry port."; description = lib.mdDoc "GitLab container registry port.";
}; };
@ -613,7 +613,7 @@ in {
}; };
port = mkOption { port = mkOption {
type = types.int; type = types.port;
default = 25; default = 25;
description = lib.mdDoc "Port of the SMTP server for GitLab."; description = lib.mdDoc "Port of the SMTP server for GitLab.";
}; };

View File

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

View File

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

View File

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

View File

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

View File

@ -505,7 +505,7 @@ in
description = lib.mdDoc "Origin URL for API, 100 more than web."; description = lib.mdDoc "Origin URL for API, 100 more than web.";
type = types.str; type = types.str;
default = "http://${cfg.listenAddress}:${toString (cfg.meta.port + 100)}"; 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 { webhooks = mkOption {
description = lib.mdDoc "The Redis connection used for the webhooks worker."; description = lib.mdDoc "The Redis connection used for the webhooks worker.";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,15 +7,27 @@ let
dnsmasq = pkgs.dnsmasq; dnsmasq = pkgs.dnsmasq;
stateDir = "/var/lib/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" '' dnsmasqConf = pkgs.writeText "dnsmasq.conf" ''
dhcp-leasefile=${stateDir}/dnsmasq.leases conf-file=${settingsFormat.generate "dnsmasq.conf" cfg.settings}
${optionalString cfg.resolveLocalQueries ''
conf-file=/etc/dnsmasq-conf.conf
resolv-file=/etc/dnsmasq-resolv.conf
''}
${flip concatMapStrings cfg.servers (server: ''
server=${server}
'')}
${cfg.extraConfig} ${cfg.extraConfig}
''; '';
@ -23,6 +35,10 @@ in
{ {
imports = [
(mkRenamedOptionModule [ "services" "dnsmasq" "servers" ] [ "services" "dnsmasq" "settings" "server" ])
];
###### interface ###### interface
options = { 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 { alwaysKeepRunning = mkOption {
type = types.bool; type = types.bool;
default = false; 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 { extraConfig = mkOption {
type = types.lines; type = types.lines;
default = ""; default = "";
description = lib.mdDoc '' description = lib.mdDoc ''
Extra configuration directives that should be added to Extra configuration directives that should be added to
`dnsmasq.conf`. `dnsmasq.conf`.
This option is deprecated, please use {option}`settings` instead.
''; '';
}; };
@ -81,6 +125,14 @@ in
config = mkIf cfg.enable { 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 = networking.nameservers =
optional cfg.resolveLocalQueries "127.0.0.1"; optional cfg.resolveLocalQueries "127.0.0.1";

View File

@ -17,10 +17,10 @@ in {
configFile = lib.mkOption { configFile = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = (pkgs.formats.yaml {}).generate "ergo.conf" cfg.settings; 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 '' description = lib.mdDoc ''
Path to configuration file. 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 { port = mkOption {
type = types.int; type = types.port;
default = 3000; default = 3000;
description = lib.mdDoc "Listing port"; description = lib.mdDoc "Listing port";
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,7 +21,7 @@ in
package = mkOption { 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."; 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; default = pkgs.meilisearch;
defaultText = "pkgs.meilisearch"; defaultText = lib.literalExpression "pkgs.meilisearch";
type = types.package; type = types.package;
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -29,7 +29,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.onlyoffice-documentserver; 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."; description = lib.mdDoc "Which package to use for the OnlyOffice instance.";
}; };

View File

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

View File

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

View File

@ -29,7 +29,7 @@ with lib;
listen = mkOption { listen = mkOption {
type = with types; listOf (submodule { options = { type = with types; listOf (submodule { options = {
addr = mkOption { type = str; description = lib.mdDoc "IP address."; }; 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; }; 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" ]; }; 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 { virtualisation.host.pkgs = mkOption {
type = options.nixpkgs.pkgs.type; type = options.nixpkgs.pkgs.type;
default = pkgs; default = pkgs;
defaultText = "pkgs"; defaultText = literalExpression "pkgs";
example = literalExpression '' example = literalExpression ''
import pkgs.path { system = "x86_64-darwin"; } import pkgs.path { system = "x86_64-darwin"; }
''; '';
@ -595,7 +595,8 @@ in
mkOption { mkOption {
type = types.package; type = types.package;
default = cfg.host.pkgs.qemu_kvm; 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."; description = lib.mdDoc "QEMU package to use.";
}; };
@ -721,7 +722,7 @@ in
firmware = mkOption { firmware = mkOption {
type = types.path; type = types.path;
default = pkgs.OVMF.firmware; default = pkgs.OVMF.firmware;
defaultText = "pkgs.OVMF.firmware"; defaultText = literalExpression "pkgs.OVMF.firmware";
description = description =
lib.mdDoc '' lib.mdDoc ''
Firmware binary for EFI implementation, defaults to OVMF. Firmware binary for EFI implementation, defaults to OVMF.
@ -731,7 +732,7 @@ in
variables = mkOption { variables = mkOption {
type = types.path; type = types.path;
default = pkgs.OVMF.variables; default = pkgs.OVMF.variables;
defaultText = "pkgs.OVMF.variables"; defaultText = literalExpression "pkgs.OVMF.variables";
description = description =
lib.mdDoc '' lib.mdDoc ''
Platform-specific flash binary for EFI variables, implementation-dependent to the EFI firmware. 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.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", "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"): with subtest("etc"):
docker.succeed("${examples.etc} | docker load") docker.succeed("${examples.etc} | docker load")
docker.succeed("docker run --rm etc | grep localhost") docker.succeed("docker run --rm etc | grep localhost")

View File

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

View File

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

View File

@ -69,7 +69,7 @@ let
extraConfiguration = { config, pkgs, lib, ... }: { extraConfiguration = { config, pkgs, lib, ... }: {
environment.systemPackages = [ pkgs.bind.host ]; environment.systemPackages = [ pkgs.bind.host ];
services.dnsmasq.enable = true; services.dnsmasq.enable = true;
services.dnsmasq.servers = [ services.dnsmasq.settings.server = [
"/cluster.local/${config.services.kubernetes.addons.dns.clusterIp}#53" "/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 # Since we don't have internet here, use dnsmasq to provide MX records from /etc/hosts
services.dnsmasq = { services.dnsmasq = {
enable = true; enable = true;
extraConfig = '' settings.selfmx = true;
selfmx
'';
}; };
networking.extraHosts = '' networking.extraHosts = ''

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,7 +30,7 @@ in buildFHSUserEnv {
# DGen // TODO: libarchive is broken # DGen // TODO: libarchive is broken
# Dolphin # 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 wavpack orc nettle gmp pcre vulkan-loader
# DOSBox # 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 { mkDerivation rec {
pname = "openrgb"; pname = "openrgb";
@ -12,7 +12,7 @@ mkDerivation rec {
}; };
nativeBuildInputs = [ qmake pkg-config ]; nativeBuildInputs = [ qmake pkg-config ];
buildInputs = [ libusb1 hidapi mbedtls ]; buildInputs = [ libusb1 hidapi mbedtls_2 ];
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall

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