Project import generated by Copybara.

GitOrigin-RevId: 266dc8c3d052f549826ba246d06787a219533b8f
This commit is contained in:
Default email 2021-03-15 09:37:03 +01:00
parent 04a7792ad1
commit 8ec1fd4587
412 changed files with 10296 additions and 8598 deletions

View file

@ -18,7 +18,7 @@ stdenv.mkDerivation {
The main difference between `fetchurl` and `fetchzip` is in how they store the contents. `fetchurl` will store the unaltered contents of the URL within the Nix store. `fetchzip` on the other hand will decompress the archive for you, making files and directories directly accessible in the future. `fetchzip` can only be used with archives. Despite the name, `fetchzip` is not limited to .zip files and can also be used with any tarball. The main difference between `fetchurl` and `fetchzip` is in how they store the contents. `fetchurl` will store the unaltered contents of the URL within the Nix store. `fetchzip` on the other hand will decompress the archive for you, making files and directories directly accessible in the future. `fetchzip` can only be used with archives. Despite the name, `fetchzip` is not limited to .zip files and can also be used with any tarball.
`fetchpatch` works very similarly to `fetchurl` with the same arguments expected. It expects patch files as a source and and performs normalization on them before computing the checksum. For example it will remove comments or other unstable parts that are sometimes added by version control systems and can change over time. `fetchpatch` works very similarly to `fetchurl` with the same arguments expected. It expects patch files as a source and performs normalization on them before computing the checksum. For example it will remove comments or other unstable parts that are sometimes added by version control systems and can change over time.
Other fetcher functions allow you to add source code directly from a VCS such as subversion or git. These are mostly straightforward nambes based on the name of the command used with the VCS system. Because they give you a working repository, they act most like `fetchzip`. Other fetcher functions allow you to add source code directly from a VCS such as subversion or git. These are mostly straightforward nambes based on the name of the command used with the VCS system. Because they give you a working repository, they act most like `fetchzip`.

View file

@ -16,7 +16,7 @@
</para> </para>
<para> <para>
The <parameter>base</parameter> should not be be specified, as <function>makeSnap</function> will force set it. The <parameter>base</parameter> should not be specified, as <function>makeSnap</function> will force set it.
</para> </para>
<para> <para>

View file

@ -80,7 +80,7 @@ Most of the function arguments have reasonable default settings.
You can specify license names: You can specify license names:
* `extraLicenses` is a list of of license names. * `extraLicenses` is a list of license names.
You can get these names from repo.json or `querypackages.sh licenses`. The SDK You can get these names from repo.json or `querypackages.sh licenses`. The SDK
license (`android-sdk-license`) is accepted for you if you set accept_license license (`android-sdk-license`) is accepted for you if you set accept_license
to true. If you are doing something like working with preview SDKs, you will to true. If you are doing something like working with preview SDKs, you will

View file

@ -64,7 +64,7 @@ $ dotnet --info
The `dotnetCorePackages.sdk_X_Y` is preferred over the old dotnet-sdk as both major and minor version are very important for a dotnet environment. If a given minor version isn't present (or was changed), then this will likely break your ability to build a project. The `dotnetCorePackages.sdk_X_Y` is preferred over the old dotnet-sdk as both major and minor version are very important for a dotnet environment. If a given minor version isn't present (or was changed), then this will likely break your ability to build a project.
## dotnetCorePackages.sdk vs vs dotnetCorePackages.net vs dotnetCorePackages.netcore vs dotnetCorePackages.aspnetcore ## dotnetCorePackages.sdk vs dotnetCorePackages.net vs dotnetCorePackages.netcore vs dotnetCorePackages.aspnetcore
The `dotnetCorePackages.sdk` contains both a runtime and the full sdk of a given version. The `net`, `netcore` and `aspnetcore` packages are meant to serve as minimal runtimes to deploy alongside already built applications. For runtime versions >= .NET 5 `net` is used while `netcore` is used for older .NET Core runtime version. The `dotnetCorePackages.sdk` contains both a runtime and the full sdk of a given version. The `net`, `netcore` and `aspnetcore` packages are meant to serve as minimal runtimes to deploy alongside already built applications. For runtime versions >= .NET 5 `net` is used while `netcore` is used for older .NET Core runtime version.

View file

@ -50,7 +50,7 @@ and install it in your profile with
```shell ```shell
nix-env -iA nixpkgs.myLuaEnv nix-env -iA nixpkgs.myLuaEnv
``` ```
The environment is is installed by referring to the attribute, and considering The environment is installed by referring to the attribute, and considering
the `nixpkgs` channel was used. the `nixpkgs` channel was used.
#### Lua environment defined in `/etc/nixos/configuration.nix` #### Lua environment defined in `/etc/nixos/configuration.nix`
@ -129,7 +129,7 @@ the whitelist maintainers/scripts/luarocks-packages.csv and updated by running m
[luarocks2nix](https://github.com/nix-community/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock). [luarocks2nix](https://github.com/nix-community/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock).
The automation only goes so far though and some packages need to be customized. The automation only goes so far though and some packages need to be customized.
These customizations go in `pkgs/development/lua-modules/overrides.nix`. These customizations go in `pkgs/development/lua-modules/overrides.nix`.
For instance if the rockspec defines `external_dependencies`, these need to be manually added in in its rockspec file then it won't work. For instance if the rockspec defines `external_dependencies`, these need to be manually added in its rockspec file then it won't work.
You can try converting luarocks packages to nix packages with the command `nix-shell -p luarocks-nix` and then `luarocks nix PKG_NAME`. You can try converting luarocks packages to nix packages with the command `nix-shell -p luarocks-nix` and then `luarocks nix PKG_NAME`.
Nix rely on luarocks to install lua packages, basically it runs: Nix rely on luarocks to install lua packages, basically it runs:

View file

@ -334,7 +334,7 @@ Above, we were mostly just focused on use cases and what to do to get started
creating working Python environments in nix. creating working Python environments in nix.
Now that you know the basics to be up and running, it is time to take a step Now that you know the basics to be up and running, it is time to take a step
back and take a deeper look at at how Python packages are packaged on Nix. Then, back and take a deeper look at how Python packages are packaged on Nix. Then,
we will look at how you can use development mode with your code. we will look at how you can use development mode with your code.
#### Python library packages in Nixpkgs #### Python library packages in Nixpkgs
@ -918,7 +918,7 @@ because their behaviour is different:
* `nativeBuildInputs ? []`: Build-time only dependencies. Typically executables * `nativeBuildInputs ? []`: Build-time only dependencies. Typically executables
as well as the items listed in `setup_requires`. as well as the items listed in `setup_requires`.
* `buildInputs ? []`: Build and/or run-time dependencies that need to be be * `buildInputs ? []`: Build and/or run-time dependencies that need to be
compiled for the host machine. Typically non-Python libraries which are being compiled for the host machine. Typically non-Python libraries which are being
linked. linked.
* `checkInputs ? []`: Dependencies needed for running the `checkPhase`. These * `checkInputs ? []`: Dependencies needed for running the `checkPhase`. These

View file

@ -229,7 +229,7 @@ end
If you want to package a specific version, you can use the standard Gemfile syntax for that, e.g. `gem 'mdl', '0.5.0'`, but if you want the latest stable version anyway, it's easier to update by simply running the `bundle lock` and `bundix` steps again. If you want to package a specific version, you can use the standard Gemfile syntax for that, e.g. `gem 'mdl', '0.5.0'`, but if you want the latest stable version anyway, it's easier to update by simply running the `bundle lock` and `bundix` steps again.
Now you can also also make a `default.nix` that looks like this: Now you can also make a `default.nix` that looks like this:
```nix ```nix
{ bundlerApp }: { bundlerApp }:

View file

@ -737,7 +737,7 @@ with import "${src.out}/rust-overlay.nix" pkgs pkgs;
stdenv.mkDerivation { stdenv.mkDerivation {
name = "rust-env"; name = "rust-env";
buildInputs = [ buildInputs = [
# Note: to use use stable, just replace `nightly` with `stable` # Note: to use stable, just replace `nightly` with `stable`
latest.rustChannels.nightly.rust latest.rustChannels.nightly.rust
# Add some extra dependencies from `pkgs` # Add some extra dependencies from `pkgs`

View file

@ -15,9 +15,9 @@
</part> </part>
<part> <part>
<title>Standard environment</title> <title>Standard environment</title>
<xi:include href="stdenv/stdenv.xml" /> <xi:include href="stdenv/stdenv.chapter.xml" />
<xi:include href="stdenv/meta.xml" /> <xi:include href="stdenv/meta.chapter.xml" />
<xi:include href="stdenv/multiple-output.xml" /> <xi:include href="stdenv/multiple-output.chapter.xml" />
<xi:include href="stdenv/cross-compilation.chapter.xml" /> <xi:include href="stdenv/cross-compilation.chapter.xml" />
<xi:include href="stdenv/platform-notes.chapter.xml" /> <xi:include href="stdenv/platform-notes.chapter.xml" />
</part> </part>

View file

@ -0,0 +1,194 @@
# Meta-attributes {#chap-meta}
Nix packages can declare *meta-attributes* that contain information about a package such as a description, its homepage, its license, and so on. For instance, the GNU Hello package has a `meta` declaration like this:
```nix
meta = with lib; {
description = "A program that produces a familiar, friendly greeting";
longDescription = ''
GNU Hello is a program that prints "Hello, world!" when you run it.
It is fully customizable.
'';
homepage = "https://www.gnu.org/software/hello/manual/";
license = licenses.gpl3Plus;
maintainers = [ maintainers.eelco ];
platforms = platforms.all;
};
```
Meta-attributes are not passed to the builder of the package. Thus, a change to a meta-attribute doesnt trigger a recompilation of the package. The value of a meta-attribute must be a string.
The meta-attributes of a package can be queried from the command-line using `nix-env`:
```ShellSession
$ nix-env -qa hello --json
{
"hello": {
"meta": {
"description": "A program that produces a familiar, friendly greeting",
"homepage": "https://www.gnu.org/software/hello/manual/",
"license": {
"fullName": "GNU General Public License version 3 or later",
"shortName": "GPLv3+",
"url": "http://www.fsf.org/licensing/licenses/gpl.html"
},
"longDescription": "GNU Hello is a program that prints \"Hello, world!\" when you run it.\nIt is fully customizable.\n",
"maintainers": [
"Ludovic Court\u00e8s <ludo@gnu.org>"
],
"platforms": [
"i686-linux",
"x86_64-linux",
"armv5tel-linux",
"armv7l-linux",
"mips32-linux",
"x86_64-darwin",
"i686-cygwin",
"i686-freebsd",
"x86_64-freebsd",
"i686-openbsd",
"x86_64-openbsd"
],
"position": "/home/user/dev/nixpkgs/pkgs/applications/misc/hello/default.nix:14"
},
"name": "hello-2.9",
"system": "x86_64-linux"
}
}
```
`nix-env` knows about the `description` field specifically:
```ShellSession
$ nix-env -qa hello --description
hello-2.3 A program that produces a familiar, friendly greeting
```
## Standard meta-attributes {#sec-standard-meta-attributes}
It is expected that each meta-attribute is one of the following:
### `description` {#var-meta-description}
A short (one-line) description of the package. This is shown by `nix-env -q --description` and also on the Nixpkgs release pages.
Dont include a period at the end. Dont include newline characters. Capitalise the first character. For brevity, dont repeat the name of package --- just describe what it does.
Wrong: `"libpng is a library that allows you to decode PNG images."`
Right: `"A library for decoding PNG images"`
### `longDescription` {#var-meta-longDescription}
An arbitrarily long description of the package.
### `branch` {#var-meta-branch}
Release branch. Used to specify that a package is not going to receive updates that are not in this branch; for example, Linux kernel 3.0 is supposed to be updated to 3.0.X, not 3.1.
### `homepage` {#var-meta-homepage}
The packages homepage. Example: `https://www.gnu.org/software/hello/manual/`
### `downloadPage` {#var-meta-downloadPage}
The page where a link to the current version can be found. Example: `https://ftp.gnu.org/gnu/hello/`
### `changelog` {#var-meta-changelog}
A link or a list of links to the location of Changelog for a package. A link may use expansion to refer to the correct changelog version. Example: `"https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}"`
### `license` {#var-meta-license}
The license, or licenses, for the package. One from the attribute set defined in [`nixpkgs/lib/licenses.nix`](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix). At this moment using both a list of licenses and a single license is valid. If the license field is in the form of a list representation, then it means that parts of the package are licensed differently. Each license should preferably be referenced by their attribute. The non-list attribute value can also be a space delimited string representation of the contained attribute `shortNames` or `spdxIds`. The following are all valid examples:
- Single license referenced by attribute (preferred) `lib.licenses.gpl3Only`.
- Single license referenced by its attribute shortName (frowned upon) `"gpl3Only"`.
- Single license referenced by its attribute spdxId (frowned upon) `"GPL-3.0-only"`.
- Multiple licenses referenced by attribute (preferred) `with lib.licenses; [ asl20 free ofl ]`.
- Multiple licenses referenced as a space delimited string of attribute shortNames (frowned upon) `"asl20 free ofl"`.
For details, see [Licenses](#sec-meta-license).
### `maintainers` {#var-meta-maintainers}
A list of the maintainers of this Nix expression. Maintainers are defined in [`nixpkgs/maintainers/maintainer-list.nix`](https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix). There is no restriction to becoming a maintainer, just add yourself to that list in a separate commit titled “maintainers: add alice”, and reference maintainers with `maintainers = with lib.maintainers; [ alice bob ]`.
### `priority` {#var-meta-priority}
The *priority* of the package, used by `nix-env` to resolve file name conflicts between packages. See the Nix manual page for `nix-env` for details. Example: `"10"` (a low-priority package).
### `platforms` {#var-meta-platforms}
The list of Nix platform types on which the package is supported. Hydra builds packages according to the platform specified. If no platform is specified, the package does not have prebuilt binaries. An example is:
```nix
meta.platforms = lib.platforms.linux;
```
Attribute Set `lib.platforms` defines [various common lists](https://github.com/NixOS/nixpkgs/blob/master/lib/systems/doubles.nix) of platforms types.
### `tests` {#var-meta-tests}
::: warning
This attribute is special in that it is not actually under the `meta` attribute set but rather under the `passthru` attribute set. This is due to how `meta` attributes work, and the fact that they are supposed to contain only metadata, not derivations.
:::
An attribute set with as values tests. A test is a derivation, which builds successfully when the test passes, and fails to build otherwise. A derivation that is a test needs to have `meta.timeout` defined.
The NixOS tests are available as `nixosTests` in parameters of derivations. For instance, the OpenSMTPD derivation includes lines similar to:
```nix
{ /* ... */, nixosTests }:
{
# ...
passthru.tests = {
basic-functionality-and-dovecot-integration = nixosTests.opensmtpd;
};
}
```
### `timeout` {#var-meta-timeout}
A timeout (in seconds) for building the derivation. If the derivation takes longer than this time to build, it can fail due to breaking the timeout. However, all computers do not have the same computing power, hence some builders may decide to apply a multiplicative factor to this value. When filling this value in, try to keep it approximately consistent with other values already present in `nixpkgs`.
### `hydraPlatforms` {#var-meta-hydraPlatforms}
The list of Nix platform types for which the Hydra instance at `hydra.nixos.org` will build the package. (Hydra is the Nix-based continuous build system.) It defaults to the value of `meta.platforms`. Thus, the only reason to set `meta.hydraPlatforms` is if you want `hydra.nixos.org` to build the package on a subset of `meta.platforms`, or not at all, e.g.
```nix
meta.platforms = lib.platforms.linux;
meta.hydraPlatforms = [];
```
### `broken` {#var-meta-broken}
If set to `true`, the package is marked as "broken", meaning that it wont show up in `nix-env -qa`, and cannot be built or installed. Such packages should be removed from Nixpkgs eventually unless they are fixed.
### `updateWalker` {#var-meta-updateWalker}
If set to `true`, the package is tested to be updated correctly by the `update-walker.sh` script without additional settings. Such packages have `meta.version` set and their homepage (or the page specified by `meta.downloadPage`) contains a direct link to the package tarball.
## Licenses {#sec-meta-license}
The `meta.license` attribute should preferably contain a value from `lib.licenses` defined in [`nixpkgs/lib/licenses.nix`](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix), or in-place license description of the same format if the license is unlikely to be useful in another expression.
Although its typically better to indicate the specific license, a few generic options are available:
### `lib.licenses.free`, `"free"`
Catch-all for free software licenses not listed above.
### `lib.licenses.unfreeRedistributable`, `"unfree-redistributable"`
Unfree package that can be redistributed in binary form. That is, its legal to redistribute the *output* of the derivation. This means that the package can be included in the Nixpkgs channel.
Sometimes proprietary software can only be redistributed unmodified. Make sure the builder doesnt actually modify the original binaries; otherwise were breaking the license. For instance, the NVIDIA X11 drivers can be redistributed unmodified, but our builder applies `patchelf` to make them work. Thus, its license is `"unfree"` and it cannot be included in the Nixpkgs channel.
### `lib.licenses.unfree`, `"unfree"`
Unfree package that cannot be redistributed. You can build it yourself, but you cannot redistribute the output of the derivation. Thus it cannot be included in the Nixpkgs channel.
### `lib.licenses.unfreeRedistributableFirmware`, `"unfree-redistributable-firmware"`
This package supplies unfree, redistributable firmware. This is a separate value from `unfree-redistributable` because not everybody cares whether firmware is free.

View file

@ -1,349 +0,0 @@
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="chap-meta">
<title>Meta-attributes</title>
<para>
Nix packages can declare <emphasis>meta-attributes</emphasis> that contain information about a package such as a description, its homepage, its license, and so on. For instance, the GNU Hello package has a <varname>meta</varname> declaration like this:
<programlisting>
meta = with lib; {
description = "A program that produces a familiar, friendly greeting";
longDescription = ''
GNU Hello is a program that prints "Hello, world!" when you run it.
It is fully customizable.
'';
homepage = "https://www.gnu.org/software/hello/manual/";
license = licenses.gpl3Plus;
maintainers = [ maintainers.eelco ];
platforms = platforms.all;
};
</programlisting>
</para>
<para>
Meta-attributes are not passed to the builder of the package. Thus, a change to a meta-attribute doesnt trigger a recompilation of the package. The value of a meta-attribute must be a string.
</para>
<para>
The meta-attributes of a package can be queried from the command-line using <command>nix-env</command>:
<screen>
<prompt>$ </prompt>nix-env -qa hello --json
{
"hello": {
"meta": {
"description": "A program that produces a familiar, friendly greeting",
"homepage": "https://www.gnu.org/software/hello/manual/",
"license": {
"fullName": "GNU General Public License version 3 or later",
"shortName": "GPLv3+",
"url": "http://www.fsf.org/licensing/licenses/gpl.html"
},
"longDescription": "GNU Hello is a program that prints \"Hello, world!\" when you run it.\nIt is fully customizable.\n",
"maintainers": [
"Ludovic Court\u00e8s &lt;ludo@gnu.org>"
],
"platforms": [
"i686-linux",
"x86_64-linux",
"armv5tel-linux",
"armv7l-linux",
"mips32-linux",
"x86_64-darwin",
"i686-cygwin",
"i686-freebsd",
"x86_64-freebsd",
"i686-openbsd",
"x86_64-openbsd"
],
"position": "/home/user/dev/nixpkgs/pkgs/applications/misc/hello/default.nix:14"
},
"name": "hello-2.9",
"system": "x86_64-linux"
}
}
</screen>
<command>nix-env</command> knows about the <varname>description</varname> field specifically:
<screen>
<prompt>$ </prompt>nix-env -qa hello --description
hello-2.3 A program that produces a familiar, friendly greeting
</screen>
</para>
<section xml:id="sec-standard-meta-attributes">
<title>Standard meta-attributes</title>
<para>
It is expected that each meta-attribute is one of the following:
</para>
<variablelist>
<varlistentry xml:id="var-meta-description">
<term>
<varname>description</varname>
</term>
<listitem>
<para>
A short (one-line) description of the package. This is shown by <command>nix-env -q --description</command> and also on the Nixpkgs release pages.
</para>
<para>
Dont include a period at the end. Dont include newline characters. Capitalise the first character. For brevity, dont repeat the name of package — just describe what it does.
</para>
<para>
Wrong: <literal>"libpng is a library that allows you to decode PNG images."</literal>
</para>
<para>
Right: <literal>"A library for decoding PNG images"</literal>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-longDescription">
<term>
<varname>longDescription</varname>
</term>
<listitem>
<para>
An arbitrarily long description of the package.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-branch">
<term>
<varname>branch</varname>
</term>
<listitem>
<para>
Release branch. Used to specify that a package is not going to receive updates that are not in this branch; for example, Linux kernel 3.0 is supposed to be updated to 3.0.X, not 3.1.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-homepage">
<term>
<varname>homepage</varname>
</term>
<listitem>
<para>
The packages homepage. Example: <literal>https://www.gnu.org/software/hello/manual/</literal>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-downloadPage">
<term>
<varname>downloadPage</varname>
</term>
<listitem>
<para>
The page where a link to the current version can be found. Example: <literal>https://ftp.gnu.org/gnu/hello/</literal>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-changelog">
<term>
<varname>changelog</varname>
</term>
<listitem>
<para>
A link or a list of links to the location of Changelog for a package. A link may use expansion to refer to the correct changelog version. Example: <literal>"https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}"</literal>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-license">
<term>
<varname>license</varname>
</term>
<listitem>
<para>
The license, or licenses, for the package. One from the attribute set defined in <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix"> <filename>nixpkgs/lib/licenses.nix</filename></link>. At this moment using both a list of licenses and a single license is valid. If the license field is in the form of a list representation, then it means that parts of the package are licensed differently. Each license should preferably be referenced by their attribute. The non-list attribute value can also be a space delimited string representation of the contained attribute shortNames or spdxIds. The following are all valid examples:
<itemizedlist>
<listitem>
<para>
Single license referenced by attribute (preferred) <literal>lib.licenses.gpl3Only</literal>.
</para>
</listitem>
<listitem>
<para>
Single license referenced by its attribute shortName (frowned upon) <literal>"gpl3Only"</literal>.
</para>
</listitem>
<listitem>
<para>
Single license referenced by its attribute spdxId (frowned upon) <literal>"GPL-3.0-only"</literal>.
</para>
</listitem>
<listitem>
<para>
Multiple licenses referenced by attribute (preferred) <literal>with lib.licenses; [ asl20 free ofl ]</literal>.
</para>
</listitem>
<listitem>
<para>
Multiple licenses referenced as a space delimited string of attribute shortNames (frowned upon) <literal>"asl20 free ofl"</literal>.
</para>
</listitem>
</itemizedlist>
For details, see <xref linkend='sec-meta-license'/>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-maintainers">
<term>
<varname>maintainers</varname>
</term>
<listitem>
<para>
A list of the maintainers of this Nix expression. Maintainers are defined in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix"><filename>nixpkgs/maintainers/maintainer-list.nix</filename></link>. There is no restriction to becoming a maintainer, just add yourself to that list in a separate commit titled 'maintainers: add alice', and reference maintainers with <literal>maintainers = with lib.maintainers; [ alice bob ]</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-priority">
<term>
<varname>priority</varname>
</term>
<listitem>
<para>
The <emphasis>priority</emphasis> of the package, used by <command>nix-env</command> to resolve file name conflicts between packages. See the Nix manual page for <command>nix-env</command> for details. Example: <literal>"10"</literal> (a low-priority package).
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-platforms">
<term>
<varname>platforms</varname>
</term>
<listitem>
<para>
The list of Nix platform types on which the package is supported. Hydra builds packages according to the platform specified. If no platform is specified, the package does not have prebuilt binaries. An example is:
<programlisting>
meta.platforms = lib.platforms.linux;
</programlisting>
Attribute Set <varname>lib.platforms</varname> defines <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/systems/doubles.nix"> various common lists</link> of platforms types.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-tests">
<term>
<varname>tests</varname>
</term>
<listitem>
<warning>
<para>
This attribute is special in that it is not actually under the <literal>meta</literal> attribute set but rather under the <literal>passthru</literal> attribute set. This is due to how <literal>meta</literal> attributes work, and the fact that they are supposed to contain only metadata, not derivations.
</para>
</warning>
<para>
An attribute set with as values tests. A test is a derivation, which builds successfully when the test passes, and fails to build otherwise. A derivation that is a test needs to have <literal>meta.timeout</literal> defined.
</para>
<para>
The NixOS tests are available as <literal>nixosTests</literal> in parameters of derivations. For instance, the OpenSMTPD derivation includes lines similar to:
<programlisting>
{ /* ... */, nixosTests }:
{
# ...
passthru.tests = {
basic-functionality-and-dovecot-integration = nixosTests.opensmtpd;
};
}
</programlisting>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-timeout">
<term>
<varname>timeout</varname>
</term>
<listitem>
<para>
A timeout (in seconds) for building the derivation. If the derivation takes longer than this time to build, it can fail due to breaking the timeout. However, all computers do not have the same computing power, hence some builders may decide to apply a multiplicative factor to this value. When filling this value in, try to keep it approximately consistent with other values already present in <literal>nixpkgs</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-hydraPlatforms">
<term>
<varname>hydraPlatforms</varname>
</term>
<listitem>
<para>
The list of Nix platform types for which the Hydra instance at <literal>hydra.nixos.org</literal> will build the package. (Hydra is the Nix-based continuous build system.) It defaults to the value of <varname>meta.platforms</varname>. Thus, the only reason to set <varname>meta.hydraPlatforms</varname> is if you want <literal>hydra.nixos.org</literal> to build the package on a subset of <varname>meta.platforms</varname>, or not at all, e.g.
<programlisting>
meta.platforms = lib.platforms.linux;
meta.hydraPlatforms = [];
</programlisting>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-broken">
<term>
<varname>broken</varname>
</term>
<listitem>
<para>
If set to <literal>true</literal>, the package is marked as “broken”, meaning that it wont show up in <literal>nix-env -qa</literal>, and cannot be built or installed. Such packages should be removed from Nixpkgs eventually unless they are fixed.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="var-meta-updateWalker">
<term>
<varname>updateWalker</varname>
</term>
<listitem>
<para>
If set to <literal>true</literal>, the package is tested to be updated correctly by the <literal>update-walker.sh</literal> script without additional settings. Such packages have <varname>meta.version</varname> set and their homepage (or the page specified by <varname>meta.downloadPage</varname>) contains a direct link to the package tarball.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="sec-meta-license">
<title>Licenses</title>
<para>
The <varname>meta.license</varname> attribute should preferrably contain a value from <varname>lib.licenses</varname> defined in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix"> <filename>nixpkgs/lib/licenses.nix</filename></link>, or in-place license description of the same format if the license is unlikely to be useful in another expression.
</para>
<para>
Although it's typically better to indicate the specific license, a few generic options are available:
<variablelist>
<varlistentry>
<term>
<varname>lib.licenses.free</varname>, <varname>"free"</varname>
</term>
<listitem>
<para>
Catch-all for free software licenses not listed above.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>lib.licenses.unfreeRedistributable</varname>, <varname>"unfree-redistributable"</varname>
</term>
<listitem>
<para>
Unfree package that can be redistributed in binary form. That is, its legal to redistribute the <emphasis>output</emphasis> of the derivation. This means that the package can be included in the Nixpkgs channel.
</para>
<para>
Sometimes proprietary software can only be redistributed unmodified. Make sure the builder doesnt actually modify the original binaries; otherwise were breaking the license. For instance, the NVIDIA X11 drivers can be redistributed unmodified, but our builder applies <command>patchelf</command> to make them work. Thus, its license is <varname>"unfree"</varname> and it cannot be included in the Nixpkgs channel.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>lib.licenses.unfree</varname>, <varname>"unfree"</varname>
</term>
<listitem>
<para>
Unfree package that cannot be redistributed. You can build it yourself, but you cannot redistribute the output of the derivation. Thus it cannot be included in the Nixpkgs channel.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>lib.licenses.unfreeRedistributableFirmware</varname>, <varname>"unfree-redistributable-firmware"</varname>
</term>
<listitem>
<para>
This package supplies unfree, redistributable firmware. This is a separate value from <varname>unfree-redistributable</varname> because not everybody cares whether firmware is free.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>
</chapter>

View file

@ -0,0 +1,128 @@
# Multiple-output packages {#chap-multiple-output}
## Introduction {#sec-multiple-outputs-introduction}
The Nix language allows a derivation to produce multiple outputs, which is similar to what is utilized by other Linux distribution packaging systems. The outputs reside in separate Nix store paths, so they can be mostly handled independently of each other, including passing to build inputs, garbage collection or binary substitution. The exception is that building from source always produces all the outputs.
The main motivation is to save disk space by reducing runtime closure sizes; consequently also sizes of substituted binaries get reduced. Splitting can be used to have more granular runtime dependencies, for example the typical reduction is to split away development-only files, as those are typically not needed during runtime. As a result, closure sizes of many packages can get reduced to a half or even much less.
::: note
The reduction effects could be instead achieved by building the parts in completely separate derivations. That would often additionally reduce build-time closures, but it tends to be much harder to write such derivations, as build systems typically assume all parts are being built at once. This compromise approach of single source package producing multiple binary packages is also utilized often by rpm and deb.
:::
A number of attributes can be used to work with a derivation with multiple outputs. The attribute `outputs` is a list of strings, which are the names of the outputs. For each of these names, an identically named attribute is created, corresponding to that output. The attribute `meta.outputsToInstall` is used to determine the default set of outputs to install when using the derivation name unqualified.
## Installing a split package {#sec-multiple-outputs-installing}
When installing a package with multiple outputs, the packages `meta.outputsToInstall` attribute determines which outputs are actually installed. `meta.outputsToInstall` is a list whose [default installs binaries and the associated man pages](https://github.com/NixOS/nixpkgs/blob/f1680774340d5443a1409c3421ced84ac1163ba9/pkgs/stdenv/generic/make-derivation.nix#L310-L320). The following sections describe ways to install different outputs.
### Selecting outputs to install via NixOS {#sec-multiple-outputs-installing-nixos}
NixOS provides two ways to select the outputs to install for packages listed in `environment.systemPackages`:
- The configuration option `environment.extraOutputsToInstall` is appended to each packages `meta.outputsToInstall` attribute to determine the outputs to install. It can for example be used to install `info` documentation or debug symbols for all packages.
- The outputs can be listed as packages in `environment.systemPackages`. For example, the `"out"` and `"info"` outputs for the `coreutils` package can be installed by including `coreutils` and `coreutils.info` in `environment.systemPackages`.
### Selecting outputs to install via `nix-env` {#sec-multiple-outputs-installing-nix-env}
`nix-env` lacks an easy way to select the outputs to install. When installing a package, `nix-env` always installs the outputs listed in `meta.outputsToInstall`, even when the user explicitly selects an output.
::: warning
`nix-env` silenty disregards the outputs selected by the user, and instead installs the outputs from `meta.outputsToInstall`. For example,
```ShellSession
$ nix-env -iA nixpkgs.coreutils.info
```
installs the `"out"` output (`coreutils.meta.outputsToInstall` is `[ "out" ]`) instead of the requested `"info"`.
:::
The only recourse to select an output with `nix-env` is to override the packages `meta.outputsToInstall`, using the functions described in <xref linkend="chap-overrides" />. For example, the following overlay adds the `"info"` output for the `coreutils` package:
```nix
self: super:
{
coreutils = super.coreutils.overrideAttrs (oldAttrs: {
meta = oldAttrs.meta // { outputsToInstall = oldAttrs.meta.outputsToInstall or [ "out" ] ++ [ "info" ]; };
});
}
```
## Using a split package {#sec-multiple-outputs-using-split-packages}
In the Nix language the individual outputs can be reached explicitly as attributes, e.g. `coreutils.info`, but the typical case is just using packages as build inputs.
When a multiple-output derivation gets into a build input of another derivation, the `dev` output is added if it exists, otherwise the first output is added. In addition to that, `propagatedBuildOutputs` of that package which by default contain `$outputBin` and `$outputLib` are also added. (See <xref linkend="multiple-output-file-type-groups" />.)
In some cases it may be desirable to combine different outputs under a single store path. A function `symlinkJoin` can be used to do this. (Note that it may negate some closure size benefits of using a multiple-output package.)
## Writing a split derivation {#sec-multiple-outputs-}
Here you find how to write a derivation that produces multiple outputs.
In nixpkgs there is a framework supporting multiple-output derivations. It tries to cover most cases by default behavior. You can find the source separated in `<nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh>`; its relatively well-readable. The whole machinery is triggered by defining the `outputs` attribute to contain the list of desired output names (strings).
```nix
outputs = [ "bin" "dev" "out" "doc" ];
```
Often such a single line is enough. For each output an equally named environment variable is passed to the builder and contains the path in nix store for that output. Typically you also want to have the main `out` output, as it catches any files that didnt get elsewhere.
::: note
There is a special handling of the `debug` output, described at <xref linkend="stdenv-separateDebugInfo" />.
:::
### “Binaries first” {#multiple-output-file-binaries-first-convention}
A commonly adopted convention in `nixpkgs` is that executables provided by the package are contained within its first output. This convention allows the dependent packages to reference the executables provided by packages in a uniform manner. For instance, provided with the knowledge that the `perl` package contains a `perl` executable it can be referenced as `${pkgs.perl}/bin/perl` within a Nix derivation that needs to execute a Perl script.
The `glibc` package is a deliberate single exception to the “binaries first” convention. The `glibc` has `libs` as its first output allowing the libraries provided by `glibc` to be referenced directly (e.g. `${stdenv.glibc}/lib/ld-linux-x86-64.so.2`). The executables provided by `glibc` can be accessed via its `bin` attribute (e.g. `${stdenv.glibc.bin}/bin/ldd`).
The reason for why `glibc` deviates from the convention is because referencing a library provided by `glibc` is a very common operation among Nix packages. For instance, third-party executables packaged by Nix are typically patched and relinked with the relevant version of `glibc` libraries from Nix packages (please see the documentation on [patchelf](https://github.com/NixOS/patchelf/blob/master/README) for more details).
### File type groups {#multiple-output-file-type-groups}
The support code currently recognizes some particular kinds of outputs and either instructs the build system of the package to put files into their desired outputs or it moves the files during the fixup phase. Each group of file types has an `outputFoo` variable specifying the output name where they should go. If that variable isnt defined by the derivation writer, it is guessed a default output name is defined, falling back to other possibilities if the output isnt defined.
#### ` $outputDev`
is for development-only files. These include C(++) headers (`include/`), pkg-config (`lib/pkgconfig/`), cmake (`lib/cmake/`) and aclocal files (`share/aclocal/`). They go to `dev` or `out` by default.
#### ` $outputBin`
is meant for user-facing binaries, typically residing in `bin/`. They go to `bin` or `out` by default.
#### ` $outputLib`
is meant for libraries, typically residing in `lib/` and `libexec/`. They go to `lib` or `out` by default.
#### ` $outputDoc`
is for user documentation, typically residing in `share/doc/`. It goes to `doc` or `out` by default.
#### ` $outputDevdoc`
is for _developer_ documentation. Currently we count gtk-doc and devhelp books, typically residing in `share/gtk-doc/` and `share/devhelp/`, in there. It goes to `devdoc` or is removed (!) by default. This is because e.g. gtk-doc tends to be rather large and completely unused by nixpkgs users.
#### ` $outputMan`
is for man pages (except for section 3), typically residing in `share/man/man[0-9]/`. They go to `man` or `$outputBin` by default.
#### ` $outputDevman`
is for section 3 man pages, typically residing in `share/man/man[0-9]/`. They go to `devman` or `$outputMan` by default.
#### ` $outputInfo`
is for info pages, typically residing in `share/info/`. They go to `info` or `$outputBin` by default.
### Common caveats {#sec-multiple-outputs-caveats}
- Some configure scripts dont like some of the parameters passed by default by the framework, e.g. `--docdir=/foo/bar`. You can disable this by setting `setOutputFlags = false;`.
- The outputs of a single derivation can retain references to each other, but note that circular references are not allowed. (And each strongly-connected component would act as a single output anyway.)
- Most of split packages contain their core functionality in libraries. These libraries tend to refer to various kind of data that typically gets into `out`, e.g. locale strings, so there is often no advantage in separating the libraries into `lib`, as keeping them in `out` is easier.
- Some packages have hidden assumptions on install paths, which complicates splitting.

View file

@ -1,261 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter [
<!ENTITY ndash "&#x2013;"> <!-- @vcunat likes to use this one ;-) -->
]>
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="chap-multiple-output">
<title>Multiple-output packages</title>
<section xml:id="sec-multiple-outputs-introduction">
<title>Introduction</title>
<para>
The Nix language allows a derivation to produce multiple outputs, which is similar to what is utilized by other Linux distribution packaging systems. The outputs reside in separate Nix store paths, so they can be mostly handled independently of each other, including passing to build inputs, garbage collection or binary substitution. The exception is that building from source always produces all the outputs.
</para>
<para>
The main motivation is to save disk space by reducing runtime closure sizes; consequently also sizes of substituted binaries get reduced. Splitting can be used to have more granular runtime dependencies, for example the typical reduction is to split away development-only files, as those are typically not needed during runtime. As a result, closure sizes of many packages can get reduced to a half or even much less.
</para>
<note>
<para>
The reduction effects could be instead achieved by building the parts in completely separate derivations. That would often additionally reduce build-time closures, but it tends to be much harder to write such derivations, as build systems typically assume all parts are being built at once. This compromise approach of single source package producing multiple binary packages is also utilized often by rpm and deb.
</para>
</note>
<para>
A number of attributes can be used to work with a derivation with multiple outputs. The attribute <varname>outputs</varname> is a list of strings, which are the names of the outputs. For each of these names, an identically named attribute is created, corresponding to that output. The attribute <varname>meta.outputsToInstall</varname> is used to determine the default set of outputs to install when using the derivation name unqualified.
</para>
</section>
<section xml:id="sec-multiple-outputs-installing">
<title>Installing a split package</title>
<para>
When installing a package with multiple outputs, the package's <varname>meta.outputsToInstall</varname> attribute determines which outputs are actually installed. <varname>meta.outputsToInstall</varname> is a list whose <link xlink:href="https://github.com/NixOS/nixpkgs/blob/f1680774340d5443a1409c3421ced84ac1163ba9/pkgs/stdenv/generic/make-derivation.nix#L310-L320">default installs binaries and the associated man pages</link>. The following sections describe ways to install different outputs.
</para>
<section xml:id="sec-multiple-outputs-installing-nixos">
<title>Selecting outputs to install via NixOS</title>
<para>
NixOS provides two ways to select the outputs to install for packages listed in <varname>environment.systemPackages</varname>:
</para>
<itemizedlist>
<listitem>
<para>
The configuration option <varname>environment.extraOutputsToInstall</varname> is appended to each package's <varname>meta.outputsToInstall</varname> attribute to determine the outputs to install. It can for example be used to install <literal>info</literal> documentation or debug symbols for all packages.
</para>
</listitem>
<listitem>
<para>
The outputs can be listed as packages in <varname>environment.systemPackages</varname>. For example, the <literal>"out"</literal> and <literal>"info"</literal> outputs for the <varname>coreutils</varname> package can be installed by including <varname>coreutils</varname> and <varname>coreutils.info</varname> in <varname>environment.systemPackages</varname>.
</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec-multiple-outputs-installing-nix-env">
<title>Selecting outputs to install via <command>nix-env</command></title>
<para>
<command>nix-env</command> lacks an easy way to select the outputs to install. When installing a package, <command>nix-env</command> always installs the outputs listed in <varname>meta.outputsToInstall</varname>, even when the user explicitly selects an output.
</para>
<warning>
<para>
<command>nix-env</command> silenty disregards the outputs selected by the user, and instead installs the outputs from <varname>meta.outputsToInstall</varname>. For example,
</para>
<screen><prompt>$ </prompt>nix-env -iA nixpkgs.coreutils.info</screen>
<para>
installs the <literal>"out"</literal> output (<varname>coreutils.meta.outputsToInstall</varname> is <literal>[ "out" ]</literal>) instead of the requested <literal>"info"</literal>.
</para>
</warning>
<para>
The only recourse to select an output with <command>nix-env</command> is to override the package's <varname>meta.outputsToInstall</varname>, using the functions described in <xref linkend="chap-overrides" />. For example, the following overlay adds the <literal>"info"</literal> output for the <varname>coreutils</varname> package:
</para>
<programlisting>self: super:
{
coreutils = super.coreutils.overrideAttrs (oldAttrs: {
meta = oldAttrs.meta // { outputsToInstall = oldAttrs.meta.outputsToInstall or [ "out" ] ++ [ "info" ]; };
});
}
</programlisting>
</section>
</section>
<section xml:id="sec-multiple-outputs-using-split-packages">
<title>Using a split package</title>
<para>
In the Nix language the individual outputs can be reached explicitly as attributes, e.g. <varname>coreutils.info</varname>, but the typical case is just using packages as build inputs.
</para>
<para>
When a multiple-output derivation gets into a build input of another derivation, the <varname>dev</varname> output is added if it exists, otherwise the first output is added. In addition to that, <varname>propagatedBuildOutputs</varname> of that package which by default contain <varname>$outputBin</varname> and <varname>$outputLib</varname> are also added. (See <xref linkend="multiple-output-file-type-groups" />.)
</para>
<para>
In some cases it may be desirable to combine different outputs under a single store path. A function <literal>symlinkJoin</literal> can be used to do this. (Note that it may negate some closure size benefits of using a multiple-output package.)
</para>
</section>
<section xml:id="sec-multiple-outputs-">
<title>Writing a split derivation</title>
<para>
Here you find how to write a derivation that produces multiple outputs.
</para>
<para>
In nixpkgs there is a framework supporting multiple-output derivations. It tries to cover most cases by default behavior. You can find the source separated in &lt;<filename>nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh</filename>&gt;; it's relatively well-readable. The whole machinery is triggered by defining the <varname>outputs</varname> attribute to contain the list of desired output names (strings).
</para>
<programlisting>outputs = [ "bin" "dev" "out" "doc" ];</programlisting>
<para>
Often such a single line is enough. For each output an equally named environment variable is passed to the builder and contains the path in nix store for that output. Typically you also want to have the main <varname>out</varname> output, as it catches any files that didn't get elsewhere.
</para>
<note>
<para>
There is a special handling of the <varname>debug</varname> output, described at <xref linkend="stdenv-separateDebugInfo" />.
</para>
</note>
<section xml:id="multiple-output-file-binaries-first-convention">
<title><quote>Binaries first</quote></title>
<para>
A commonly adopted convention in <literal>nixpkgs</literal> is that executables provided by the package are contained within its first output. This convention allows the dependent packages to reference the executables provided by packages in a uniform manner. For instance, provided with the knowledge that the <literal>perl</literal> package contains a <literal>perl</literal> executable it can be referenced as <literal>${pkgs.perl}/bin/perl</literal> within a Nix derivation that needs to execute a Perl script.
</para>
<para>
The <literal>glibc</literal> package is a deliberate single exception to the <quote>binaries first</quote> convention. The <literal>glibc</literal> has <literal>libs</literal> as its first output allowing the libraries provided by <literal>glibc</literal> to be referenced directly (e.g. <literal>${stdenv.glibc}/lib/ld-linux-x86-64.so.2</literal>). The executables provided by <literal>glibc</literal> can be accessed via its <literal>bin</literal> attribute (e.g. <literal>${stdenv.glibc.bin}/bin/ldd</literal>).
</para>
<para>
The reason for why <literal>glibc</literal> deviates from the convention is because referencing a library provided by <literal>glibc</literal> is a very common operation among Nix packages. For instance, third-party executables packaged by Nix are typically patched and relinked with the relevant version of <literal>glibc</literal> libraries from Nix packages (please see the documentation on <link xlink:href="https://github.com/NixOS/patchelf/blob/master/README">patchelf</link> for more details).
</para>
</section>
<section xml:id="multiple-output-file-type-groups">
<title>File type groups</title>
<para>
The support code currently recognizes some particular kinds of outputs and either instructs the build system of the package to put files into their desired outputs or it moves the files during the fixup phase. Each group of file types has an <varname>outputFoo</varname> variable specifying the output name where they should go. If that variable isn't defined by the derivation writer, it is guessed &ndash; a default output name is defined, falling back to other possibilities if the output isn't defined.
</para>
<variablelist>
<varlistentry>
<term>
<varname> $outputDev</varname>
</term>
<listitem>
<para>
is for development-only files. These include C(++) headers (<filename>include/</filename>), pkg-config (<filename>lib/pkgconfig/</filename>), cmake (<filename>lib/cmake/</filename>) and aclocal files (<varname>share/aclocal/</varname>). They go to <varname>dev</varname> or <varname>out</varname> by default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname> $outputBin</varname>
</term>
<listitem>
<para>
is meant for user-facing binaries, typically residing in <filename>bin/</filename>. They go to <varname>bin</varname> or <varname>out</varname> by default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname> $outputLib</varname>
</term>
<listitem>
<para>
is meant for libraries, typically residing in <filename>lib/</filename> and <filename>libexec/</filename>. They go to <varname>lib</varname> or <varname>out</varname> by default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname> $outputDoc</varname>
</term>
<listitem>
<para>
is for user documentation, typically residing in <filename>share/doc/</filename>. It goes to <varname>doc</varname> or <varname>out</varname> by default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname> $outputDevdoc</varname>
</term>
<listitem>
<para>
is for <emphasis>developer</emphasis> documentation. Currently we count gtk-doc and devhelp books, typically residing in <filename>share/gtk-doc/</filename> and <filename>share/devhelp/</filename>, in there. It goes to <varname>devdoc</varname> or is removed (!) by default. This is because e.g. gtk-doc tends to be rather large and completely unused by nixpkgs users.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname> $outputMan</varname>
</term>
<listitem>
<para>
is for man pages (except for section 3), typically residing in <filename>share/man/man[0-9]/</filename>. They go to <varname>man</varname> or <varname>$outputBin</varname> by default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname> $outputDevman</varname>
</term>
<listitem>
<para>
is for section 3 man pages, typically residing in <filename>share/man/man3/</filename>. They go to <varname>devman</varname> or <varname>$outputMan</varname> by default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname> $outputInfo</varname>
</term>
<listitem>
<para>
is for info pages, typically residing in <filename>share/info/</filename>. They go to <varname>info</varname> or <varname>$outputBin</varname> by default.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="sec-multiple-outputs-caveats">
<title>Common caveats</title>
<itemizedlist>
<listitem>
<para>
Some configure scripts don't like some of the parameters passed by default by the framework, e.g. <literal>--docdir=/foo/bar</literal>. You can disable this by setting <literal>setOutputFlags = false;</literal>.
</para>
</listitem>
<listitem>
<para>
The outputs of a single derivation can retain references to each other, but note that circular references are not allowed. (And each strongly-connected component would act as a single output anyway.)
</para>
</listitem>
<listitem>
<para>
Most of split packages contain their core functionality in libraries. These libraries tend to refer to various kind of data that typically gets into <varname>out</varname>, e.g. locale strings, so there is often no advantage in separating the libraries into <varname>lib</varname>, as keeping them in <varname>out</varname> is easier.
</para>
</listitem>
<listitem>
<para>
Some packages have hidden assumptions on install paths, which complicates splitting.
</para>
</listitem>
</itemizedlist>
</section>
</section>
<!--Writing a split derivation-->
</chapter>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -230,7 +230,7 @@ self: super:
</para> </para>
<para> <para>
For BLAS/LAPACK switching to work correctly, all packages must depend on <literal>blas</literal> or <literal>lapack</literal>. This ensures that only one BLAS/LAPACK library is used at one time. There are two versions versions of BLAS/LAPACK currently in the wild, <literal>LP64</literal> (integer size = 32 bits) and <literal>ILP64</literal> (integer size = 64 bits). Some software needs special flags or patches to work with <literal>ILP64</literal>. You can check if <literal>ILP64</literal> is used in Nixpkgs with <varname>blas.isILP64</varname> and <varname>lapack.isILP64</varname>. Some software does NOT work with <literal>ILP64</literal>, and derivations need to specify an assertion to prevent this. You can prevent <literal>ILP64</literal> from being used with the following: For BLAS/LAPACK switching to work correctly, all packages must depend on <literal>blas</literal> or <literal>lapack</literal>. This ensures that only one BLAS/LAPACK library is used at one time. There are two versions of BLAS/LAPACK currently in the wild, <literal>LP64</literal> (integer size = 32 bits) and <literal>ILP64</literal> (integer size = 64 bits). Some software needs special flags or patches to work with <literal>ILP64</literal>. You can check if <literal>ILP64</literal> is used in Nixpkgs with <varname>blas.isILP64</varname> and <varname>lapack.isILP64</varname>. Some software does NOT work with <literal>ILP64</literal>, and derivations need to specify an assertion to prevent this. You can prevent <literal>ILP64</literal> from being used with the following:
</para> </para>
<programlisting> <programlisting>

View file

@ -0,0 +1,526 @@
# Used by pkgs/misc/vim-plugins/update.py and pkgs/applications/editors/kakoune/plugins/update.py
# format:
# $ nix run nixpkgs.python3Packages.black -c black update.py
# type-check:
# $ nix run nixpkgs.python3Packages.mypy -c mypy update.py
# linted:
# $ nix run nixpkgs.python3Packages.flake8 -c flake8 --ignore E501,E265 update.py
import argparse
import functools
import http
import json
import os
import subprocess
import sys
import time
import traceback
import urllib.error
import urllib.parse
import urllib.request
import xml.etree.ElementTree as ET
from datetime import datetime
from functools import wraps
from multiprocessing.dummy import Pool
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union, Any, Callable
from urllib.parse import urljoin, urlparse
from tempfile import NamedTemporaryFile
import git
ATOM_ENTRY = "{http://www.w3.org/2005/Atom}entry" # " vim gets confused here
ATOM_LINK = "{http://www.w3.org/2005/Atom}link" # "
ATOM_UPDATED = "{http://www.w3.org/2005/Atom}updated" # "
def retry(ExceptionToCheck: Any, tries: int = 4, delay: float = 3, backoff: float = 2):
"""Retry calling the decorated function using an exponential backoff.
http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry
(BSD licensed)
:param ExceptionToCheck: the exception on which to retry
:param tries: number of times to try (not retry) before giving up
:param delay: initial delay between retries in seconds
:param backoff: backoff multiplier e.g. value of 2 will double the delay
each retry
"""
def deco_retry(f: Callable) -> Callable:
@wraps(f)
def f_retry(*args: Any, **kwargs: Any) -> Any:
mtries, mdelay = tries, delay
while mtries > 1:
try:
return f(*args, **kwargs)
except ExceptionToCheck as e:
print(f"{str(e)}, Retrying in {mdelay} seconds...")
time.sleep(mdelay)
mtries -= 1
mdelay *= backoff
return f(*args, **kwargs)
return f_retry # true decorator
return deco_retry
def make_request(url: str) -> urllib.request.Request:
token = os.getenv("GITHUB_API_TOKEN")
headers = {}
if token is not None:
headers["Authorization"] = f"token {token}"
return urllib.request.Request(url, headers=headers)
class Repo:
def __init__(
self, owner: str, name: str, branch: str, alias: Optional[str]
) -> None:
self.owner = owner
self.name = name
self.branch = branch
self.alias = alias
self.redirect: Dict[str, str] = {}
def url(self, path: str) -> str:
return urljoin(f"https://github.com/{self.owner}/{self.name}/", path)
def __repr__(self) -> str:
return f"Repo({self.owner}, {self.name})"
@retry(urllib.error.URLError, tries=4, delay=3, backoff=2)
def has_submodules(self) -> bool:
try:
req = make_request(self.url(f"blob/{self.branch}/.gitmodules"))
urllib.request.urlopen(req, timeout=10).close()
except urllib.error.HTTPError as e:
if e.code == 404:
return False
else:
raise
return True
@retry(urllib.error.URLError, tries=4, delay=3, backoff=2)
def latest_commit(self) -> Tuple[str, datetime]:
commit_url = self.url(f"commits/{self.branch}.atom")
commit_req = make_request(commit_url)
with urllib.request.urlopen(commit_req, timeout=10) as req:
self.check_for_redirect(commit_url, req)
xml = req.read()
root = ET.fromstring(xml)
latest_entry = root.find(ATOM_ENTRY)
assert latest_entry is not None, f"No commits found in repository {self}"
commit_link = latest_entry.find(ATOM_LINK)
assert commit_link is not None, f"No link tag found feed entry {xml}"
url = urlparse(commit_link.get("href"))
updated_tag = latest_entry.find(ATOM_UPDATED)
assert (
updated_tag is not None and updated_tag.text is not None
), f"No updated tag found feed entry {xml}"
updated = datetime.strptime(updated_tag.text, "%Y-%m-%dT%H:%M:%SZ")
return Path(str(url.path)).name, updated
def check_for_redirect(self, url: str, req: http.client.HTTPResponse):
response_url = req.geturl()
if url != response_url:
new_owner, new_name = (
urllib.parse.urlsplit(response_url).path.strip("/").split("/")[:2]
)
end_line = "\n" if self.alias is None else f" as {self.alias}\n"
plugin_line = "{owner}/{name}" + end_line
old_plugin = plugin_line.format(owner=self.owner, name=self.name)
new_plugin = plugin_line.format(owner=new_owner, name=new_name)
self.redirect[old_plugin] = new_plugin
def prefetch_git(self, ref: str) -> str:
data = subprocess.check_output(
["nix-prefetch-git", "--fetch-submodules", self.url(""), ref]
)
return json.loads(data)["sha256"]
def prefetch_github(self, ref: str) -> str:
data = subprocess.check_output(
["nix-prefetch-url", "--unpack", self.url(f"archive/{ref}.tar.gz")]
)
return data.strip().decode("utf-8")
class Plugin:
def __init__(
self,
name: str,
commit: str,
has_submodules: bool,
sha256: str,
date: Optional[datetime] = None,
) -> None:
self.name = name
self.commit = commit
self.has_submodules = has_submodules
self.sha256 = sha256
self.date = date
@property
def normalized_name(self) -> str:
return self.name.replace(".", "-")
@property
def version(self) -> str:
assert self.date is not None
return self.date.strftime("%Y-%m-%d")
def as_json(self) -> Dict[str, str]:
copy = self.__dict__.copy()
del copy["date"]
return copy
class Editor:
"""The configuration of the update script."""
def __init__(
self,
name: str,
root: Path,
get_plugins: str,
generate_nix: Callable[[List[Tuple[str, str, Plugin]], str], None],
default_in: Optional[Path] = None,
default_out: Optional[Path] = None,
deprecated: Optional[Path] = None,
cache_file: Optional[str] = None,
):
self.name = name
self.root = root
self.get_plugins = get_plugins
self.generate_nix = generate_nix
self.default_in = default_in or root.joinpath(f"{name}-plugin-names")
self.default_out = default_out or root.joinpath("generated.nix")
self.deprecated = deprecated or root.joinpath("deprecated.json")
self.cache_file = cache_file or f"{name}-plugin-cache.json"
class CleanEnvironment(object):
def __enter__(self) -> None:
self.old_environ = os.environ.copy()
local_pkgs = str(Path(__file__).parent.parent.parent)
os.environ["NIX_PATH"] = f"localpkgs={local_pkgs}"
self.empty_config = NamedTemporaryFile()
self.empty_config.write(b"{}")
self.empty_config.flush()
os.environ["NIXPKGS_CONFIG"] = self.empty_config.name
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
os.environ.update(self.old_environ)
self.empty_config.close()
def get_current_plugins(editor: Editor) -> List[Plugin]:
with CleanEnvironment():
out = subprocess.check_output(["nix", "eval", "--json", editor.get_plugins])
data = json.loads(out)
plugins = []
for name, attr in data.items():
p = Plugin(name, attr["rev"], attr["submodules"], attr["sha256"])
plugins.append(p)
return plugins
def prefetch_plugin(
user: str,
repo_name: str,
branch: str,
alias: Optional[str],
cache: "Optional[Cache]" = None,
) -> Tuple[Plugin, Dict[str, str]]:
repo = Repo(user, repo_name, branch, alias)
commit, date = repo.latest_commit()
has_submodules = repo.has_submodules()
cached_plugin = cache[commit] if cache else None
if cached_plugin is not None:
cached_plugin.name = alias or repo_name
cached_plugin.date = date
return cached_plugin, repo.redirect
print(f"prefetch {user}/{repo_name}")
if has_submodules:
sha256 = repo.prefetch_git(commit)
else:
sha256 = repo.prefetch_github(commit)
return (
Plugin(alias or repo_name, commit, has_submodules, sha256, date=date),
repo.redirect,
)
def fetch_plugin_from_pluginline(plugin_line: str) -> Plugin:
plugin, _ = prefetch_plugin(*parse_plugin_line(plugin_line))
return plugin
def print_download_error(plugin: str, ex: Exception):
print(f"{plugin}: {ex}", file=sys.stderr)
ex_traceback = ex.__traceback__
tb_lines = [
line.rstrip("\n")
for line in traceback.format_exception(ex.__class__, ex, ex_traceback)
]
print("\n".join(tb_lines))
def check_results(
results: List[Tuple[str, str, Union[Exception, Plugin], Dict[str, str]]]
) -> Tuple[List[Tuple[str, str, Plugin]], Dict[str, str]]:
failures: List[Tuple[str, Exception]] = []
plugins = []
redirects: Dict[str, str] = {}
for (owner, name, result, redirect) in results:
if isinstance(result, Exception):
failures.append((name, result))
else:
plugins.append((owner, name, result))
redirects.update(redirect)
print(f"{len(results) - len(failures)} plugins were checked", end="")
if len(failures) == 0:
print()
return plugins, redirects
else:
print(f", {len(failures)} plugin(s) could not be downloaded:\n")
for (plugin, exception) in failures:
print_download_error(plugin, exception)
sys.exit(1)
def parse_plugin_line(line: str) -> Tuple[str, str, str, Optional[str]]:
branch = "master"
alias = None
name, repo = line.split("/")
if " as " in repo:
repo, alias = repo.split(" as ")
alias = alias.strip()
if "@" in repo:
repo, branch = repo.split("@")
return (name.strip(), repo.strip(), branch.strip(), alias)
def load_plugin_spec(plugin_file: str) -> List[Tuple[str, str, str, Optional[str]]]:
plugins = []
with open(plugin_file) as f:
for line in f:
plugin = parse_plugin_line(line)
if not plugin[0]:
msg = f"Invalid repository {line}, must be in the format owner/repo[ as alias]"
print(msg, file=sys.stderr)
sys.exit(1)
plugins.append(plugin)
return plugins
def get_cache_path(cache_file_name: str) -> Optional[Path]:
xdg_cache = os.environ.get("XDG_CACHE_HOME", None)
if xdg_cache is None:
home = os.environ.get("HOME", None)
if home is None:
return None
xdg_cache = str(Path(home, ".cache"))
return Path(xdg_cache, cache_file_name)
class Cache:
def __init__(self, initial_plugins: List[Plugin], cache_file_name: str) -> None:
self.cache_file = get_cache_path(cache_file_name)
downloads = {}
for plugin in initial_plugins:
downloads[plugin.commit] = plugin
downloads.update(self.load())
self.downloads = downloads
def load(self) -> Dict[str, Plugin]:
if self.cache_file is None or not self.cache_file.exists():
return {}
downloads: Dict[str, Plugin] = {}
with open(self.cache_file) as f:
data = json.load(f)
for attr in data.values():
p = Plugin(
attr["name"], attr["commit"], attr["has_submodules"], attr["sha256"]
)
downloads[attr["commit"]] = p
return downloads
def store(self) -> None:
if self.cache_file is None:
return
os.makedirs(self.cache_file.parent, exist_ok=True)
with open(self.cache_file, "w+") as f:
data = {}
for name, attr in self.downloads.items():
data[name] = attr.as_json()
json.dump(data, f, indent=4, sort_keys=True)
def __getitem__(self, key: str) -> Optional[Plugin]:
return self.downloads.get(key, None)
def __setitem__(self, key: str, value: Plugin) -> None:
self.downloads[key] = value
def prefetch(
args: Tuple[str, str, str, Optional[str]], cache: Cache
) -> Tuple[str, str, Union[Exception, Plugin], dict]:
assert len(args) == 4
owner, repo, branch, alias = args
try:
plugin, redirect = prefetch_plugin(owner, repo, branch, alias, cache)
cache[plugin.commit] = plugin
return (owner, repo, plugin, redirect)
except Exception as e:
return (owner, repo, e, {})
def rewrite_input(
input_file: Path,
deprecated: Path,
redirects: Dict[str, str] = None,
append: Tuple = (),
):
with open(input_file, "r") as f:
lines = f.readlines()
lines.extend(append)
if redirects:
lines = [redirects.get(line, line) for line in lines]
cur_date_iso = datetime.now().strftime("%Y-%m-%d")
with open(deprecated, "r") as f:
deprecations = json.load(f)
for old, new in redirects.items():
old_plugin = fetch_plugin_from_pluginline(old)
new_plugin = fetch_plugin_from_pluginline(new)
if old_plugin.normalized_name != new_plugin.normalized_name:
deprecations[old_plugin.normalized_name] = {
"new": new_plugin.normalized_name,
"date": cur_date_iso,
}
with open(deprecated, "w") as f:
json.dump(deprecations, f, indent=4, sort_keys=True)
lines = sorted(lines, key=str.casefold)
with open(input_file, "w") as f:
f.writelines(lines)
def parse_args(editor: Editor):
parser = argparse.ArgumentParser(
description=(
f"Updates nix derivations for {editor.name} plugins"
f"By default from {editor.default_in} to {editor.default_out}"
)
)
parser.add_argument(
"--add",
dest="add_plugins",
default=[],
action="append",
help=f"Plugin to add to {editor.name}Plugins from Github in the form owner/repo",
)
parser.add_argument(
"--input-names",
"-i",
dest="input_file",
default=editor.default_in,
help="A list of plugins in the form owner/repo",
)
parser.add_argument(
"--out",
"-o",
dest="outfile",
default=editor.default_out,
help="Filename to save generated nix code",
)
parser.add_argument(
"--proc",
"-p",
dest="proc",
type=int,
default=30,
help="Number of concurrent processes to spawn.",
)
return parser.parse_args()
def commit(repo: git.Repo, message: str, files: List[Path]) -> None:
repo.index.add([str(f.resolve()) for f in files])
if repo.index.diff("HEAD"):
print(f'committing to nixpkgs "{message}"')
repo.index.commit(message)
else:
print("no changes in working tree to commit")
def get_update(input_file: str, outfile: str, proc: int, editor: Editor):
cache: Cache = Cache(get_current_plugins(editor), editor.cache_file)
_prefetch = functools.partial(prefetch, cache=cache)
def update() -> dict:
plugin_names = load_plugin_spec(input_file)
try:
pool = Pool(processes=proc)
results = pool.map(_prefetch, plugin_names)
finally:
cache.store()
plugins, redirects = check_results(results)
editor.generate_nix(plugins, outfile)
return redirects
return update
def update_plugins(editor: Editor):
"""The main entry function of this module. All input arguments are grouped in the `Editor`."""
args = parse_args(editor)
nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True)
update = get_update(args.input_file, args.outfile, args.proc, editor)
redirects = update()
rewrite_input(args.input_file, editor.deprecated, redirects)
commit(nixpkgs_repo, f"{editor.name}Plugins: update", [args.outfile])
if redirects:
update()
commit(
nixpkgs_repo,
f"{editor.name}Plugins: resolve github repository redirects",
[args.outfile, args.input_file, editor.deprecated],
)
for plugin_line in args.add_plugins:
rewrite_input(args.input_fil, editor.deprecated, append=(plugin_line + "\n",))
update()
plugin = fetch_plugin_from_pluginline(plugin_line)
commit(
nixpkgs_repo,
"{editor}Plugins.{name}: init at {version}".format(
editor=editor.name, name=plugin.normalized_name, version=plugin.version
),
[args.outfile, args.input_file],
)

View file

@ -29,14 +29,24 @@
<listitem> <listitem>
<para> <para>
<link xlink:href="https://www.gnuradio.org/">GNURadio</link> 3.8 was <link xlink:href="https://www.gnuradio.org/">GNURadio</link> 3.8 was
<link xlink:href="https://github.com/NixOS/nixpkgs/issues/82263">finnally</link> <link xlink:href="https://github.com/NixOS/nixpkgs/issues/82263">finally</link>
packaged, along with a rewrite to the Nix expressions, allowing users to packaged, along with a rewrite to the Nix expressions, allowing users to
override the features upstream supports selecting to compile or not to. override the features upstream supports selecting to compile or not to.
Additionally, the attribute <code>gnuradio</code> and <code>gnuradio3_7</code> Additionally, the attribute <code>gnuradio</code> and <code>gnuradio3_7</code>
now point to an externally wrapped by default derivations, that allow you to now point to an externally wrapped by default derivations, that allow you to
also add `extraPythonPackages` to the Python interpreter used by GNURadio. also add `extraPythonPackages` to the Python interpreter used by GNURadio.
Missing environmental variables needed for operational GUI were also added Missing environmental variables needed for operational GUI were also added
(<link xlink:href="https://github.com/NixOS/nixpkgs/issues/75478">#7547</link>). (<link xlink:href="https://github.com/NixOS/nixpkgs/issues/75478">#75478</link>).
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://www.gnuradio.org/">GNURadio</link> has a
<code>pkgs</code> attribute set, and there's a <code>gnuradio.callPackage</code>
function that extends <code>pkgs</code> with a <code>mkDerivation</code>, and a
<code>mkDerivationWith</code>, like Qt5. Now all <code>gnuradio.pkgs</code> are
defined with <code>gnuradio.callPackage</code> and some packages that depend
on gnuradio are defined with this as well.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -57,6 +67,13 @@
for the motivation). for the motivation).
</para> </para>
</listitem> </listitem>
<listitem>
<para>
<link xlink:href="https://kodi.tv/">Kodi</link> has been updated to version 19.0 "Matrix". See
the <link xlink:href="https://kodi.tv/article/kodi-190-matrix-release">announcement</link> for
further details.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>
@ -577,6 +594,37 @@ self: super:
for your Kafka version. for your Kafka version.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
The <package>kodi</package> package has been modified to allow concise addon management. Consider
the following configuration from previous releases of NixOS to install <package>kodi</package>,
including the <package>kodiPackages.inputstream-adaptive</package> and <package>kodiPackages.vfs-sftp</package>
addons:
<programlisting>
environment.systemPackages = [
pkgs.kodi
];
nixpkgs.config.kodi = {
enableInputStreamAdaptive = true;
enableVFSSFTP = true;
};
</programlisting>
All Kodi <literal>config</literal> flags have been removed, and as a result the above configuration
should now be written as:
<programlisting>
environment.systemPackages = [
(pkgs.kodi.withPackages (p: with p; [
inputstream-adaptive
vfs-sftp
]))
];
</programlisting>
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>

View file

@ -98,7 +98,7 @@ in
See "Multiple-output packages" chapter in the nixpkgs manual for more info. See "Multiple-output packages" chapter in the nixpkgs manual for more info.
''; '';
# which is at ../../../doc/multiple-output.xml # which is at ../../../doc/multiple-output.chapter.md
}; };
man.enable = mkOption { man.enable = mkOption {

View file

@ -47,9 +47,9 @@ in
doc = mkOption { doc = mkOption {
type = docFile; type = docFile;
internal = true; internal = true;
example = "./meta.xml"; example = "./meta.chapter.xml";
description = '' description = ''
Documentation prologe for the set of options of each module. This Documentation prologue for the set of options of each module. This
option should be defined at most once per module. option should be defined at most once per module.
''; '';
}; };

View file

@ -638,6 +638,7 @@
./services/networking/coredns.nix ./services/networking/coredns.nix
./services/networking/corerad.nix ./services/networking/corerad.nix
./services/networking/coturn.nix ./services/networking/coturn.nix
./services/networking/croc.nix
./services/networking/dante.nix ./services/networking/dante.nix
./services/networking/ddclient.nix ./services/networking/ddclient.nix
./services/networking/dhcpcd.nix ./services/networking/dhcpcd.nix

View file

@ -36,6 +36,7 @@ let
only_admins_can_pause_the_game = true; only_admins_can_pause_the_game = true;
autosave_only_on_server = true; autosave_only_on_server = true;
admins = []; admins = [];
non_blocking_saving = cfg.nonBlockingSaving;
} // cfg.extraSettings; } // cfg.extraSettings;
serverSettingsFile = pkgs.writeText "server-settings.json" (builtins.toJSON (filterAttrsRecursive (n: v: v != null) serverSettings)); serverSettingsFile = pkgs.writeText "server-settings.json" (builtins.toJSON (filterAttrsRecursive (n: v: v != null) serverSettings));
modDir = pkgs.factorio-utils.mkModDirDrv cfg.mods; modDir = pkgs.factorio-utils.mkModDirDrv cfg.mods;
@ -193,6 +194,15 @@ in
Autosave interval in minutes. Autosave interval in minutes.
''; '';
}; };
nonBlockingSaving = mkOption {
type = types.bool;
default = false;
description = ''
Highly experimental feature, enable only at your own risk of losing your saves.
On UNIX systems, server will fork itself to create an autosave.
Autosaving on connected Windows clients will be disabled regardless of autosave_only_on_server option.
'';
};
}; };
}; };

View file

@ -6,8 +6,9 @@ let
dataDir = "/var/lib/mautrix-telegram"; dataDir = "/var/lib/mautrix-telegram";
registrationFile = "${dataDir}/telegram-registration.yaml"; registrationFile = "${dataDir}/telegram-registration.yaml";
cfg = config.services.mautrix-telegram; cfg = config.services.mautrix-telegram;
# TODO: switch to configGen.json once RFC42 is implemented settingsFormat = pkgs.formats.json {};
settingsFile = pkgs.writeText "mautrix-telegram-settings.json" (builtins.toJSON cfg.settings); settingsFileUnsubstituted = settingsFormat.generate "mautrix-telegram-config-unsubstituted.json" cfg.settings;
settingsFile = "${dataDir}/config.json";
in { in {
options = { options = {
@ -15,9 +16,8 @@ in {
enable = mkEnableOption "Mautrix-Telegram, a Matrix-Telegram hybrid puppeting/relaybot bridge"; enable = mkEnableOption "Mautrix-Telegram, a Matrix-Telegram hybrid puppeting/relaybot bridge";
settings = mkOption rec { settings = mkOption rec {
# TODO: switch to types.config.json as prescribed by RFC42 once it's implemented
type = types.attrs;
apply = recursiveUpdate default; apply = recursiveUpdate default;
inherit (settingsFormat) type;
default = { default = {
appservice = rec { appservice = rec {
database = "sqlite:///${dataDir}/mautrix-telegram.db"; database = "sqlite:///${dataDir}/mautrix-telegram.db";
@ -124,6 +124,16 @@ in {
after = [ "network-online.target" ] ++ cfg.serviceDependencies; after = [ "network-online.target" ] ++ cfg.serviceDependencies;
preStart = '' preStart = ''
# Not all secrets can be passed as environment variable (yet)
# https://github.com/tulir/mautrix-telegram/issues/584
[ -f ${settingsFile} ] && rm -f ${settingsFile}
old_umask=$(umask)
umask 0277
${pkgs.envsubst}/bin/envsubst \
-o ${settingsFile} \
-i ${settingsFileUnsubstituted}
umask $old_umask
# generate the appservice's registration file if absent # generate the appservice's registration file if absent
if [ ! -f '${registrationFile}' ]; then if [ ! -f '${registrationFile}' ]; then
${pkgs.mautrix-telegram}/bin/mautrix-telegram \ ${pkgs.mautrix-telegram}/bin/mautrix-telegram \
@ -159,6 +169,8 @@ in {
--config='${settingsFile}' --config='${settingsFile}'
''; '';
}; };
restartTriggers = [ settingsFileUnsubstituted ];
}; };
}; };

View file

@ -31,6 +31,7 @@ let
"dovecot" "dovecot"
"fritzbox" "fritzbox"
"json" "json"
"jitsi"
"keylight" "keylight"
"knot" "knot"
"lnd" "lnd"
@ -130,7 +131,7 @@ let
inherit name port; inherit name port;
} // extraOpts); } // extraOpts);
} ({ config, ... }: mkIf config.openFirewall { } ({ config, ... }: mkIf config.openFirewall {
firewallFilter = mkOptionDefault "-p tcp -m tcp --dport ${toString config.port}"; firewallFilter = mkDefault "-p tcp -m tcp --dport ${toString config.port}";
})]; })];
internal = true; internal = true;
default = {}; default = {};

View file

@ -0,0 +1,40 @@
{ config, lib, pkgs, options }:
with lib;
let
cfg = config.services.prometheus.exporters.jitsi;
in
{
port = 9700;
extraOpts = {
url = mkOption {
type = types.str;
default = "http://localhost:8080/colibri/stats";
description = ''
Jitsi Videobridge metrics URL to monitor.
This is usually /colibri/stats on port 8080 of the jitsi videobridge host.
'';
};
interval = mkOption {
type = types.str;
default = "30s";
example = "1min";
description = ''
How often to scrape new data
'';
};
};
serviceOpts = {
serviceConfig = {
ExecStart = ''
${pkgs.prometheus-jitsi-exporter}/bin/jitsiexporter \
-url ${escapeShellArg cfg.url} \
-host ${cfg.listenAddress} \
-port ${toString cfg.port} \
-interval ${toString cfg.interval} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
};
};
}

View file

@ -0,0 +1,88 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) types;
cfg = config.services.croc;
rootDir = "/run/croc";
in
{
options.services.croc = {
enable = lib.mkEnableOption "croc relay";
ports = lib.mkOption {
type = with types; listOf port;
default = [9009 9010 9011 9012 9013];
description = "Ports of the relay.";
};
pass = lib.mkOption {
type = with types; either path str;
default = "pass123";
description = "Password or passwordfile for the relay.";
};
openFirewall = lib.mkEnableOption "opening of the peer port(s) in the firewall";
debug = lib.mkEnableOption "debug logs";
};
config = lib.mkIf cfg.enable {
systemd.services.croc = {
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.croc}/bin/croc --pass '${cfg.pass}' ${lib.optionalString cfg.debug "--debug"} relay --ports ${lib.concatMapStringsSep "," toString cfg.ports}";
# The following options are only for optimizing:
# systemd-analyze security croc
AmbientCapabilities = "";
CapabilityBoundingSet = "";
DynamicUser = true;
# ProtectClock= adds DeviceAllow=char-rtc r
DeviceAllow = "";
LockPersonality = true;
MemoryDenyWriteExecute = true;
MountAPIVFS = true;
NoNewPrivileges = true;
PrivateDevices = true;
PrivateMounts = true;
PrivateNetwork = lib.mkDefault false;
PrivateTmp = true;
PrivateUsers = true;
ProcSubset = "pid";
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "noaccess";
ProtectSystem = "strict";
RemoveIPC = true;
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
RootDirectory = rootDir;
# Avoid mounting rootDir in the own rootDir of ExecStart='s mount namespace.
InaccessiblePaths = [ "-+${rootDir}" ];
BindReadOnlyPaths = [
builtins.storeDir
] ++ lib.optional (types.path.check cfg.pass) cfg.pass;
# This is for BindReadOnlyPaths=
# to allow traversal of directories they create in RootDirectory=.
UMask = "0066";
# Create rootDir in the host's mount namespace.
RuntimeDirectory = [(baseNameOf rootDir)];
RuntimeDirectoryMode = "700";
SystemCallFilter = [
"@system-service"
"~@aio" "~@chown" "~@keyring" "~@memlock"
"~@privileged" "~@resources" "~@setuid"
"~@sync" "~@timer"
];
SystemCallArchitectures = "native";
SystemCallErrorNumber = "EPERM";
};
};
networking.firewall.allowedTCPPorts = lib.mkIf cfg.openFirewall cfg.ports;
};
meta.maintainers = with lib.maintainers; [ hax404 julm ];
}

