Merge master into staging-nixos
This commit is contained in:
@@ -18785,6 +18785,13 @@
|
||||
github = "netthier";
|
||||
githubId = 66856670;
|
||||
};
|
||||
nettika = {
|
||||
email = "nettika@leaf.ninja";
|
||||
name = "Nettika";
|
||||
github = "nettika-cat";
|
||||
githubId = 131948390;
|
||||
keys = [ { fingerprint = "6AC6 0C6F FA92 94AD AEA7 8C03 C357 EE70 D502 7BCC"; } ];
|
||||
};
|
||||
networkexception = {
|
||||
name = "networkException";
|
||||
email = "nix@nwex.de";
|
||||
@@ -18848,6 +18855,12 @@
|
||||
githubId = 10180857;
|
||||
name = "Anmol Sethi";
|
||||
};
|
||||
ni5arga = {
|
||||
email = "hello@ni5arga.com";
|
||||
github = "ni5arga";
|
||||
githubId = 45588772;
|
||||
name = "Nisarga Adhikary";
|
||||
};
|
||||
nialov = {
|
||||
email = "nikolasovaskainen@gmail.com";
|
||||
github = "nialov";
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
- [ImmichFrame](https://immichframe.dev/), display your photos from Immich as a digital photo frame. Available as `services.immichframe`.
|
||||
|
||||
- [PdfDing](https://www.pdfding.com/), manage, view and edit your PDFs seamlessly on all your devices wherever you are. Available as [services.pdfding](#opt-services.pdfding.enable).
|
||||
|
||||
- [reaction](https://reaction.ppom.me/), a daemon that scans program outputs for repeated patterns, and takes action. A common usage is to scan ssh and webserver logs, and to ban hosts that cause multiple authentication errors. A modern alternative to fail2ban. Available as [services.reaction](#opt-services.reaction.enable).
|
||||
|
||||
- [rqbit](https://github.com/ikatson/rqbit), a bittorrent client written in Rust. It has HTTP API and Web UI, and can be used as a library. Available as [services.rqbit](#opt-services.rqbit.enable).
|
||||
|
||||
@@ -464,7 +464,7 @@ let
|
||||
Whether to enable or disable lingering for this user. Without
|
||||
lingering, user units will not be started until the user logs in,
|
||||
and may be stopped on logout depending on the settings in
|
||||
`logind.conf`.
|
||||
{file}`logind.conf`.
|
||||
|
||||
By default, NixOS will not manage lingering, new users will default
|
||||
to not lingering, and lingering can be configured imperatively using
|
||||
|
||||
@@ -91,8 +91,8 @@ in
|
||||
Sets which portal backend should be used to provide the implementation
|
||||
for the requested interface. For details check {manpage}`portals.conf(5)`.
|
||||
|
||||
Configs will be linked to `/etc/xdg/xdg-desktop-portal/` with the name `$desktop-portals.conf`
|
||||
for `xdg.portal.config.$desktop` and `portals.conf` for `xdg.portal.config.common`
|
||||
Configs will be linked to {file}`/etc/xdg/xdg-desktop-portal/` with the name {file}`$desktop-portals.conf`
|
||||
for {file}`xdg.portal.config.$desktop` and {file}`portals.conf` for {file}`xdg.portal.config.common`
|
||||
as an exception.
|
||||
'';
|
||||
};
|
||||
@@ -103,7 +103,7 @@ in
|
||||
example = lib.literalExpression "[ pkgs.gnome-session ]";
|
||||
description = ''
|
||||
List of packages that provide XDG desktop portal configuration, usually in
|
||||
the form of `share/xdg-desktop-portal/$desktop-portals.conf`.
|
||||
the form of {file}`share/xdg-desktop-portal/$desktop-portals.conf`.
|
||||
|
||||
Note that configs in `xdg.portal.config` will be preferred if set.
|
||||
'';
|
||||
|
||||
@@ -1714,6 +1714,7 @@
|
||||
./services/web-apps/outline.nix
|
||||
./services/web-apps/pairdrop.nix
|
||||
./services/web-apps/part-db.nix
|
||||
./services/web-apps/pdfding.nix
|
||||
./services/web-apps/peering-manager.nix
|
||||
./services/web-apps/peertube-runner.nix
|
||||
./services/web-apps/peertube.nix
|
||||
|
||||
@@ -60,7 +60,7 @@ in
|
||||
inherit (settingsFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration included in `starship.toml`.
|
||||
Configuration included in {file}`starship.toml`.
|
||||
|
||||
See <https://starship.rs/config/#prompt> for documentation.
|
||||
'';
|
||||
|
||||
@@ -100,7 +100,7 @@ in
|
||||
description = ''
|
||||
Configuration options in RabbitMQ's new config file format,
|
||||
which is a simple key-value format that can not express nested
|
||||
data structures. This is known as the `rabbitmq.conf` file,
|
||||
data structures. This is known as the {file}`rabbitmq.conf` file,
|
||||
although outside NixOS that filename may have Erlang syntax, particularly
|
||||
prior to RabbitMQ 3.7.0.
|
||||
|
||||
@@ -119,7 +119,7 @@ in
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
Verbatim advanced configuration file contents using the Erlang syntax.
|
||||
This is also known as the `advanced.config` file or the old config format.
|
||||
This is also known as the {file}`advanced.config` file or the old config format.
|
||||
|
||||
`configItems` is preferred whenever possible. However, nested
|
||||
data structures can only be expressed properly using the `config` option.
|
||||
|
||||
@@ -143,7 +143,7 @@ in
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Extra configuration for `slurmdbd.conf` See also:
|
||||
Extra configuration for {file}`slurmdbd.conf` See also:
|
||||
{manpage}`slurmdbd.conf(8)`.
|
||||
'';
|
||||
};
|
||||
@@ -196,7 +196,7 @@ in
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to provide a slurm.conf file.
|
||||
Whether to provide a {file}`slurm.conf` file.
|
||||
Enable this option if you do not run a slurm daemon on this host
|
||||
(i.e. `server.enable` and `client.enable` are `false`)
|
||||
but you still want to run slurm commands from this host.
|
||||
@@ -332,7 +332,7 @@ in
|
||||
default = "";
|
||||
type = lib.types.lines;
|
||||
description = ''
|
||||
Extra configuration for that will be added to `mpi.conf`.
|
||||
Extra configuration for that will be added to {file}`mpi.conf`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -341,7 +341,7 @@ in
|
||||
default = "";
|
||||
type = lib.types.lines;
|
||||
description = ''
|
||||
Extra configuration that will be added to the end of `plugstack.conf`.
|
||||
Extra configuration that will be added to the end of {file}`plugstack.conf`.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -349,7 +349,7 @@ in
|
||||
default = "";
|
||||
type = lib.types.lines;
|
||||
description = ''
|
||||
Extra configuration for `cgroup.conf`. This file is
|
||||
Extra configuration for {file}`cgroup.conf`. This file is
|
||||
used when `procTrackType=proctrack/cgroup`.
|
||||
'';
|
||||
};
|
||||
@@ -359,9 +359,9 @@ in
|
||||
default = [ ];
|
||||
description = ''
|
||||
Slurm expects config files for plugins in the same path
|
||||
as `slurm.conf`. Add extra nix store
|
||||
as {file}`slurm.conf`. Add extra nix store
|
||||
paths that should be merged into same directory as
|
||||
`slurm.conf`.
|
||||
{file}`slurm.conf`.
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ in
|
||||
package = mkPackageOption pkgs "hercules-ci-agent" { };
|
||||
settings = mkOption {
|
||||
description = ''
|
||||
These settings are written to the `agent.toml` file.
|
||||
These settings are written to the {file}`agent.toml` file.
|
||||
|
||||
Not all settings are listed as options, can be set nonetheless.
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ in
|
||||
|
||||
settings = mkOption {
|
||||
description = ''
|
||||
Free-form settings written directly to the `lldap_config.toml` file.
|
||||
Free-form settings written directly to the {file}`lldap_config.toml` file.
|
||||
Refer to <https://github.com/lldap/lldap/blob/main/lldap_config.docker_template.toml> for supported values.
|
||||
'';
|
||||
|
||||
|
||||
@@ -570,7 +570,7 @@ in
|
||||
description = ''
|
||||
PostgreSQL configuration. Refer to
|
||||
<https://www.postgresql.org/docs/current/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE>
|
||||
for an overview of `postgresql.conf`.
|
||||
for an overview of {file}`postgresql.conf`.
|
||||
|
||||
::: {.note}
|
||||
String values will automatically be enclosed in single quotes. Single quotes will be
|
||||
|
||||
@@ -200,7 +200,7 @@ in
|
||||
default = { };
|
||||
|
||||
description = ''
|
||||
Configuration for MCHPRS via `Config.toml`.
|
||||
Configuration for MCHPRS via {file}`Config.toml`.
|
||||
See <https://github.com/MCHPR/MCHPRS/blob/master/README.md> for documentation.
|
||||
'';
|
||||
};
|
||||
@@ -210,7 +210,7 @@ in
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether or not the whitelist (in `whitelist.json`) shoud be enabled.
|
||||
Whether or not the whitelist (in {file}`whitelist.json`) shoud be enabled.
|
||||
Only has effect when {option}`services.mchprs.declarativeSettings` is `true`.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -112,7 +112,7 @@ in
|
||||
};
|
||||
settings = lib.mkOption {
|
||||
description = ''
|
||||
Generates the `aria2.conf` file. Refer to [the documentation][0] for
|
||||
Generates the {file}`aria2.conf` file. Refer to [the documentation][0] for
|
||||
all possible settings.
|
||||
|
||||
[0]: <https://aria2.github.io/manual/en/html/aria2c.html#synopsis>
|
||||
|
||||
@@ -78,7 +78,7 @@ in
|
||||
'';
|
||||
description = ''
|
||||
Extra configuration options appended to the default
|
||||
`asterisk.conf` file.
|
||||
{file}`asterisk.conf` file.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -134,7 +134,7 @@ in
|
||||
Sets the content of config files (typically ending with
|
||||
`.conf`) in the Asterisk configuration directory.
|
||||
|
||||
Note that if you want to change `asterisk.conf`, it
|
||||
Note that if you want to change {file}`asterisk.conf`, it
|
||||
is preferable to use the {option}`services.asterisk.extraConfig`
|
||||
option over this option. If `"asterisk.conf"` is
|
||||
specified with the {option}`confFiles` option (not recommended),
|
||||
|
||||
@@ -27,7 +27,7 @@ in
|
||||
default = atalkdConfFile;
|
||||
defaultText = "/nix/store/xxx-atalkd.conf";
|
||||
description = ''
|
||||
Optional path to a custom `atalkd.conf` file. When set, this overrides the generated
|
||||
Optional path to a custom {file}`atalkd.conf` file. When set, this overrides the generated
|
||||
configuration from `services.atalkd.interfaces`.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -59,7 +59,7 @@ in
|
||||
'';
|
||||
description = ''
|
||||
Commands to execute before the config file check. The file to be checked will be
|
||||
available as `bird.conf` in the current directory.
|
||||
available as {file}`bird.conf` in the current directory.
|
||||
|
||||
Files created with this option will not be available at service runtime, only during
|
||||
build time checking.
|
||||
|
||||
@@ -54,7 +54,7 @@ in
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Contents of the `config.yaml` config file.
|
||||
Contents of the {file}`config.yaml` config file.
|
||||
The `--config-path` argument will only be passed if this set is not empty.
|
||||
|
||||
See <https://github.com/AdguardTeam/dnsproxy/blob/master/config.yaml.dist>.
|
||||
|
||||
@@ -121,7 +121,7 @@ in
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Additional options that will be copied verbatim in `gnunet.conf`.
|
||||
Additional options that will be copied verbatim in {file}`gnunet.conf`.
|
||||
See {manpage}`gnunet.conf(5)` for details.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ in
|
||||
config = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
description = ''
|
||||
Verbatim `inspircd.conf` file.
|
||||
Verbatim {file}`inspircd.conf` file.
|
||||
For a list of options, consult the
|
||||
[InspIRCd documentation](https://docs.inspircd.org/3/configuration/), the
|
||||
[Module documentation](https://docs.inspircd.org/3/modules/)
|
||||
|
||||
@@ -361,7 +361,7 @@ in
|
||||
'';
|
||||
description = ''
|
||||
Additional configuration that exists before the first start and
|
||||
later overrides the existing values in `config.json`.
|
||||
later overrides the existing values in {file}`config.json`.
|
||||
|
||||
It is mostly helpful to manage configuration ignored/not yet implemented
|
||||
outside of `netbird up` invocation.
|
||||
@@ -369,9 +369,9 @@ in
|
||||
WARNING: this is not an upstream feature, it could break in the future
|
||||
(by having lower priority) after upstream implements an equivalent.
|
||||
|
||||
It is implemented as a `preStart` script which overrides `config.json`
|
||||
with content of `/etc/${client.dir.baseName}/config.d/*.json` files.
|
||||
This option manages specifically `50-nixos.json` file.
|
||||
It is implemented as a `preStart` script which overrides {file}`config.json`
|
||||
with content of {file}`/etc/${client.dir.baseName}/config.d/*.json` files.
|
||||
This option manages specifically {file}`50-nixos.json` file.
|
||||
|
||||
Consult [the source code](https://github.com/netbirdio/netbird/blob/88747e3e0191abc64f1e8c7ecc65e5e50a1527fd/client/internal/config.go#L49-L82)
|
||||
or inspect existing file for a complete list of available configurations.
|
||||
@@ -396,7 +396,7 @@ in
|
||||
type = path;
|
||||
default = "/var/lib/${client.dir.baseName}";
|
||||
description = ''
|
||||
A state directory used by NetBird client to store `config.json`, `state.json` & `resolv.conf`.
|
||||
A state directory used by NetBird client to store {file}`config.json`, {file}`state.json` & {file}`resolv.conf`.
|
||||
'';
|
||||
};
|
||||
dir.runtime = mkOption {
|
||||
@@ -471,8 +471,8 @@ in
|
||||
2. run as a `netbird-<name>.service`,
|
||||
3. listen for incoming remote connections on the port `51820` (`openFirewall` by default),
|
||||
4. manage the `netbird-<name>` wireguard interface,
|
||||
5. use the `/var/lib/netbird-<name>/config.json` configuration file,
|
||||
6. override `/var/lib/netbird-<name>/config.json` with values from `/etc/netbird-<name>/config.d/*.json`,
|
||||
5. use the {file}`/var/lib/netbird-<name>/config.json` configuration file,
|
||||
6. override {file}`/var/lib/netbird-<name>/config.json` with values from {file}`/etc/netbird-<name>/config.d/*.json`,
|
||||
7. (`hardened`) be locally manageable by `netbird-<name>` system group,
|
||||
|
||||
With following caveats:
|
||||
|
||||
@@ -346,7 +346,7 @@ in
|
||||
];
|
||||
default = "default";
|
||||
description = ''
|
||||
Set the DNS (`resolv.conf`) processing mode.
|
||||
Set the DNS ({file}`resolv.conf`) processing mode.
|
||||
|
||||
A description of these modes can be found in the main section of
|
||||
[
|
||||
|
||||
@@ -225,7 +225,7 @@ in
|
||||
default = "";
|
||||
description = ''
|
||||
Extra configuration directives that should be added to
|
||||
`chrony.conf`
|
||||
{file}`chrony.conf`
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ in
|
||||
inherit (format) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Additional attributes to be merged with the configuration options and written to Pangolin's `config.yml` file.
|
||||
Additional attributes to be merged with the configuration options and written to Pangolin's {file}`config.yml` file.
|
||||
'';
|
||||
example = {
|
||||
app = {
|
||||
|
||||
@@ -42,7 +42,7 @@ in
|
||||
default = "";
|
||||
description = ''
|
||||
Global configuration that should be added to the global directory
|
||||
of `pdnsd.conf`.
|
||||
of {file}`pdnsd.conf`.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ in
|
||||
default = "";
|
||||
description = ''
|
||||
Server configuration that should be added to the server directory
|
||||
of `pdnsd.conf`.
|
||||
of {file}`pdnsd.conf`.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ in
|
||||
default = "";
|
||||
description = ''
|
||||
Extra configuration directives that should be added to
|
||||
`pdnsd.conf`.
|
||||
{file}`pdnsd.conf`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ in
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
Contents of the `strongswan.conf` file.
|
||||
Contents of the {file}`strongswan.conf` file.
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ in
|
||||
`ike:` prefix are configured any signature scheme
|
||||
constraint (without `ike:` prefix) will also apply to
|
||||
IKEv2 authentication, unless this is disabled in
|
||||
`strongswan.conf`. To use RSASSA-PSS signatures use
|
||||
{file}`strongswan.conf`. To use RSASSA-PSS signatures use
|
||||
`rsa/pss` instead of `pubkey` or
|
||||
`rsa` as in e.g.
|
||||
`ike:rsa/pss-sha256`. If `pubkey` or
|
||||
@@ -628,7 +628,7 @@ in
|
||||
`pubkey-sha256-sha512`,
|
||||
`rsa-2048-sha256-sha384-sha512` or
|
||||
`rsa-2048-sha256-ecdsa-256-sha256-sha384`).
|
||||
Unless disabled in `strongswan.conf`, or explicit IKEv2
|
||||
Unless disabled in {file}`strongswan.conf`, or explicit IKEv2
|
||||
signature constraints are configured (refer to the description of the
|
||||
{option}`local` section's {option}`auth` keyword for
|
||||
details), such key types and hash algorithms are also applied as
|
||||
|
||||
@@ -110,7 +110,7 @@ in
|
||||
default = null;
|
||||
example = literalExpression "/etc/wpa_supplicant.conf";
|
||||
description = ''
|
||||
External `wpa_supplicant.conf` configuration file.
|
||||
External {file}`wpa_supplicant.conf` configuration file.
|
||||
The configuration options defined declaratively within `networking.supplicant` have
|
||||
precedence over options defined in `configFile`.
|
||||
'';
|
||||
@@ -145,7 +145,7 @@ in
|
||||
model_number=2015
|
||||
'';
|
||||
description = ''
|
||||
Configuration options for `wpa_supplicant.conf`.
|
||||
Configuration options for {file}`wpa_supplicant.conf`.
|
||||
Options defined here have precedence over options in `configFile`.
|
||||
NOTE: Do not write sensitive data into `extraConf` as it will
|
||||
be world-readable in the `nix-store`. For sensitive information
|
||||
|
||||
@@ -43,7 +43,7 @@ in
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Contents of the `teleport.yaml` config file.
|
||||
Contents of the {file}`teleport.yaml` config file.
|
||||
The `--config` arguments will only be passed if this set is not empty.
|
||||
|
||||
See <https://goteleport.com/docs/setup/reference/config/>.
|
||||
|
||||
@@ -127,7 +127,7 @@ in
|
||||
"log"
|
||||
];
|
||||
description = ''
|
||||
A list of modules to include in the `znc.conf` file.
|
||||
A list of modules to include in the {file}`znc.conf` file.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -144,7 +144,7 @@ in
|
||||
"push"
|
||||
];
|
||||
description = ''
|
||||
A list of user modules to include in the `znc.conf` file.
|
||||
A list of user modules to include in the {file}`znc.conf` file.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -233,7 +233,7 @@ in
|
||||
default = "";
|
||||
type = types.lines;
|
||||
description = ''
|
||||
Extra config to `znc.conf` file.
|
||||
Extra config to {file}`znc.conf` file.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -72,7 +72,7 @@ let
|
||||
"https://github.com/hashicorp/consul-template/blob/main/docs/configuration.md#configuration-file";
|
||||
in
|
||||
''
|
||||
Free-form settings written directly to the `config.json` file.
|
||||
Free-form settings written directly to the {file}`config.json` file.
|
||||
Refer to <${upstreamDocs}> for supported values.
|
||||
|
||||
::: {.note}
|
||||
|
||||
@@ -99,7 +99,7 @@ in
|
||||
freeformType = attrsOf (attrsOf anything);
|
||||
};
|
||||
description = ''
|
||||
Free-form settings mapped to the `qBittorrent.conf` file in the profile.
|
||||
Free-form settings mapped to the {file}`qBittorrent.conf` file in the profile.
|
||||
Refer to [Explanation-of-Options-in-qBittorrent](https://github.com/qbittorrent/qBittorrent/wiki/Explanation-of-Options-in-qBittorrent).
|
||||
The Password_PBKDF2 format is oddly unique, you will likely want to use [this tool](https://codeberg.org/feathecutie/qbittorrent_password) to generate the format.
|
||||
Alternatively you can run qBittorrent independently first and use its webUI to generate the format.
|
||||
|
||||
@@ -41,7 +41,7 @@ in
|
||||
settings = lib.mkOption {
|
||||
default = { };
|
||||
description = ''
|
||||
Settings serialized into `config.yml` before build.
|
||||
Settings serialized into {file}`config.yml` before build.
|
||||
If left empty, the default configuration shipped with the package will be used instead.
|
||||
For more information, see the [official documentation](https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md).
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ in
|
||||
Example config can be generated by `ocis init --config-path fileName --admin-password "adminPass"`.
|
||||
Add `--insecure true` if SSL certificates are generated and managed externally (e.g. using oCIS behind reverse proxy).
|
||||
|
||||
Note: This directory must contain at least a `ocis.yaml`. Ensure
|
||||
Note: This directory must contain at least a {file}`ocis.yaml`. Ensure
|
||||
[user](#opt-services.ocis.user) has read/write access to it. In some
|
||||
circumstances you may need to add additional oCIS configuration files (e.g.,
|
||||
`proxy.yaml`) to this directory.
|
||||
{file}`proxy.yaml`) to this directory.
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,451 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
concatStringsSep
|
||||
mapAttrsToList
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
optionalAttrs
|
||||
optionalString
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.pdfding;
|
||||
|
||||
stateDir = "/var/lib/pdfding";
|
||||
|
||||
usePostgres = cfg.database.type == "postgres";
|
||||
|
||||
envVars = {
|
||||
# HOST_IP is used in the package derivation
|
||||
HOST_IP = cfg.hostName;
|
||||
HOST_NAME = concatStringsSep "," cfg.allowedHosts;
|
||||
HOST_PORT = toString cfg.port;
|
||||
DATABASE_TYPE = "";
|
||||
DATA_DIR = stateDir;
|
||||
}
|
||||
// optionalAttrs usePostgres {
|
||||
DATABASE_TYPE = "POSTGRES";
|
||||
POSTGRES_PORT = toString cfg.database.port;
|
||||
# Django Uses the unix domain socket
|
||||
# if host is set to empty see https://docs.djangoproject.com/en/6.0/ref/settings/#host
|
||||
POSTGRES_HOST = lib.optionalString (!cfg.database.createLocally) cfg.database.host;
|
||||
POSTGRES_NAME = cfg.database.name;
|
||||
POSTGRES_USER = cfg.database.user;
|
||||
}
|
||||
// optionalAttrs cfg.consume.enable {
|
||||
CONSUME_ENABLE = "TRUE";
|
||||
CONSUME_SCHEDULE = cfg.consume.schedule;
|
||||
}
|
||||
// optionalAttrs cfg.backup.enable {
|
||||
BACKUP_ENABLE = "TRUE";
|
||||
BACKUP_ENDPOINT = cfg.backup.endpoint;
|
||||
BACKUP_SCHEDULE = cfg.backup.schedule;
|
||||
}
|
||||
// cfg.extraEnvironment;
|
||||
|
||||
envFile = pkgs.writeText "pdfding.env" (
|
||||
lib.pipe envVars [
|
||||
(mapAttrsToList (name: value: "${name}=\"${toString value}\""))
|
||||
(concatStringsSep "\n")
|
||||
]
|
||||
);
|
||||
|
||||
loadCreds =
|
||||
optionalString (usePostgres && !cfg.database.createLocally) ''
|
||||
export POSTGRES_PASSWORD="$(<${cfg.database.passwordFile})"
|
||||
''
|
||||
+ ''
|
||||
export SECRET_KEY="$(<${cfg.secretKeyFile})"
|
||||
'';
|
||||
|
||||
secretRecommendation = "Consider using a secret managing scheme such as `agenix` or `sops-nix` to generate this file.";
|
||||
in
|
||||
{
|
||||
options.services.pdfding = {
|
||||
enable = mkEnableOption "PdfDing service" // {
|
||||
description = ''
|
||||
Whether to enable PdfDing service.
|
||||
|
||||
To use the pdfding-manage CLI, add your user to the pdfding group:
|
||||
users.users.<youruser>.extraGroups = [ "pdfding" ];
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkPackageOption pkgs "pdfding" { };
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "pdfding";
|
||||
description = "User account under which PdfDing runs";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "pdfding";
|
||||
description = "Group under which PdfDing runs";
|
||||
};
|
||||
|
||||
hostName = mkOption {
|
||||
type = types.str;
|
||||
default = "0.0.0.0";
|
||||
example = "pdfding.example.com";
|
||||
description = "Listen address for PdfDing";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 8000;
|
||||
description = "Port on which PdfDing listens";
|
||||
};
|
||||
|
||||
allowedHosts = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
"127.0.0.1"
|
||||
"localhost"
|
||||
];
|
||||
description = "Domains where PdfDing is allowed to run";
|
||||
};
|
||||
|
||||
gunicorn.extraArgs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
description = "Command line arguments passed to Gunicorn server.";
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
extraEnvironment = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
description = "Additional environment variables";
|
||||
};
|
||||
|
||||
envFiles = mkOption {
|
||||
type = types.listOf types.path;
|
||||
description = "Environment variable files";
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
secretKeyFile = mkOption {
|
||||
type = types.path;
|
||||
default = null;
|
||||
description = "File containing the Django SECRET_KEY. ${secretRecommendation}";
|
||||
example = "/run/secrets/pdfding-secret-key";
|
||||
};
|
||||
|
||||
database = {
|
||||
type = mkOption {
|
||||
type = types.enum [
|
||||
"sqlite"
|
||||
"postgres"
|
||||
];
|
||||
default = "sqlite";
|
||||
description = "Database type to use";
|
||||
};
|
||||
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = "PostgreSQL host";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 5432;
|
||||
description = "PostgreSQL port";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "pdfding";
|
||||
description = "PostgreSQL database name";
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "pdfding";
|
||||
description = "PostgreSQL user";
|
||||
};
|
||||
|
||||
passwordFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = "File containing POSTGRES_PASSWORD. ${secretRecommendation}";
|
||||
example = "/run/secrets/pdfding-db-password";
|
||||
};
|
||||
|
||||
createLocally = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to create a local PostgreSQL database automatically";
|
||||
};
|
||||
};
|
||||
|
||||
consume = {
|
||||
enable = mkEnableOption "Consume functionality" // {
|
||||
description = ''
|
||||
Bulk PDF import from consume directory.
|
||||
|
||||
When enabled, administrators can create per-user directories like /var/lib/pdfding/consume/<user_id>
|
||||
with permissions allowing the pdfding user to read and write.
|
||||
PDFs placed in these directories are automatically imported into user accounts.
|
||||
|
||||
PDFs are imported periodically via cronjob and successfully imported files
|
||||
are automatically deleted from the consume directory.
|
||||
'';
|
||||
};
|
||||
schedule = mkOption {
|
||||
type = types.str;
|
||||
default = "*/5 * * * *";
|
||||
description = ''
|
||||
The cron schedule for the consume task to trigger.
|
||||
The format is "minute hour day month day_of_week"
|
||||
Read
|
||||
- https://github.com/mrmn2/PdfDing/blob/d0f21ec2f9fbee4b1a2f6b7e0e6c7ea7784ab1bc/pdfding/base/task_helpers.py#L5
|
||||
- https://huey.readthedocs.io/en/latest/api.html#crontab
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
backup = {
|
||||
enable = mkEnableOption "Backup functionality" // {
|
||||
description = ''
|
||||
Automatic backup of important data to a AWS S3 (or compatible) instance.
|
||||
|
||||
When enabled and properly configured via environment variables,
|
||||
important data is periodically uploaded to the specified s3
|
||||
instance via cronjob.
|
||||
'';
|
||||
};
|
||||
schedule = mkOption {
|
||||
type = types.str;
|
||||
default = "0 2 * * *";
|
||||
description = ''
|
||||
The cron schedule for the consume task to trigger.
|
||||
The format is "minute hour day month day_of_week"
|
||||
Read
|
||||
- https://github.com/mrmn2/PdfDing/blob/d0f21ec2f9fbee4b1a2f6b7e0e6c7ea7784ab1bc/pdfding/base/task_helpers.py#L5
|
||||
- https://huey.readthedocs.io/en/latest/api.html#crontab
|
||||
'';
|
||||
};
|
||||
endpoint = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "The s3 endpoint for backups";
|
||||
example = "127.0.0.1:9000";
|
||||
};
|
||||
};
|
||||
|
||||
openFirewall = lib.mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Open ports in the firewall for the PdfDing web interface.";
|
||||
};
|
||||
|
||||
installTestHelpers = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
internal = true;
|
||||
description = "Adds a few helper commands to systemPackages for nixos tests";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.secretKeyFile != null;
|
||||
message = "services.pdfding.secretKeyFile must be set when using PdfDing";
|
||||
}
|
||||
{
|
||||
assertion = cfg.backup.enable -> envVars.BACKUP_ENDPOINT != null;
|
||||
message = "services.pdfding.extraEnvironment.BACKUP_ENDPOINT must be set when backup is enabled";
|
||||
}
|
||||
{
|
||||
assertion = cfg.database.createLocally -> usePostgres;
|
||||
message = "services.pdfding.database.createLocally is enabled but not database.type is not postgres";
|
||||
}
|
||||
{
|
||||
assertion = cfg.database.createLocally -> cfg.database.host == "";
|
||||
message = "services.pdfding.database.host must be empty when services.pdfding.database.createLocally is enabled";
|
||||
}
|
||||
{
|
||||
assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
|
||||
message = "specifying services.pdfding.database.passwordFile is not supported when used along with a local db setup";
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
cfg.database.createLocally
|
||||
-> cfg.database.user == cfg.user && cfg.database.user == cfg.database.name;
|
||||
message = "services.pdfding.database.user should be the same as services.pdfding.user as well as services.pdfding.database.name when running a local db setup";
|
||||
}
|
||||
];
|
||||
|
||||
networking.firewall = lib.mkIf cfg.openFirewall {
|
||||
allowedTCPPorts = [ cfg.port ];
|
||||
};
|
||||
|
||||
environment.systemPackages =
|
||||
let
|
||||
genWrapper =
|
||||
name: cmd:
|
||||
pkgs.writeShellScriptBin name ''
|
||||
set -eou pipefail
|
||||
set -a
|
||||
${lib.toShellVars cfg.extraEnvironment}
|
||||
${lib.concatMapStringsSep "\n" (f: "source ${f}") cfg.envFiles}
|
||||
set +a
|
||||
${loadCreds}
|
||||
sudo=exec
|
||||
if [[ "$USER" != ${cfg.user} ]]; then
|
||||
sudo='${config.security.wrapperDir}/sudo -E -u ${cfg.user}'
|
||||
fi
|
||||
${cmd}
|
||||
'';
|
||||
commands.pdfding-manage = ''
|
||||
$sudo ${lib.getExe cfg.package} "$@"
|
||||
'';
|
||||
commands.consume-immediate = ''
|
||||
echo "from pdf.tasks import consume_function; consume_function(True)" | \
|
||||
$sudo ${lib.getExe cfg.package} shell
|
||||
'';
|
||||
commands.backup-immediate = ''
|
||||
echo "from backup.tasks import backup_function; backup_function()" | \
|
||||
$sudo ${lib.getExe cfg.package} shell
|
||||
'';
|
||||
packages = lib.genAttrs (lib.attrNames commands) (name: genWrapper name commands.${name});
|
||||
in
|
||||
lib.mkMerge [
|
||||
[
|
||||
packages.pdfding-manage
|
||||
]
|
||||
(lib.mkIf cfg.installTestHelpers [
|
||||
packages.consume-immediate
|
||||
packages.backup-immediate
|
||||
])
|
||||
];
|
||||
|
||||
users.users.${cfg.user} = {
|
||||
isSystemUser = true;
|
||||
group = cfg.group;
|
||||
};
|
||||
|
||||
users.groups.${cfg.group} = { };
|
||||
|
||||
services.pdfding.envFiles = [ envFile ];
|
||||
|
||||
services.pdfding.extraEnvironment = {
|
||||
DEFAULT_THEME = "dark";
|
||||
DEFAULT_THEME_COLOR = "green";
|
||||
};
|
||||
|
||||
services.pdfding.gunicorn.extraArgs = [
|
||||
"--workers=4"
|
||||
"--max-requests=1200"
|
||||
"--max-requests-jitter=50"
|
||||
"--log-level=error"
|
||||
];
|
||||
|
||||
systemd.services.pdfding = {
|
||||
description = "PdfDing Web Service";
|
||||
after = [
|
||||
"network.target"
|
||||
]
|
||||
++ lib.optionals (usePostgres && cfg.database.createLocally) [ "postgresql.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
preStart = ''
|
||||
${loadCreds}
|
||||
${optionalString (usePostgres && cfg.database.createLocally)
|
||||
# bash
|
||||
''
|
||||
count=0
|
||||
timeout=30
|
||||
until ${pkgs.postgresql}/bin/pg_isready -p ${toString cfg.database.port}; do
|
||||
if [ $count -ge $timeout ]; then
|
||||
echo "Timed out waiting for PostgreSQL after $timeout seconds."
|
||||
exit 1
|
||||
fi
|
||||
echo "Waiting for PostgreSQL... ($count/$timeout)"
|
||||
sleep 1
|
||||
count=$((count+1))
|
||||
done
|
||||
''
|
||||
}
|
||||
|
||||
${cfg.package}/bin/pdfding-manage migrate
|
||||
${cfg.package}/bin/pdfding-manage clean_up
|
||||
'';
|
||||
|
||||
script = ''
|
||||
${loadCreds}
|
||||
exec ${cfg.package}/bin/pdfding-start ${toString cfg.gunicorn.extraArgs}
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
Type = "exec";
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
EnvironmentFile = cfg.envFiles;
|
||||
StateDirectory = [
|
||||
"pdfding"
|
||||
"pdfding/db"
|
||||
"pdfding/media"
|
||||
]
|
||||
++ lib.optional cfg.consume.enable "pdfding/consume";
|
||||
NoNewPrivileges = true;
|
||||
PrivateTmp = true;
|
||||
PrivateDevices = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.pdfding-background = lib.mkIf (cfg.consume.enable || cfg.backup.enable) {
|
||||
description = "PdfDing Background Tasks (Huey)";
|
||||
after = [ "pdfding.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
script = ''
|
||||
${loadCreds}
|
||||
exec ${cfg.package}/bin/pdfding-manage run_huey
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "exec";
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
WorkingDirectory = stateDir;
|
||||
EnvironmentFile = cfg.envFiles;
|
||||
|
||||
NoNewPrivileges = true;
|
||||
PrivateTmp = true;
|
||||
PrivateDevices = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
ReadWritePaths = [ stateDir ];
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
TimeoutStopSec = 30;
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresql = lib.mkIf cfg.database.createLocally {
|
||||
enable = true;
|
||||
ensureDatabases = [ cfg.database.name ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = cfg.database.user;
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = lib.teams.ngi.members;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ in
|
||||
The set of NTP servers from which to synchronise.
|
||||
|
||||
Setting this option to an empty list will write `NTP=` to the
|
||||
`timesyncd.conf` file as opposed to setting this option to null which
|
||||
{file}`timesyncd.conf` file as opposed to setting this option to null which
|
||||
will remove `NTP=` entirely.
|
||||
|
||||
See {manpage}`timesyncd.conf(5)` for details.
|
||||
@@ -39,7 +39,7 @@ in
|
||||
The set of fallback NTP servers from which to synchronise.
|
||||
|
||||
Setting this option to an empty list will write `FallbackNTP=` to the
|
||||
`timesyncd.conf` file as opposed to setting this option to null which
|
||||
{file}`timesyncd.conf` file as opposed to setting this option to null which
|
||||
will remove `FallbackNTP=` entirely.
|
||||
|
||||
See {manpage}`timesyncd.conf(5)` for details.
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
# succeeds, and all other jobs have finished (they may fail).
|
||||
|
||||
{
|
||||
lib ? (import ../lib),
|
||||
nixpkgs ? {
|
||||
outPath = (import ../lib).cleanSource ./..;
|
||||
outPath = lib.cleanSource ./..;
|
||||
revCount = 56789;
|
||||
shortRev = "gfedcba";
|
||||
},
|
||||
@@ -28,7 +29,7 @@ let
|
||||
if (set.type or "") == "derivation" then
|
||||
set // { meta = removeAttrs (set.meta or { }) [ "maintainers" ]; }
|
||||
else
|
||||
pkgs.lib.mapAttrs (n: v: removeMaintainers v) set
|
||||
lib.mapAttrs (n: v: removeMaintainers v) set
|
||||
else
|
||||
set;
|
||||
|
||||
@@ -57,7 +58,7 @@ rec {
|
||||
onSystems =
|
||||
systems: x:
|
||||
map (system: "${x}.${system}") (
|
||||
pkgs.lib.intersectLists systems (supportedSystems ++ limitedSupportedSystems)
|
||||
lib.intersectLists systems (supportedSystems ++ limitedSupportedSystems)
|
||||
);
|
||||
in
|
||||
pkgs.releaseTools.aggregate {
|
||||
@@ -66,7 +67,7 @@ rec {
|
||||
description = "Release-critical builds for the NixOS channel";
|
||||
maintainers = [ ];
|
||||
};
|
||||
constituents = pkgs.lib.concatLists [
|
||||
constituents = lib.concatLists [
|
||||
[ "nixos.channel" ]
|
||||
(onFullSupported "nixos.dummy")
|
||||
(onAllSupported "nixos.iso_minimal")
|
||||
|
||||
@@ -1231,6 +1231,10 @@ in
|
||||
pass-secret-service = runTest ./pass-secret-service.nix;
|
||||
password-option-override-ordering = runTest ./password-option-override-ordering.nix;
|
||||
patroni = handleTestOn [ "x86_64-linux" ] ./patroni.nix { };
|
||||
pdfding = import ./web-apps/pdfding {
|
||||
inherit (pkgs) lib;
|
||||
inherit runTest;
|
||||
};
|
||||
pdns-recursor = runTest ./pdns-recursor.nix;
|
||||
peerflix = runTest ./peerflix.nix;
|
||||
peering-manager = runTest ./web-apps/peering-manager.nix;
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "PdfDing sqlite";
|
||||
|
||||
nodes = {
|
||||
machine =
|
||||
{ ... }:
|
||||
{
|
||||
# WARNING: Do not add secrets to the world-readable /nix/store in a production deployment
|
||||
# Use a secret management scheme instead https://wiki.nixos.org/wiki/Comparison_of_secret_managing_schemes
|
||||
services.pdfding = {
|
||||
enable = true;
|
||||
secretKeyFile = pkgs.writeText "secretKeyFile" "test123";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
sqlite
|
||||
];
|
||||
|
||||
# test email validation works
|
||||
services.pdfding.extraEnvironment = {
|
||||
EMAIL_BACKEND = "SMTP";
|
||||
SMTP_HOST = "localhost";
|
||||
SMTP_PORT = "1025";
|
||||
SMTP_USER = ""; # mailpit doesn't need auth
|
||||
SMTP_PASSWORD = "";
|
||||
SMTP_USE_TLS = "FALSE";
|
||||
SMTP_USE_SSL = "FALSE";
|
||||
};
|
||||
|
||||
# enable mailpit
|
||||
services.mailpit.instances.default = { };
|
||||
};
|
||||
};
|
||||
|
||||
# Test the most basic user functionality expected from pdfding.
|
||||
# Heavy e2e test suite is implemented in e2e.nix
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
let
|
||||
inherit (nodes.machine.services.pdfding) port;
|
||||
mailpitApiEndpoint = "http://${nodes.machine.services.mailpit.instances.default.listen}/api/v1";
|
||||
stateDir = "/var/lib/pdfding";
|
||||
in
|
||||
# py
|
||||
''
|
||||
import json
|
||||
from pprint import pprint
|
||||
|
||||
# start vms
|
||||
start_all()
|
||||
|
||||
# create admin
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.succeed("DJANGO_SUPERUSER_PASSWORD=admin pdfding-manage createsuperuser --no-input --username admin --email admin@localhost")
|
||||
|
||||
cookie_jar = "/tmp/cookies.txt"
|
||||
endpoint = "http://localhost:${toString port}"
|
||||
|
||||
with subtest("login and basic usage"):
|
||||
# login
|
||||
machine.succeed(f"""
|
||||
curl -f \
|
||||
-X POST -c {cookie_jar} -b {cookie_jar} \
|
||||
-d "csrfmiddlewaretoken=$(curl -f -c {cookie_jar} -s '{endpoint}/accountlogin/' | grep -oP 'name="csrfmiddlewaretoken" value="\\K[^"]+')" \
|
||||
-d "login=admin@localhost" \
|
||||
-d "password=admin" \
|
||||
{endpoint}/accountlogin/
|
||||
""")
|
||||
|
||||
test_pdf = "${pkgs.pdfding.src}/pdfding/pdf/tests/data/dummy.pdf"
|
||||
|
||||
# verify no pdfs exist in db
|
||||
machine.succeed("sqlite3 ${stateDir}/db/db.sqlite3 'SELECT COUNT(*) FROM pdf_pdf' | grep -q '^0$'")
|
||||
|
||||
# upload
|
||||
machine.succeed(f"""
|
||||
csrf_token=$(curl -f -b {cookie_jar} -c {cookie_jar} -s "{endpoint}/pdf/add" | grep -oP 'name="csrfmiddlewaretoken" value="\\K[^"]+')
|
||||
curl -f \
|
||||
-c {cookie_jar} -b {cookie_jar} \
|
||||
-F "notes=" \
|
||||
-F "tag_string=" \
|
||||
-F "description=" \
|
||||
-F "collection=1" \
|
||||
-F "use_file_name=on" \
|
||||
-F "name=test-upload" \
|
||||
-F "file=@{test_pdf};type=application/pdf" \
|
||||
-F "csrfmiddlewaretoken=$csrf_token" \
|
||||
-H "Referer: {endpoint}/pdf/add" \
|
||||
{endpoint}/pdf/add
|
||||
""")
|
||||
|
||||
# download
|
||||
machine.succeed(f"""
|
||||
pdf_id=$(curl -f -b {cookie_jar} -s "{endpoint}/pdf/" | grep -oP 'href="/pdf/view/\\K[^"]+' | head -1)
|
||||
curl -f -b {cookie_jar} -o /tmp/downloaded.pdf "{endpoint}/pdf/download/$pdf_id"
|
||||
""")
|
||||
|
||||
# verify pdf in user's dir
|
||||
machine.succeed("test -f ${stateDir}/media/1/default/pdf/*.pdf")
|
||||
|
||||
# verify one entry exists in sqlite db
|
||||
machine.succeed("sqlite3 ${stateDir}/db/db.sqlite3 'SELECT COUNT(*) FROM pdf_pdf' | grep -q '^1$'")
|
||||
|
||||
with subtest("email validation"):
|
||||
# check we can reach mailpit
|
||||
machine.succeed("curl -f ${mailpitApiEndpoint}/info")
|
||||
|
||||
# check that no emails exist
|
||||
result = json.loads(machine.succeed("curl -sf ${mailpitApiEndpoint}/messages"))
|
||||
pprint(result)
|
||||
assert result["total"] == 0
|
||||
|
||||
# signup
|
||||
machine.succeed(f"""
|
||||
curl -f \
|
||||
-X POST -c {cookie_jar} -b {cookie_jar} \
|
||||
-d "csrfmiddlewaretoken=$(curl -f -c {cookie_jar} -s '{endpoint}/accountsignup/' | grep -oP 'name="csrfmiddlewaretoken" value="\\K[^"]+')" \
|
||||
-d "email=pdfding_new_user@example.com" \
|
||||
-d "password1=foobarbaz" \
|
||||
-d "password2=foobarbaz" \
|
||||
{endpoint}/accountsignup/
|
||||
""")
|
||||
|
||||
# wait a bit for email to be processed
|
||||
machine.sleep(3)
|
||||
|
||||
# verify the email was received by mailpit
|
||||
result = json.loads(machine.succeed("curl -s ${mailpitApiEndpoint}/messages"))
|
||||
pprint(result)
|
||||
assert result["total"] == 1
|
||||
assert result["messages"][0]["To"][0]["Address"] == "pdfding_new_user@example.com"
|
||||
'';
|
||||
|
||||
# Debug interactively with:
|
||||
# - nix run .#nixosTests.pdfding.basic.driverInteractive -L
|
||||
# - start_all() / run_tests()
|
||||
interactive.sshBackdoor.enable = true; # ssh -o User=root vsock%3
|
||||
interactive.nodes.machine =
|
||||
{ config, ... }:
|
||||
let
|
||||
port = config.services.pdfding.port;
|
||||
in
|
||||
{
|
||||
# not needed, only for manual interactive debugging
|
||||
virtualisation.memorySize = 4096;
|
||||
environment.systemPackages = with pkgs; [
|
||||
htop
|
||||
];
|
||||
|
||||
virtualisation.forwardPorts = map (port: {
|
||||
from = "host";
|
||||
host.port = port;
|
||||
guest.port = port;
|
||||
}) [ port ];
|
||||
|
||||
# forwarded ports need to be accessible
|
||||
networking.firewall.allowedTCPPorts = [ port ];
|
||||
};
|
||||
|
||||
meta.maintainers = lib.teams.ngi.members;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{ lib, runTest }:
|
||||
lib.recurseIntoAttrs {
|
||||
basic = runTest ./basic.nix;
|
||||
e2e = runTest ./e2e.nix;
|
||||
postgres = runTest ./postgres.nix;
|
||||
s3-backups = runTest ./s3-backups.nix;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "PdfDing e2e tests";
|
||||
|
||||
nodes = {
|
||||
machine =
|
||||
{ ... }:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "tests_e2e" (
|
||||
let
|
||||
pythonPath =
|
||||
with pkgs.python3Packages;
|
||||
[
|
||||
playwright
|
||||
pkgs.pdfding
|
||||
]
|
||||
++ pkgs.pdfding.dependencies
|
||||
++ pkgs.pdfding.optional-dependencies.e2e;
|
||||
in
|
||||
# bash
|
||||
''
|
||||
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
|
||||
export PYTHONPATH=${pkgs.python3Packages.makePythonPath pythonPath}
|
||||
export PATH=${pkgs.pdfding.python}/bin:$PATH
|
||||
export E2E_TESTS=1
|
||||
cd $(mktemp -d)
|
||||
cp -r --no-preserve=all ${pkgs.pdfding.src} source
|
||||
cd source
|
||||
cp -ru --no-preserve=all ${pkgs.pdfding.frontend}/pdfding/static pdfding
|
||||
# some tests are flaky due to timeouts, re-run them
|
||||
python -m pytest pdfding/e2e \
|
||||
-x -r aR \
|
||||
--reruns 10 --only-rerun TimeoutError
|
||||
''
|
||||
# see https://github.com/MrBin99/django-vite/issues/95
|
||||
# tdlr; collectstatic is not important for e2e tests which uses StaticLiveServerTestCase
|
||||
# it only cares about files in static/
|
||||
))
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
# py
|
||||
''
|
||||
# start
|
||||
start_all()
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
machine.succeed("tests_e2e | systemd-cat")
|
||||
'';
|
||||
|
||||
# Debug interactively with:
|
||||
# - nix run .#nixosTests.pdfding.e2e.driverInteractive -L
|
||||
# - start_all() / run_tests()
|
||||
interactive.sshBackdoor.enable = true; # ssh -o User=root vsock%3
|
||||
interactive.nodes.machine =
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
# enable graphical session + users (alice, bob)
|
||||
./common/x11.nix
|
||||
./common/user-account.nix
|
||||
];
|
||||
services.xserver.enable = true;
|
||||
test-support.displayManager.auto.user = "alice";
|
||||
virtualisation.memorySize = lib.mkForce 8192;
|
||||
environment.systemPackages = with pkgs; [
|
||||
htop
|
||||
];
|
||||
# env DISPLAY=:0 sudo -u alice tests_e2e | systemd-cat
|
||||
};
|
||||
|
||||
meta.maintainers = lib.teams.ngi.members;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "PdfDing postgres";
|
||||
|
||||
nodes = {
|
||||
machine =
|
||||
{ config, ... }:
|
||||
{
|
||||
# WARNING: Do not add secrets to the world-readable /nix/store in a production deployment
|
||||
# Use a secret management scheme instead https://wiki.nixos.org/wiki/Comparison_of_secret_managing_schemes
|
||||
services.pdfding = {
|
||||
enable = true;
|
||||
secretKeyFile = pkgs.writeText "secretKeyFile" "test123";
|
||||
database.createLocally = true;
|
||||
database.type = "postgres";
|
||||
consume.enable = true; # allows bulk importing pdf files from the backend
|
||||
consume.schedule = "*/1 * * * *"; # once every minute
|
||||
installTestHelpers = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
config.services.postgresql.finalPackage
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Tests the most basic user functionality expected from pdfding with postgres and consume feature
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
let
|
||||
stateDir = "/var/lib/pdfding";
|
||||
in
|
||||
# py
|
||||
''
|
||||
# start
|
||||
start_all()
|
||||
|
||||
# create admin
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
machine.succeed("DJANGO_SUPERUSER_PASSWORD=admin pdfding-manage createsuperuser --no-input --username admin --email admin@localhost")
|
||||
|
||||
test_pdf = "${pkgs.pdfding.src}/pdfding/pdf/tests/data/dummy.pdf"
|
||||
|
||||
# copy to consume dir
|
||||
machine.succeed(f"sudo -u pdfding bash -c 'mkdir -p ${stateDir}/consume/1 && cp {test_pdf} ${stateDir}/consume/1/'")
|
||||
|
||||
# check the file was copied
|
||||
output = machine.succeed("sudo -u pdfding bash -c 'ls -l ${stateDir}/consume/1/'")
|
||||
assert "dummy.pdf" in output, "dummy pdf file not found"
|
||||
|
||||
# check there are no pdfs
|
||||
machine.succeed("sudo -u pdfding psql -tAc 'SELECT COUNT(*) FROM pdf_pdf' | grep -q '^0$'")
|
||||
|
||||
print(machine.succeed("realpath /run/current-system/sw/bin/consume-immediate"))
|
||||
print(machine.succeed("consume-immediate"))
|
||||
|
||||
# verify pdf is in user's dir, and removed from consume dir
|
||||
machine.wait_for_file("${stateDir}/media/1/default/pdf/dummy.pdf")
|
||||
machine.fail("test -f ${stateDir}/consume/1/default/pdf/dummy.pdf")
|
||||
|
||||
# verify pdf is also in postgres db
|
||||
machine.succeed("sudo -u pdfding psql -tAc 'SELECT COUNT(*) FROM pdf_pdf' | grep -q '^1$'")
|
||||
'';
|
||||
|
||||
# Debug interactively with:
|
||||
# - nix run .#nixosTests.pdfding.postgres.driverInteractive -L
|
||||
# - start_all() / run_tests()
|
||||
interactive.sshBackdoor.enable = true; # ssh -o User=root vsock%3
|
||||
interactive.nodes.machine =
|
||||
{ config, ... }:
|
||||
let
|
||||
port = config.services.pdfding.port;
|
||||
in
|
||||
{
|
||||
# not needed, only for manual interactive debugging
|
||||
virtualisation.memorySize = 4096;
|
||||
environment.systemPackages = with pkgs; [
|
||||
htop
|
||||
];
|
||||
|
||||
virtualisation.forwardPorts = map (port: {
|
||||
from = "host";
|
||||
host.port = port;
|
||||
guest.port = port;
|
||||
}) [ port ];
|
||||
|
||||
# forwarded ports need to be accessible
|
||||
networking.firewall.allowedTCPPorts = [ port ];
|
||||
};
|
||||
|
||||
meta.maintainers = lib.teams.ngi.members;
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# WARNING: Do not add secrets to the world-readable /nix/store in a production deployment
|
||||
# Use a secret management scheme instead https://wiki.nixos.org/wiki/Comparison_of_secret_managing_schemes
|
||||
|
||||
# note: In a production deployment use `garage key generate`, along with the steps specified in the getting started guide of garage.
|
||||
# (sops-nix or agenix for configuring secrets for garage is out of scope here)
|
||||
garageAccessKey = "GK0a0a0a0b0b0b0c0c0c0d0d0d";
|
||||
garageSecretKey = "0a0a0a0a0b0b0b0b0c0c0c0c0d0d0d0d1a1a1a1a1b1b1b1b1c1c1c1c1d1d1d1d";
|
||||
pdfding-s3-keys = pkgs.writeText "pdfding-s3-keys" ''
|
||||
BACKUP_ACCESS_KEY=${garageAccessKey}
|
||||
BACKUP_SECRET_KEY=${garageSecretKey}
|
||||
'';
|
||||
in
|
||||
{
|
||||
name = "PdfDing s3 backups";
|
||||
|
||||
nodes = {
|
||||
machine =
|
||||
{ config, ... }:
|
||||
{
|
||||
services.pdfding = {
|
||||
enable = true;
|
||||
secretKeyFile = pkgs.writeText "secretKeyFile" "test123";
|
||||
|
||||
backup.enable = true;
|
||||
backup.schedule = "*/1 * * * *";
|
||||
backup.endpoint = "[::]:3900";
|
||||
extraEnvironment.BACKUP_BUCKET_NAME = "pdfding-bucket";
|
||||
extraEnvironment.BACKUP_REGION = "garage";
|
||||
|
||||
envFiles = [ pdfding-s3-keys ];
|
||||
installTestHelpers = true;
|
||||
};
|
||||
|
||||
# Setup a local garage service for the backup feature
|
||||
# taken from garage nixosTest
|
||||
services.garage = {
|
||||
enable = true;
|
||||
package = pkgs.garage_2;
|
||||
settings = {
|
||||
rpc_bind_addr = "[::]:3901";
|
||||
rpc_public_addr = "[::1]:3901";
|
||||
rpc_secret = "5c1915fa04d0b6739675c61bf5907eb0fe3d9c69850c83820f51b4d25d13868c";
|
||||
|
||||
s3_api = {
|
||||
s3_region = "garage";
|
||||
api_bind_addr = "[::]:3900";
|
||||
root_domain = ".s3.garage";
|
||||
};
|
||||
|
||||
s3_web = {
|
||||
bind_addr = "[::]:3902";
|
||||
root_domain = ".web.garage";
|
||||
index = "index.html";
|
||||
};
|
||||
|
||||
replication_factor = 1;
|
||||
};
|
||||
};
|
||||
|
||||
# setup garage bucket and credentials
|
||||
# note: The nixos module has no option to specify secrets declaratively
|
||||
systemd.services.garage.postStart = ''
|
||||
export PATH="$PATH:${config.services.garage.package}/bin"
|
||||
|
||||
# wait for garage to be up
|
||||
while ! garage status >/dev/null 2>&1; do sleep 2; done
|
||||
|
||||
if ! garage bucket list | grep -q pdfding-bucket; then
|
||||
garage layout assign -z dc1 -c 1G $(garage status | cut -d' ' -f1 | tail -1)
|
||||
garage layout apply --version 1
|
||||
|
||||
# note: the key id should be valid (starts with `GK`, followed by 12 hex-encoded bytes)
|
||||
# the secret key should be valid (composed of 32 hex-encoded bytes)
|
||||
garage key import ${garageAccessKey} ${garageSecretKey} -n pdfding-key --yes
|
||||
|
||||
garage bucket create pdfding-bucket
|
||||
|
||||
garage bucket allow --read --write --owner pdfding-bucket --key pdfding-key
|
||||
fi
|
||||
'';
|
||||
|
||||
# Garage requires at least 1GiB of free disk space to run.
|
||||
virtualisation.diskSize = 2 * 1024;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
minio-client
|
||||
sqlite
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Tests the most basic user functionality expected from pdfding backup service
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
let
|
||||
inherit (nodes.machine.services.pdfding) port;
|
||||
stateDir = "/var/lib/pdfding";
|
||||
in
|
||||
# py
|
||||
''
|
||||
# start vms
|
||||
start_all()
|
||||
|
||||
# create admin
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.succeed("DJANGO_SUPERUSER_PASSWORD=admin pdfding-manage createsuperuser --no-input --username admin --email admin@localhost")
|
||||
|
||||
# login
|
||||
endpoint = "http://localhost:${toString port}"
|
||||
cookie_jar = "/tmp/cookies.txt"
|
||||
machine.succeed(f"""
|
||||
curl -f \
|
||||
-X POST -c {cookie_jar} -b {cookie_jar} \
|
||||
-d "csrfmiddlewaretoken=$(curl -f -c {cookie_jar} -s '{endpoint}/accountlogin/' | grep -oP 'name="csrfmiddlewaretoken" value="\\K[^"]+')" \
|
||||
-d "login=admin@localhost" \
|
||||
-d "password=admin" \
|
||||
{endpoint}/accountlogin/
|
||||
""")
|
||||
|
||||
test_pdf = "${pkgs.pdfding.src}/pdfding/pdf/tests/data/dummy.pdf"
|
||||
|
||||
# upload
|
||||
machine.succeed(f"""
|
||||
csrf_token=$(curl -f -b {cookie_jar} -c {cookie_jar} -s "{endpoint}/pdf/add" | grep -oP 'name="csrfmiddlewaretoken" value="\\K[^"]+')
|
||||
curl -f \
|
||||
-c {cookie_jar} -b {cookie_jar} \
|
||||
-F "notes=" \
|
||||
-F "tag_string=" \
|
||||
-F "description=" \
|
||||
-F "collection=1" \
|
||||
-F "use_file_name=on" \
|
||||
-F "name=test-upload" \
|
||||
-F "file=@{test_pdf};type=application/pdf" \
|
||||
-F "csrfmiddlewaretoken=$csrf_token" \
|
||||
-H "Referer: {endpoint}/pdf/add" \
|
||||
{endpoint}/pdf/add
|
||||
""")
|
||||
|
||||
# download
|
||||
machine.succeed(f"""
|
||||
pdf_id=$(curl -f -b {cookie_jar} -s "{endpoint}/pdf/" | grep -oP 'href="/pdf/view/\\K[^"]+' | head -1)
|
||||
curl -f -b {cookie_jar} -o /tmp/downloaded.pdf "{endpoint}/pdf/download/$pdf_id"
|
||||
""")
|
||||
|
||||
# verify pdf in user's dir
|
||||
machine.succeed("test -f ${stateDir}/media/1/default/pdf/*.pdf")
|
||||
|
||||
# verify one entry exists in sqlite db
|
||||
machine.succeed("sqlite3 ${stateDir}/db/db.sqlite3 'SELECT COUNT(*) FROM pdf_pdf' | grep -q '^1$'")
|
||||
|
||||
machine.succeed("""
|
||||
source ${pdfding-s3-keys}
|
||||
mc alias set garage --api S3v4 \
|
||||
http://[::]:3900 $BACKUP_ACCESS_KEY $BACKUP_SECRET_KEY
|
||||
""")
|
||||
|
||||
print(machine.succeed("realpath /run/current-system/sw/bin/backup-immediate"))
|
||||
print(machine.succeed("backup-immediate"))
|
||||
|
||||
# verify the backup s3 service has that pdf file
|
||||
machine.wait_until_succeeds("mc stat garage/pdfding-bucket/1/default/pdf/dummy.pdf", timeout=10)
|
||||
print(machine.succeed("mc stat garage/pdfding-bucket/1/default/pdf/dummy.pdf"))
|
||||
'';
|
||||
|
||||
# Debug interactively with:
|
||||
# - nix run .#nixosTests.pdfding.s3.driverInteractive -L
|
||||
# - start_all() / run_tests()
|
||||
interactive.sshBackdoor.enable = true; # ssh -o User=root vsock%3
|
||||
interactive.nodes.machine =
|
||||
{ config, ... }:
|
||||
let
|
||||
ports = [
|
||||
config.services.pdfding.port
|
||||
3901
|
||||
3902
|
||||
];
|
||||
in
|
||||
{
|
||||
# not needed, only for manual interactive debugging
|
||||
virtualisation.memorySize = 4096;
|
||||
environment.systemPackages = with pkgs; [
|
||||
htop
|
||||
];
|
||||
|
||||
virtualisation.forwardPorts = map (port: {
|
||||
from = "host";
|
||||
host.port = port;
|
||||
guest.port = port;
|
||||
}) ports;
|
||||
|
||||
# forwarded ports need to be accessible
|
||||
networking.firewall.allowedTCPPorts = ports;
|
||||
};
|
||||
|
||||
meta.maintainers = lib.teams.ngi.members;
|
||||
}
|
||||
@@ -7,11 +7,11 @@
|
||||
let
|
||||
src = mkJetBrainsSource {
|
||||
# update-script-start: source-args
|
||||
version = "2025.3.1.1";
|
||||
buildNumber = "253.29346.308";
|
||||
version = "2025.3.2.1";
|
||||
buildNumber = "253.30387.173";
|
||||
buildType = "pycharm";
|
||||
ideaHash = "sha256-sx/yLkMsjOQWAMJztoI0T6xQ66pnjnQejgc85PGod2s=";
|
||||
androidHash = "sha256-quMCzrjCKIo1pkzw4PWewAs5tz7A2aq7TI5zd+QaaUY=";
|
||||
ideaHash = "sha256-13da6xCaZfS7zwesqGJpwsKfUK61Vi7gtMgPKtve43U=";
|
||||
androidHash = "sha256-FA/6ry1M7+RISJL+2SR9QkDvAGJAkXhFMh9YoOEU5nk=";
|
||||
jpsHash = "sha256-iHpt926BDLNUwHRXvkqVgwlWiLo1qSZEaGeJcS0Fjmk=";
|
||||
restarterHash = "sha256-acCmC58URd6p9uKZrm0qWgdZkqu9yqCs23v8qgxV2Ag=";
|
||||
mvnDeps = ../source/pycharm_maven_artefacts.json;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,12 +12,12 @@
|
||||
pkgs,
|
||||
}:
|
||||
let
|
||||
version = "0.0.27-unstable-2026-01-24";
|
||||
version = "0.0.27-unstable-2026-02-03";
|
||||
src = fetchFromGitHub {
|
||||
owner = "yetone";
|
||||
repo = "avante.nvim";
|
||||
rev = "fde9a524457d17661618678f085649d4e8d3fd6f";
|
||||
hash = "sha256-i+IxrUcqQk9okjXkHm7m+PF6+H4YKUkOtuyF/ZuoCWc=";
|
||||
rev = "d80b7966c0505809e83e408353bbe8cb3394936d";
|
||||
hash = "sha256-+IfICc7uBaMV27VJcHlUOxZ2TFQoIHFJPMtoIjjgnZ8=";
|
||||
};
|
||||
avante-nvim-lib = rustPlatform.buildRustPackage {
|
||||
pname = "avante-nvim-lib";
|
||||
|
||||
@@ -33,7 +33,7 @@ vimUtils.buildVimPlugin {
|
||||
|
||||
meta = {
|
||||
description = "Index and navigate your code repository using vectorcode";
|
||||
homepage = "https://github.com/Davidyz/VectorCode/blob/main/docs/neovim.md";
|
||||
homepage = "https://github.com/Davidyz/VectorCode/blob/main/docs/neovim/README.md";
|
||||
inherit (vectorcode.meta) changelog license;
|
||||
maintainers = with lib.maintainers; [ sarahec ];
|
||||
};
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
}:
|
||||
mkLibretroCore {
|
||||
core = "flycast";
|
||||
version = "0-unstable-2026-01-28";
|
||||
version = "0-unstable-2026-02-06";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "flyinghead";
|
||||
repo = "flycast";
|
||||
rev = "21eb24f86d785b1c631161f03057b22c160182c0";
|
||||
hash = "sha256-gGjSbkhy6ykEin8Bci6xHNII2MdEzLcUPr/dU6IwlIw=";
|
||||
rev = "c577e29f43edc5a86c6ed4edca46706000d214b2";
|
||||
hash = "sha256-nHMtXwtrgxoN/tuY1d+DqZAJFag8vmHAP/9tS2j3ErU=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
|
||||
"out"
|
||||
"dev"
|
||||
];
|
||||
version = "15.71.4";
|
||||
version = "15.74.3";
|
||||
|
||||
src =
|
||||
let
|
||||
@@ -38,11 +38,11 @@ stdenv.mkDerivation rec {
|
||||
{
|
||||
x86_64-linux = fetchurl {
|
||||
url = "${base_url}/teamviewer_${version}_amd64.deb";
|
||||
hash = "sha256-DztZRVBIFdLkZX1a89tVwJvJicgsm5YTux0ezyWL1+w=";
|
||||
hash = "sha256-7QQlGzIr3BBFaur8ycGY0VuYz21cJI+EfCsRuCAr8XA=";
|
||||
};
|
||||
aarch64-linux = fetchurl {
|
||||
url = "${base_url}/teamviewer_${version}_arm64.deb";
|
||||
hash = "sha256-lKEAuMsScbnEkgR6VFykEyar55u/Fdt5VcCWnKPwJLU=";
|
||||
hash = "sha256-prz3RaeMykgLrK9ai3/ivzRsUFT1dyWP1xymEl3s4eA=";
|
||||
};
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
@@ -102,12 +102,8 @@ stdenv.mkDerivation rec {
|
||||
--replace '/opt/teamviewer/tv_bin/script/execscript' \
|
||||
"$out/share/teamviewer/tv_bin/script/execscript"
|
||||
|
||||
for i in 16 20 24 32 48 256; do
|
||||
size=$i"x"$i
|
||||
|
||||
mkdir -p $out/share/icons/hicolor/$size/apps
|
||||
ln -s $out/share/teamviewer/tv_bin/desktop/teamviewer_$i.png $out/share/icons/hicolor/$size/apps/TeamViewer.png
|
||||
done;
|
||||
mkdir -p $out/share/icons/hicolor/scalable/apps
|
||||
ln -s $out/share/teamviewer/tv_bin/desktop/TeamViewer.svg $out/share/icons/hicolor/scalable/apps/TeamViewer.svg
|
||||
|
||||
sed -i "s,/opt/teamviewer,$out/share/teamviewer,g" $out/share/teamviewer/tv_bin/desktop/com.teamviewer.*.desktop
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ let
|
||||
"9.0.0".sha256 = "sha256-GRwYSvrJGiPD+I82gLOgotb+8Ra5xHZUJGcNwxWqZkU=";
|
||||
"9.0.1".sha256 = "sha256-gRgQhFiYvGR/Z46TmTl1bgN9O32nifxQGdrzfw0WHrk=";
|
||||
"9.1.0".sha256 = "sha256-+QL7I1/0BfT87n7lSaOmpHj2jJuDB4idWhAxwzvVQOE=";
|
||||
"9.1.1".sha256 = "sha256-aFsGsFzexyDnOVarHPKs35HjiV8uUCpeOKSl15wXZ4s=";
|
||||
"9.2+rc1".sha256 = "sha256-zKVhnBid5LOcd7uHWFGmUdHpyNLxIyB7RNNz5btz0mI=";
|
||||
};
|
||||
releaseRev = v: "V${v}";
|
||||
|
||||
@@ -27,6 +27,7 @@ let
|
||||
"9.0.0".sha256 = "sha256-GRwYSvrJGiPD+I82gLOgotb+8Ra5xHZUJGcNwxWqZkU=";
|
||||
"9.0.1".sha256 = "sha256-gRgQhFiYvGR/Z46TmTl1bgN9O32nifxQGdrzfw0WHrk=";
|
||||
"9.1.0".sha256 = "sha256-+QL7I1/0BfT87n7lSaOmpHj2jJuDB4idWhAxwzvVQOE=";
|
||||
"9.1.1".sha256 = "sha256-aFsGsFzexyDnOVarHPKs35HjiV8uUCpeOKSl15wXZ4s=";
|
||||
"9.2+rc1".sha256 = "sha256-zKVhnBid5LOcd7uHWFGmUdHpyNLxIyB7RNNz5btz0mI=";
|
||||
};
|
||||
releaseRev = v: "V${v}";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
version = "1.3.8";
|
||||
version = "1.3.9";
|
||||
pname = "bun";
|
||||
|
||||
src =
|
||||
@@ -81,19 +81,19 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
sources = {
|
||||
"aarch64-darwin" = fetchurl {
|
||||
url = "https://github.com/oven-sh/bun/releases/download/bun-v${finalAttrs.version}/bun-darwin-aarch64.zip";
|
||||
hash = "sha256-ZyoKmnt0TQhaHSIZypB+Pib1V5/Knng6lRCk+Yo2IS8=";
|
||||
hash = "sha256-zeak7fGc9kkJFY+lpGShICb9fw15pKlQwQzwrwQmbYU=";
|
||||
};
|
||||
"aarch64-linux" = fetchurl {
|
||||
url = "https://github.com/oven-sh/bun/releases/download/bun-v${finalAttrs.version}/bun-linux-aarch64.zip";
|
||||
hash = "sha256-Tp3raBSn7H9ocl3dl9DXtAZbzamoUPadSXVn6ZWn+jM=";
|
||||
hash = "sha256-osKGK8wf0cCzqNzcjH77XirNhx6yDtLxdheITt6ByEQ=";
|
||||
};
|
||||
"x86_64-darwin" = fetchurl {
|
||||
url = "https://github.com/oven-sh/bun/releases/download/bun-v${finalAttrs.version}/bun-darwin-x64-baseline.zip";
|
||||
hash = "sha256-mBLl9sf4GO+cSR4Fp3SBqy56ShWAs3hSbhYRwQL+fKM=";
|
||||
hash = "sha256-puFYIapgeV9UHOGPzha8qfKpThkwaLd/bzMzD00KOtU=";
|
||||
};
|
||||
"x86_64-linux" = fetchurl {
|
||||
url = "https://github.com/oven-sh/bun/releases/download/bun-v${finalAttrs.version}/bun-linux-x64.zip";
|
||||
hash = "sha256-AyKxfwci2namQpiq1JgiWu3L9t8QCKHe5F4W7LImo/E=";
|
||||
hash = "sha256-RoDoDkTjKqcYVgzq6F0i7Pvy77jzZBeC415Lfv1loao=";
|
||||
};
|
||||
};
|
||||
updateScript = writeShellScript "update-bun" ''
|
||||
|
||||
@@ -61,6 +61,22 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
url = "https://github.com/debian-calibre/calibre/raw/refs/tags/debian/${finalAttrs.version}+${debian-source}/debian/patches/hardening/0007-Hardening-Qt-code.patch";
|
||||
hash = "sha256-lKp/omNicSBiQUIK+6OOc8ysM6LImn5GxWhpXr4iX+U=";
|
||||
})
|
||||
# Fix CVE-2026-25636
|
||||
# http://tracker.security.nixos.org/issues/NIXPKGS-2026-0160
|
||||
# https://github.com/NixOS/nixpkgs/issues/488052
|
||||
# Fixed upstream in 9.1.0.
|
||||
#
|
||||
# Both patches appear to be needed to fix the CVE.
|
||||
(fetchpatch {
|
||||
name = "CVE-2026-25636.1.patch";
|
||||
url = "https://github.com/kovidgoyal/calibre/commit/267bfd34020a4f297c2de9cc0cde50ebe5d024d4.patch";
|
||||
hash = "sha256-5CKlJG0e0v/VXiIeAqiByThRgMs+gwRdgOzPHupB8A8=";
|
||||
})
|
||||
(fetchpatch {
|
||||
name = "CVE-2026-25636.2.patch";
|
||||
url = "https://github.com/kovidgoyal/calibre/commit/9484ea82c6ab226c18e6ca5aa000fa16de598726.patch";
|
||||
hash = "sha256-hpWFSQXyOAVRqou0v+5oT5zIrBbyP2Uv2z1Vg811ZG0=";
|
||||
})
|
||||
]
|
||||
++ lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "clearlyU";
|
||||
pname = "clearly-u";
|
||||
version = "12-1.9";
|
||||
|
||||
src = fetchurl {
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "diskgraph";
|
||||
version = "0-unstable-2025-11-13";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "stolk";
|
||||
repo = "diskgraph";
|
||||
rev = "9a515fc620a792d118763ea591c304792e511274";
|
||||
hash = "sha256-iL4u63/dGapOSK7AuV1FChDUcwsBOcx0TYAhcH9E+S0=";
|
||||
};
|
||||
|
||||
makeFlags = [
|
||||
"PREFIX=${placeholder "out"}"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Terminal-based monitor for disk I/O";
|
||||
homepage = "https://github.com/stolk/diskgraph";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [
|
||||
fliegendewurst
|
||||
nettika
|
||||
];
|
||||
mainProgram = "diskgraph";
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "dnf5";
|
||||
version = "5.2.17.0";
|
||||
version = "5.2.18.0";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
@@ -44,7 +44,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
owner = "rpm-software-management";
|
||||
repo = "dnf5";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-bVXmpoM2ymLgqjv8+3syYhkIKSyW68eKzKhUWRfR1vY=";
|
||||
hash = "sha256-VTuGHHNNdoDfbJ86GOR4a+Fy2s+NSXPH337+AZpLKuo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
python3,
|
||||
fetchPypi,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
git,
|
||||
postgresql,
|
||||
postgresqlTestHook,
|
||||
@@ -35,27 +34,35 @@ let
|
||||
};
|
||||
doCheck = false;
|
||||
});
|
||||
|
||||
# https://github.com/irrdnet/irrd/blob/0fd95020279060f2bc2816c0533c825e40f4c73c/pyproject.toml#L58C1-L59C1
|
||||
limits = prev.limits.overridePythonAttrs (oldAttrs: rec {
|
||||
version = "5.6.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "alisaifee";
|
||||
repo = "limits";
|
||||
tag = version;
|
||||
hash = "sha256-kghfF2ihEvyMPEGO1m9BquCdeBsYRoPyIljdLL1hToQ=";
|
||||
};
|
||||
doCheck = false;
|
||||
});
|
||||
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
py.pkgs.buildPythonPackage rec {
|
||||
py.pkgs.buildPythonPackage (finalAttrs: {
|
||||
pname = "irrd";
|
||||
version = "4.5.0b2";
|
||||
version = "4.5.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "irrdnet";
|
||||
repo = "irrd";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-MMacxjF0LLSdInSwXwpHJUTdUQJ6sl4yu83vWR/A4Jc=";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-6z94Ha2QQ0LE4o3hzsNl4y/nPv849cSP8on3UeegE4c=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace-fail py-radix py-radix-sr
|
||||
'';
|
||||
|
||||
pythonRelaxDeps = true;
|
||||
|
||||
build-system = with python3.pkgs; [ poetry-core ];
|
||||
@@ -153,10 +160,10 @@ py.pkgs.buildPythonPackage rec {
|
||||
];
|
||||
|
||||
meta = {
|
||||
changelog = "https://irrd.readthedocs.io/en/v${version}/releases/";
|
||||
changelog = "https://irrd.readthedocs.io/en/${finalAttrs.src.tag}/releases/";
|
||||
description = "Internet Routing Registry database server, processing IRR objects in the RPSL format";
|
||||
license = lib.licenses.mit;
|
||||
homepage = "https://github.com/irrdnet/irrd";
|
||||
maintainers = with lib.maintainers; [ yureka-wdz ];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
let
|
||||
pname = "ledger-live-desktop";
|
||||
version = "2.139.0";
|
||||
version = "2.139.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.live.ledger.com/${pname}-${version}-linux-x86_64.AppImage";
|
||||
hash = "sha256-sTqa/UOKkZodwSPnxkjxjz15xrr1VSCuAiO3bmzsbQU=";
|
||||
hash = "sha256-I4NYtvef+6wnd3IMffwAeuCg4dvGz6gLRcYHwXWwdtM=";
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extractType2 {
|
||||
|
||||
@@ -137,13 +137,13 @@ let
|
||||
in
|
||||
goBuild (finalAttrs: {
|
||||
pname = "ollama";
|
||||
version = "0.15.5";
|
||||
version = "0.15.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ollama";
|
||||
repo = "ollama";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-VJrAUHX+BVQXsH34BDI4YqVXEqD14ERnKhSpMByAdrQ=";
|
||||
hash = "sha256-II9ffgkMj2yx7Sek5PuAgRnUIS1Kf1UeK71+DwAgBRE=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-r7bSHOYAB5f3fRz7lKLejx6thPx0dR4UXoXu0XD7kVM=";
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "opencsg";
|
||||
version = "1.8.1";
|
||||
version = "1.8.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.opencsg.org/OpenCSG-${finalAttrs.version}.tar.gz";
|
||||
hash = "sha256-r8wASontO8R4qeS6ObIPPVibJOI+J1tzg/kaWQ1NV8U=";
|
||||
hash = "sha256-WsXfc7GtM0DdZwX/kOAJ8alGu5U2whwiY6b5dCZWZMA=";
|
||||
};
|
||||
|
||||
patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./opencsgexample.patch ];
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
stdenv,
|
||||
fetchpatch2,
|
||||
fetchNpmDeps,
|
||||
fetchzip,
|
||||
fetchFromGitHub,
|
||||
npmHooks,
|
||||
|
||||
tailwindcss_4,
|
||||
nodejs,
|
||||
}:
|
||||
let
|
||||
pdfjsVersion = "5.4.394"; # see update script
|
||||
pdfjsHash = "sha256-pd7xwfvR9U1bHT5eblszYU3YJQwQwhuyDDiNj+fnyaQ=";
|
||||
pdfjs = fetchzip {
|
||||
url = "https://github.com/mozilla/pdf.js/releases/download/v${pdfjsVersion}/pdfjs-${pdfjsVersion}-dist.zip";
|
||||
hash = pdfjsHash;
|
||||
stripRoot = false;
|
||||
postFetch = ''
|
||||
rm -rf $out/web/locale \
|
||||
$out/web/standard_fonts \
|
||||
$out/web/compressed.tracemonkey-pldi-09.pdf
|
||||
|
||||
# remove source maps
|
||||
find "$out" -name '*.map' -exec rm -f '{}' \;
|
||||
'';
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "pdfding-frontend";
|
||||
version = "1.5.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mrmn2";
|
||||
repo = "PdfDing";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-PXkD+2k8/LmMWzZAj8qEK4mLoOKS4mDWcqe8AgoCdBU=";
|
||||
};
|
||||
|
||||
npmDeps = fetchNpmDeps {
|
||||
inherit (finalAttrs) src;
|
||||
name = "pdfding-frontend-${finalAttrs.version}-npm-deps";
|
||||
hash = "sha256-SgL8QhRGONGhJBu6b8HSVqZPzJ+NojhVClBEH5ajCcc=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
npmHooks.npmConfigHook
|
||||
# it is in package.json and thus node_modules but no cli executable
|
||||
tailwindcss_4
|
||||
];
|
||||
|
||||
# keeping the file structure same as upstream to minimise confusion
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
mkdir -p $out/pdfding
|
||||
cp -r --no-preserve=mode pdfding/static $out/pdfding/static
|
||||
cp -r --no-preserve=mode ${finalAttrs.passthru.pdfjs} $out/pdfding/static/pdfjs
|
||||
|
||||
tailwindcss -i $out/pdfding/static/css/input.css -o $out/pdfding/static/css/tailwind.css --minify
|
||||
rm $out/pdfding/static/css/input.css
|
||||
|
||||
for i in build/pdf.mjs build/pdf.sandbox.mjs build/pdf.worker.mjs web/viewer.mjs;
|
||||
do
|
||||
node_modules/terser/bin/terser $out/pdfding/static/pdfjs/$i --compress -o $out/pdfding/static/pdfjs/$i;
|
||||
done
|
||||
|
||||
npm run build
|
||||
|
||||
cp -r pdfding/static/js $out/pdfding/static
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit pdfjs;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "PdfDing frontend";
|
||||
};
|
||||
})
|
||||
@@ -0,0 +1,206 @@
|
||||
{
|
||||
lib,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
fetchpatch2,
|
||||
makeWrapper,
|
||||
nixosTests,
|
||||
|
||||
python3,
|
||||
}:
|
||||
let
|
||||
python = python3;
|
||||
in
|
||||
python.pkgs.buildPythonPackage (finalAttrs: {
|
||||
pname = "pdfding";
|
||||
version = "1.5.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mrmn2";
|
||||
repo = "PdfDing";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-PXkD+2k8/LmMWzZAj8qEK4mLoOKS4mDWcqe8AgoCdBU=";
|
||||
};
|
||||
pyproject = true;
|
||||
|
||||
patches = [
|
||||
# fixes two tests, remove patch in the next version
|
||||
# https://github.com/mrmn2/PdfDing/pull/248
|
||||
(fetchpatch2 {
|
||||
url = "https://github.com/mrmn2/PdfDing/pull/248/commits/8f6900dddd1dbbe1a1024a484f63b792dd022f99.patch?full_index=1";
|
||||
hash = "sha256-5oUC2TKL4X5IFy/41qViaafyUr4+bLBIovk9AWQmxZc=";
|
||||
})
|
||||
];
|
||||
|
||||
# remove supervisor from dependencies
|
||||
postPatch = ''
|
||||
sed -i 's/supervisor.*$//' pyproject.toml
|
||||
|
||||
substituteInPlace pdfding/backup/tests/test_management.py pdfding/backup/tests/test_tasks.py \
|
||||
--replace-fail "Path(__file__).parents[2]" "Path('$PDFDING_OUT_DIR')"
|
||||
'';
|
||||
|
||||
dependencies =
|
||||
with python.pkgs;
|
||||
[
|
||||
django
|
||||
django-allauth
|
||||
django-cleanup
|
||||
django-htmx
|
||||
gunicorn
|
||||
huey
|
||||
markdown
|
||||
minio
|
||||
nh3
|
||||
oauthlib
|
||||
pillow
|
||||
psycopg2-binary
|
||||
pypdf
|
||||
pypdfium2
|
||||
python-magic
|
||||
qrcode
|
||||
rapidfuzz
|
||||
ruamel-yaml
|
||||
whitenoise
|
||||
|
||||
# dependecies required for django collectstatic
|
||||
cryptography
|
||||
pyjwt
|
||||
requests
|
||||
]
|
||||
++ qrcode.optional-dependencies.pil
|
||||
++ django-allauth.optional-dependencies.socialaccount;
|
||||
|
||||
build-system = with python.pkgs; [ poetry-core ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
optional-dependencies = {
|
||||
e2e = with python.pkgs; [
|
||||
pytest
|
||||
pytest-django
|
||||
pytest-playwright
|
||||
pytest-rerunfailures # required to retry some flaky e2e tests
|
||||
];
|
||||
};
|
||||
|
||||
preBuild = ''
|
||||
# remove originals, copy from frontend
|
||||
rm -rf pdfding/static
|
||||
ln -s ${finalAttrs.passthru.frontend}/pdfding/static pdfding/static
|
||||
|
||||
# staticfiles step requires prod configuration, remove dev.py
|
||||
mv pdfding/core/settings/dev.py dev.py.bak
|
||||
|
||||
${python.pythonOnBuildForHost.interpreter} pdfding/manage.py collectstatic
|
||||
|
||||
# not needed, now we have staticfiles directory
|
||||
rm -rf pdfding/static
|
||||
|
||||
# the following is from upstream's Dockerfile
|
||||
|
||||
# remove django md5 hash from filenames of pdfjs as it will mess up the relative imports because of the whitenoise setup
|
||||
export PDFJS_PATH="pdfding/staticfiles/pdfjs"
|
||||
for file_name in $(find $PDFJS_PATH -type f -not -path "$PDFJS_PATH/web/images/*")
|
||||
do
|
||||
if [[ $file_name =~ "LICENSE" ]]; then
|
||||
new=$(echo "$file_name" | sed -E "s/LICENSE\.[a-zA-Z0-9]{12}/LICENSE/");
|
||||
else
|
||||
new=$(echo "$file_name" | sed -E "s/\.[a-zA-Z0-9]{12}\./\./");
|
||||
fi;
|
||||
mv -- "$file_name" "$new";
|
||||
done \
|
||||
&& echo 'Successfully removed hash from pdfjs files'
|
||||
|
||||
echo "VERSION = '${finalAttrs.version}'" > pdfding/core/settings/version.py;
|
||||
'';
|
||||
|
||||
env.PDFDING_OUT_DIR = "${placeholder "out"}/${python.sitePackages}/pdfding";
|
||||
|
||||
makeWrapperArgs = [
|
||||
"--set-default DATA_DIR /var/lib/pdfding"
|
||||
# allow for gunicorn processes to have access to Python packages
|
||||
"--prefix PYTHONPATH : "
|
||||
"${python.pkgs.makePythonPath finalAttrs.passthru.dependencies}:${finalAttrs.env.PDFDING_OUT_DIR}"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
makeWrapper "$PDFDING_OUT_DIR/manage.py" $out/bin/pdfding-manage \
|
||||
$makeWrapperArgs
|
||||
|
||||
makeWrapper ${lib.getExe python.pkgs.gunicorn} $out/bin/pdfding-start \
|
||||
--add-flags '--bind ''${HOST_IP:-127.0.0.1}:''${HOST_PORT:-8080} core.wsgi:application' \
|
||||
$makeWrapperArgs
|
||||
'';
|
||||
|
||||
pythonRelaxDeps = [
|
||||
"django"
|
||||
"django-allauth"
|
||||
"django-htmx"
|
||||
"pypdf"
|
||||
"ruamel-yaml"
|
||||
];
|
||||
|
||||
nativeCheckInputs = with python.pkgs; [
|
||||
pytest-django
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
# from .github/workflows/tests.yaml
|
||||
pytestFlags = [
|
||||
"--ignore=e2e"
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# broken tests in 1.5.0
|
||||
"test_adjust_file_paths_to_ws_collection"
|
||||
"test_oidc_callback" # AssertionError: 200 != 401
|
||||
];
|
||||
|
||||
/*
|
||||
fix two breaking tests by providing full out path
|
||||
AssertionError: Calls not found
|
||||
AssertionError: 'add_file_to_minio' does not contain all of ...
|
||||
*/
|
||||
preCheck = ''
|
||||
# dev.py is required for tests, restore it
|
||||
mv dev.py.bak $PDFDING_OUT_DIR/core/settings/dev.py
|
||||
|
||||
# tests should run in pdfding directory
|
||||
pushd pdfding
|
||||
'';
|
||||
|
||||
postCheck = ''
|
||||
# come out of the pdfding directory
|
||||
popd
|
||||
|
||||
# remove dev.py
|
||||
rm $PDFDING_OUT_DIR/core/settings/dev.py
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [
|
||||
"pdfding"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
inherit python;
|
||||
tests = nixosTests.pdfding;
|
||||
frontend = callPackage ./frontend.nix { };
|
||||
updateScript = ./update.sh;
|
||||
};
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/mrmn2/PdfDing/blob/${finalAttrs.src.rev}/CHANGELOG.md";
|
||||
description = "Selfhosted PDF manager, viewer and editor offering a seamless user experience on multiple devices";
|
||||
downloadPage = "https://github.com/mrmn2/PdfDing";
|
||||
homepage = "https://pdfding.com";
|
||||
license = lib.licenses.agpl3Only;
|
||||
mainProgram = "pdfding-manage";
|
||||
maintainers = with lib.maintainers; [ phanirithvij ];
|
||||
platforms = lib.platforms.unix;
|
||||
teams = with lib.teams; [ ngi ];
|
||||
};
|
||||
})
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq nix-update gitMinimal prefetch-npm-deps coreutils
|
||||
|
||||
set -x
|
||||
set -eou pipefail
|
||||
|
||||
version=$(curl ${GITHUB_TOKEN:+ -H "Authorization: Bearer $GITHUB_TOKEN"} -sL https://api.github.com/repos/mrmn2/PdfDing/releases/latest | jq -r '.tag_name')
|
||||
|
||||
if [[ "v${UPDATE_NIX_OLD_VERSION:-}" == "$version" ]]; then
|
||||
echo "Already up-to-date, version: $version"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# source hashes
|
||||
nix-update --version="$version" pdfding
|
||||
nix-update --version="$version" pdfding.frontend
|
||||
|
||||
NIXPKGS_PATH="$(git rev-parse --show-toplevel)"
|
||||
PACKAGE_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
|
||||
TMPDIR="$(mktemp -d)"
|
||||
trap 'rm -rf "$TMPDIR"' EXIT
|
||||
cd "$TMPDIR"
|
||||
|
||||
src="$(nix-build --no-link "$NIXPKGS_PATH" -A pdfding.src)"
|
||||
cp "$src"/{package.json,package-lock.json} .
|
||||
|
||||
# npmDeps hash
|
||||
prev_npm_hash="$(
|
||||
nix-instantiate "$NIXPKGS_PATH" \
|
||||
--eval --json \
|
||||
-A pdfding.frontend.npmDeps.hash |
|
||||
jq -r .
|
||||
)"
|
||||
new_npm_hash="$(prefetch-npm-deps ./package-lock.json)"
|
||||
|
||||
sed -i "s|$prev_npm_hash|$new_npm_hash|g" "$PACKAGE_DIR/frontend.nix"
|
||||
|
||||
# pdfjs version
|
||||
pdfjs_version="$(grep 'PDFJS_VERSION=' "$src/Dockerfile" | cut -d'=' -f2)"
|
||||
|
||||
sed -i "s|pdfjsVersion = .*;|pdfjsVersion = \"$pdfjs_version\";|" "$PACKAGE_DIR/frontend.nix"
|
||||
|
||||
# pdfjs hash
|
||||
sed -i "s|pdfjsHash = .*;|pdfjsHash = \"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\";|" "$PACKAGE_DIR/frontend.nix"
|
||||
|
||||
set +e
|
||||
new_pdfjs_hash="$(
|
||||
nix-build --no-out-link -A pdfding.frontend.pdfjs "$NIXPKGS_PATH" 2>&1 >/dev/null | grep "got:" | cut -d':' -f2 | sed 's| ||g'
|
||||
)"
|
||||
set -e
|
||||
|
||||
sed -i "s|\"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"|\"$new_pdfjs_hash\"|g" "$PACKAGE_DIR/frontend.nix"
|
||||
@@ -10,16 +10,16 @@
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "alertmanager";
|
||||
version = "0.30.1";
|
||||
version = "0.31.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "prometheus";
|
||||
repo = "alertmanager";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-xtQzbjtES5zh52ERCfCCeHyCxWaV3xSbP8qA/erYgRw=";
|
||||
hash = "sha256-U8mG27sLw1cZDbSq44Zr2tubuuts4qVZB9Ux8QBWkZU=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-LgGsXaJ97uXtqHHicsLOaMNx3PzlVPhz/xG+KvO4nLI=";
|
||||
vendorHash = "sha256-X8BiQ9OSXj56mbjmb0AFaSsAWGwDhhMV/RztklxHYa4=";
|
||||
|
||||
subPackages = [
|
||||
"cmd/alertmanager"
|
||||
|
||||
@@ -4,41 +4,24 @@
|
||||
php,
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
let
|
||||
php.buildComposerProject2 (finalAttrs: {
|
||||
pname = "psysh";
|
||||
version = "0.12.19";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bobthecow";
|
||||
repo = "psysh";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-Gdye6+fdqqxgHqq79XJgSkywP1IMMAIVexh0kEol0Jw=";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-j2AcpbptbsdK/GOIuglMBwklTZSAEa8oD7g/H9oibUo=";
|
||||
forceFetchGit = true;
|
||||
};
|
||||
in
|
||||
php.buildComposerProject2 (finalAttrs: {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
src
|
||||
;
|
||||
|
||||
composerVendor = php.mkComposerVendor {
|
||||
inherit
|
||||
src
|
||||
version
|
||||
pname
|
||||
;
|
||||
|
||||
preConfigure = ''
|
||||
cp build/composer.json .
|
||||
cp build/composer.lock .
|
||||
postFetch = ''
|
||||
cp $out/build/composer.json $out/
|
||||
cp $out/build/composer.lock $out/
|
||||
'';
|
||||
|
||||
vendorHash = "sha256-MbYMFQVUmRAV7qttJBEJxzimeFIA0K8wbrwC9yDirf8=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-MbYMFQVUmRAV7qttJBEJxzimeFIA0K8wbrwC9yDirf8=";
|
||||
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
|
||||
buildNpmPackage rec {
|
||||
pname = "redocly";
|
||||
version = "2.14.3";
|
||||
version = "2.17.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Redocly";
|
||||
repo = "redocly-cli";
|
||||
rev = "@redocly/cli@${version}";
|
||||
hash = "sha256-pMLwGsit4vKZn9BC1Y5aIn7OG0kILmOpnYY/hMx7cSA=";
|
||||
hash = "sha256-bhM8CIKmZ3p96DViHVieMmUXOtkhs0+nhQs4naIgQVY=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-7cKjTXMzHu7RTnYFSQVHsh1/zDBV+VDnTITo+LXfjA4=";
|
||||
npmDepsHash = "sha256-iWyFuyZJOW2/F1gE2nA601IlgXpYXeK31gwI+SfxRuY=";
|
||||
|
||||
npmBuildScript = "prepare";
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "slint-tr-extractor";
|
||||
version = "1.14.1";
|
||||
version = "1.15.0";
|
||||
|
||||
src = fetchCrate {
|
||||
inherit (finalAttrs) pname version;
|
||||
hash = "sha256-mKc75nvSeCLNZde9D2pdJk1iShdG23LRaZsB7V/S8YY=";
|
||||
hash = "sha256-lxXJc1jDwqZTiA9wZ9i9nGwxRGvZ87s5jlHPJBdHle8=";
|
||||
};
|
||||
cargoHash = "sha256-uMYZ5kfHmiBnm9vRpoMPtsuICOi7fWervVYdVrjHgtY=";
|
||||
cargoHash = "sha256-MY9qX8FnenCahBQgMLn7dcefqao2jDixScFXzf72NAk=";
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "stock-tui";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ni5arga";
|
||||
repo = "stock-tui";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-5k24fBG0ZBr2JhVf30IGjLky087j203hZGEvtSzwUqQ=";
|
||||
};
|
||||
|
||||
subPackages = [ "cmd/stock-tui" ];
|
||||
|
||||
vendorHash = "sha256-Use54AVRMZ9xYx8tQpcRN3th+MufuER3lCJ+JVPpYRU=";
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "Terminal-based stock and cryptocurrency price tracker";
|
||||
homepage = "https://github.com/ni5arga/stock-tui";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ ni5arga ];
|
||||
mainProgram = "stock-tui";
|
||||
};
|
||||
})
|
||||
@@ -7,16 +7,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "versatiles";
|
||||
version = "3.4.0";
|
||||
version = "3.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "versatiles-org";
|
||||
repo = "versatiles-rs";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-9mguuYR8sc+WpF9Jl+1O3iLkx+0jQxbckw8dUVPL3S4=";
|
||||
hash = "sha256-bxrx+gjJbOzDvD6/Ov3vGCvDL6x5/tEo1+qFIWl7tTI=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-/2gQib4ui7OG0DC+gk+kpNBNznCIcm9XuY0QasIi3Mg=";
|
||||
cargoHash = "sha256-SN1+ujgaS/lfN/CyTOVwDft8MypdYfnz1LiJE7FtQ2s=";
|
||||
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
|
||||
@@ -194,6 +194,14 @@ let
|
||||
xddxdd
|
||||
];
|
||||
mainProgram = "wechat-uos";
|
||||
knownVulnerabilities = [
|
||||
''
|
||||
CWE-78: Clicking on a file attachment whose name contains backtick-quoted
|
||||
commands will cause it to be executed.
|
||||
|
||||
Reference: https://archive.ph/A5McZ (Chinese)
|
||||
''
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
@@ -23,6 +23,12 @@ let
|
||||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
];
|
||||
knownVulnerabilities = lib.optional stdenvNoCC.hostPlatform.isLinux ''
|
||||
CWE-78: Clicking on a file attachment whose name contains backtick-quoted
|
||||
commands will cause it to be executed.
|
||||
|
||||
Reference: https://archive.ph/A5McZ (Chinese)
|
||||
'';
|
||||
};
|
||||
|
||||
sources =
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "zabbix-agent2-plugin-postgresql";
|
||||
version = "7.4.5";
|
||||
version = "7.4.6";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://cdn.zabbix.com/zabbix-agent2-plugins/sources/postgresql/zabbix-agent2-plugin-postgresql-${version}.tar.gz";
|
||||
hash = "sha256-AeQfPA1o5XmRcY9L6p4ZwOTEaq2h+35QuIHBZhxV/2M=";
|
||||
hash = "sha256-rUv75kA/jU1fF1qWWkdRiAJVBWFD+78+YP/ovghtcxA=";
|
||||
};
|
||||
|
||||
vendorHash = null;
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
assert withGLES -> stdenv.hostPlatform.isLinux;
|
||||
|
||||
let
|
||||
channel = "stable";
|
||||
executableName = "zeditor";
|
||||
# Based on vscode.fhs
|
||||
# Zed allows for users to download and use extensions
|
||||
@@ -227,6 +228,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
|
||||
useNextest = true;
|
||||
|
||||
remoteServerExecutableName = "zed-remote-server-${channel}-${finalAttrs.version}+${channel}";
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
@@ -284,7 +286,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
)
|
||||
''
|
||||
+ lib.optionalString buildRemoteServer ''
|
||||
install -Dm755 $release_target/remote_server $remote_server/bin/zed-remote-server-stable-$version
|
||||
install -Dm755 $release_target/remote_server $remote_server/bin/${finalAttrs.remoteServerExecutableName}
|
||||
''
|
||||
+ ''
|
||||
runHook postInstall
|
||||
@@ -318,7 +320,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
tests = {
|
||||
remoteServerVersion = testers.testVersion {
|
||||
package = finalAttrs.finalPackage.remote_server;
|
||||
command = "zed-remote-server-stable-${finalAttrs.version} version";
|
||||
command = "${finalAttrs.remoteServerExecutableName} version";
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs stdenv.hostPlatform.isLinux {
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "lomiri-push-qml";
|
||||
version = "0.3.1";
|
||||
version = "0.4.0";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "ubports";
|
||||
repo = "development/core/lomiri-push-qml";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-1HJkcAe5ixqmEACy4mSk5dSCPf4FsY3tzH6v09SSH+M=";
|
||||
hash = "sha256-QpkW/fbl0Px5HsKfz/gv+D1S+iSpMZM8TiZCuAq1myk=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
@@ -46,8 +46,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
dontWrapQtApps = true;
|
||||
|
||||
cmakeFlags = [
|
||||
# In case anything still depends on deprecated hints
|
||||
(lib.cmakeBool "ENABLE_UBUNTU_COMPAT" true)
|
||||
(lib.cmakeBool "ENABLE_QT6" (lib.strings.versionAtLeast qtbase.version "6"))
|
||||
(lib.cmakeBool "ENABLE_UBUNTU_COMPAT" (!lib.strings.versionAtLeast qtbase.version "6"))
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
@@ -60,7 +60,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
meta = {
|
||||
description = "Lomiri Push Notifications QML plugin";
|
||||
homepage = "https://gitlab.com/ubports/development/core/lomiri-push-qml";
|
||||
# License file indicates gpl3Only, but de87869c2cdb9819c2ca7c9eca9c5fb8b500a01f says it should be lgpl3Only
|
||||
changelog = "https://gitlab.com/ubports/development/core/lomiri-push-qml/-/blob/${
|
||||
if (!isNull finalAttrs.src.tag) then finalAttrs.src.tag else finalAttrs.src.rev
|
||||
}/ChangeLog";
|
||||
license = lib.licenses.lgpl3Only;
|
||||
teams = [ lib.teams.lomiri ];
|
||||
platforms = lib.platforms.linux;
|
||||
|
||||
@@ -1,73 +1,73 @@
|
||||
{
|
||||
"version": "3.41.0-0.2.pre",
|
||||
"engineVersion": "15d137647e372c59e8dcb78f670ab7686a0d1031",
|
||||
"version": "3.41.0-0.3.pre",
|
||||
"engineVersion": "492bf6df86d056e47d05a3d5404f3d78939b3dae",
|
||||
"engineSwiftShaderHash": "sha256-qbtCl2nTpmtp9dnaoXc7rF3RqLnAZEmzw1BzPoCRWrc=",
|
||||
"engineSwiftShaderRev": "794b0cfce1d828d187637e6d932bae484fbe0976",
|
||||
"channel": "beta",
|
||||
"engineHashes": {
|
||||
"aarch64-linux": {
|
||||
"aarch64-linux": "sha256-bRebKpS4FiIdhnTIsv0KfV3GqtRPrYZJrKq4R67iFpA=",
|
||||
"x86_64-linux": "sha256-bRebKpS4FiIdhnTIsv0KfV3GqtRPrYZJrKq4R67iFpA="
|
||||
"aarch64-linux": "sha256-sL+RfXTdy5qAzgbSdfxeZHDcHSBzBLsbJ0Q8qLC9KMU=",
|
||||
"x86_64-linux": "sha256-sL+RfXTdy5qAzgbSdfxeZHDcHSBzBLsbJ0Q8qLC9KMU="
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"aarch64-linux": "sha256-zvyMMc5vmtyl0W3H14JcxhyxAOYtRfqohb6F0hYFRcM=",
|
||||
"x86_64-linux": "sha256-zvyMMc5vmtyl0W3H14JcxhyxAOYtRfqohb6F0hYFRcM="
|
||||
"aarch64-linux": "sha256-82KrH53pKiLCwdwzxlFRCD/IKe0RcP8NEnjItA2whdA=",
|
||||
"x86_64-linux": "sha256-82KrH53pKiLCwdwzxlFRCD/IKe0RcP8NEnjItA2whdA="
|
||||
}
|
||||
},
|
||||
"dartVersion": "3.11.0-296.4.beta",
|
||||
"dartVersion": "3.11.0-296.5.beta",
|
||||
"dartHash": {
|
||||
"x86_64-linux": "sha256-7K4IreZXaF9l8XL544miwKs5GjhxWQE51otR6cD0Qkk=",
|
||||
"aarch64-linux": "sha256-5aQGrc1GD8hfut0qnGH+u4TcrHzCm0fM9rvu0dFGSQk=",
|
||||
"x86_64-darwin": "sha256-/hifcVYo3B18i/77KCtYfHb1kj4ZdcIIaKBpo04BW/Q=",
|
||||
"aarch64-darwin": "sha256-HRucig/9pSM9Z2EbRRjyL3/3BNz+63J76dMwBnjVuPY="
|
||||
"x86_64-linux": "sha256-7EJPXQQrViX66lnpdqapSuTYrcT2uNwpqZClpjvNzRY=",
|
||||
"aarch64-linux": "sha256-2xgSEH9HQj8oJNH8eNs0NYxK3UGGaVBWnyuDbdam7XQ=",
|
||||
"x86_64-darwin": "sha256-cz7VM3lBWxnpFNaOI3ERZXVOgtEPVa6LVpvnvqFcw2M=",
|
||||
"aarch64-darwin": "sha256-eSTSzsjaIQUoTHqdwc3ZVkSKcXeiz+MIc0fh2XW935Q="
|
||||
},
|
||||
"flutterHash": "sha256-thAwWiddq13E/s8MOMzqIC7xtVcZI8RwFB1qwiUTIjw=",
|
||||
"flutterHash": "sha256-dCfrPq1oJOmDb3bP24D2rmDQzoB8uI3qJF2hqWmXywI=",
|
||||
"artifactHashes": {
|
||||
"android": {
|
||||
"aarch64-darwin": "sha256-RfHYnEbc2Plwe9/qJ1qgWLPheYodrA8TiKohpjh0q8c=",
|
||||
"aarch64-linux": "sha256-uUXiXB5Ar4VN25vaBoHTI+HuC8QLQ5YCcjPUMF+753A=",
|
||||
"x86_64-darwin": "sha256-RfHYnEbc2Plwe9/qJ1qgWLPheYodrA8TiKohpjh0q8c=",
|
||||
"x86_64-linux": "sha256-uUXiXB5Ar4VN25vaBoHTI+HuC8QLQ5YCcjPUMF+753A="
|
||||
"aarch64-darwin": "sha256-+HRucNf5J3fb1uVcYEte5zw4LcnfbmBL0kmeSQBHBlw=",
|
||||
"aarch64-linux": "sha256-7t3r/mq8KnWEbY2CVCv7l2HAV2dncrJj18vb2QxTh+8=",
|
||||
"x86_64-darwin": "sha256-+HRucNf5J3fb1uVcYEte5zw4LcnfbmBL0kmeSQBHBlw=",
|
||||
"x86_64-linux": "sha256-7t3r/mq8KnWEbY2CVCv7l2HAV2dncrJj18vb2QxTh+8="
|
||||
},
|
||||
"fuchsia": {
|
||||
"aarch64-darwin": "sha256-wwORZIhIAGvH0ksdyLRUIsmoQFz3sWp/zZ7Md6hbkFQ=",
|
||||
"aarch64-linux": "sha256-wwORZIhIAGvH0ksdyLRUIsmoQFz3sWp/zZ7Md6hbkFQ=",
|
||||
"x86_64-darwin": "sha256-wwORZIhIAGvH0ksdyLRUIsmoQFz3sWp/zZ7Md6hbkFQ=",
|
||||
"x86_64-linux": "sha256-wwORZIhIAGvH0ksdyLRUIsmoQFz3sWp/zZ7Md6hbkFQ="
|
||||
"aarch64-darwin": "sha256-8MjxukMuB31krOuTaQdFw3uy57bNg053xFgwVZUr9qg=",
|
||||
"aarch64-linux": "sha256-8MjxukMuB31krOuTaQdFw3uy57bNg053xFgwVZUr9qg=",
|
||||
"x86_64-darwin": "sha256-8MjxukMuB31krOuTaQdFw3uy57bNg053xFgwVZUr9qg=",
|
||||
"x86_64-linux": "sha256-8MjxukMuB31krOuTaQdFw3uy57bNg053xFgwVZUr9qg="
|
||||
},
|
||||
"ios": {
|
||||
"aarch64-darwin": "sha256-fRHm09zjIC9oyHOpc2o/KQg8xCII+iaB4/CErKlItF4=",
|
||||
"aarch64-linux": "sha256-fRHm09zjIC9oyHOpc2o/KQg8xCII+iaB4/CErKlItF4=",
|
||||
"x86_64-darwin": "sha256-fRHm09zjIC9oyHOpc2o/KQg8xCII+iaB4/CErKlItF4=",
|
||||
"x86_64-linux": "sha256-fRHm09zjIC9oyHOpc2o/KQg8xCII+iaB4/CErKlItF4="
|
||||
"aarch64-darwin": "sha256-2gOpJcPdzSY1q1SAs8oUJHkKTVQluFSrS3M4U3Mh9/o=",
|
||||
"aarch64-linux": "sha256-2gOpJcPdzSY1q1SAs8oUJHkKTVQluFSrS3M4U3Mh9/o=",
|
||||
"x86_64-darwin": "sha256-2gOpJcPdzSY1q1SAs8oUJHkKTVQluFSrS3M4U3Mh9/o=",
|
||||
"x86_64-linux": "sha256-2gOpJcPdzSY1q1SAs8oUJHkKTVQluFSrS3M4U3Mh9/o="
|
||||
},
|
||||
"linux": {
|
||||
"aarch64-darwin": "sha256-Zx9zWR0eOsiQGjnN8CIxKRNE0w7ck2ZzVEK71mqXMmc=",
|
||||
"aarch64-linux": "sha256-Zx9zWR0eOsiQGjnN8CIxKRNE0w7ck2ZzVEK71mqXMmc=",
|
||||
"x86_64-darwin": "sha256-jw+ZD2QIQsg6LbUchkDkMgyYKU+b/G9ZNVNCewBS0E4=",
|
||||
"x86_64-linux": "sha256-jw+ZD2QIQsg6LbUchkDkMgyYKU+b/G9ZNVNCewBS0E4="
|
||||
"aarch64-darwin": "sha256-NouPte/10GE7QctNlMpDXP/Yl3dDEjC52cf3Zd8Si40=",
|
||||
"aarch64-linux": "sha256-NouPte/10GE7QctNlMpDXP/Yl3dDEjC52cf3Zd8Si40=",
|
||||
"x86_64-darwin": "sha256-ELqekEn0ofBiDMh+cUXYhYTweu81k7Qc2f3WlO0fZzE=",
|
||||
"x86_64-linux": "sha256-ELqekEn0ofBiDMh+cUXYhYTweu81k7Qc2f3WlO0fZzE="
|
||||
},
|
||||
"macos": {
|
||||
"aarch64-darwin": "sha256-OTUv/k3Nts5BBzz+dWQq6EeBPeMzfUvIo3A39K5xRgA=",
|
||||
"aarch64-linux": "sha256-OTUv/k3Nts5BBzz+dWQq6EeBPeMzfUvIo3A39K5xRgA=",
|
||||
"x86_64-darwin": "sha256-OTUv/k3Nts5BBzz+dWQq6EeBPeMzfUvIo3A39K5xRgA=",
|
||||
"x86_64-linux": "sha256-OTUv/k3Nts5BBzz+dWQq6EeBPeMzfUvIo3A39K5xRgA="
|
||||
"aarch64-darwin": "sha256-Aj3FdXENj5fWleC/QaWQ5qWn+RNdFzq+lQoy3UgMF84=",
|
||||
"aarch64-linux": "sha256-Aj3FdXENj5fWleC/QaWQ5qWn+RNdFzq+lQoy3UgMF84=",
|
||||
"x86_64-darwin": "sha256-Aj3FdXENj5fWleC/QaWQ5qWn+RNdFzq+lQoy3UgMF84=",
|
||||
"x86_64-linux": "sha256-Aj3FdXENj5fWleC/QaWQ5qWn+RNdFzq+lQoy3UgMF84="
|
||||
},
|
||||
"universal": {
|
||||
"aarch64-darwin": "sha256-nWjUPgVwG0TJyTP1VpsJMI51/flfQyBhcsgv1DJpnZE=",
|
||||
"aarch64-linux": "sha256-qmfIGpAqJl8giZrv918oJP04AD03XXXb18KPB2aP30U=",
|
||||
"x86_64-darwin": "sha256-+L49rfv8uhBvqi5ezzOF16QFKgkxX/cleZDlt8NR5Oc=",
|
||||
"x86_64-linux": "sha256-ifFFlLsgN7et/hpBQewYYeN7EzCUQAGUj5nlJgNt2UI="
|
||||
"aarch64-darwin": "sha256-ymXBamYKnmhcTwgc2rX/RgFdQml7obiYOpBh5ghKhlU=",
|
||||
"aarch64-linux": "sha256-bULGcWqxjolrksGQYFXEx6zmlcDSD6ngw0L9kDoIVvY=",
|
||||
"x86_64-darwin": "sha256-+erTasrFkQTXPQtuu8YzvfFspEVb0wIVX5jKPp9RXBE=",
|
||||
"x86_64-linux": "sha256-8foy5AZZwTBPn2WrUiG8qgc+H/0bajCgSApJ/vIlVIw="
|
||||
},
|
||||
"web": {
|
||||
"aarch64-darwin": "sha256-ReQNXUPZHGfL0grqK0cjc7xppYvxwFxJQl/FFGAqeDQ=",
|
||||
"aarch64-linux": "sha256-ReQNXUPZHGfL0grqK0cjc7xppYvxwFxJQl/FFGAqeDQ=",
|
||||
"x86_64-darwin": "sha256-ReQNXUPZHGfL0grqK0cjc7xppYvxwFxJQl/FFGAqeDQ=",
|
||||
"x86_64-linux": "sha256-ReQNXUPZHGfL0grqK0cjc7xppYvxwFxJQl/FFGAqeDQ="
|
||||
"aarch64-darwin": "sha256-jFESLAj61eOQJh++mycJWjO6pPe9Icjhpr8c9qiVmv0=",
|
||||
"aarch64-linux": "sha256-jFESLAj61eOQJh++mycJWjO6pPe9Icjhpr8c9qiVmv0=",
|
||||
"x86_64-darwin": "sha256-jFESLAj61eOQJh++mycJWjO6pPe9Icjhpr8c9qiVmv0=",
|
||||
"x86_64-linux": "sha256-jFESLAj61eOQJh++mycJWjO6pPe9Icjhpr8c9qiVmv0="
|
||||
},
|
||||
"windows": {
|
||||
"x86_64-darwin": "sha256-u77tk4Spp8AyujimnFAop2o5Orm5OlaBZ6bmbO2OG9w=",
|
||||
"x86_64-linux": "sha256-u77tk4Spp8AyujimnFAop2o5Orm5OlaBZ6bmbO2OG9w="
|
||||
"x86_64-darwin": "sha256-J+N6ADOB3SF298uxN0hPydslw3k+5+nwHln2NwTQTgc=",
|
||||
"x86_64-linux": "sha256-J+N6ADOB3SF298uxN0hPydslw3k+5+nwHln2NwTQTgc="
|
||||
}
|
||||
},
|
||||
"pubspecLock": {
|
||||
|
||||
@@ -121,9 +121,9 @@ let
|
||||
in
|
||||
{
|
||||
ogre_14 = common {
|
||||
version = "14.5.1";
|
||||
hash = "sha256-UTjyOeDCZy+J9qkch1g1X/6x5/K2+1MWJ2v7r0trZqY=";
|
||||
# https://github.com/OGRECave/ogre/blob/v14.5.1/Components/Overlay/CMakeLists.txt
|
||||
version = "14.5.2";
|
||||
hash = "sha256-qI5z6a5WD1WCQZarogQb4c9KRac/szQLsvs/9/5BNCI=";
|
||||
# https://github.com/OGRECave/ogre/blob/v14.5.2/Components/Overlay/CMakeLists.txt
|
||||
imguiVersion = "1.91.9b";
|
||||
imguiHash = "sha256-dkukDP0HD8CHC2ds0kmqy7KiGIh4148hMCyA1QF3IMo=";
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
fetchgit,
|
||||
llvmPackages,
|
||||
python,
|
||||
numpy,
|
||||
cmake,
|
||||
autoPatchelfHook,
|
||||
stdenv,
|
||||
@@ -38,12 +39,16 @@ stdenv'.mkDerivation (finalAttrs: {
|
||||
python.pkgs.ninja
|
||||
python.pkgs.packaging
|
||||
python.pkgs.setuptools
|
||||
numpy
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
python.pkgs.qt6.darwinVersionInputs
|
||||
];
|
||||
|
||||
cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
|
||||
cmakeFlags = [
|
||||
"-DBUILD_TESTS=OFF"
|
||||
"-DNUMPY_INCLUDE_DIR=${numpy.coreIncludeDir}"
|
||||
];
|
||||
|
||||
# We intentionally use single quotes around `${BASH}` since it expands from a CMake
|
||||
# variable available in this file.
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
config,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
pythonAtLeast,
|
||||
|
||||
# patches
|
||||
replaceVars,
|
||||
@@ -41,7 +42,7 @@
|
||||
cudaSupport ? config.cudaSupport,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "triton";
|
||||
version = "3.5.1";
|
||||
pyproject = true;
|
||||
@@ -50,7 +51,7 @@ buildPythonPackage rec {
|
||||
src = fetchFromGitHub {
|
||||
owner = "triton-lang";
|
||||
repo = "triton";
|
||||
tag = "v${version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-dyNRtS1qtU8C/iAf0Udt/1VgtKGSvng1+r2BtvT9RB4=";
|
||||
};
|
||||
|
||||
@@ -99,6 +100,14 @@ buildPythonPackage rec {
|
||||
substituteInPlace cmake/AddTritonUnitTest.cmake \
|
||||
--replace-fail "include(\''${PROJECT_SOURCE_DIR}/unittest/googletest.cmake)" ""\
|
||||
--replace-fail "include(GoogleTest)" "find_package(GTest REQUIRED)"
|
||||
''
|
||||
|
||||
# triton will try dlopening libcublas.so at runtime
|
||||
+ lib.optionalString cudaSupport ''
|
||||
substituteInPlace third_party/nvidia/include/cublas_instance.h \
|
||||
--replace-fail \
|
||||
'"libcublas.so"' \
|
||||
'"${lib.getLib cudaPackages.libcublas}/lib/libcublas.so"'
|
||||
'';
|
||||
|
||||
build-system = [ setuptools ];
|
||||
@@ -217,9 +226,63 @@ buildPythonPackage rec {
|
||||
|
||||
doCheck = true;
|
||||
|
||||
preCheck = ''
|
||||
cd python/test/unit
|
||||
'';
|
||||
disabledTests = [
|
||||
# triton.runtime.errors.OutOfResources: out of resource: shared memory,
|
||||
# Required: 131072, Hardware limit: 101376. Reducing block sizes or `num_stages` may help.
|
||||
"test_gather"
|
||||
"test_gather_warp_shuffle"
|
||||
"test_tensor_descriptor_batched_gemm_2d_tma"
|
||||
"test_tensor_descriptor_batched_gemm_3d_tma"
|
||||
|
||||
# AssertionError: assert all(delta == 0 for delta in diff.values())
|
||||
# ----------------------------- Captured stdout call -----------------------------
|
||||
# Expected line "pid (0, 0, 0) idx ( 0, 0) x: 1" 1 time(s), but saw 0 time(s)
|
||||
# ...
|
||||
"test_print"
|
||||
|
||||
# This test ensures that the ptxas binary is available under .../site-packages/triton/backends/nvidia/bin/ptxas
|
||||
# Usually, this is where the install script downloads and copies ptxas to.
|
||||
# However, this is not the case here, as triton is built with TRITON_OFFLINE_BUILD=1
|
||||
# and TRITON_PTXAS_PATH=<path_to_nix_store_ptxas>
|
||||
"test_nvidia_tool"
|
||||
]
|
||||
++ lib.optionals (pythonAtLeast "3.14") [
|
||||
# triton.compiler.errors.CompilationError
|
||||
# AttributeError("module 'ast' has no attribute 'Num'"
|
||||
"test_aggregate_modification_in_for_loop"
|
||||
"test_call"
|
||||
"test_call_in_loop"
|
||||
"test_compile_only_k_loop"
|
||||
"test_dot_mulbroadcasted"
|
||||
"test_globaltimer"
|
||||
"test_host_tensor_descriptor_matmul"
|
||||
"test_make_tensor_descriptor_matmul"
|
||||
"test_nested_while"
|
||||
"test_preshuffle_scale_mxfp_cdna4"
|
||||
"test_temp_var_in_loop"
|
||||
"test_tensor_descriptor_rank_reducing_matmul"
|
||||
"test_tensor_descriptor_reshape_matmul"
|
||||
];
|
||||
|
||||
disabledTestPaths = [
|
||||
# torch.AcceleratorError: CUDA error: device-side assert triggered
|
||||
"python/test/unit/test_debug.py"
|
||||
|
||||
# ptxas fatal : Unexpected non-ASCII character encountered on line 1
|
||||
# ptxas fatal : Ptx assembly aborted due to errors
|
||||
"python/test/unit/language/test_line_info.py"
|
||||
|
||||
# Triton Error [CUDA]: \n
|
||||
"python/test/unit/tools/test_aot.py"
|
||||
|
||||
# ptxas fatal : Unknown option 'sass'
|
||||
"python/test/unit/tools/test_disasm.py"
|
||||
];
|
||||
|
||||
enabledTestPaths = [
|
||||
"python/test/unit"
|
||||
];
|
||||
|
||||
checkPhase = "pytestCheckPhase";
|
||||
|
||||
installPhase = "touch $out";
|
||||
@@ -314,11 +377,13 @@ buildPythonPackage rec {
|
||||
meta = {
|
||||
description = "Language and compiler for writing highly efficient custom Deep-Learning primitives";
|
||||
homepage = "https://github.com/triton-lang/triton";
|
||||
changelog = "https://github.com/triton-lang/triton/releases/tag/${finalAttrs.src.tag}";
|
||||
platforms = lib.platforms.linux;
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [
|
||||
GaetanLepage
|
||||
SomeoneSerge
|
||||
derdennisop
|
||||
];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
lib,
|
||||
mkTclDerivation,
|
||||
fetchFromGitHub,
|
||||
autoreconfHook,
|
||||
pkg-config,
|
||||
yajl,
|
||||
}:
|
||||
|
||||
mkTclDerivation rec {
|
||||
pname = "yajl-tcl";
|
||||
version = "1.8.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "flightaware";
|
||||
repo = "yajl-tcl";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-MKm/cfZxPoxpsHuZf9qSXZXzdFbDb7IGeJgMHGh9bcE=";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
yajl
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Tcl bindings for Yet Another JSON Library";
|
||||
homepage = "https://github.com/flightaware/yajl-tcl";
|
||||
changelog = "https://github.com/flightaware/yajl-tcl/blob/${src.tag}/ChangeLog";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ fgaz ];
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
import ./generic.nix {
|
||||
version = "14.20";
|
||||
rev = "refs/tags/REL_14_20";
|
||||
hash = "sha256-5wWuS78yn1p+ZjlUy5jCf1mLq78D3iI7mWPBVTd1Ufk=";
|
||||
version = "14.21";
|
||||
# rev = "refs/tags/REL_14_21";
|
||||
rev = "eb788b43371849237c61ba2747fc11e96c08d861";
|
||||
hash = "sha256-9uG32BVzXOL2yAJmFVkIvEZJrmI5ToL7ojtivWmufL8=";
|
||||
muslPatches = {
|
||||
disable-test-collate-icu-utf8 = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql14/disable-test-collate.icu.utf8.patch?id=56999e6d0265ceff5c5239f85fdd33e146f06cb7";
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import ./generic.nix {
|
||||
version = "15.15";
|
||||
rev = "refs/tags/REL_15_15";
|
||||
hash = "sha256-veGKXAvK+dNofBuSXsmCsPdXDJOC04+QV3HEr0XaE68=";
|
||||
version = "15.16";
|
||||
# rev = "refs/tags/REL_15_16";
|
||||
rev = "78bc85dd4455c302c345c550e0628a1522df108d";
|
||||
hash = "sha256-ju/KkeBOumYHCarhqNA8jq+ceUo4y8g/SzjAMWm80ak=";
|
||||
muslPatches = {
|
||||
dont-use-locale-a = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql15/dont-use-locale-a-on-musl.patch?id=f424e934e6d076c4ae065ce45e734aa283eecb9c";
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import ./generic.nix {
|
||||
version = "16.11";
|
||||
rev = "refs/tags/REL_16_11";
|
||||
hash = "sha256-hxv+N+OWqiXmFmsB+SSYGKQLBbHtNMnneHFvOtUz8z4=";
|
||||
version = "16.12";
|
||||
# rev = "refs/tags/REL_16_12";
|
||||
rev = "e15d96551f9760e62888b5082ad050329c1c4cdf";
|
||||
hash = "sha256-1jkVElZTtp60Jgl5RyPT+8lalDYtjRDe9MxO3KMYJmU=";
|
||||
muslPatches = {
|
||||
dont-use-locale-a = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql16/dont-use-locale-a-on-musl.patch?id=08a24be262339fd093e641860680944c3590238e";
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import ./generic.nix {
|
||||
version = "17.7";
|
||||
rev = "refs/tags/REL_17_7";
|
||||
hash = "sha256-W+505LAeiO5ln7wBhxZLv/p3GxiJp8MFfCGVDyvHREg=";
|
||||
version = "17.8";
|
||||
# rev = "refs/tags/REL_17_8";
|
||||
rev = "6af885119b52a2a6229959670ba3ae5e36bf9806";
|
||||
hash = "sha256-4lV1/xRmMsc5rgY3RB6WMigTXHgHjh9bmR6nzL82Rs4=";
|
||||
muslPatches = {
|
||||
dont-use-locale-a = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql17/dont-use-locale-a-on-musl.patch?id=d69ead2c87230118ae7f72cef7d761e761e1f37e";
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import ./generic.nix {
|
||||
version = "18.1";
|
||||
rev = "refs/tags/REL_18_1";
|
||||
hash = "sha256-cZA2hWtr5RwsUrRWkvl/yvUzFPSfdtpyAKGXfrVUr0g=";
|
||||
version = "18.2";
|
||||
# rev = "refs/tags/REL_18_2";
|
||||
rev = "5a461dc4dbf72a1ec281394a76eb36d68cbdd935";
|
||||
hash = "sha256-cvBXxA7/kEwDGxFv/YoZCIh17jzUujrCtfKAmtSxKTw=";
|
||||
muslPatches = {
|
||||
dont-use-locale-a = {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/postgresql17/dont-use-locale-a-on-musl.patch?id=d69ead2c87230118ae7f72cef7d761e761e1f37e";
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
postgresqlBuildExtension (finalAttrs: {
|
||||
pname = "pg_partman";
|
||||
version = "5.4.0";
|
||||
version = "5.4.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pgpartman";
|
||||
repo = "pg_partman";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-4z5B9jiG4EaOm2jz2BSNRi28at9aqpgNGXbJM3ZtBC8=";
|
||||
hash = "sha256-giWjH4HM6qCoYGvFGyv+RjaSA4ggPHVBK7eNLBESPN4=";
|
||||
};
|
||||
|
||||
meta = {
|
||||
|
||||
@@ -87,7 +87,7 @@ let
|
||||
# Building with JIT in pkgsStatic fails like this:
|
||||
# fatal error: 'stdio.h' file not found
|
||||
&& !stdenv.hostPlatform.isStatic,
|
||||
llvmPackages_20,
|
||||
llvmPackages,
|
||||
nukeReferences,
|
||||
overrideCC,
|
||||
|
||||
@@ -163,14 +163,6 @@ let
|
||||
|
||||
dlSuffix = if olderThan "16" then ".so" else stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
|
||||
# Pin LLVM 20 until upstream has fully resolved:
|
||||
# https://www.postgresql.org/message-id/flat/d25e6e4a-d1b4-84d3-2f8a-6c45b975f53d%40applied-asynchrony.com
|
||||
# Currently still a problem on aarch64.
|
||||
# TODO: Remove with next minor releases
|
||||
llvmPackages = lib.warnIf (
|
||||
version == "17.8"
|
||||
) "PostgreSQL: Is the pin for LLVM 20 still needed?" llvmPackages_20;
|
||||
|
||||
stdenv' =
|
||||
if !stdenv.cc.isClang then
|
||||
overrideCC llvmPackages.stdenv (
|
||||
|
||||
@@ -485,6 +485,7 @@ mapAliases {
|
||||
clang_17 = throw "clang_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
|
||||
clashmi = throw "'clashmi' has been removed, as it is unmaintained in nixpkgs"; # Added 2026-01-31
|
||||
clasp = throw "'clasp' has been renamed to/replaced by 'clingo'"; # Converted to throw 2025-10-27
|
||||
clearlyU = clearly-u; # Added 2026-02-08
|
||||
cli-visualizer = throw "'cli-visualizer' has been removed as the upstream repository is gone"; # Added 2025-06-05
|
||||
clima = throw "'clima' has been removed, as it has been unmaintained upstream since December 2024, use glow instead"; # Added 2026-01-01
|
||||
clipbuzz = throw "clipbuzz has been removed, as it does not build with supported Zig versions"; # Added 2025-08-09
|
||||
|
||||
Reference in New Issue
Block a user