Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Oct 13, 2020
2 parents aabcf2d + c5a41da commit 9e1943e
Show file tree
Hide file tree
Showing 210 changed files with 11,865 additions and 8,913 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/editorconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: technote-space/get-diff-action@v3.1.0
- uses: technote-space/get-diff-action@v4.0.0
- name: Fetch editorconfig-checker
if: env.GIT_DIFF
env:
Expand Down
39 changes: 22 additions & 17 deletions doc/languages-frameworks/agda.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ Agda can be installed from `agda`:
$ nix-env -iA agda
```

To use agda with libraries, the `agda.withPackages` function can be used. This function either takes:
+ A list of packages,
+ or a function which returns a list of packages when given the `agdaPackages` attribute set,
+ or an attribute set containing a list of packages and a GHC derivation for compilation (see below).
To use Agda with libraries, the `agda.withPackages` function can be used. This function either takes:

For example, suppose we wanted a version of agda which has access to the standard library. This can be obtained with the expressions:
* A list of packages,
* or a function which returns a list of packages when given the `agdaPackages` attribute set,
* or an attribute set containing a list of packages and a GHC derivation for compilation (see below).

For example, suppose we wanted a version of Agda which has access to the standard library. This can be obtained with the expressions:

```
agda.withPackages [ agdaPackages.standard-library ]
Expand All @@ -33,18 +34,19 @@ or can be called as in the [Compiling Agda](#compiling-agda) section.

If you want to use a library in your home directory (for instance if it is a development version) then typecheck it manually (using `agda.withPackages` if necessary) and then override the `src` attribute of the package to point to your local repository.

Agda will not by default use these libraries. To tell agda to use the library we have some options:
- Call `agda` with the library flag:
Agda will not by default use these libraries. To tell Agda to use the library we have some options:

* Call `agda` with the library flag:
```
$ agda -l standard-library -i . MyFile.agda
```
- Write a `my-library.agda-lib` file for the project you are working on which may look like:
* Write a `my-library.agda-lib` file for the project you are working on which may look like:
```
name: my-library
include: .
depend: standard-library
```
- Create the file `~/.agda/defaults` and add any libraries you want to use by default.
* Create the file `~/.agda/defaults` and add any libraries you want to use by default.

More information can be found in the [official Agda documentation on library management](https://agda.readthedocs.io/en/v2.6.1/tools/package-system.html).

Expand All @@ -60,12 +62,13 @@ agda.withPackages {
```

## Writing Agda packages
To write a nix derivation for an agda library, first check that the library has a `*.agda-lib` file.
To write a nix derivation for an Agda library, first check that the library has a `*.agda-lib` file.

A derivation can then be written using `agdaPackages.mkDerivation`. This has similar arguments to `stdenv.mkDerivation` with the following additions:
+ `everythingFile` can be used to specify the location of the `Everything.agda` file, defaulting to `./Everything.agda`. If this file does not exist then either it should be patched in or the `buildPhase` should be overridden (see below).
+ `libraryName` should be the name that appears in the `*.agda-lib` file, defaulting to `pname`.
+ `libraryFile` should be the file name of the `*.agda-lib` file, defaulting to `${libraryName}.agda-lib`.

* `everythingFile` can be used to specify the location of the `Everything.agda` file, defaulting to `./Everything.agda`. If this file does not exist then either it should be patched in or the `buildPhase` should be overridden (see below).
* `libraryName` should be the name that appears in the `*.agda-lib` file, defaulting to `pname`.
* `libraryFile` should be the file name of the `*.agda-lib` file, defaulting to `${libraryName}.agda-lib`.

### Building Agda packages
The default build phase for `agdaPackages.mkDerivation` simply runs `agda` on the `Everything.agda` file.
Expand All @@ -74,12 +77,14 @@ Additionally, a `preBuild` or `configurePhase` can be used if there are steps th
`agda` and the Agda libraries contained in `buildInputs` are made available during the build phase.

### Installing Agda packages
The default install phase copies agda source files, agda interface files (`*.agdai`) and `*.agda-lib` files to the output directory.
The default install phase copies Agda source files, Agda interface files (`*.agdai`) and `*.agda-lib` files to the output directory.
This can be overridden.

By default, agda sources are files ending on `.agda`, or literate agda files ending on `.lagda`, `.lagda.tex`, `.lagda.org`, `.lagda.md`, `.lagda.rst`. The list of recognised agda source extensions can be extended by setting the `extraExtensions` config variable.
By default, Agda sources are files ending on `.agda`, or literate Agda files ending on `.lagda`, `.lagda.tex`, `.lagda.org`, `.lagda.md`, `.lagda.rst`. The list of recognised Agda source extensions can be extended by setting the `extraExtensions` config variable.

## Adding Agda packages to Nixpkgs

To add an agda package to `nixpkgs`, the derivation should be written to `pkgs/development/libraries/agda/${library-name}/` and an entry should be added to `pkgs/top-level/agda-packages.nix`. Here it is called in a scope with access to all other agda libraries, so the top line of the `default.nix` can look like:
To add an Agda package to `nixpkgs`, the derivation should be written to `pkgs/development/libraries/agda/${library-name}/` and an entry should be added to `pkgs/top-level/agda-packages.nix`. Here it is called in a scope with access to all other Agda libraries, so the top line of the `default.nix` can look like:
```
{ mkDerivation, standard-library, fetchFromGitHub }:
```
Expand All @@ -103,4 +108,4 @@ mkDerivation {
```
This library has a file called `.agda-lib`, and so we give an empty string to `libraryFile` as nothing precedes `.agda-lib` in the filename. This file contains `name: IAL-1.3`, and so we let `libraryName = "IAL-1.3"`. This library does not use an `Everything.agda` file and instead has a Makefile, so there is no need to set `everythingFile` and we set a custom `buildPhase`.

When writing an agda package it is essential to make sure that no `.agda-lib` file gets added to the store as a single file (for example by using `writeText`). This causes agda to think that the nix store is a agda library and it will attempt to write to it whenever it typechecks something. See [https://github.com/agda/agda/issues/4613](https://github.com/agda/agda/issues/4613).
When writing an Agda package it is essential to make sure that no `.agda-lib` file gets added to the store as a single file (for example by using `writeText`). This causes Agda to think that the nix store is a Agda library and it will attempt to write to it whenever it typechecks something. See [https://github.com/agda/agda/issues/4613](https://github.com/agda/agda/issues/4613).
4 changes: 2 additions & 2 deletions doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,8 @@ and in this case the `python38` interpreter is automatically used.

### Interpreters

Versions 2.7, 3.6, 3.7 and 3.8 of the CPython interpreter are available as
respectively `python27`, `python36`, `python37` and `python38`. The
Versions 2.7, 3.6, 3.7, 3.8 and 3.9 of the CPython interpreter are available as
respectively `python27`, `python36`, `python37`, `python38` and `python39`. The
aliases `python2` and `python3` correspond to respectively `python27` and
`python38`. The default interpreter, `python`, maps to `python2`. The PyPy
interpreters compatible with Python 2.7 and 3 are available as `pypy27` and
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
modules ++ [
{
system.nixos.versionSuffix =
".${final.substring 0 8 (self.lastModifiedDate or self.lastModified)}.${self.shortRev or "dirty"}";
".${final.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}.${self.shortRev or "dirty"}";
system.nixos.revision = final.mkIf (self ? rev) self.rev;

system.build = {
Expand Down
30 changes: 30 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,12 @@
githubId = 984691;
name = "Evan Danaher";
};
edcragg = {
email = "ed.cragg@eipi.xyz";
github = "nuxeh";
githubId = 1516017;
name = "Ed Cragg";
};
edef = {
email = "edef@edef.eu";
github = "edef1c";
Expand Down Expand Up @@ -4274,6 +4280,12 @@
githubId = 39434424;
name = "Felix Springer";
};
justinas = {
email = "justinas@justinas.org";
github = "justinas";
githubId = 662666;
name = "Justinas Stankevičius";
};
justinlovinger = {
email = "git@justinlovinger.com";
github = "JustinLovinger";
Expand Down Expand Up @@ -6243,6 +6255,12 @@
githubId = 40049608;
name = "Andy Chun";
};
norfair = {
email = "syd@cs-syd.eu";
github = "NorfairKing";
githubId = 3521180;
name = "Tom Sydney Kerckhove";
};
notthemessiah = {
email = "brian.cohen.88@gmail.com";
github = "notthemessiah";
Expand Down Expand Up @@ -6377,6 +6395,12 @@
githubId = 1538622;
name = "Michael Reilly";
};
onny = {
email = "onny@project-insanity.org";
github = "onny";
githubId = 757752;
name = "Jonas Heinrich";
};
OPNA2608 = {
email = "christoph.neidahl@gmail.com";
github = "OPNA2608";
Expand Down Expand Up @@ -9106,6 +9130,12 @@
githubId = 508305;
name = "Jaroslavas Pocepko";
};
vonfry = {
email = "nixos@vonfry.name";
github = "Vonfry";
githubId = 3413119;
name = "Vonfry";
};
vozz = {
email = "oliver.huntuk@gmail.com";
name = "Oliver Hunt";
Expand Down
51 changes: 13 additions & 38 deletions nixos/doc/manual/release-notes/rl-2009.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,29 +232,7 @@ GRANT ALL PRIVILEGES ON *.* TO 'mysql'@'localhost' WITH GRANT OPTION;
<filename>testing-python.nix</filename> respectively.
</para>
</listitem>
<listitem>
<para>
The Mediatomb service declares new options. It also adapts existing
options to make the configuration generation lazy. The existing option
<literal>customCfg</literal> (defaults to false), when enabled, stops
the service configuration generation completely. It then expects the
users to provide their own correct configuration at the right location
(whereas the configuration was generated and not used at all before).
The new option <literal>transcodingOption</literal> (defaults to no)
allows a generated configuration. It makes the mediatomb service pulls
the necessary runtime dependencies in the nix store (whereas it was
generated with hardcoded values before). The new option
<literal>mediaDirectories</literal> allows the users to declare autoscan
media directories from their nixos configuration:
<programlisting>
services.mediatomb.mediaDirectories = [
{ path = "/var/lib/mediatomb/pictures"; recursive = false; hidden-files = false; }
{ path = "/var/lib/mediatomb/audio"; recursive = true; hidden-files = false; }
];
</programlisting>
</para>
</listitem>
</itemizedlist>
</itemizedlist>
</section>

<section xmlns="http://docbook.org/ns/docbook"
Expand Down Expand Up @@ -871,6 +849,13 @@ CREATE ROLE postgres LOGIN SUPERUSER;
functionally redundent.
</para>
</listitem>
<listitem>
<para>
The <literal>hardware.nvidia.optimus_prime.enable</literal> service has been renamed to
<literal>hardware.nvidia.prime.sync.enable</literal> and has many new enhancements.
Related nvidia prime settings may have also changed.
</para>
</listitem>
<listitem>
<para>
The package <package>nextcloud17</package> has been removed and <package>nextcloud18</package> was marked as insecure
Expand All @@ -897,21 +882,11 @@ CREATE ROLE postgres LOGIN SUPERUSER;
</para>
</listitem>
<listitem>
<para>
The mediatomb service is now using the new and maintained <literal>gerbera</literal>
<literal>gerbera</literal> fork instead of the unmaintained
<literal>mediatomb</literal> package. If you want to keep the old
behavior, you must declare it with:
<programlisting>
services.mediatomb.package = pkgs.mediatomb;
</programlisting>
One new option <literal>openFirewall</literal> has been introduced which
defaults to false. If you relied on the service declaration to add the
firewall rules itself before, you should now declare it with:
<programlisting>
services.mediatomb.openFirewall = true;
</programlisting>
</para>
<para>
The GNOME desktop manager no longer default installs <package>gnome3.epiphany</package>.
It was chosen to do this as it has a usability breaking issue (see issue <link xlink:href="https://github.com/NixOS/nixpkgs/issues/98819">#98819</link>)
that makes it unsuitable to be a default app.
</para>
</listitem>
</itemizedlist>
</section>
Expand Down
11 changes: 11 additions & 0 deletions nixos/doc/manual/release-notes/rl-2103.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@
for consistency with other X11 resources.
</para>
</listitem>
<listitem>
<para>
A number of options have been renamed in the kicad interface. <literal>oceSupport</literal>
has been renamed to <literal>withOCE</literal>, <literal>withOCCT</literal> has been renamed
to <literal>withOCC</literal>, <literal>ngspiceSupport</literal> has been renamed to
<literal>withNgspice</literal>, and <literal>scriptingSupport</literal> has been renamed to
<literal>withScripting</literal>. Additionally, <literal>kicad/base.nix</literal> no longer
provides default argument values since these are provided by
<literal>kicad/default.nix</literal>.
</para>
</listitem>
</itemizedlist>
</section>

Expand Down
2 changes: 2 additions & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@
./services/misc/dysnomia.nix
./services/misc/disnix.nix
./services/misc/docker-registry.nix
./services/misc/domoticz.nix
./services/misc/errbot.nix
./services/misc/etcd.nix
./services/misc/ethminer.nix
Expand All @@ -466,6 +467,7 @@
./services/misc/irkerd.nix
./services/misc/jackett.nix
./services/misc/jellyfin.nix
./services/misc/klipper.nix
./services/misc/logkeys.nix
./services/misc/leaps.nix
./services/misc/lidarr.nix
Expand Down
5 changes: 4 additions & 1 deletion nixos/modules/security/acme.nix
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,22 @@ let
"--email" data.email
"--key-type" data.keyType
] ++ protocolOpts
++ optionals data.ocspMustStaple [ "--must-staple" ]
++ optionals (acmeServer != null) [ "--server" acmeServer ]
++ concatMap (name: [ "-d" name ]) extraDomains
++ data.extraLegoFlags;

# Although --must-staple is common to both modes, it is not declared as a
# mode-agnostic argument in lego and thus must come after the mode.
runOpts = escapeShellArgs (
commonOpts
++ [ "run" ]
++ optionals data.ocspMustStaple [ "--must-staple" ]
++ data.extraLegoRunFlags
);
renewOpts = escapeShellArgs (
commonOpts
++ [ "renew" "--reuse-key" ]
++ optionals data.ocspMustStaple [ "--must-staple" ]
++ data.extraLegoRenewFlags
);

Expand Down
51 changes: 51 additions & 0 deletions nixos/modules/services/misc/domoticz.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{ lib, pkgs, config, ... }:

with lib;

let

cfg = config.services.domoticz;
pkgDesc = "Domoticz home automation";

in {

options = {

services.domoticz = {
enable = mkEnableOption pkgDesc;

bind = mkOption {
type = types.str;
default = "0.0.0.0";
description = "IP address to bind to.";
};

port = mkOption {
type = types.int;
default = 8080;
description = "Port to bind to for HTTP, set to 0 to disable HTTP.";
};

};

};

config = mkIf cfg.enable {

systemd.services."domoticz" = {
description = pkgDesc;
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
serviceConfig = {
DynamicUser = true;
StateDirectory = "domoticz";
Restart = "always";
ExecStart = ''
${pkgs.domoticz}/bin/domoticz -noupdates -www ${toString cfg.port} -wwwbind ${cfg.bind} -sslwww 0 -userdata /var/lib/domoticz -approot ${pkgs.domoticz}/share/domoticz/ -pidfile /var/run/domoticz.pid
'';
};
};

};

}

0 comments on commit 9e1943e

Please sign in to comment.