View file

@ -104,7 +104,7 @@ let
ignoreCollisions = true; ignoreCollisions = true;
}; };
filterGutenprint = pkgs: filter (pkg: pkg.meta.isGutenprint or false == true) pkgs; filterGutenprint = filter (pkg: pkg.meta.isGutenprint or false == true);
containsGutenprint = pkgs: length (filterGutenprint pkgs) > 0; containsGutenprint = pkgs: length (filterGutenprint pkgs) > 0;
getGutenprint = pkgs: head (filterGutenprint pkgs); getGutenprint = pkgs: head (filterGutenprint pkgs);

View file

@ -14,17 +14,16 @@ let
ADMIN_PASSWORD=password ADMIN_PASSWORD=password
''; '';
pgsu = "${pkgs.sudo}/bin/sudo -u ${config.services.postgresql.superUser}";
pgbin = "${config.services.postgresql.package}/bin"; pgbin = "${config.services.postgresql.package}/bin";
preStart = pkgs.writeScript "miniflux-pre-start" '' preStart = pkgs.writeScript "miniflux-pre-start" ''
#!${pkgs.runtimeShell} #!${pkgs.runtimeShell}
db_exists() { db_exists() {
[ "$(${pgsu} ${pgbin}/psql -Atc "select 1 from pg_database where datname='$1'")" == "1" ] [ "$(${pgbin}/psql -Atc "select 1 from pg_database where datname='$1'")" == "1" ]
} }
if ! db_exists "${dbName}"; then if ! db_exists "${dbName}"; then
${pgsu} ${pgbin}/psql postgres -c "CREATE ROLE ${dbUser} WITH LOGIN NOCREATEDB NOCREATEROLE ENCRYPTED PASSWORD '${dbPassword}'" ${pgbin}/psql postgres -c "CREATE ROLE ${dbUser} WITH LOGIN NOCREATEDB NOCREATEROLE ENCRYPTED PASSWORD '${dbPassword}'"
${pgsu} ${pgbin}/createdb --owner "${dbUser}" "${dbName}" ${pgbin}/createdb --owner "${dbUser}" "${dbName}"
${pgsu} ${pgbin}/psql "${dbName}" -c "CREATE EXTENSION IF NOT EXISTS hstore" ${pgbin}/psql "${dbName}" -c "CREATE EXTENSION IF NOT EXISTS hstore"
fi fi
''; '';
in in
@ -73,15 +72,26 @@ in
services.postgresql.enable = true; services.postgresql.enable = true;
systemd.services.miniflux-dbsetup = {
description = "Miniflux database setup";
wantedBy = [ "multi-user.target" ];
requires = [ "postgresql.service" ];
after = [ "network.target" "postgresql.service" ];
serviceConfig = {
Type = "oneshot";
User = config.services.postgresql.superUser;
ExecStart = preStart;
};
};
systemd.services.miniflux = { systemd.services.miniflux = {
description = "Miniflux service"; description = "Miniflux service";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
requires = [ "postgresql.service" ]; requires = [ "postgresql.service" ];
after = [ "network.target" "postgresql.service" ]; after = [ "network.target" "postgresql.service" "miniflux-dbsetup.service" ];
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.miniflux}/bin/miniflux"; ExecStart = "${pkgs.miniflux}/bin/miniflux";
ExecStartPre = "+${preStart}";
DynamicUser = true; DynamicUser = true;
RuntimeDirectory = "miniflux"; RuntimeDirectory = "miniflux";
RuntimeDirectoryMode = "0700"; RuntimeDirectoryMode = "0700";

View file

@ -84,6 +84,7 @@ in
couchdb = handleTest ./couchdb.nix {}; couchdb = handleTest ./couchdb.nix {};
cri-o = handleTestOn ["x86_64-linux"] ./cri-o.nix {}; cri-o = handleTestOn ["x86_64-linux"] ./cri-o.nix {};
custom-ca = handleTest ./custom-ca.nix {}; custom-ca = handleTest ./custom-ca.nix {};
croc = handleTest ./croc.nix {};
deluge = handleTest ./deluge.nix {}; deluge = handleTest ./deluge.nix {};
dhparams = handleTest ./dhparams.nix {}; dhparams = handleTest ./dhparams.nix {};
dnscrypt-proxy2 = handleTestOn ["x86_64-linux"] ./dnscrypt-proxy2.nix {}; dnscrypt-proxy2 = handleTestOn ["x86_64-linux"] ./dnscrypt-proxy2.nix {};

View file

@ -0,0 +1,51 @@
import ./make-test-python.nix ({ pkgs, ... }:
let
client = { pkgs, ... }: {
environment.systemPackages = [ pkgs.croc ];
};
pass = pkgs.writeText "pass" "PassRelay";
in {
name = "croc";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ hax404 julm ];
};
nodes = {
relay = {
services.croc = {
enable = true;
pass = pass;
openFirewall = true;
};
};
sender = client;
receiver = client;
};
testScript = ''
start_all()
# wait until relay is up
relay.wait_for_unit("croc")
relay.wait_for_open_port(9009)
relay.wait_for_open_port(9010)
relay.wait_for_open_port(9011)
relay.wait_for_open_port(9012)
relay.wait_for_open_port(9013)
# generate testfiles and send them
sender.wait_for_unit("multi-user.target")
sender.execute("echo Hello World > testfile01.txt")
sender.execute("echo Hello Earth > testfile02.txt")
sender.execute(
"croc --pass ${pass} --relay relay send --code topSecret testfile01.txt testfile02.txt &"
)
# receive the testfiles and check them
receiver.succeed(
"croc --pass ${pass} --yes --relay relay topSecret"
)
assert "Hello World" in receiver.succeed("cat testfile01.txt")
assert "Hello Earth" in receiver.succeed("cat testfile02.txt")
'';
})

View file

@ -20,6 +20,13 @@ with lib;
services.miniflux.enable = true; services.miniflux.enable = true;
}; };
withoutSudo =
{ ... }:
{
services.miniflux.enable = true;
security.sudo.enable = false;
};
customized = customized =
{ ... }: { ... }:
{ {
@ -46,6 +53,13 @@ with lib;
"curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep -q '\"is_admin\":true'" "curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep -q '\"is_admin\":true'"
) )
withoutSudo.wait_for_unit("miniflux.service")
withoutSudo.wait_for_open_port(${toString defaultPort})
withoutSudo.succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep -q OK")
withoutSudo.succeed(
"curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep -q '\"is_admin\":true'"
)
customized.wait_for_unit("miniflux.service") customized.wait_for_unit("miniflux.service")
customized.wait_for_open_port(${toString port}) customized.wait_for_open_port(${toString port})
customized.succeed("curl --fail 'http://localhost:${toString port}/healthcheck' | grep -q OK") customized.succeed("curl --fail 'http://localhost:${toString port}/healthcheck' | grep -q OK")

View file

@ -233,6 +233,29 @@ let
''; '';
}; };
jitsi = {
exporterConfig = {
enable = true;
};
metricProvider = {
systemd.services.prometheus-jitsi-exporter.after = [ "jitsi-videobridge2.service" ];
services.jitsi-videobridge = {
enable = true;
apis = [ "colibri" "rest" ];
};
};
exporterTest = ''
wait_for_unit("jitsi-videobridge2.service")
wait_for_open_port(8080)
wait_for_unit("prometheus-jitsi-exporter.service")
wait_for_open_port(9700)
wait_until_succeeds(
'journalctl -eu prometheus-jitsi-exporter.service -o cat | grep -q "key=participants"'
)
succeed("curl -sSf 'localhost:9700/metrics' | grep -q 'jitsi_participants 0'")
'';
};
json = { json = {
exporterConfig = { exporterConfig = {
enable = true; enable = true;

View file

@ -17,6 +17,6 @@ in
'' ''
machine.wait_for_unit("multi-user.target") machine.wait_for_unit("multi-user.target")
output = machine.succeed("spike -m64 $(which pk) $(which hello)") output = machine.succeed("spike -m64 $(which pk) $(which hello)")
assert output == "Hello, world!\n" assert "Hello, world!" in output
''; '';
}) })

View file

@ -1,4 +1,5 @@
{ lib { stdenv
, lib
, fetchFromGitLab , fetchFromGitLab
, cairo , cairo
, dbus , dbus
@ -7,17 +8,17 @@
, glib , glib
, gtk3 , gtk3
, libhandy_0 , libhandy_0
, libsass
, meson , meson
, ninja , ninja
, pango , pango
, pkg-config , pkg-config
, python3 , python3
, rustc
, rustPlatform , rustPlatform
, wrapGAppsHook , wrapGAppsHook
}: }:
rustPlatform.buildRustPackage rec { stdenv.mkDerivation rec {
pname = "contrast"; pname = "contrast";
version = "0.0.3"; version = "0.0.3";
@ -30,7 +31,11 @@ rustPlatform.buildRustPackage rec {
sha256 = "0kk3mv7a6y258109xvgicmsi0lw0rcs00gfyivl5hdz7qh47iccy"; sha256 = "0kk3mv7a6y258109xvgicmsi0lw0rcs00gfyivl5hdz7qh47iccy";
}; };
cargoSha256 = "0vi8nv4hkhsgqgz36xacwkk5cxirg6li44nbmk3x7vx7c64hzybq"; cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-ePkPiWGn79PHrMsSEql5OXZW5uRMdTP+w0/DCcm2KG4=";
};
nativeBuildInputs = [ nativeBuildInputs = [
desktop-file-utils desktop-file-utils
@ -39,6 +44,9 @@ rustPlatform.buildRustPackage rec {
ninja ninja
pkg-config pkg-config
python3 python3
rustPlatform.rust.cargo
rustPlatform.cargoSetupHook
rustPlatform.rust.rustc
wrapGAppsHook wrapGAppsHook
glib # for glib-compile-resources glib # for glib-compile-resources
]; ];
@ -49,6 +57,7 @@ rustPlatform.buildRustPackage rec {
glib glib
gtk3 gtk3
libhandy_0 libhandy_0
libsass
pango pango
]; ];
@ -56,12 +65,6 @@ rustPlatform.buildRustPackage rec {
patchShebangs build-aux/meson_post_install.py patchShebangs build-aux/meson_post_install.py
''; '';
# Don't use buildRustPackage phases, only use it for rust deps setup
configurePhase = null;
buildPhase = null;
checkPhase = null;
installPhase = null;
meta = with lib; { meta = with lib; {
description = "Checks whether the contrast between two colors meet the WCAG requirements"; description = "Checks whether the contrast between two colors meet the WCAG requirements";
homepage = "https://gitlab.gnome.org/World/design/contrast"; homepage = "https://gitlab.gnome.org/World/design/contrast";

View file

@ -1,11 +1,10 @@
{ lib { stdenv
, lib
, rustPlatform , rustPlatform
, fetchFromGitLab , fetchFromGitLab
, meson , meson
, ninja , ninja
, gettext , gettext
, cargo
, rustc
, python3 , python3
, pkg-config , pkg-config
, glib , glib
@ -18,9 +17,9 @@
, wrapGAppsHook , wrapGAppsHook
}: }:
rustPlatform.buildRustPackage rec { stdenv.mkDerivation rec {
version = "0.4.8";
pname = "gnome-podcasts"; pname = "gnome-podcasts";
version = "0.4.8";
src = fetchFromGitLab { src = fetchFromGitLab {
domain = "gitlab.gnome.org"; domain = "gitlab.gnome.org";
@ -30,16 +29,21 @@ rustPlatform.buildRustPackage rec {
sha256 = "0y2332zjq7vf1v38wzwz98fs19vpzy9kl7y0xbdzqr303l59hjb1"; sha256 = "0y2332zjq7vf1v38wzwz98fs19vpzy9kl7y0xbdzqr303l59hjb1";
}; };
cargoSha256 = "1jbii9k4bkrivdk1ffr6556q1sgk9j4jbzwnn8vbxmksyl1x328q"; cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-GInRA/V61r42spb/JYlM8+mATSkmOxdm2zHPRWaKcck=";
};
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
pkg-config pkg-config
gettext gettext
cargo
rustc
python3 python3
rustPlatform.rust.cargo
rustPlatform.cargoSetupHook
rustPlatform.rust.rustc
wrapGAppsHook wrapGAppsHook
glib glib
]; ];
@ -57,12 +61,6 @@ rustPlatform.buildRustPackage rec {
gst_all_1.gst-plugins-good gst_all_1.gst-plugins-good
]; ];
# use Meson/Ninja phases
configurePhase = null;
buildPhase = null;
checkPhase = null;
installPhase = null;
# tests require network # tests require network
doCheck = false; doCheck = false;
@ -74,7 +72,7 @@ rustPlatform.buildRustPackage rec {
meta = with lib; { meta = with lib; {
description = "Listen to your favorite podcasts"; description = "Listen to your favorite podcasts";
homepage = "https://wiki.gnome.org/Apps/Podcasts"; homepage = "https://wiki.gnome.org/Apps/Podcasts";
license = licenses.gpl3; license = licenses.gpl3Plus;
maintainers = teams.gnome.members; maintainers = teams.gnome.members;
platforms = platforms.unix; platforms = platforms.unix;
}; };

View file

@ -0,0 +1,82 @@
{ lib, stdenv, alsaLib, atk, at-spi2-atk, cairo, cups, dbus, dpkg, expat, fontconfig, freetype
, fetchurl, GConf, gdk-pixbuf, glib, gtk2, gtk3, libpulseaudio, makeWrapper, nspr
, nss, pango, udev, xorg
}:
let
version = "4.7.1";
deps = [
alsaLib
atk
at-spi2-atk
cairo
cups
dbus
expat
fontconfig
freetype
GConf
gdk-pixbuf
glib
gtk2
gtk3
libpulseaudio
nspr
nss
pango
stdenv.cc.cc
udev
xorg.libX11
xorg.libxcb
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXScrnSaver
xorg.libXtst
];
in
stdenv.mkDerivation {
pname = "google-play-music-desktop-player";
inherit version;
src = fetchurl {
url = "https://github.com/MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-/releases/download/v${version}/google-play-music-desktop-player_${version}_amd64.deb";
sha256 = "1ljm9c5sv6wa7pa483yq03wq9j1h1jdh8363z5m2imz407yzgm5r";
};
dontBuild = true;
nativeBuildInputs = [ dpkg makeWrapper ];
unpackPhase = ''
dpkg -x $src .
'';
installPhase = ''
mkdir -p $out
cp -r ./usr/share $out
cp -r ./usr/bin $out
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
"$out/share/google-play-music-desktop-player/Google Play Music Desktop Player"
wrapProgram $out/bin/google-play-music-desktop-player \
--prefix LD_LIBRARY_PATH : "$out/share/google-play-music-desktop-player" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath deps}"
'';
meta = {
homepage = "https://www.googleplaymusicdesktopplayer.com/";
description = "A beautiful cross platform Desktop Player for Google Play Music and YouTube Music";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ anna328p SuprDewd ];
};
}

View file

@ -8,13 +8,13 @@
mkDerivation rec { mkDerivation rec {
pname = "musescore"; pname = "musescore";
version = "3.6.1"; version = "3.6.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "musescore"; owner = "musescore";
repo = "MuseScore"; repo = "MuseScore";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-21ZI5rsc05ZWEyM0LeFr+212YViLYveZZBvVpskh8iA="; sha256 = "sha256-GBGAD/qdOhoNfDzI+O0EiKgeb86GFJxpci35T6tZ+2s=";
}; };
patches = [ patches = [

View file

@ -3,12 +3,12 @@
, liblo, libsamplerate, libsndfile, lirc ? null, lrdf, qtbase }: , liblo, libsamplerate, libsndfile, lirc ? null, lrdf, qtbase }:
stdenv.mkDerivation (rec { stdenv.mkDerivation (rec {
version = "20.06"; version = "20.12";
pname = "rosegarden"; pname = "rosegarden";
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/rosegarden/${pname}-${version}.tar.bz2"; url = "mirror://sourceforge/rosegarden/${pname}-${version}.tar.bz2";
sha256 = "1i9x9rkqwwdrk77xl5ra8i48cjirbc7fbisnj0nnclccwaq0wk6r"; sha256 = "sha256-iGaEr8WFipV4I00fhFGI2xMBFPf784IIxNXs2hUTHFs=";
}; };
patchPhase = '' patchPhase = ''

View file

@ -1,10 +1,11 @@
{ lib { stdenv
, lib
, fetchFromGitLab , fetchFromGitLab
, cargo
, dbus , dbus
, desktop-file-utils , desktop-file-utils
, gdk-pixbuf , gdk-pixbuf
, gettext , gettext
, gitMinimal
, glib , glib
, gst_all_1 , gst_all_1
, gtk3 , gtk3
@ -14,13 +15,12 @@
, openssl , openssl
, pkg-config , pkg-config
, python3 , python3
, rustc
, rustPlatform , rustPlatform
, sqlite , sqlite
, wrapGAppsHook , wrapGAppsHook
}: }:
rustPlatform.buildRustPackage rec { stdenv.mkDerivation rec {
pname = "shortwave"; pname = "shortwave";
version = "1.1.1"; version = "1.1.1";
@ -32,18 +32,24 @@ rustPlatform.buildRustPackage rec {
sha256 = "1vlhp2ss06j41simjrrjg38alp85jddhqyvccy6bhfzm0gzynwld"; sha256 = "1vlhp2ss06j41simjrrjg38alp85jddhqyvccy6bhfzm0gzynwld";
}; };
cargoSha256 = "181699rlpr5dszc18wg0kbss3gfskxaz9lpxpgsc4yfb6ip89qnk"; cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-0+KEbjTLecL0u/3S9FWf2r2h9ZrgcRTY163kS3NKJqA=";
};
nativeBuildInputs = [ nativeBuildInputs = [
cargo
desktop-file-utils desktop-file-utils
gettext gettext
gitMinimal
glib # for glib-compile-schemas glib # for glib-compile-schemas
meson meson
ninja ninja
pkg-config pkg-config
python3 python3
rustc rustPlatform.rust.cargo
rustPlatform.cargoSetupHook
rustPlatform.rust.rustc
wrapGAppsHook wrapGAppsHook
]; ];
@ -62,12 +68,6 @@ rustPlatform.buildRustPackage rec {
gst-plugins-bad gst-plugins-bad
]); ]);
# Don't use buildRustPackage phases, only use it for rust deps setup
configurePhase = null;
buildPhase = null;
checkPhase = null;
installPhase = null;
postPatch = '' postPatch = ''
patchShebangs build-aux/meson/postinstall.py patchShebangs build-aux/meson/postinstall.py
''; '';

View file

@ -0,0 +1,13 @@
diff --git a/src/borg/utils.rs b/src/borg/utils.rs
index 4e30913..30d7d6f 100644
--- a/src/borg/utils.rs
+++ b/src/borg/utils.rs
@@ -223,7 +223,7 @@ impl BorgCall {
}
pub fn cmd(&self) -> Command {
- let mut cmd = Command::new("borg");
+ let mut cmd = Command::new("@borg@");
cmd.args(self.args())
.stderr(Stdio::piped())

View file

@ -0,0 +1,77 @@
{ lib
, stdenv
, fetchFromGitLab
, rustPlatform
, substituteAll
, desktop-file-utils
, meson
, ninja
, pkg-config
, python3
, wrapGAppsHook
, borgbackup
, dbus
, gdk-pixbuf
, glib
, gtk3
, libhandy
}:
stdenv.mkDerivation rec {
pname = "pika-backup";
version = "0.2.1";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "World";
repo = "pika-backup";
rev = "v${version}";
sha256 = "0fm6vwpw0pa98v2yn8p3818rrlv9lk3pmgnal1b2kh52im5ll7m8";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
sha256 = "1f5s6a0wjrs2spsicirhbvb5xlz9iflwsaqchij9k02hfcsr308y";
};
patches = [
(substituteAll {
src = ./borg-path.patch;
borg = "${borgbackup}/bin/borg";
})
];
postPatch = ''
patchShebangs build-aux
'';
nativeBuildInputs = [
desktop-file-utils
meson
ninja
pkg-config
python3
wrapGAppsHook
] ++ (with rustPlatform; [
cargoSetupHook
rust.cargo
rust.rustc
]);
buildInputs = [
dbus
gdk-pixbuf
glib
gtk3
libhandy
];
meta = with lib; {
description = "Simple backups based on borg";
homepage = "https://wiki.gnome.org/Apps/PikaBackup";
changelog = "https://gitlab.gnome.org/World/pika-backup/-/blob/v${version}/CHANGELOG.md";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dotlambda ];
};
}

View file

@ -1,23 +1,25 @@
{ rust, rustPlatform, stdenv, lib, fetchFromGitHub, autoreconfHook, makeWrapper { rust, rustPlatform, stdenv, lib, fetchFromGitHub, autoreconfHook, makeWrapper
, cargo, pkg-config , fetchpatch, cargo, pkg-config, curl, coreutils, boost174, db62, hexdump
, bash, curl, coreutils, boost17x, db62, libsodium, libevent, utf8cpp, util-linux , libsodium, libevent, utf8cpp, util-linux, withWallet ? true, withDaemon ? true
, withUtils ? true
}: }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec {
pname = "zcash"; pname = "zcash";
version = "4.1.1"; version = "4.3.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "zcash"; owner = "zcash";
repo = "zcash"; repo = "zcash";
rev = "v${version}"; rev = "v${version}";
sha256 = "185zrw276g545np0niw5hlhlppkjbf5a1r4rwhnbaimdjdii2dil"; sha256 = "00pn1jw8j90y7i8nc92b51znz4gczphvdzbkbcjx63cf6vk7v4ks";
}; };
cargoSha256 = "0qxr6asf8zsya0f1ri39z2cnfpjk96hgwjchz2c7j87vibbvg6dc"; cargoSha256 = "1rl9sjbvpfrv1mlyb04vw1935qx0kz9cs177xl7izdva1ixk9blr";
nativeBuildInputs = [ autoreconfHook cargo makeWrapper pkg-config ]; nativeBuildInputs = [ autoreconfHook cargo hexdump makeWrapper pkg-config ];
buildInputs = [ bash boost17x db62 libevent libsodium utf8cpp ]; buildInputs = [ boost174 libevent libsodium utf8cpp ]
++ lib.optional withWallet db62;
# Use the stdenv default phases (./configure; make) instead of the # Use the stdenv default phases (./configure; make) instead of the
# ones from buildRustPackage. # ones from buildRustPackage.
@ -26,6 +28,14 @@ rustPlatform.buildRustPackage rec {
checkPhase = "checkPhase"; checkPhase = "checkPhase";
installPhase = "installPhase"; installPhase = "installPhase";
patches = [
# See https://github.com/zcash/zcash/pull/5015
(fetchpatch {
url = "https://github.com/zcash/zcash/commit/a0ac27ec6ed434a233c7ad2468258f6e6e7e9688.patch";
sha256 = "0pmx1spql9p8vvpjgw7qf3qy46f4mh9ni16bq4ss1xz1z9zgjc4k";
})
];
postPatch = '' postPatch = ''
# Have to do this here instead of in preConfigure because # Have to do this here instead of in preConfigure because
# cargoDepsCopy gets unset after postPatch. # cargoDepsCopy gets unset after postPatch.
@ -34,10 +44,12 @@ rustPlatform.buildRustPackage rec {
configureFlags = [ configureFlags = [
"--disable-tests" "--disable-tests"
"--with-boost-libdir=${lib.getLib boost17x}/lib" "--with-boost-libdir=${lib.getLib boost174}/lib"
"CXXFLAGS=-I${lib.getDev utf8cpp}/include/utf8cpp" "CXXFLAGS=-I${lib.getDev utf8cpp}/include/utf8cpp"
"RUST_TARGET=${rust.toRustTargetSpec stdenv.hostPlatform}" "RUST_TARGET=${rust.toRustTargetSpec stdenv.hostPlatform}"
]; ] ++ lib.optional (!withWallet) "--disable-wallet"
++ lib.optional (!withDaemon) "--without-daemon"
++ lib.optional (!withUtils) "--without-utils";
enableParallelBuilding = true; enableParallelBuilding = true;

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "lightdm-mini-greeter"; pname = "lightdm-mini-greeter";
version = "0.5.0"; version = "0.5.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "prikhi"; owner = "prikhi";
repo = "lightdm-mini-greeter"; repo = "lightdm-mini-greeter";
rev = version; rev = version;
sha256 = "sha256-cVOnd3k+9hFQjROiwPpxZcCxD2NiH1eclJHF88eV6BM="; sha256 = "sha256-Pm7ExfusFIPktX2C4UE07qgOVhcWhVxnaD3QARpmu7Y=";
}; };
nativeBuildInputs = [ autoreconfHook pkg-config wrapGAppsHook ]; nativeBuildInputs = [ autoreconfHook pkg-config wrapGAppsHook ];

View file

@ -636,16 +636,16 @@
license = lib.licenses.free; license = lib.licenses.free;
}; };
}) {}; }) {};
counsel = callPackage ({ elpaBuild, emacs, fetchurl, lib, swiper }: counsel = callPackage ({ elpaBuild, emacs, fetchurl, ivy, lib, swiper }:
elpaBuild { elpaBuild {
pname = "counsel"; pname = "counsel";
ename = "counsel"; ename = "counsel";
version = "0.13.1"; version = "0.13.4";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/counsel-0.13.1.tar"; url = "https://elpa.gnu.org/packages/counsel-0.13.4.tar";
sha256 = "0m4dmhj33cxaapn9lf7bj1r680gi2wd7cw9xlssjklzvic29a6db"; sha256 = "094zfapfn1l8wjf3djkipk0d9nks0g77sbk107pfsbr3skkzh031";
}; };
packageRequires = [ emacs swiper ]; packageRequires = [ emacs ivy swiper ];
meta = { meta = {
homepage = "https://elpa.gnu.org/packages/counsel.html"; homepage = "https://elpa.gnu.org/packages/counsel.html";
license = lib.licenses.free; license = lib.licenses.free;
@ -1295,10 +1295,10 @@
elpaBuild { elpaBuild {
pname = "flymake"; pname = "flymake";
ename = "flymake"; ename = "flymake";
version = "1.0.9"; version = "1.1.1";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/flymake-1.0.9.el"; url = "https://elpa.gnu.org/packages/flymake-1.1.1.tar";
sha256 = "0xm1crhjcs14iqkf481igbf40wj2ib3hjzinw1gn8w1n0462ymp6"; sha256 = "0lk2v34b59b24j3hsmi8d0v7fgpwcipv7ka9i88cdgjmjjmzgz5q";
}; };
packageRequires = [ eldoc emacs ]; packageRequires = [ eldoc emacs ];
meta = { meta = {
@ -1714,10 +1714,10 @@
elpaBuild { elpaBuild {
pname = "ivy"; pname = "ivy";
ename = "ivy"; ename = "ivy";
version = "0.13.1"; version = "0.13.4";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/ivy-0.13.1.tar"; url = "https://elpa.gnu.org/packages/ivy-0.13.4.tar";
sha256 = "0n0ixhdykbdpis4krkqq6zncbby28p34742q96n0l91w0p19slcx"; sha256 = "0qpza1c45mr8fcpnm32cck4v22fnzz1yb7kww05rzgq1k9iivx5v";
}; };
packageRequires = [ emacs ]; packageRequires = [ emacs ];
meta = { meta = {
@ -1725,6 +1725,21 @@
license = lib.licenses.free; license = lib.licenses.free;
}; };
}) {}; }) {};
ivy-avy = callPackage ({ avy, elpaBuild, emacs, fetchurl, ivy, lib }:
elpaBuild {
pname = "ivy-avy";
ename = "ivy-avy";
version = "0.13.4";
src = fetchurl {
url = "https://elpa.gnu.org/packages/ivy-avy-0.13.4.tar";
sha256 = "1q5caxm4rnh4jy5n88dhkdbx1afsshmfki5dl8xsqbdb3y0zq7yi";
};
packageRequires = [ avy emacs ivy ];
meta = {
homepage = "https://elpa.gnu.org/packages/ivy-avy.html";
license = lib.licenses.free;
};
}) {};
ivy-explorer = callPackage ({ elpaBuild, emacs, fetchurl, ivy, lib }: ivy-explorer = callPackage ({ elpaBuild, emacs, fetchurl, ivy, lib }:
elpaBuild { elpaBuild {
pname = "ivy-explorer"; pname = "ivy-explorer";
@ -1740,6 +1755,21 @@
license = lib.licenses.free; license = lib.licenses.free;
}; };
}) {}; }) {};
ivy-hydra = callPackage ({ elpaBuild, emacs, fetchurl, hydra, ivy, lib }:
elpaBuild {
pname = "ivy-hydra";
ename = "ivy-hydra";
version = "0.13.5";
src = fetchurl {
url = "https://elpa.gnu.org/packages/ivy-hydra-0.13.5.tar";
sha256 = "06rln9bnq5hli5rqlm47fb68b8llpqrmzwqqv4rn7mx3854i9a5x";
};
packageRequires = [ emacs hydra ivy ];
meta = {
homepage = "https://elpa.gnu.org/packages/ivy-hydra.html";
license = lib.licenses.free;
};
}) {};
ivy-posframe = callPackage ({ elpaBuild ivy-posframe = callPackage ({ elpaBuild
, emacs , emacs
, fetchurl , fetchurl
@ -2019,10 +2049,10 @@
elpaBuild { elpaBuild {
pname = "map"; pname = "map";
ename = "map"; ename = "map";
version = "2.1"; version = "3.0";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/map-2.1.el"; url = "https://elpa.gnu.org/packages/map-3.0.tar";
sha256 = "0ydz5w1n4vwhhzxxj003s7jv8n1wjijwfryk5z93bwhnr0cak0i0"; sha256 = "00wf8lgh1b1i5l838y6di8194rf5gf5djklkhmxj1nlikz66j2ls";
}; };
packageRequires = [ emacs ]; packageRequires = [ emacs ];
meta = { meta = {
@ -2384,6 +2414,21 @@
license = lib.licenses.free; license = lib.licenses.free;
}; };
}) {}; }) {};
ob-haxe = callPackage ({ elpaBuild, fetchurl, lib }:
elpaBuild {
pname = "ob-haxe";
ename = "ob-haxe";
version = "1.0";
src = fetchurl {
url = "https://elpa.gnu.org/packages/ob-haxe-1.0.tar";
sha256 = "1x19b3aappv4d3mvpf01r505l1sfndbzbpr5sbid411g9g9k3rwr";
};
packageRequires = [];
meta = {
homepage = "https://elpa.gnu.org/packages/ob-haxe.html";
license = lib.licenses.free;
};
}) {};
objed = callPackage ({ cl-lib ? null, elpaBuild, emacs, fetchurl, lib }: objed = callPackage ({ cl-lib ? null, elpaBuild, emacs, fetchurl, lib }:
elpaBuild { elpaBuild {
pname = "objed"; pname = "objed";
@ -2613,10 +2658,10 @@
elpaBuild { elpaBuild {
pname = "phps-mode"; pname = "phps-mode";
ename = "phps-mode"; ename = "phps-mode";
version = "0.4.1"; version = "0.4.2";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/phps-mode-0.4.1.tar"; url = "https://elpa.gnu.org/packages/phps-mode-0.4.2.tar";
sha256 = "11d1gsvvj26h9d7a28v87b022vbi3syzngn1x9v1d2g55iv01x38"; sha256 = "0ngh54jdh56563crgvf0r4gd6zfvhbkxs9prp12930gav8mdm3sh";
}; };
packageRequires = [ emacs ]; packageRequires = [ emacs ];
meta = { meta = {
@ -2658,10 +2703,10 @@
elpaBuild { elpaBuild {
pname = "posframe"; pname = "posframe";
ename = "posframe"; ename = "posframe";
version = "0.8.5"; version = "0.8.8";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/posframe-0.8.5.tar"; url = "https://elpa.gnu.org/packages/posframe-0.8.8.tar";
sha256 = "0rls0rsj9clx4wd0gbdi5jzwyslparlf7phib649637gq6gs90ds"; sha256 = "1ij6brzcxv9viz37qafcinlfx5l20w8x8s6786r1rsda5n1xsmvd";
}; };
packageRequires = [ emacs ]; packageRequires = [ emacs ];
meta = { meta = {
@ -2673,10 +2718,10 @@
elpaBuild { elpaBuild {
pname = "project"; pname = "project";
ename = "project"; ename = "project";
version = "0.5.3"; version = "0.5.4";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/project-0.5.3.el"; url = "https://elpa.gnu.org/packages/project-0.5.4.tar";
sha256 = "0cpf69m41h8gfcqnq72h11925zdk35b7hw7bfy83xm83xwp12rxx"; sha256 = "0arjvhzzcf8b80w94yvpgfdlhsjwf5jk1r7vcai5a4dg3bi9cxyb";
}; };
packageRequires = [ emacs xref ]; packageRequires = [ emacs xref ];
meta = { meta = {
@ -2718,10 +2763,10 @@
elpaBuild { elpaBuild {
pname = "pyim"; pname = "pyim";
ename = "pyim"; ename = "pyim";
version = "3.2"; version = "3.5";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/pyim-3.2.tar"; url = "https://elpa.gnu.org/packages/pyim-3.5.tar";
sha256 = "1rr9mq334dqf7mx1ii7910zkigw7chl63iws4sw0qsn014kjlb0a"; sha256 = "0593ds3zbmpd6235b8v33f3cb3sn8cwr6arb6zbf1ba97nawjxqs";
}; };
packageRequires = [ async emacs xr ]; packageRequires = [ async emacs xr ];
meta = { meta = {
@ -2729,6 +2774,21 @@
license = lib.licenses.free; license = lib.licenses.free;
}; };
}) {}; }) {};
pyim-basedict = callPackage ({ elpaBuild, fetchurl, lib }:
elpaBuild {
pname = "pyim-basedict";
ename = "pyim-basedict";
version = "0.5.0";
src = fetchurl {
url = "https://elpa.gnu.org/packages/pyim-basedict-0.5.0.tar";
sha256 = "0h946wsnbbii32kl2kpv0k1kq118ymvpd5q1mphfsf126dz9sv78";
};
packageRequires = [];
meta = {
homepage = "https://elpa.gnu.org/packages/pyim-basedict.html";
license = lib.licenses.free;
};
}) {};
python = callPackage ({ cl-lib ? null, elpaBuild, emacs, fetchurl, lib }: python = callPackage ({ cl-lib ? null, elpaBuild, emacs, fetchurl, lib }:
elpaBuild { elpaBuild {
pname = "python"; pname = "python";
@ -3073,10 +3133,10 @@
elpaBuild { elpaBuild {
pname = "rt-liberation"; pname = "rt-liberation";
ename = "rt-liberation"; ename = "rt-liberation";
version = "2.2"; version = "2.3";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/rt-liberation-2.2.tar"; url = "https://elpa.gnu.org/packages/rt-liberation-2.3.tar";
sha256 = "01nkkrgygq5p5s0pfxpcn794jr6ln65ad809v9mvzz7972xw625s"; sha256 = "0sqq5zfzx9dir6d6zvg7vj5v629b508bbxsp7j0sp21rr4fw9nn0";
}; };
packageRequires = []; packageRequires = [];
meta = { meta = {
@ -3469,10 +3529,10 @@
elpaBuild { elpaBuild {
pname = "swiper"; pname = "swiper";
ename = "swiper"; ename = "swiper";
version = "0.13.1"; version = "0.13.4";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/swiper-0.13.1.tar"; url = "https://elpa.gnu.org/packages/swiper-0.13.4.tar";
sha256 = "0k39pa89y0bfvdfqg3nc5pjq5mwxwimc4ma3z28vaf14zd38x9m1"; sha256 = "197pq2cvvskib87aky907wv2am55vilr7y5dabmmm07a8vr9py0v";
}; };
packageRequires = [ emacs ivy ]; packageRequires = [ emacs ivy ];
meta = { meta = {
@ -3799,10 +3859,10 @@
elpaBuild { elpaBuild {
pname = "verilog-mode"; pname = "verilog-mode";
ename = "verilog-mode"; ename = "verilog-mode";
version = "2020.6.27.14326051"; version = "2021.2.2.263931197";
src = fetchurl { src = fetchurl {
url = "https://elpa.gnu.org/packages/verilog-mode-2020.6.27.14326051.el"; url = "https://elpa.gnu.org/packages/verilog-mode-2021.2.2.263931197.tar";
sha256 = "194gn8cj01jb9xcl0qq3gq6mzxfdyn459ysb35fnib7pcnafm188"; sha256 = "0rizadyzrsprc3mw3h2ag4760wapx5gxzsr11rgrllwzzqwin1ks";
}; };
packageRequires = []; packageRequires = [];
meta = { meta = {

View file

@ -4,10 +4,10 @@
elpaBuild { elpaBuild {
pname = "org"; pname = "org";
ename = "org"; ename = "org";
version = "20210301"; version = "20210308";
src = fetchurl { src = fetchurl {
url = "https://orgmode.org/elpa/org-20210301.tar"; url = "https://orgmode.org/elpa/org-20210308.tar";
sha256 = "0930km35lvbw89ifrqmcv96fjmp4fi12yv3spn51q27sfsmzqsrj"; sha256 = "1i5zga615inn5s547329g6paqbzcbhyj9hxv14c0c1m9bhra5bjs";
}; };
packageRequires = []; packageRequires = [];
meta = { meta = {
@ -19,10 +19,10 @@
elpaBuild { elpaBuild {
pname = "org-plus-contrib"; pname = "org-plus-contrib";
ename = "org-plus-contrib"; ename = "org-plus-contrib";
version = "20210301"; version = "20210308";
src = fetchurl { src = fetchurl {
url = "https://orgmode.org/elpa/org-plus-contrib-20210301.tar"; url = "https://orgmode.org/elpa/org-plus-contrib-20210308.tar";
sha256 = "11mwar5x848iwc1cdssr3vyx0amji840x6f0dmjpigngpcnj02m8"; sha256 = "1agbxhjkkmf4p8p8mwc6sv77ij22dr5fyhkpsnljvzkidiarfldf";
}; };
packageRequires = []; packageRequires = [];
meta = { meta = {

View file

@ -2,16 +2,16 @@
buildGoModule rec { buildGoModule rec {
pname = "glow"; pname = "glow";
version = "1.3.0"; version = "1.4.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "charmbracelet"; owner = "charmbracelet";
repo = "glow"; repo = "glow";
rev = "v${version}"; rev = "v${version}";
sha256 = "1y5cdqmyc2z2qk74l0r2c4mnw0jfibrf2ry7qcnmh96nhalq9m7j"; sha256 = "13ip29yxjc2fhsk12m6hj6mswrgc9a4m8gf0hiffd1nh5313mqxi";
}; };
vendorSha256 = "11x6hshbqg1a39a1hwpfivgrhyk7ykw2aqylira3dqv039b1f639"; vendorSha256 = "0i49b1yq9x5n59k29yacxyif928r0w7hl6azfvr5k3rssg0y4l7f";
doCheck = false; doCheck = false;

View file

@ -0,0 +1,46 @@
# Deprecated aliases - for backward compatibility
lib: overriden:
with overriden;
let
# Removing recurseForDerivation prevents derivations of aliased attribute
# set to appear while listing all the packages available.
removeRecurseForDerivations = alias: with lib;
if alias.recurseForDerivations or false then
removeAttrs alias ["recurseForDerivations"]
else alias;
# Disabling distribution prevents top-level aliases for non-recursed package
# sets from building on Hydra.
removeDistribute = alias: with lib;
if isDerivation alias then
dontDistribute alias
else alias;
# Make sure that we are not shadowing something from
# all-packages.nix.
checkInPkgs = n: alias: if builtins.hasAttr n overriden
then throw "Alias ${n} is still in kakounePlugins"
else alias;
mapAliases = aliases:
lib.mapAttrs (n: alias: removeDistribute
(removeRecurseForDerivations
(checkInPkgs n alias)))
aliases;
deprecations = lib.mapAttrs (old: info:
throw "${old} was renamed to ${info.new} on ${info.date}. Please update to ${info.new}."
) (builtins.fromJSON (builtins.readFile ./deprecated.json));
in
mapAliases ({
kak-auto-pairs = auto-pairs-kak; # backwards compat, added 2021-01-04
kak-buffers = kakoune-buffers; # backwards compat, added 2021-01-04
kak-fzf = fzf-kak; # backwards compat, added 2021-01-04
kak-powerline = powerline-kak; # backwards compat, added 2021-01-04
kak-prelude = prelude-kak; # backwards compat, added 2021-01-04
kak-vertical-selection = kakoune-vertical-selection; # backwards compat, added 2021-01-04
} // deprecations)

View file

@ -0,0 +1,33 @@
{ lib, stdenv, rtpPath ? "share/kak/autoload/plugins" }:
rec {
buildKakounePlugin = attrs@{
name ? "${attrs.pname}-${attrs.version}",
namePrefix ? "kakplugin-",
src,
unpackPhase ? "",
configurePhase ? "",
buildPhase ? "",
preInstall ? "",
postInstall ? "",
path ? lib.getName name,
...
}:
stdenv.mkDerivation ((builtins.removeAttrs attrs [ "namePrefix" "path" ]) // {
name = namePrefix + name;
installPhase = ''
runHook preInstall
target=$out/${rtpPath}/${path}
mkdir -p $out/${rtpPath}
cp -r . $target
runHook postInstall
'';
});
buildKakounePluginFrom2Nix = attrs: buildKakounePlugin ({
buildPhase = ":";
configurePhase = ":";
} // attrs);
}

View file

@ -1,27 +0,0 @@
{ lib, stdenv, fetchFromGitLab }:
stdenv.mkDerivation {
name = "case.kak";
version = "unstable-2020-04-06";
src = fetchFromGitLab {
owner = "FlyingWombat";
repo = "case.kak";
rev = "6f1511820aa3abfa118e0f856118adc8113e2185";
sha256 = "002njrlwgakqgp74wivbppr9qyn57dn4n5bxkr6k6nglk9qndwdp";
};
installPhase = ''
mkdir -p $out/share/kak/autoload/plugins
cp -r rc/case.kak $out/share/kak/autoload/plugins
'';
meta = with lib; {
description = "Case convention conversion for Kakoune";
homepage = "https://gitlab.com/FlyingWombat/case.kak";
license = licenses.unlicense;
maintainers = with maintainers; [ eraserhd ];
platform = platforms.all;
};
}

View file

@ -1,17 +1,25 @@
{ pkgs, parinfer-rust, rep, kak-lsp }: { callPackage, config, kakouneUtils, lib }:
{ let
inherit parinfer-rust rep kak-lsp;
case-kak = pkgs.callPackage ./case.kak.nix { }; inherit (kakouneUtils.override {}) buildKakounePluginFrom2Nix;
kak-ansi = pkgs.callPackage ./kak-ansi.nix { };
kak-auto-pairs = pkgs.callPackage ./kak-auto-pairs.nix { }; plugins = callPackage ./generated.nix {
kak-buffers = pkgs.callPackage ./kak-buffers.nix { }; inherit buildKakounePluginFrom2Nix overrides;
kak-fzf = pkgs.callPackage ./kak-fzf.nix { }; };
kak-plumb = pkgs.callPackage ./kak-plumb.nix { };
kak-powerline = pkgs.callPackage ./kak-powerline.nix { }; # TL;DR
kak-prelude = pkgs.callPackage ./kak-prelude.nix { }; # * Add your plugin to ./kakoune-plugin-names
kak-vertical-selection = pkgs.callPackage ./kak-vertical-selection.nix { }; # * run ./update.py
openscad-kak = pkgs.callPackage ./openscad.kak.nix { }; #
quickscope-kak = pkgs.callPackage ./quickscope.kak.nix { }; # If additional modifications to the build process are required,
} # add to ./overrides.nix.
overrides = callPackage ./overrides.nix {
inherit buildKakounePluginFrom2Nix;
};
aliases = lib.optionalAttrs (config.allowAliases or true) (import ./aliases.nix lib plugins);
in
plugins // aliases

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1,211 @@
# This file has been generated by ./pkgs/applications/editors/kakoune/plugins/update.py. Do not edit!
{ lib, buildKakounePluginFrom2Nix, fetchFromGitHub, overrides ? (self: super: {}) }:
let
packages = ( self:
{
active-window-kak = buildKakounePluginFrom2Nix {
pname = "active-window-kak";
version = "2020-05-13";
src = fetchFromGitHub {
owner = "greenfork";
repo = "active-window.kak";
rev = "988db69cfbb88bd741d089bb43b0be551693e7c1";
sha256 = "1fv1cp9q212gamf9z2papl5xcl2w31fpcmbgdzbxcxdl1pvfsqp8";
};
meta.homepage = "https://github.com/greenfork/active-window.kak/";
};
auto-pairs-kak = buildKakounePluginFrom2Nix {
pname = "auto-pairs-kak";
version = "2020-10-04";
src = fetchFromGitHub {
owner = "alexherbo2";
repo = "auto-pairs.kak";
rev = "fd735ec149ef0d9ca5f628a95b1e52858b5afbdc";
sha256 = "07795kv9njlnp6mckwv141ny2ns6wyf5r0dfjaxh9ngd105zgif1";
};
meta.homepage = "https://github.com/alexherbo2/auto-pairs.kak/";
};
connect-kak = buildKakounePluginFrom2Nix {
pname = "connect-kak";
version = "2021-02-13";
src = fetchFromGitHub {
owner = "alexherbo2";
repo = "connect.kak";
rev = "0858c0e50c6ca6d214fb088f052385a242548e83";
sha256 = "1w4pwybg3v916hcyc49gz0blygv54ivv81x8fxp44ck0sy98idr3";
};
meta.homepage = "https://github.com/alexherbo2/connect.kak/";
};
fzf-kak = buildKakounePluginFrom2Nix {
pname = "fzf-kak";
version = "2021-01-27";
src = fetchFromGitHub {
owner = "andreyorst";
repo = "fzf.kak";
rev = "e10de405e2a98e910d0808059200d206ba80f865";
sha256 = "1hbsm1k8k0cgv7gxqicvnl22n2lb1plhkanniggk694gll22lq68";
};
meta.homepage = "https://github.com/andreyorst/fzf.kak/";
};
kakoune-buffer-switcher = buildKakounePluginFrom2Nix {
pname = "kakoune-buffer-switcher";
version = "2020-12-27";
src = fetchFromGitHub {
owner = "occivink";
repo = "kakoune-buffer-switcher";
rev = "6a27c45db87a23070c34fab36d2f8d812cd002a6";
sha256 = "1rmwy317908v8p54806m721bpzm8sgygb9abri34537ka6r05y5j";
};
meta.homepage = "https://github.com/occivink/kakoune-buffer-switcher/";
};
kakoune-buffers = buildKakounePluginFrom2Nix {
pname = "kakoune-buffers";
version = "2020-06-11";
src = fetchFromGitHub {
owner = "Delapouite";
repo = "kakoune-buffers";
rev = "67959fbad727ba8470fe8cd6361169560f4fb532";
sha256 = "09prhzz4yzf6ryw0npd1gpcfp77681vgawpp1ilfvbf25xgbbz33";
};
meta.homepage = "https://github.com/Delapouite/kakoune-buffers/";
};
kakoune-easymotion = buildKakounePluginFrom2Nix {
pname = "kakoune-easymotion";
version = "2020-03-09";
src = fetchFromGitHub {
owner = "danr";
repo = "kakoune-easymotion";
rev = "0ca75450023a149efc70e8e383e459b571355c70";
sha256 = "15czvl0qj2k767pysr6xk2v31mkhvcbmv76xs2a8yrslchms70b5";
};
meta.homepage = "https://github.com/danr/kakoune-easymotion/";
};
kakoune-extra-filetypes = buildKakounePluginFrom2Nix {
pname = "kakoune-extra-filetypes";
version = "2021-01-15";
src = fetchFromGitHub {
owner = "kakoune-editor";
repo = "kakoune-extra-filetypes";
rev = "c6f8aaccd8c9cd6b487964c8943416e21fbe7c18";
sha256 = "1vkff8xbycfgxv8x09cvc79qcg5fdzn2x77mbmifmkq236khrwrg";
};
meta.homepage = "https://github.com/kakoune-editor/kakoune-extra-filetypes/";
};
kakoune-rainbow = buildKakounePluginFrom2Nix {
pname = "kakoune-rainbow";
version = "2020-09-01";
src = fetchFromGitHub {
owner = "listentolist";
repo = "kakoune-rainbow";
rev = "d09103e8d268cf4621215bf162a0244c9482be3c";
sha256 = "1i3id7xw0j4z1a14mscr68ckpgvcwsjpl86lr864wy7w7qcmblx6";
};
meta.homepage = "https://github.com/listentolist/kakoune-rainbow/";
};
kakoune-registers = buildKakounePluginFrom2Nix {
pname = "kakoune-registers";
version = "2020-06-19";
src = fetchFromGitHub {
owner = "Delapouite";
repo = "kakoune-registers";
rev = "9531947baecd83c1d4c3bea0adf10f4462f1e120";
sha256 = "08v9ndghh7wvr8rsrqm05gksk9ai5vnwvw9gwqasbppb48cv4a8c";
};
meta.homepage = "https://github.com/Delapouite/kakoune-registers/";
};
kakoune-vertical-selection = buildKakounePluginFrom2Nix {
pname = "kakoune-vertical-selection";
version = "2019-04-11";
src = fetchFromGitHub {
owner = "occivink";
repo = "kakoune-vertical-selection";
rev = "c420f8b867ce47375fac303886e31623669a42b7";
sha256 = "13jdyd2j45wvgqvxdzw9zww14ly93bqjb6700zzxj7mkbiff6wsb";
};
meta.homepage = "https://github.com/occivink/kakoune-vertical-selection/";
};
openscad-kak = buildKakounePluginFrom2Nix {
pname = "openscad-kak";
version = "2020-12-10";
src = fetchFromGitHub {
owner = "mayjs";
repo = "openscad.kak";
rev = "ba51bbdcd96ccf94bb9239bef1481b6f37125849";
sha256 = "15dybd6dnnwla6mj8sw83nwd62para1syxzifznl6rz6kp8vqjjj";
};
meta.homepage = "https://github.com/mayjs/openscad.kak/";
};
powerline-kak = buildKakounePluginFrom2Nix {
pname = "powerline-kak";
version = "2021-02-15";
src = fetchFromGitHub {
owner = "jdugan6240";
repo = "powerline.kak";
rev = "322a760daa099d519ff50d14c29b27f3e2af00d1";
sha256 = "0mb8f8p6g75p05ifp45i0gbq2mib8c8giz7r1xfd0yrwspp4aksc";
};
meta.homepage = "https://github.com/jdugan6240/powerline.kak/";
};
prelude-kak = buildKakounePluginFrom2Nix {
pname = "prelude-kak";
version = "2020-09-06";
src = fetchFromGitHub {
owner = "alexherbo2";
repo = "prelude.kak";
rev = "f1e0f4d5cb62a36924e3f8ba6824d6aed8c19d23";
sha256 = "1pncr8azqvl2z9yvzhc68p1s9fld8cvak8yz88zgrp5ypx2cxl8c";
};
meta.homepage = "https://github.com/alexherbo2/prelude.kak/";
};
replace-mode-kak = buildKakounePluginFrom2Nix {
pname = "replace-mode-kak";
version = "2020-10-07";
src = fetchFromGitHub {
owner = "alexherbo2";
repo = "replace-mode.kak";
rev = "5f4c73cdbaf5aeb964ee35ad4b9081b233af90c0";
sha256 = "1cmylx99bm7jwfb4hclb69sdc4n8f29ssyy2byjiw53ni9rnc8q0";
};
meta.homepage = "https://github.com/alexherbo2/replace-mode.kak/";
};
sleuth-kak = buildKakounePluginFrom2Nix {
pname = "sleuth-kak";
version = "2020-11-06";
src = fetchFromGitHub {
owner = "alexherbo2";
repo = "sleuth.kak";
rev = "911db8bd208ad0d289b8fa15a2ac665ff39bd6bd";
sha256 = "0g41c0038fpmihqva71xl4vfbmvsp13i47gp6fnmaikajpynzc51";
};
meta.homepage = "https://github.com/alexherbo2/sleuth.kak/";
};
tabs-kak = buildKakounePluginFrom2Nix {
pname = "tabs-kak";
version = "2021-02-16";
src = fetchFromGitHub {
owner = "enricozb";
repo = "tabs.kak";
rev = "1aaa8cd89e404cbbd76d44ff8089de0951612fbf";
sha256 = "0dfz6j6yxl65jbh4xvpiy2abr2sdjyalynzhl28y7l1gzqv4ni3j";
};
meta.homepage = "https://github.com/enricozb/tabs.kak/";
};
});
in lib.fix' (lib.extends overrides packages)

View file

@ -1,32 +0,0 @@
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "kak-ansi";
version = "0.2.1";
src = fetchFromGitHub {
owner = "eraserhd";
repo = "kak-ansi";
rev = "v${version}";
sha256 = "0ddjih8hfyf6s4g7y46p1355kklaw1ydzzh61141i0r45wyb2d0d";
};
installPhase = ''
mkdir -p $out/bin $out/share/kak/autoload/plugins/
cp kak-ansi-filter $out/bin/
# Hard-code path of filter and don't try to build when Kakoune boots
sed '
/^declare-option.* ansi_filter /i\
declare-option -hidden str ansi_filter %{'"$out"'/bin/kak-ansi-filter}
/^declare-option.* ansi_filter /,/^}/d
' rc/ansi.kak >$out/share/kak/autoload/plugins/ansi.kak
'';
meta = with lib; {
description = "Kakoune support for rendering ANSI code";
homepage = "https://github.com/eraserhd/kak-ansi";
license = licenses.unlicense;
maintainers = with maintainers; [ eraserhd ];
platforms = platforms.all;
};
}

View file

@ -1,24 +0,0 @@
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation {
name = "kak-auto-pairs";
version = "2020-07-14";
src = fetchFromGitHub {
owner = "alexherbo2";
repo = "auto-pairs.kak";
rev = "5b4b3b723c34c8b7f40cee60868204974349bf9f";
sha256 = "1wgrv03f1lkzflbbaz8n23glij5rvfxf8pcqysd668mbx1hcrk9i";
};
installPhase = ''
mkdir -p $out/share/kak/autoload/plugins
cp -r rc $out/share/kak/autoload/plugins/auto-pairs
'';
meta = with lib;
{ description = "Kakoune extension to enable automatic closing of pairs";
homepage = "https://github.com/alexherbo2/auto-pairs.kak";
license = licenses.unlicense;
maintainers = with maintainers; [ nrdxp ];
platform = platforms.all;
};
}

View file

@ -1,24 +0,0 @@
{ stdenv, fetchFromGitHub, lib }:
stdenv.mkDerivation {
name = "kak-buffers";
version = "2019-04-03";
src = fetchFromGitHub {
owner = "Delapouite";
repo = "kakoune-buffers";
rev = "3b35b23ac2be661a37c085d34dd04d066450f757";
sha256 = "0f3g0v1sjinii3ig9753jjj35v2km4h9bcfw9xgzwz8b10d75bax";
};
installPhase = ''
mkdir -p $out/share/kak/autoload/plugins
cp -r buffers.kak $out/share/kak/autoload/plugins
'';
meta = with lib;
{ description = "Ease navigation between opened buffers in Kakoune";
homepage = "https://github.com/Delapouite/kakoune-buffers";
license = licenses.mit;
maintainers = with maintainers; [ nrdxp ];
platform = platforms.all;
};
}

View file

@ -1,39 +0,0 @@
{ lib, stdenv, fetchFromGitHub, fzf }:
assert lib.asserts.assertOneOf "fzf" fzf.pname [ "fzf" "skim" ];
stdenv.mkDerivation {
name = "kak-fzf";
version = "2020-07-26";
src = fetchFromGitHub {
owner = "andreyorst";
repo = "fzf.kak";
rev = "f23daa698ad95493fbd675ae153e3cac13ef34e9";
hash = "sha256-BfXHTJ371ThOizMI/4BAbdJoaltGSP586hz4HqX1KWA=";
};
configurePhase = ''
if [[ -x "${fzf}/bin/fzf" ]]; then
fzfImpl='${fzf}/bin/fzf'
else
fzfImpl='${fzf}/bin/sk'
fi
substituteInPlace rc/fzf.kak \
--replace \'fzf\' \'"$fzfImpl"\'
'';
installPhase = ''
mkdir -p $out/share/kak/autoload/plugins
cp -r rc $out/share/kak/autoload/plugins/fzf
'';
meta = with lib;
{ description = "Kakoune plugin that brings integration with fzf";
homepage = "https://github.com/andreyorst/fzf.kak";
license = licenses.mit;
maintainers = with maintainers; [ nrdxp ];
platform = platforms.all;
};
}

View file

@ -1,31 +0,0 @@
{ lib, stdenv, fetchFromGitHub, kakoune-unwrapped, plan9port, ... }:
stdenv.mkDerivation rec {
pname = "kak-plumb";
version = "0.1.1";
src = fetchFromGitHub {
owner = "eraserhd";
repo = "kak-plumb";
rev = "v${version}";
sha256 = "1rz6pr786slnf1a78m3sj09axr4d2lb5rg7sfa4mfg1zcjh06ps6";
};
installPhase = ''
mkdir -p $out/bin $out/share/kak/autoload/plugins/
substitute rc/plumb.kak $out/share/kak/autoload/plugins/plumb.kak \
--replace '9 plumb' '${plan9port}/bin/9 plumb'
substitute edit-client $out/bin/edit-client \
--replace '9 9p' '${plan9port}/bin/9 9p' \
--replace 'kak -p' '${kakoune-unwrapped}/bin/kak -p'
chmod +x $out/bin/edit-client
'';
meta = with lib; {
description = "Kakoune integration with the Plan 9 plumber";
homepage = "https://github.com/eraserhd/kak-plumb";
license = licenses.unlicense;
maintainers = with maintainers; [ eraserhd ];
platforms = platforms.all;
};
}

View file

@ -1,29 +0,0 @@
{ stdenv, git, fetchFromGitHub, lib }:
stdenv.mkDerivation {
name = "kak-powerline";
version = "2020-08-22";
src = fetchFromGitHub {
owner = "jdugan6240";
repo = "powerline.kak";
rev = "d641b2cd8024f872bcda23f9256e7aff36da02ae";
sha256 = "65948f5ef3ab2f46f6d186ad752665c251d887631d439949decc2654a67958a4";
};
configurePhase = ''
substituteInPlace rc/modules/git.kak \
--replace \'git\' \'${git}/bin/git\'
'';
installPhase = ''
mkdir -p $out/share/kak/autoload/plugins
cp -r rc $out/share/kak/autoload/plugins/powerline
'';
meta = with lib;
{ description = "Kakoune modeline, but with passion";
homepage = "https://github.com/jdugan6240/powerline.kak";
license = licenses.mit;
maintainers = with maintainers; [ nrdxp ];
platform = platforms.all;
};
}

View file

@ -1,25 +0,0 @@
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation {
name = "kak-prelude";
version = "2020-06-09";
src = fetchFromGitHub {
owner = "alexherbo2";
repo = "prelude.kak";
rev = "f1e0f4d5cb62a36924e3f8ba6824d6aed8c19d23";
sha256 = "1pncr8azqvl2z9yvzhc68p1s9fld8cvak8yz88zgrp5ypx2cxl8c";
};
installPhase = ''
mkdir -p $out/share/kak/autoload/plugins
cp -r rc $out/share/kak/autoload/plugins/prelude
'';
meta = with lib;
{ description = "Prelude of shell blocks for Kakoune.";
homepage = "https://github.com/alexherbo2/prelude.kak";
license = licenses.unlicense;
maintainers = with maintainers; [ buffet ];
platform = platforms.all;
};
}

View file

@ -1,24 +0,0 @@
{ stdenv, fetchFromGitHub, lib }:
stdenv.mkDerivation {
name = "kak-vertical-selection";
version = "2019-04-11";
src = fetchFromGitHub {
owner = "occivink";
repo = "kakoune-vertical-selection";
rev = "c420f8b867ce47375fac303886e31623669a42b7";
sha256 = "13jdyd2j45wvgqvxdzw9zww14ly93bqjb6700zzxj7mkbiff6wsb";
};
installPhase = ''
mkdir -p $out/share/kak/autoload/plugins
cp -r vertical-selection.kak $out/share/kak/autoload/plugins
'';
meta = with lib;
{ description = "Select up and down lines that match the same pattern in Kakoune";
homepage = "https://github.com/occivink/kakoune-vertical-selection";
license = licenses.unlicense;
maintainers = with maintainers; [ nrdxp ];
platform = platforms.all;
};
}

View file

@ -0,0 +1,17 @@
alexherbo2/auto-pairs.kak
alexherbo2/connect.kak
alexherbo2/prelude.kak
alexherbo2/replace-mode.kak
alexherbo2/sleuth.kak
andreyorst/fzf.kak
danr/kakoune-easymotion
Delapouite/kakoune-buffers
Delapouite/kakoune-registers
enricozb/tabs.kak@main
greenfork/active-window.kak
jdugan6240/powerline.kak
kakoune-editor/kakoune-extra-filetypes
listentolist/kakoune-rainbow
mayjs/openscad.kak
occivink/kakoune-buffer-switcher
occivink/kakoune-vertical-selection

View file

@ -0,0 +1,4 @@
{ lib, stdenv }:
{
inherit (import ./build-kakoune-plugin.nix { inherit lib stdenv; }) buildKakounePlugin buildKakounePluginFrom2Nix;
}

View file

@ -1,25 +0,0 @@
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation {
pname = "openscad.kak";
version = "unstable-2019-11-08";
src = fetchFromGitHub {
owner = "mayjs";
repo = "openscad.kak";
rev = "d9143d5e7834e3356b49720664d5647cab9db7cc";
sha256 = "0j4dqhrn56z77hdalfdxagwz8h6nwr8s9i4w0bs2644k72lsm2ix";
};
installPhase = ''
install -Dm644 rc/openscad.kak -t $out/share/kak/autoload/plugins/
'';
meta = with lib; {
description = "Syntax highlighting for OpenSCAD files";
homepage = "https://github.com/mayjs/openscad.kak";
license = licenses.unlicense;
maintainers = with maintainers; [ eraserhd ];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,161 @@
{ lib, stdenv, fetchFromGitHub, fetchFromGitLab, fetchgit
, buildKakounePluginFrom2Nix
, kak-lsp, parinfer-rust, rep
, fzf, git, guile, kakoune-unwrapped, lua5_3, plan9port
}:
self: super: {
inherit kak-lsp parinfer-rust rep;
case-kak = buildKakounePluginFrom2Nix {
pname = "case-kak";
version = "2020-04-06";
src = fetchFromGitLab {
owner = "FlyingWombat";
repo = "case.kak";
rev = "6f1511820aa3abfa118e0f856118adc8113e2185";
sha256 = "002njrlwgakqgp74wivbppr9qyn57dn4n5bxkr6k6nglk9qndwdp";
};
meta.homepage = "https://gitlab.com/FlyingWombat/case.kak";
};
fzf-kak = super.fzf-kak.overrideAttrs(oldAttrs: rec {
preFixup = ''
if [[ -x "${fzf}/bin/fzf" ]]; then
fzfImpl='${fzf}/bin/fzf'
else
fzfImpl='${fzf}/bin/sk'
fi
substituteInPlace $out/share/kak/autoload/plugins/fzf-kak/rc/fzf.kak \
--replace \'fzf\' \'"$fzfImpl"\'
'';
});
kak-ansi = stdenv.mkDerivation rec {
pname = "kak-ansi";
version = "0.2.1";
src = fetchFromGitHub {
owner = "eraserhd";
repo = "kak-ansi";
rev = "v${version}";
sha256 = "0ddjih8hfyf6s4g7y46p1355kklaw1ydzzh61141i0r45wyb2d0d";
};
installPhase = ''
mkdir -p $out/bin $out/share/kak/autoload/plugins/
cp kak-ansi-filter $out/bin/
# Hard-code path of filter and don't try to build when Kakoune boots
sed '
/^declare-option.* ansi_filter /i\
declare-option -hidden str ansi_filter %{'"$out"'/bin/kak-ansi-filter}
/^declare-option.* ansi_filter /,/^}/d
' rc/ansi.kak >$out/share/kak/autoload/plugins/ansi.kak
'';
meta = with lib; {
description = "Kakoune support for rendering ANSI code";
homepage = "https://github.com/eraserhd/kak-ansi";
license = licenses.unlicense;
maintainers = with maintainers; [ eraserhd ];
platforms = platforms.all;
};
};
kak-plumb = stdenv.mkDerivation rec {
pname = "kak-plumb";
version = "0.1.1";
src = fetchFromGitHub {
owner = "eraserhd";
repo = "kak-plumb";
rev = "v${version}";
sha256 = "1rz6pr786slnf1a78m3sj09axr4d2lb5rg7sfa4mfg1zcjh06ps6";
};
installPhase = ''
mkdir -p $out/bin $out/share/kak/autoload/plugins/
substitute rc/plumb.kak $out/share/kak/autoload/plugins/plumb.kak \
--replace '9 plumb' '${plan9port}/bin/9 plumb'
substitute edit-client $out/bin/edit-client \
--replace '9 9p' '${plan9port}/bin/9 9p' \
--replace 'kak -p' '${kakoune-unwrapped}/bin/kak -p'
chmod +x $out/bin/edit-client
'';
meta = with lib; {
description = "Kakoune integration with the Plan 9 plumber";
homepage = "https://github.com/eraserhd/kak-plumb";
license = licenses.unlicense;
maintainers = with maintainers; [ eraserhd ];
platforms = platforms.all;
};
};
kakoune-rainbow = super.kakoune-rainbow.overrideAttrs(oldAttrs: rec {
preFixup = ''
mkdir -p $out/bin
mv $out/share/kak/autoload/plugins/kakoune-rainbow/bin/kak-rainbow.scm $out/bin
substituteInPlace $out/bin/kak-rainbow.scm \
--replace '/usr/bin/env -S guile' '${guile}/bin/guile'
substituteInPlace $out/share/kak/autoload/plugins/kakoune-rainbow/rainbow.kak \
--replace '%sh{dirname "$kak_source"}' "'$out'"
'';
});
kakoune-state-save = buildKakounePluginFrom2Nix {
pname = "kakoune-state-save";
version = "2020-02-09";
src = fetchFromGitLab {
owner = "Screwtapello";
repo = "kakoune-state-save";
rev = "ab7c0c765326a4a80af78857469ee8c80814c52a";
sha256 = "AAOCG0TY3G188NnkkwMCSbkkNe487F4gwiFWwG9Yo+A=";
};
meta = with lib; {
description = "Help Kakoune save and restore state between sessions";
homepage = "https://gitlab.com/Screwtapello/kakoune-state-save";
license = licenses.mit;
maintainers = with maintainers; [ Flakebi ];
platforms = platforms.all;
};
};
powerline-kak = super.powerline-kak.overrideAttrs(oldAttrs: rec {
preFixup = ''
substituteInPlace $out/share/kak/autoload/plugins/powerline-kak/rc/modules/git.kak \
--replace ' git ' ' ${git}/bin/git '
'';
});
quickscope-kak = buildKakounePluginFrom2Nix rec {
pname = "quickscope-kak";
version = "1.0.0";
src = fetchgit {
url = "https://git.sr.ht/~voroskoi/quickscope.kak";
rev = "v${version}";
sha256 = "0y1g3zpa2ql8l9rl5i2w84bka8a09kig9nq9zdchaff5pw660mcx";
};
buildInputs = [ lua5_3 ];
installPhase = ''
mkdir -p $out/share/kak/autoload/plugins/
cp quickscope.* $out/share/kak/autoload/plugins/
# substituteInPlace does not like the pipe
sed -e 's,[|] *lua,|${lua5_3}/bin/lua,' quickscope.kak >$out/share/kak/autoload/plugins/quickscope.kak
'';
meta = with lib; {
description = "Highlight f and t jump positions";
homepage = "https://sr.ht/~voroskoi/quickscope.kak/";
license = licenses.unlicense;
maintainers = with maintainers; [ eraserhd ];
platforms = platforms.all;
};
};
}

View file

@ -1,29 +0,0 @@
{ lib, stdenv, fetchgit, lua5_3 }:
stdenv.mkDerivation rec {
pname = "quickscope-kak";
version = "1.0.0";
src = fetchgit {
url = "https://git.sr.ht/~voroskoi/quickscope.kak";
rev = "v${version}";
sha256 = "0y1g3zpa2ql8l9rl5i2w84bka8a09kig9nq9zdchaff5pw660mcx";
};
buildInputs = [ lua5_3 ];
installPhase = ''
mkdir -p $out/share/kak/autoload/plugins/
cp quickscope.* $out/share/kak/autoload/plugins/
# substituteInPlace does not like the pipe
sed -e 's,[|] *lua,|${lua5_3}/bin/lua,' quickscope.kak >$out/share/kak/autoload/plugins/quickscope.kak
'';
meta = with lib; {
description = "Highlight f and t jump positions";
homepage = "https://sr.ht/~voroskoi/quickscope.kak/";
license = licenses.unlicense;
maintainers = with maintainers; [ eraserhd ];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,91 @@
#!/usr/bin/env nix-shell
#!nix-shell -p nix-prefetch-git -p python3 -p python3Packages.GitPython nix -i python3
# format:
# $ nix run nixpkgs.python3Packages.black -c black update.py
# type-check:
# $ nix run nixpkgs.python3Packages.mypy -c mypy update.py
# linted:
# $ nix run nixpkgs.python3Packages.flake8 -c flake8 --ignore E501,E265,E402 update.py
import inspect
import os
import sys
from typing import List, Tuple
from pathlib import Path
# Import plugin update library from maintainers/scripts/pluginupdate.py
ROOT = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
sys.path.insert(
0, os.path.join(ROOT.parent.parent.parent.parent.parent, "maintainers", "scripts")
)
import pluginupdate
GET_PLUGINS = f"""(with import <localpkgs> {{}};
let
inherit (kakouneUtils.override {{}}) buildKakounePluginFrom2Nix;
generated = callPackage {ROOT}/generated.nix {{
inherit buildKakounePluginFrom2Nix;
}};
hasChecksum = value: lib.isAttrs value && lib.hasAttrByPath ["src" "outputHash"] value;
getChecksum = name: value:
if hasChecksum value then {{
submodules = value.src.fetchSubmodules or false;
sha256 = value.src.outputHash;
rev = value.src.rev;
}} else null;
checksums = lib.mapAttrs getChecksum generated;
in lib.filterAttrs (n: v: v != null) checksums)"""
HEADER = "# This file has been generated by ./pkgs/applications/editors/kakoune/plugins/update.py. Do not edit!"
def generate_nix(plugins: List[Tuple[str, str, pluginupdate.Plugin]], outfile: str):
sorted_plugins = sorted(plugins, key=lambda v: v[2].name.lower())
with open(outfile, "w+") as f:
f.write(HEADER)
f.write(
"""
{ lib, buildKakounePluginFrom2Nix, fetchFromGitHub, overrides ? (self: super: {}) }:
let
packages = ( self:
{"""
)
for owner, repo, plugin in sorted_plugins:
if plugin.has_submodules:
submodule_attr = "\n fetchSubmodules = true;"
else:
submodule_attr = ""
f.write(
f"""
{plugin.normalized_name} = buildKakounePluginFrom2Nix {{
pname = "{plugin.normalized_name}";
version = "{plugin.version}";
src = fetchFromGitHub {{
owner = "{owner}";
repo = "{repo}";
rev = "{plugin.commit}";
sha256 = "{plugin.sha256}";{submodule_attr}
}};
meta.homepage = "https://github.com/{owner}/{repo}/";
}};
"""
)
f.write(
"""
});
in lib.fix' (lib.extends overrides packages)
"""
)
print(f"updated {outfile}")
def main():
editor = pluginupdate.Editor("kakoune", ROOT, GET_PLUGINS, generate_nix)
pluginupdate.update_plugins(editor)
if __name__ == "__main__":
main()

View file

@ -1,27 +1,19 @@
{ mkDerivation, lib, fetchFromGitHub, fetchpatch, cmake, pkg-config { mkDerivation, lib, fetchFromGitHub, cmake, pkg-config
, qtscript, poppler, hunspell , qtscript, poppler, hunspell
, withLua ? true, lua , withLua ? true, lua
, withPython ? true, python3 }: , withPython ? true, python3 }:
mkDerivation rec { mkDerivation rec {
pname = "texworks"; pname = "texworks";
version = "0.6.5"; version = "0.6.6";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "TeXworks"; owner = "TeXworks";
repo = "texworks"; repo = "texworks";
rev = "release-${version}"; rev = "release-${version}";
sha256 = "1lw1p4iyzxypvjhnav11g6rwf6gx7kyzwy2iprvv8zzpqcdkjp2z"; sha256 = "0l8jl1b8lpas7yz6m0qc2nikyn54lx2ljzmjjz3zgxgd6l502006";
}; };
patches = [
(fetchpatch {
name = "fix-compilation-with-qt-5.15.patch";
url = "https://github.com/TeXworks/texworks/commit/a5352a3a94e3685125650b65e6197de060326cc2.patch";
sha256 = "0pf7h1m11x0s039bxknm7rxdp9b4g8ch86y38jlyy56c74mw97i6";
})
];
nativeBuildInputs = [ cmake pkg-config ]; nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ qtscript poppler hunspell ] buildInputs = [ qtscript poppler hunspell ]
++ lib.optional withLua lua ++ lib.optional withLua lua

View file

@ -16,13 +16,13 @@ in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "imagemagick"; pname = "imagemagick";
version = "6.9.12-1"; version = "6.9.12-3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ImageMagick"; owner = "ImageMagick";
repo = "ImageMagick6"; repo = "ImageMagick6";
rev = version; rev = version;
sha256 = "1s1zr0fqnm9jl1ni07if2klvf2lfg26dgxdbspksq5xdhsxxn841"; sha256 = "sha256-h9c0N9AcFVpNYpKl+95q1RVJWuacN4N4kbAJIKJp8Jc=";
}; };
outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big
@ -81,6 +81,7 @@ stdenv.mkDerivation rec {
changelog = "https://legacy.imagemagick.org/script/changelog.php"; changelog = "https://legacy.imagemagick.org/script/changelog.php";
description = "A software suite to create, edit, compose, or convert bitmap images"; description = "A software suite to create, edit, compose, or convert bitmap images";
platforms = platforms.linux ++ platforms.darwin; platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ erictapen ];
license = licenses.asl20; license = licenses.asl20;
}; };
} }

View file

@ -3,13 +3,13 @@
mkDerivation rec { mkDerivation rec {
pname = "photoflare"; pname = "photoflare";
version = "1.6.6"; version = "1.6.7";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "PhotoFlare"; owner = "PhotoFlare";
repo = "photoflare"; repo = "photoflare";
rev = "v${version}"; rev = "v${version}";
sha256 = "07lrlxagv1bljj607s8m0zsbzx9jrvi18bnxahnm7r4i5car5x2d"; sha256 = "sha256-Gx3YP29NrNHp0p05a1O4Xb9kqkA6pQLTJZ3/wOx+BWY=";
}; };
nativeBuildInputs = [ qmake qttools ]; nativeBuildInputs = [ qmake qttools ];
@ -19,13 +19,11 @@ mkDerivation rec {
NIX_CFLAGS_COMPILE = "-I${graphicsmagick}/include/GraphicsMagick"; NIX_CFLAGS_COMPILE = "-I${graphicsmagick}/include/GraphicsMagick";
enableParallelBuilding = true;
meta = with lib; { meta = with lib; {
description = "A cross-platform image editor with a powerful features and a very friendly graphical user interface"; description = "A cross-platform image editor with a powerful features and a very friendly graphical user interface";
homepage = "https://photoflare.io"; homepage = "https://photoflare.io";
maintainers = [ maintainers.omgbebebe ]; maintainers = [ maintainers.omgbebebe ];
license = licenses.gpl3; license = licenses.gpl3Plus;
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }

View file

@ -13,14 +13,14 @@ let
pythonPackages = python3Packages; pythonPackages = python3Packages;
in in
mkDerivation rec { mkDerivation rec {
version = "1.11"; version = "1.12";
pname = "renderdoc"; pname = "renderdoc";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "baldurk"; owner = "baldurk";
repo = "renderdoc"; repo = "renderdoc";
rev = "v${version}"; rev = "v${version}";
sha256 = "01r4fq03fpyhwvn47wx3dw29vcadcd0qml00h36q38cq3pi9x42j"; sha256 = "4k0WsTsz4WwPZC8Dj85l2ntJOZkLgmBBOJcX9Bb4U7I=";
}; };
buildInputs = [ buildInputs = [

View file

@ -1,5 +1,5 @@
{ lib { lib
, fetchgit , fetchFromSourcehut
, python3 , python3
, glib , glib
, gobject-introspection , gobject-introspection
@ -18,8 +18,9 @@ python3.pkgs.buildPythonApplication rec {
version = "0.3"; version = "0.3";
format = "other"; format = "other";
src = fetchgit { src = fetchFromSourcehut {
url = "https://git.sr.ht/~craftyguy/caerbannog"; owner = "~craftyguy";
repo = "caerbannog";
rev = version; rev = version;
sha256 = "0wqkb9zcllxm3fdsr5lphknkzy8r1cr80f84q200hbi99qql1dxh"; sha256 = "0wqkb9zcllxm3fdsr5lphknkzy8r1cr80f84q200hbi99qql1dxh";
}; };

View file

@ -26,11 +26,11 @@
mkDerivation rec { mkDerivation rec {
pname = "calibre"; pname = "calibre";
version = "5.12.0"; version = "5.13.0";
src = fetchurl { src = fetchurl {
url = "https://download.calibre-ebook.com/${version}/${pname}-${version}.tar.xz"; url = "https://download.calibre-ebook.com/${version}/${pname}-${version}.tar.xz";
sha256 = "sha256-N3/y1kSWyM36LpwbimftJ67h4zfk2j9hcvUi/pQL3YU="; sha256 = "sha256-GDFAZxZmkio7e7kVjhYqhNdhXIlUPJF0iMWVl0uWVCM=";
}; };
patches = [ patches = [

View file

@ -46,13 +46,13 @@ let
in in
mkDerivation rec { mkDerivation rec {
pname = "crow-translate"; pname = "crow-translate";
version = "2.7.1"; version = "2.8.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "crow-translate"; owner = "crow-translate";
repo = "crow-translate"; repo = "crow-translate";
rev = version; rev = version;
sha256 = "sha256-YOsp/noGsYthre18fMyBj9s+YFzdHJfIJzJSm43wiZ0="; sha256 = "sha256-kpr3Xn1ZLBS1fVhhJ/sxo8UgB4M+SdOVhddnU8pNUfA=";
}; };
patches = [ patches = [

View file

@ -7,19 +7,25 @@
, gtk3 , gtk3
, gobject-introspection , gobject-introspection
, libxml2 , libxml2
, fetchpatch
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "deadd-notification-center"; pname = "deadd-notification-center";
version = "1.7.3"; version = "2021-03-10";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "phuhl"; owner = "phuhl";
repo = "linux_notification_center"; repo = "linux_notification_center";
rev = version; rev = "640ce0f";
sha256 = "QaOLrtlhQyhMOirk6JO1yMGRrgycHmF9FAdKNbN2TRk="; sha256 = "12ldr8vppylr90849g3mpjphmnr4lp0vsdkj01a5f4bv4ksx35fm";
}; };
dontUnpack = true; patches = [
(fetchpatch {
url = "https://github.com/phuhl/linux_notification_center/commit/5244e1498574983322be97925e1ff7ebe456d974.patch";
sha256 = "sha256-hbqbgBmuewOhtx0na2tmFa5W128ZrBvDcyPme/mRzlI=";
})
];
nativeBuildInputs = [ nativeBuildInputs = [
autoPatchelfHook autoPatchelfHook
@ -33,15 +39,18 @@ stdenv.mkDerivation rec {
hicolor-icon-theme hicolor-icon-theme
]; ];
installPhase = '' buildFlags = [
mkdir -p $out/bin $out/share/dbus-1/services # Exclude stack from `make all` to use the prebuilt binary from .out/
"service"
];
cp $src/.out/${pname} $out/bin/ makeFlags = [
chmod +x $out/bin/${pname} "PREFIX=${placeholder "out"}"
"SERVICEDIR_SYSTEMD=${placeholder "out"}/etc/systemd/user"
sed "s|##PREFIX##|$out|g" $src/${pname}.service.in > \ "SERVICEDIR_DBUS=${placeholder "out"}/share/dbus-1/services"
$out/share/dbus-1/services/com.ph-uhl.deadd.notification.service # Override systemd auto-detection.
''; "SYSTEMD=1"
];
meta = with lib; { meta = with lib; {
description = "A haskell-written notification center for users that like a desktop with style"; description = "A haskell-written notification center for users that like a desktop with style";

View file

@ -8,13 +8,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "free42"; pname = "free42";
version = "3.0"; version = "3.0.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "thomasokken"; owner = "thomasokken";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "jzNopLndYH9dIdm30pyDaZNksHwS4i5LTZUXRmcrTp8="; sha256 = "sha256-Htk2NHgYVL622URx67BUtounAUopLTahaSqfAqd3+ZI=";
}; };
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];

View file

@ -10,13 +10,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gphoto2"; pname = "gphoto2";
version = "2.5.26"; version = "2.5.27";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "gphoto"; owner = "gphoto";
repo = "gphoto2"; repo = "gphoto2";
rev = "v${version}"; rev = "v${version}";
sha256 = "1w01j3qvjl2nlfs38rnsmjvn3r0r2xf7prxz1i6yarbpj3fzwqqc"; sha256 = "sha256-zzlyA2IedyBZ4/TdSmrqbe2le8rFMQ6tY6jF5skJ7l4=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [

View file

@ -14,11 +14,11 @@ let
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "mkgmap"; pname = "mkgmap";
version = "4604"; version = "4608";
src = fetchurl { src = fetchurl {
url = "http://www.mkgmap.org.uk/download/mkgmap-r${version}-src.tar.gz"; url = "http://www.mkgmap.org.uk/download/mkgmap-r${version}-src.tar.gz";
sha256 = "HmQwi3kIVhZOQpSfG3V48vUTbncsJLb/YCqsXrmtmQM="; sha256 = "uj/iZZHML4nqEKdFBQSDdegkalZFJdzEE4xQrOruEp0=";
}; };
patches = [ patches = [

View file

@ -30,12 +30,12 @@ let
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "obsidian"; pname = "obsidian";
version = "0.11.3"; version = "0.11.5";
src = fetchurl { src = fetchurl {
url = url =
"https://github.com/obsidianmd/obsidian-releases/releases/download/v${version}/obsidian-${version}.tar.gz"; "https://github.com/obsidianmd/obsidian-releases/releases/download/v${version}/obsidian-${version}.tar.gz";
sha256 = "brpNQiWpIbvnPuCXrNJhBjgqPlhIb3dz3LFRf0M4K0Q="; sha256 = "FxhvRRxV8oxRwvImftoSTqrus2x5p90NfuvddZjdBNU=";
}; };
nativeBuildInputs = [ makeWrapper graphicsmagick ]; nativeBuildInputs = [ makeWrapper graphicsmagick ];

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "pdfsam-basic"; pname = "pdfsam-basic";
version = "4.2.2"; version = "4.2.3";
src = fetchurl { src = fetchurl {
url = "https://github.com/torakiki/pdfsam/releases/download/v${version}/pdfsam_${version}-1_amd64.deb"; url = "https://github.com/torakiki/pdfsam/releases/download/v${version}/pdfsam_${version}-1_amd64.deb";
sha256 = "sha256-fbcU3NZdQ8NR5tLjEJyOPneVWNMBddLdttLeVwIUtpg="; sha256 = "sha256-WmJ+atndIXm5Z6RvRVSvf2de1Gda+cs5kSw4iotPVfU=";
}; };
unpackPhase = '' unpackPhase = ''

View file

@ -1,20 +1,22 @@
{ lib, rustPlatform, fetchFromGitHub, installShellFiles }: { stdenv, lib, rustPlatform, fetchFromGitHub, installShellFiles, SystemConfiguration, libiconv }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "pueue"; pname = "pueue";
version = "0.12.0"; version = "0.12.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Nukesor"; owner = "Nukesor";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-yOUVDq/wRY35ZQjQVwTLYHKukkKpoggN51wBDdZnhI4="; sha256 = "sha256-wcOF34GzlB6YKISkjDgYgsaN1NmWBMIntfT23A6byx8=";
}; };
cargoSha256 = "sha256-56jJ8IjxWTBlaDd1CVit4RP659Mgw2j2wMWcSDYVihM="; cargoSha256 = "sha256-7SJjtHNSabE/VqdiSwKZ/yNzk6GSMNsQLaSx/MjN5NA=";
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ SystemConfiguration libiconv ];
checkFlags = [ "--skip=test_single_huge_payload" "--skip=test_create_unix_socket" ]; checkFlags = [ "--skip=test_single_huge_payload" "--skip=test_create_unix_socket" ];
postInstall = '' postInstall = ''
@ -27,6 +29,7 @@ rustPlatform.buildRustPackage rec {
meta = with lib; { meta = with lib; {
description = "A daemon for managing long running shell commands"; description = "A daemon for managing long running shell commands";
homepage = "https://github.com/Nukesor/pueue"; homepage = "https://github.com/Nukesor/pueue";
changelog = "https://github.com/Nukesor/pueue/raw/v${version}/CHANGELOG.md";
license = licenses.mit; license = licenses.mit;
maintainers = [ maintainers.marsam ]; maintainers = [ maintainers.marsam ];
}; };

View file

@ -19,24 +19,29 @@
}: }:
mkDerivation rec { mkDerivation rec {
version = "1.1.2"; version = "1.1.3";
pname = "syncthingtray"; pname = "syncthingtray";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Martchus"; owner = "Martchus";
repo = "syncthingtray"; repo = "syncthingtray";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-I5QhnYp4ga3ERJ3w4qjh5gFFU+S1Htw26vHK/2M8j5s="; sha256 = "sha256-ovit2XSkxSjcbpqQUv8IzMqfsfItbtXLbx0/Vy0+J0Y=";
}; };
buildInputs = [ qtbase cpp-utilities qtutilities ] buildInputs = [ qtbase cpp-utilities qtutilities ]
++ lib.optionals webviewSupport [ qtwebengine ] ++ lib.optionals webviewSupport [ qtwebengine ]
++ lib.optionals jsSupport [ qtdeclarative ] ++ lib.optionals jsSupport [ qtdeclarative ]
++ lib.optionals kioPluginSupport [ kio ] ++ lib.optionals kioPluginSupport [ kio ]
++ lib.optionals plasmoidSupport [ extra-cmake-modules plasma-framework ] ++ lib.optionals plasmoidSupport [ plasma-framework ]
; ;
nativeBuildInputs = [ cmake qttools ]; nativeBuildInputs = [
cmake
qttools
]
++ lib.optionals plasmoidSupport [ extra-cmake-modules ]
;
# No tests are available by upstream, but we test --help anyway # No tests are available by upstream, but we test --help anyway
doInstallCheck = true; doInstallCheck = true;
@ -56,7 +61,7 @@ mkDerivation rec {
meta = with lib; { meta = with lib; {
homepage = "https://github.com/Martchus/syncthingtray"; homepage = "https://github.com/Martchus/syncthingtray";
description = "Tray application and Dolphin/Plasma integration for Syncthing"; description = "Tray application and Dolphin/Plasma integration for Syncthing";
license = licenses.gpl2; license = licenses.gpl2Plus;
maintainers = with maintainers; [ doronbehar ]; maintainers = with maintainers; [ doronbehar ];
platforms = platforms.linux; platforms = platforms.linux;
}; };

View file

@ -5,16 +5,16 @@
buildGoModule rec { buildGoModule rec {
pname = "ticker"; pname = "ticker";
version = "3.1.9"; version = "4.0.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "achannarasappa"; owner = "achannarasappa";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-/OpDcsRIwuj1bvtpPyk1Qc9QZGJMLiOLj8NBfbT7hdo="; sha256 = "sha256-YVpspFBwao/7M2nTVMw+ANc0roL0vBO4DpNUb7Thp3Q=";
}; };
vendorSha256 = "sha256-aUBj7ZGWBeWc71y1CWm/KCw+El5TwH29S+KxyZGH1Zo="; vendorSha256 = "sha256-nidOIjrTL4llV5GORebXOOPGeL6TxkurDY82cIc7+mU=";
preBuild = '' preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X github.com/achannarasappa/ticker/cmd.Version=v${version}") buildFlagsArray+=("-ldflags" "-s -w -X github.com/achannarasappa/ticker/cmd.Version=v${version}")

View file

@ -2,16 +2,16 @@
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "tickrs"; pname = "tickrs";
version = "0.14.1"; version = "0.14.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "tarkah"; owner = "tarkah";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-FbbxkAP1RQVYL91mlAw0PcEWUDxgCrCd9QjLPE+bqmo="; sha256 = "sha256-8m4mIXTqc6rDMIjODbHJL7ipH5Y4WwgsWcSmw/SaiIo=";
}; };
cargoSha256 = "sha256-94U84/UxHAf5yrCnqpxjwHi/ekFHbFBs9b7pBewKvjw="; cargoSha256 = "sha256-ZcRFQT2CxqpO35UqK79g2Jq5SPOLZ88WiG36issC5kY=";
nativeBuildInputs = [ perl ]; nativeBuildInputs = [ perl ];

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, appimageTools, makeWrapper, electron, libsecret }: { lib, stdenv, fetchurl, appimageTools, makeWrapper, electron_11, libsecret }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "todoist-electron"; pname = "todoist-electron";
@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
''; '';
postFixup = '' postFixup = ''
makeWrapper ${electron}/bin/electron $out/bin/${pname} \ makeWrapper ${electron_11}/bin/electron $out/bin/${pname} \
--add-flags $out/share/${pname}/resources/app.asar \ --add-flags $out/share/${pname}/resources/app.asar \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc libsecret ]}" --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc libsecret ]}"
''; '';

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "worker"; pname = "worker";
version = "4.5.0"; version = "4.7.0";
src = fetchurl { src = fetchurl {
url = "http://www.boomerangsworld.de/cms/worker/downloads/${pname}-${version}.tar.gz"; url = "http://www.boomerangsworld.de/cms/worker/downloads/${pname}-${version}.tar.gz";
sha256 = "02xrdg1v784p4gfqjm1mlxqwi40qlbzhp68p5ksj96cjv6av5b5s"; sha256 = "sha256-9x/nHd2nUeFSH7a2qH4qlyH4FRH/NfNvTE1LEaMMSwU=";
}; };
buildInputs = [ libX11 ]; buildInputs = [ libX11 ];

View file

@ -1,12 +1,14 @@
{ lib, stdenv, rustPlatform, fetchurl, pkg-config, ncurses, openssl, Security }: { lib, stdenv, rustPlatform, fetchFromSourcehut, pkg-config, ncurses, openssl, Security }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "asuka"; pname = "asuka";
version = "0.8.1"; version = "0.8.1";
src = fetchurl { src = fetchFromSourcehut {
url = "https://git.sr.ht/~julienxx/${pname}/archive/${version}.tar.gz"; owner = "~julienxx";
sha256 = "07i80qmdpwfdgwrk1gzs10wln91v23qjrsk0x134xf5mjnakxc06"; repo = pname;
rev = version;
sha256 = "1y8v4qc5dng3v9k0bky1xlf3qi9pk2vdsi29lff4ha5310467f0k";
}; };
cargoSha256 = "0p0x4ch04kydg76bfal5zqzr9hvn5268wf3k2v9h7g8r4y8xqlhw"; cargoSha256 = "0p0x4ch04kydg76bfal5zqzr9hvn5268wf3k2v9h7g8r4y8xqlhw";

View file

@ -1,8 +1,8 @@
{ {
"stable": { "stable": {
"version": "89.0.4389.82", "version": "89.0.4389.90",
"sha256": "0yg33d6zldz3j1jghhdci63fn46i10dkz3nb95jdrbv8gd018jfz", "sha256": "16i7bgk2jbcqs2p28nk5mlf0k6wah594pcsfm8b154nxbyf0iihi",
"sha256bin64": "1sqzzillq38qyh85449ncz8bni93mjxb6r4z8y5h8k2w3j38jc0q", "sha256bin64": "1hgpx7isp9krarj7jpbhs97ym4i9j9a1srywv9pdfzbhw6cid2pk",
"deps": { "deps": {
"gn": { "gn": {
"version": "2021-01-07", "version": "2021-01-07",
@ -31,9 +31,9 @@
} }
}, },
"dev": { "dev": {
"version": "90.0.4430.19", "version": "91.0.4442.4",
"sha256": "174isyx4g62d8ggn9imp41dfklcbxi3y5nfprm4jbjmn5cb7v8xa", "sha256": "0cmm2pimkghb6s956bkqf2k77lj69dz51nlydgkqbvw0sc8n784k",
"sha256bin64": "1155mk933xvhd8141dp210akkmbcchly3q4cr7v176id50dvpnxl", "sha256bin64": "1hbfx8n51p7dwwz1vbp94jdmlb96vvxrbql2af4kmvx1bmzr2ism",
"deps": { "deps": {
"gn": { "gn": {
"version": "2021-02-09", "version": "2021-02-09",

View file

@ -33,6 +33,7 @@
, nspr , nspr
, nss , nss
, pango , pango
, pciutils
, libheimdal , libheimdal
, libpulseaudio , libpulseaudio
, systemd , systemd
@ -125,6 +126,7 @@ stdenv.mkDerivation {
nspr nspr
nss nss
pango pango
pciutils
libheimdal libheimdal
libpulseaudio libpulseaudio
systemd systemd

View file

@ -127,8 +127,9 @@ buildStdenv.mkDerivation ({
inherit src unpackPhase meta; inherit src unpackPhase meta;
patches = [ patches = [
./env_var_for_system_dir.patch
] ++ ] ++
lib.optional (lib.versionOlder ffversion "86") ./env_var_for_system_dir-ff85.patch ++
lib.optional (lib.versionAtLeast ffversion "86") ./env_var_for_system_dir-ff86.patch ++
lib.optional (lib.versionOlder ffversion "83") ./no-buildconfig-ffx76.patch ++ lib.optional (lib.versionOlder ffversion "83") ./no-buildconfig-ffx76.patch ++
lib.optional (lib.versionAtLeast ffversion "84") ./no-buildconfig-ffx84.patch ++ lib.optional (lib.versionAtLeast ffversion "84") ./no-buildconfig-ffx84.patch ++
lib.optional (ltoSupport && lib.versionOlder ffversion "84") ./lto-dependentlibs-generation-ffx83.patch ++ lib.optional (ltoSupport && lib.versionOlder ffversion "84") ./lto-dependentlibs-generation-ffx83.patch ++

View file

@ -0,0 +1,21 @@
diff -r 22fc47c968f2 toolkit/xre/nsXREDirProvider.cpp
--- a/toolkit/xre/nsXREDirProvider.cpp Mon Dec 14 15:09:17 2020 +0000
+++ b/toolkit/xre/nsXREDirProvider.cpp Tue Feb 23 23:38:56 2021 +0100
@@ -11,6 +11,7 @@
#include "jsapi.h"
#include "xpcpublic.h"
+#include "prenv.h"
#include "nsIAppStartup.h"
#include "nsIFile.h"
@@ -305,7 +306,8 @@
"/usr/lib/mozilla"_ns
# endif
;
- rv = NS_NewNativeLocalFile(dirname, false, getter_AddRefs(localDir));
+ const char* pathVar = PR_GetEnv("MOZ_SYSTEM_DIR");
+ rv = NS_NewNativeLocalFile((pathVar && *pathVar) ? nsDependentCString(pathVar) : reinterpret_cast<const nsCString&>(dirname), false, getter_AddRefs(localDir));
# endif
if (NS_SUCCEEDED(rv)) {

View file

@ -7,10 +7,10 @@ in
rec { rec {
firefox = common rec { firefox = common rec {
pname = "firefox"; pname = "firefox";
ffversion = "85.0.2"; ffversion = "86.0.1";
src = fetchurl { src = fetchurl {
url = "mirror://mozilla/firefox/releases/${ffversion}/source/firefox-${ffversion}.source.tar.xz"; url = "mirror://mozilla/firefox/releases/${ffversion}/source/firefox-${ffversion}.source.tar.xz";
sha512 = "2m46li5ni1m4xv42h99rn2hhhv2mqy229wihmzxmgvws1rh2h11yf6x2a07akkjrsp2dmwxmmkhmf9dhakgj9i55z5qqi99azyx07df"; sha512 = "e613cdcadfd71a01800a72c08c590032605ca8a8a0ba93326ffba93c2819f629fd620c23d00ca1274b203adc20acfe5d7913fee240ff14819fb1377ed08b1214";
}; };
meta = { meta = {

View file

@ -39,6 +39,12 @@
, gsettings-desktop-schemas , gsettings-desktop-schemas
, gnome3 , gnome3
# For video acceleration via VA-API (--enable-features=VaapiVideoDecoder)
, libvaSupport ? true, libva
# For Vulkan support (--enable-features=Vulkan)
, vulkanSupport ? true, vulkan-loader
}: }:
with lib; with lib;
@ -63,6 +69,8 @@ let
kerberos libdrm mesa coreutils kerberos libdrm mesa coreutils
libxkbcommon wayland libxkbcommon wayland
] ++ optional pulseSupport libpulseaudio ] ++ optional pulseSupport libpulseaudio
++ optional libvaSupport libva
++ optional vulkanSupport vulkan-loader
++ [ gtk3 ]; ++ [ gtk3 ];
suffix = if channel != "stable" then "-" + channel else ""; suffix = if channel != "stable" then "-" + channel else "";

View file

@ -19,13 +19,13 @@ let
in in
buildGoModule rec { buildGoModule rec {
pname = "argo"; pname = "argo";
version = "2.12.9"; version = "2.12.10";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "argoproj"; owner = "argoproj";
repo = "argo"; repo = "argo";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-WfyP48qOdFZfQ0+8AZDYokw7WK7lSx5di7z07gsRPZk="; sha256 = "sha256-A4s6D3/1FsqrJ+Jaql4IuyD9ySChL3SXqVvl8wUDRDE=";
}; };
vendorSha256 = "sha256-4XPMixVNj6PUKobNLwpsOBT7Zs/7pkhDtQacLIB5EfE="; vendorSha256 = "sha256-4XPMixVNj6PUKobNLwpsOBT7Zs/7pkhDtQacLIB5EfE=";

View file

@ -2,15 +2,15 @@
buildGoModule rec { buildGoModule rec {
pname = "helm"; pname = "helm";
version = "3.5.2"; version = "3.5.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "helm"; owner = "helm";
repo = "helm"; repo = "helm";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-XFWJtzKQrZL6lcr8JNiEQ8ldG5289x5pE21E8XgoYkA="; sha256 = "sha256-7xO07JDy6ujWlDF+5Xd3myRQ8ajTppCXz9fNe4yizVw=";
}; };
vendorSha256 = "sha256-mjWQxCCtTgj1VCFjnuJWgDjwMt/r4jiFC9Of+CXRgPg="; vendorSha256 = "sha256-lpEoUgABtJczwShNdvD+zYAPDFTJqILSei2YY6mQ2mw=";
doCheck = false; doCheck = false;

View file

@ -1,6 +1,6 @@
{ lib, buildGoPackage, fetchFromGitHub, ... }: { lib, buildGoPackage, fetchFromGitHub, ... }:
let version = "0.17.0"; in let version = "0.18.0"; in
buildGoPackage { buildGoPackage {
pname = "kubecfg"; pname = "kubecfg";
@ -10,7 +10,7 @@ buildGoPackage {
owner = "bitnami"; owner = "bitnami";
repo = "kubecfg"; repo = "kubecfg";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-/91im204vBS3NjrMOvwTVO6tEBgdpirqJFqCnbIB+iQ="; sha256 = "sha256-TJbuJZDj9ZwEaN8LV/M30+5+IgN8EZCTTBBDB0OgdEE=";
}; };
goPackagePath = "github.com/bitnami/kubecfg"; goPackagePath = "github.com/bitnami/kubecfg";

View file

@ -2,23 +2,20 @@
buildGoModule rec { buildGoModule rec {
pname = "tektoncd-cli"; pname = "tektoncd-cli";
version = "0.16.0"; version = "0.17.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "tektoncd"; owner = "tektoncd";
repo = "cli"; repo = "cli";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-IY9iJa4HcZ60jDPdP47jjC0FiOJesvf2vEENMAYVd4Q="; sha256 = "sha256-IyYlmatgcVbUj1WCPAFVOIgn1iHM80P4ie6d1YD3ISM=";
}; };
vendorSha256 = null; vendorSha256 = null;
buildFlagsArray = [ preBuild = ''
"-ldflags=" buildFlagsArray+=("-ldflags" "-s -w -X github.com/tektoncd/cli/pkg/cmd/version.clientVersion=${version}")
"-s" '';
"-w"
"-X github.com/tektoncd/cli/pkg/cmd/version.clientVersion=${version}"
];
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
@ -40,6 +37,14 @@ buildGoModule rec {
--zsh <($out/bin/tkn completion zsh) --zsh <($out/bin/tkn completion zsh)
''; '';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/tkn --help
$out/bin/tkn version | grep "Client version: ${version}"
runHook postInstallCheck
'';
meta = with lib; { meta = with lib; {
homepage = "https://tekton.dev"; homepage = "https://tekton.dev";
changelog = "https://github.com/tektoncd/cli/releases/tag/v${version}"; changelog = "https://github.com/tektoncd/cli/releases/tag/v${version}";

View file

@ -2,16 +2,16 @@
buildGoModule rec { buildGoModule rec {
pname = "terragrunt"; pname = "terragrunt";
version = "0.28.9"; version = "0.28.11";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "gruntwork-io"; owner = "gruntwork-io";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-sqwR+bXx5ab5OsmW44C5MIXjzQFM1QsBvsM0R3pL3H8="; sha256 = "sha256-qlmiQ73MRXcdXXC50pewUMt9YFbzXIbjnZTV5gIcvGs=";
}; };
vendorSha256 = "sha256-9DBCP/4mp/Gr2ie0nk7WGfL+M7snMEztdHZzxdIFbzM="; vendorSha256 = "sha256-SVrDBDGK809O+RaE3gOa9U1agY6hSGI/k3FUCgm+5PA=";
doCheck = false; doCheck = false;

View file

@ -20,19 +20,19 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "newsflash"; pname = "newsflash";
version = "1.3.0"; version = "1.4.0";
src = fetchFromGitLab { src = fetchFromGitLab {
owner = "news-flash"; owner = "news-flash";
repo = "news_flash_gtk"; repo = "news_flash_gtk";
rev = version; rev = version;
hash = "sha256-Vu8PXdnayrglAFVfO+WZTzk4Qrb/3uqzQIwClnRHto8="; hash = "sha256-EInI5Unaz9m8/gJ7vAzJVyMynJGq0KZh12dNK8r1wnY=";
}; };
cargoDeps = rustPlatform.fetchCargoTarball { cargoDeps = rustPlatform.fetchCargoTarball {
inherit src; inherit src;
name = "${pname}-${version}"; name = "${pname}-${version}";
hash = "sha256-dWumQi/Bk7w2C8zVVExxguWchZU+K2qTC02otsiK9jA="; hash = "sha256-xrWZhjfYnO6M3LMTP6l3+oZOusvUWuRBDesIlsiEJ6s=";
}; };
patches = [ patches = [

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