Merge 0832d1b3a0 into haskell-updates

This commit is contained in:
nixpkgs-ci[bot]
2025-10-05 00:22:14 +00:00
committed by GitHub
608 changed files with 2983 additions and 4266 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ wide variety of extensions and libraries available.
The different versions of PHP that nixpkgs provides are located under
attributes named based on major and minor version number; e.g.,
`php81` is PHP 8.1.
`php84` is PHP 8.4.
Only versions of PHP that are supported by upstream for the entirety
of a given NixOS release will be included in that release of
@@ -22,8 +22,8 @@ NixOS - not necessarily the latest major release from upstream.
All available PHP attributes are wrappers around their respective
binary PHP package and provide commonly used extensions this way. The
real PHP 8.1 package, i.e. the unwrapped one, is available as
`php81.unwrapped`; see the next section for more details.
real PHP 8.4 package, i.e. the unwrapped one, is available as
`php84.unwrapped`; see the next section for more details.
Interactive tools built on PHP are put in `php.packages`; composer is
for example available at `php.packages.composer`.
+50
View File
@@ -167,6 +167,11 @@ lib.mapAttrs mkLicense (
fullName = "Apache License 2.0";
};
baekmuk = {
spdxId = "Baekmuk";
fullName = "Baekmuk License";
};
bitstreamVera = {
spdxId = "Bitstream-Vera";
fullName = "Bitstream Vera Font License";
@@ -182,6 +187,11 @@ lib.mapAttrs mkLicense (
fullName = " BitTorrent Open Source License v1.1";
};
boehmGC = {
spdxId = "Boehm-GC";
fullName = "Boehm-Demers-Weiser GC License";
};
bola11 = {
url = "https://blitiri.com.ar/p/bola/";
fullName = "Buena Onda License Agreement 1.1";
@@ -586,6 +596,11 @@ lib.mapAttrs mkLicense (
free = false;
};
fontException = {
spdxId = "Font-exception-2.0";
fullName = "Font exception 2.0";
};
fraunhofer-fdk = {
fullName = "Fraunhofer FDK AAC Codec Library";
spdxId = "FDK-AAC";
@@ -595,6 +610,11 @@ lib.mapAttrs mkLicense (
fullName = "Unspecified free software license";
};
freeimage = {
spdxId = "FreeImage";
fullName = "FreeImage Public License v1.0";
};
fsl11Mit = {
fullName = "Functional Source License, Version 1.1, MIT Future License";
spdxId = "FSL-1.1-MIT";
@@ -766,6 +786,11 @@ lib.mapAttrs mkLicense (
free = false;
};
interbase = {
spdxId = "Interbase-1.0";
fullName = "Interbase Public License v1.0";
};
ipa = {
spdxId = "IPA";
fullName = "IPA Font License";
@@ -1042,6 +1067,11 @@ lib.mapAttrs mkLicense (
redistributable = true; # Only if used in Netdata products.
};
ngpl = {
spdxId = "NGPL";
fullName = "Nethack General Public License";
};
nistSoftware = {
spdxId = "NIST-Software";
fullName = "NIST Software License";
@@ -1134,6 +1164,11 @@ lib.mapAttrs mkLicense (
fullName = "Open Software License 3.0";
};
paratype = {
fullName = "ParaType Free Font Licensing Agreement";
url = "https://web.archive.org/web/20161209023955/http://www.paratype.ru/public/pt_openlicense_eng.asp";
};
parity70 = {
spdxId = "Parity-7.0.0";
fullName = "Parity Public License 7.0.0";
@@ -1262,6 +1297,11 @@ lib.mapAttrs mkLicense (
redistributable = false; # only free to redistribute "for non-commercial purposes"
};
tcpWrappers = {
spdxId = "TCP-wrappers";
fullName = "TCP Wrappers License";
};
teamspeak = {
fullName = "Teamspeak client license";
url = "https://www.teamspeak.com/en/privacy-and-terms/";
@@ -1309,6 +1349,11 @@ lib.mapAttrs mkLicense (
# https://github.com/spdx/license-list-XML/issues/2757
};
torque11 = {
spdxId = "TORQUE-1.1";
fullName = "TORQUE v2.5+ Software License v1.1";
};
tsl = {
shortName = "TSL";
fullName = "Timescale License Agreegment";
@@ -1449,6 +1494,11 @@ lib.mapAttrs mkLicense (
fullName = "X11 License";
};
xerox = {
spdxId = "Xerox";
fullName = "Xerox License";
};
xfig = {
spdxId = "Xfig";
fullName = "xfig";
+8 -1
View File
@@ -44,7 +44,14 @@ let
baseName == ".git"
||
type == "directory"
&& (baseName == ".svn" || baseName == "CVS" || baseName == ".hg" || baseName == ".jj")
&& (
baseName == ".svn"
|| baseName == "CVS"
|| baseName == ".hg"
|| baseName == ".jj"
|| baseName == ".pijul"
|| baseName == "_darcs"
)
)
||
# Filter out editor backup / swap files.
+11
View File
@@ -3918,6 +3918,12 @@
name = "Builditluc";
keys = [ { fingerprint = "FF16E475723B8C1E57A6B2569374074AE2D6F20E"; } ];
};
burmudar = {
email = "william.bezuidenhout@gmail.com";
github = "burmudar";
githubId = 1001709;
name = "William Bezuidenhout";
};
buurro = {
email = "marcoburro98@gmail.com";
github = "buurro";
@@ -14284,6 +14290,11 @@
githubId = 2034420;
name = "Luke Sandell";
};
lasantosr = {
github = "lasantosr";
githubId = 5946707;
name = "Luis Santos";
};
lassulus = {
email = "lassulus@gmail.com";
matrix = "@lassulus:lassul.us";
@@ -127,7 +127,7 @@ In addition to numerous new and upgraded packages, this release has the followin
- [sx](https://github.com/earnestly/sx), a simple alternative to both xinit and startx for starting a Xorg server. Available as [services.xserver.displayManager.sx](#opt-services.xserver.displayManager.sx.enable)
- [postfixadmin](https://postfixadmin.sourceforge.io/), a web based virtual user administration interface for Postfix mail servers. Available as [postfixadmin](#opt-services.postfixadmin.enable).
- [postfixadmin](https://postfixadmin.sourceforge.io/), a web based virtual user administration interface for Postfix mail servers.
- [prowlarr](https://wiki.servarr.com/prowlarr), an indexer manager/proxy built on the popular arr .net/reactjs base stack [services.prowlarr](#opt-services.prowlarr.enable).
@@ -99,7 +99,7 @@ In addition to numerous new and upgraded packages, this release has the followin
- [input-remapper](https://github.com/sezanzeb/input-remapper), an easy to use tool to change the mapping of your input device buttons. Available at [services.input-remapper](#opt-services.input-remapper.enable).
- [InvoicePlane](https://invoiceplane.com), web application for managing and creating invoices. Available at [services.invoiceplane](#opt-services.invoiceplane.sites._name_.enable).
- [InvoicePlane](https://invoiceplane.com), web application for managing and creating invoices. Available at `services.invoiceplane`.
- [k3b](https://userbase.kde.org/K3b), the KDE disk burning application. Available as [programs.k3b](#opt-programs.k3b.enable).
@@ -328,6 +328,8 @@
Note that system activation will complete before all certificates may have been renewed or acquired.
- `php81` was removed.
- `libvirt` now supports using `nftables` backend.
- The `virtualisation.libvirtd.firewallBackend` option can be used to configure the firewall backend used by libvirtd.
@@ -373,6 +375,8 @@
- `strongSwan` has been updated to 6.0. See [strongSwan 6.0.0 release notes](https://github.com/strongswan/strongswan/releases/tag/6.0.0) for a complete list of changes.
- `slurm` no longer supports gtk2.
- `amdgpu` kernel driver overdrive mode can now be enabled by setting [hardware.amdgpu.overdrive.enable](#opt-hardware.amdgpu.overdrive.enable) and customized through [hardware.amdgpu.overdrive.ppfeaturemask](#opt-hardware.amdgpu.overdrive.ppfeaturemask).
This allows for fine-grained control over the GPU's performance and maybe required by overclocking softwares like Corectrl and Lact. These new options replace old options such as {option}`programs.corectrl.gpuOverclock.enable` and {option}`programs.tuxclocker.enableAMD`.
@@ -388,3 +392,5 @@
- `sparkleshare` has been removed as it no longer builds and has been abandoned upstream.
- The `open-webui` package's postgres support have been moved to optional dependencies to comply with upstream changes in 0.6.26.
- `prl-tools` has been moved out of `linuxPackages` because Parallels Guest Tools become driverless since 26.1.0.
-2
View File
@@ -752,7 +752,6 @@
./services/mail/pfix-srsd.nix
./services/mail/postfix-tlspol.nix
./services/mail/postfix.nix
./services/mail/postfixadmin.nix
./services/mail/postgrey.nix
./services/mail/postsrsd.nix
./services/mail/protonmail-bridge.nix
@@ -1613,7 +1612,6 @@
./services/web-apps/immich-public-proxy.nix
./services/web-apps/immich.nix
./services/web-apps/invidious.nix
./services/web-apps/invoiceplane.nix
./services/web-apps/isso.nix
./services/web-apps/jirafeau.nix
./services/web-apps/jitsi-meet.nix
@@ -12,17 +12,18 @@ let
shell:
if (shell == "fish") then
''
${lib.getExe pkgs.git-worktree-switcher} init ${shell} | source
${lib.getExe cfg.package} init ${shell} | source
''
else
''
eval "$(${lib.getExe pkgs.git-worktree-switcher} init ${shell})"
eval "$(${lib.getExe cfg.package} init ${shell})"
'';
in
{
options = {
programs.git-worktree-switcher = {
enable = lib.mkEnableOption "git-worktree-switcher, switch between git worktrees with speed.";
package = lib.mkPackageOption pkgs "git-worktree-switcher" { };
};
};
+8
View File
@@ -394,6 +394,14 @@ in
Consider migrating or switching to Incus, or remove from your configuration.
https://linuxcontainers.org/incus/docs/main/howto/server_migrate_lxd/
'')
(mkRemovedOptionModule [ "services" "invoiceplane" ] ''
services.invoiceplane has been removed since the service only supported PHP 8.1 which is EOL
and removed from nixpkgs.
'')
(mkRemovedOptionModule [ "services" "postfixadmin" ] ''
services.postfixadmin has been removed since it was unmaintained in nixpkgs and the version
available only supported PHP 8.1 which is EOL.
'')
# Do NOT add any option renames here, see top of the file
];
}
+49 -44
View File
@@ -43,8 +43,8 @@ in
'';
example = literalExpression ''
pkgs.fetchurl {
url = http://ipa.example.com/ipa/config/ca.crt;
sha256 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
url = "http://ipa.example.com/ipa/config/ca.crt";
hash = lib.fakeHash;
};
'';
};
@@ -191,12 +191,12 @@ in
'';
"ldap.conf".source = ldapConf;
};
environment.etc."chromium/policies/managed/freeipa.json" = mkIf cfg.chromiumSupport {
text = ''
{ "AuthServerWhitelist": "*.${cfg.domain}" }
'';
"chromium/policies/managed/freeipa.json" = mkIf cfg.chromiumSupport {
text = builtins.toJSON {
AuthServerWhitelist = "*.${cfg.domain}";
};
};
};
systemd.services."ipa-activation" = {
@@ -207,8 +207,10 @@ in
];
conflicts = [ "shutdown.target" ];
unitConfig.DefaultDependencies = false;
serviceConfig.Type = "oneshot";
serviceConfig.RemainAfterExit = true;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
# libcurl requires a hard copy of the certificate
if ! ${pkgs.diffutils}/bin/diff ${cfg.certificate} /etc/ipa/ca.crt > /dev/null 2>&1; then
@@ -226,58 +228,61 @@ in
4. Restart sssd systemd service: sudo systemctl restart sssd
EOF
# let service fail, to raise awareness
exit 1
fi
'';
};
services.sssd.config = ''
[domain/${cfg.domain}]
id_provider = ipa
auth_provider = ipa
access_provider = ipa
chpass_provider = ipa
services.sssd = {
enable = true;
config = ''
[domain/${cfg.domain}]
id_provider = ipa
auth_provider = ipa
access_provider = ipa
chpass_provider = ipa
ipa_domain = ${cfg.domain}
ipa_server = _srv_, ${cfg.server}
ipa_hostname = ${cfg.ipaHostname}
ipa_domain = ${cfg.domain}
ipa_server = _srv_, ${cfg.server}
ipa_hostname = ${cfg.ipaHostname}
cache_credentials = ${pyBool cfg.cacheCredentials}
krb5_store_password_if_offline = ${pyBool cfg.offlinePasswords}
${optionalString ((toLower cfg.domain) != (toLower cfg.realm)) "krb5_realm = ${cfg.realm}"}
cache_credentials = ${pyBool cfg.cacheCredentials}
krb5_store_password_if_offline = ${pyBool cfg.offlinePasswords}
${optionalString ((toLower cfg.domain) != (toLower cfg.realm)) "krb5_realm = ${cfg.realm}"}
dyndns_update = ${pyBool cfg.dyndns.enable}
dyndns_iface = ${cfg.dyndns.interface}
dyndns_update = ${pyBool cfg.dyndns.enable}
dyndns_iface = ${cfg.dyndns.interface}
ldap_tls_cacert = /etc/ipa/ca.crt
ldap_user_extra_attrs = mail:mail, sn:sn, givenname:givenname, telephoneNumber:telephoneNumber, lock:nsaccountlock
ldap_tls_cacert = /etc/ipa/ca.crt
ldap_user_extra_attrs = mail:mail, sn:sn, givenname:givenname, telephoneNumber:telephoneNumber, lock:nsaccountlock
[sssd]
services = nss, sudo, pam, ssh, ifp
domains = ${cfg.domain}
[sssd]
services = nss, sudo, pam, ssh, ifp
domains = ${cfg.domain}
[nss]
homedir_substring = /home
[nss]
homedir_substring = /home
[pam]
pam_pwd_expiration_warning = 3
pam_verbosity = 3
[pam]
pam_pwd_expiration_warning = 3
pam_verbosity = 3
[sudo]
[sudo]
[autofs]
[autofs]
[ssh]
[ssh]
[pac]
[pac]
[ifp]
user_attributes = +mail, +telephoneNumber, +givenname, +sn, +lock
allowed_uids = ${concatStringsSep ", " cfg.ifpAllowedUids}
'';
[ifp]
user_attributes = +mail, +telephoneNumber, +givenname, +sn, +lock
allowed_uids = ${concatStringsSep ", " cfg.ifpAllowedUids}
'';
};
services.ntp.servers = singleton cfg.server;
services.sssd.enable = true;
services.ntp.enable = true;
networking.timeServers = singleton cfg.server;
security.pki.certificateFiles = singleton cfg.certificate;
};
+15 -8
View File
@@ -4,12 +4,14 @@
pkgs,
...
}:
let
uid = config.ids.uids.mopidy;
gid = config.ids.gids.mopidy;
cfg = config.services.mopidy;
settingsFormat = pkgs.formats.ini { };
mopidyConf = pkgs.writeText "mopidy.conf" cfg.configuration;
mopidyConf = settingsFormat.generate "mopidy.conf" cfg.settings;
mopidyEnv = pkgs.buildEnv {
name = "mopidy-with-extensions-${pkgs.mopidy.version}";
@@ -24,11 +26,14 @@ let
};
in
{
imports = [
(lib.mkRemovedOptionModule [ "services" "mopidy" "configuration" ] ''
Use RFC42-style services.mopidy.settings instead.
'')
];
options = {
services.mopidy = {
enable = lib.mkEnableOption "Mopidy, a music player daemon";
dataDir = lib.mkOption {
@@ -48,11 +53,15 @@ in
'';
};
configuration = lib.mkOption {
default = "";
type = lib.types.lines;
settings = lib.mkOption {
inherit (settingsFormat) type;
example.mpd = {
enabled = true;
hostname = "::";
};
description = ''
The configuration that Mopidy should use.
See the upstream documentation <https://docs.mopidy.com/stable/config/> for details.
'';
};
@@ -67,8 +76,6 @@ in
};
};
###### implementation
config = lib.mkIf cfg.enable {
systemd.tmpfiles.settings."10-mopidy".${cfg.dataDir}.d = {
@@ -1,215 +0,0 @@
{
lib,
config,
pkgs,
...
}:
let
cfg = config.services.postfixadmin;
fpm = config.services.phpfpm.pools.postfixadmin;
localDB = cfg.database.host == "localhost";
pgsql = config.services.postgresql;
user = if localDB then cfg.database.username else "nginx";
in
{
options.services.postfixadmin = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable postfixadmin.
Also enables nginx virtual host management.
Further nginx configuration can be done by adapting `services.nginx.virtualHosts.<name>`.
See [](#opt-services.nginx.virtualHosts) for further information.
'';
};
hostName = lib.mkOption {
type = lib.types.str;
example = "postfixadmin.example.com";
description = "Hostname to use for the nginx vhost";
};
adminEmail = lib.mkOption {
type = lib.types.str;
example = "postmaster@example.com";
description = ''
Defines the Site Admin's email address.
This will be used to send emails from to create mailboxes and
from Send Email / Broadcast message pages.
'';
};
setupPasswordFile = lib.mkOption {
type = lib.types.path;
description = ''
Password file for the admin.
Generate with `php -r "echo password_hash('some password here', PASSWORD_DEFAULT);"`
'';
};
database = {
username = lib.mkOption {
type = lib.types.str;
default = "postfixadmin";
description = ''
Username for the postgresql connection.
If `database.host` is set to `localhost`, a unix user and group of the same name will be created as well.
'';
};
host = lib.mkOption {
type = lib.types.str;
default = "localhost";
description = ''
Host of the postgresql server. If this is not set to
`localhost`, you have to create the
postgresql user and database yourself, with appropriate
permissions.
'';
};
passwordFile = lib.mkOption {
type = lib.types.path;
description = "Password file for the postgresql connection. Must be readable by user `nginx`.";
};
dbname = lib.mkOption {
type = lib.types.str;
default = "postfixadmin";
description = "Name of the postgresql database";
};
};
extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
description = "Extra configuration for the postfixadmin instance, see postfixadmin's config.inc.php for available options.";
};
};
config = lib.mkIf cfg.enable {
environment.etc."postfixadmin/config.local.php".text = ''
<?php
$CONF['setup_password'] = file_get_contents('${cfg.setupPasswordFile}');
$CONF['database_type'] = 'pgsql';
$CONF['database_host'] = ${if localDB then "null" else "'${cfg.database.host}'"};
${lib.optionalString localDB "$CONF['database_user'] = '${cfg.database.username}';"}
$CONF['database_password'] = ${
if localDB then "'dummy'" else "file_get_contents('${cfg.database.passwordFile}')"
};
$CONF['database_name'] = '${cfg.database.dbname}';
$CONF['configured'] = true;
${cfg.extraConfig}
'';
systemd.tmpfiles.settings."10-postfixadmin"."/var/cache/postfixadmin/templates_c".d = {
inherit user;
group = user;
mode = "700";
};
services.nginx = {
enable = true;
virtualHosts = {
${cfg.hostName} = {
forceSSL = lib.mkDefault true;
enableACME = lib.mkDefault true;
locations."/" = {
root = "${pkgs.postfixadmin}/public";
index = "index.php";
extraConfig = ''
location ~* \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:${fpm.socket};
include ${config.services.nginx.package}/conf/fastcgi_params;
include ${pkgs.nginx}/conf/fastcgi.conf;
}
'';
};
};
};
};
services.postgresql = lib.mkIf localDB {
enable = true;
ensureUsers = [
{
name = cfg.database.username;
}
];
};
# The postgresql module doesn't currently support concepts like
# objects owners and extensions; for now we tack on what's needed
# here.
systemd.services.postfixadmin-postgres = lib.mkIf localDB {
after = [ "postgresql.target" ];
bindsTo = [ "postgresql.target" ];
wantedBy = [ "multi-user.target" ];
path = [
pgsql.package
pkgs.util-linux
];
script = ''
set -euo pipefail
PSQL() {
psql --port=${toString pgsql.settings.port} "$@"
}
PSQL -tAc "SELECT 1 FROM pg_database WHERE datname = '${cfg.database.dbname}'" | grep -q 1 || PSQL -tAc 'CREATE DATABASE "${cfg.database.dbname}" OWNER "${cfg.database.username}"'
current_owner=$(PSQL -tAc "SELECT pg_catalog.pg_get_userbyid(datdba) FROM pg_catalog.pg_database WHERE datname = '${cfg.database.dbname}'")
if [[ "$current_owner" != "${cfg.database.username}" ]]; then
PSQL -tAc 'ALTER DATABASE "${cfg.database.dbname}" OWNER TO "${cfg.database.username}"'
if [[ -e "${pgsql.dataDir}/.reassigning_${cfg.database.dbname}" ]]; then
echo "Reassigning ownership of database ${cfg.database.dbname} to user ${cfg.database.username} failed on last boot. Failing..."
exit 1
fi
touch "${pgsql.dataDir}/.reassigning_${cfg.database.dbname}"
PSQL "${cfg.database.dbname}" -tAc "REASSIGN OWNED BY \"$current_owner\" TO \"${cfg.database.username}\""
rm "${pgsql.dataDir}/.reassigning_${cfg.database.dbname}"
fi
'';
serviceConfig = {
User = pgsql.superUser;
Type = "oneshot";
RemainAfterExit = true;
};
};
users.users.${user} = lib.mkIf localDB {
group = user;
isSystemUser = true;
createHome = false;
};
users.groups.${user} = lib.mkIf localDB { };
services.phpfpm.pools.postfixadmin = {
user = user;
phpPackage = pkgs.php81;
phpOptions = ''
error_log = 'stderr'
log_errors = on
'';
settings = lib.mapAttrs (_: lib.mkDefault) {
"listen.owner" = "nginx";
"listen.group" = "nginx";
"listen.mode" = "0660";
"pm" = "dynamic";
"pm.max_children" = 75;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 1;
"pm.max_spare_servers" = 20;
"pm.max_requests" = 500;
"catch_workers_output" = true;
};
};
};
}
@@ -236,13 +236,14 @@ let
+
/*
Now we update the other settings defined in cleanedConfig which are not
"folders" or "devices".
"folders", "devices", or "guiPasswordFile".
*/
(lib.pipe cleanedConfig [
builtins.attrNames
(lib.subtractLists [
"folders"
"devices"
"guiPasswordFile"
])
(map (subOption: ''
curl -X PUT -d ${
@@ -251,6 +252,12 @@ let
''))
(lib.concatStringsSep "\n")
])
+
# Now we hash the contents of guiPasswordFile and use the result to update the gui password
(lib.optionalString (cfg.guiPasswordFile != null) ''
${pkgs.mkpasswd}/bin/mkpasswd -m bcrypt --stdin <"${cfg.guiPasswordFile}" | tr -d "\n" > "$RUNTIME_DIRECTORY/password_bcrypt"
curl -X PATCH --variable "pw_bcrypt@$RUNTIME_DIRECTORY/password_bcrypt" --expand-json '{ "password": "{{pw_bcrypt}}" }' ${curlAddressArgs "/rest/config/gui"}
'')
+ ''
# restart Syncthing if required
if curl ${curlAddressArgs "/rest/config/restart-required"} |
@@ -285,6 +292,14 @@ in
'';
};
guiPasswordFile = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Path to file containing the plaintext password for Syncthing's GUI.
'';
};
overrideDevices = mkOption {
type = types.bool;
default = true;
@@ -837,6 +852,12 @@ in
from the configuration, creating path conflicts.
'';
}
{
assertion = (lib.hasAttrByPath [ "gui" "password" ] cfg.settings) -> cfg.guiPasswordFile == null;
message = ''
Please use only one of services.syncthing.settings.gui.password or services.syncthing.guiPasswordFile.
'';
}
];
networking.firewall = mkIf cfg.openDefaultPorts {
+2 -3
View File
@@ -56,7 +56,7 @@ let
pkgs.writeTextFile {
inherit name;
text = "<?php\n${text}";
checkPhase = "${pkgs.php81}/bin/php --syntax-check $target";
checkPhase = "${pkgs.php84}/bin/php --syntax-check $target";
};
mkPhpValue =
@@ -368,8 +368,7 @@ let
};
phpPackage = mkPackageOption pkgs "php" {
default = "php81";
example = "php82";
default = "php84";
};
phpOptions = mkOption {
@@ -1,492 +0,0 @@
{
config,
pkgs,
lib,
...
}:
with lib;
let
cfg = config.services.invoiceplane;
eachSite = cfg.sites;
user = "invoiceplane";
webserver = config.services.${cfg.webserver};
invoiceplane-config =
hostName: cfg:
pkgs.writeText "ipconfig.php" ''
# <?php exit('No direct script access allowed'); ?>
IP_URL=http://${hostName}
ENABLE_DEBUG=false
DISABLE_SETUP=false
REMOVE_INDEXPHP=false
DB_HOSTNAME=${cfg.database.host}
DB_USERNAME=${cfg.database.user}
# NOTE: file_get_contents adds newline at the end of returned string
DB_PASSWORD=${
optionalString (
cfg.database.passwordFile != null
) "trim(file_get_contents('${cfg.database.passwordFile}'), \"\\r\\n\")"
}
DB_DATABASE=${cfg.database.name}
DB_PORT=${toString cfg.database.port}
SESS_EXPIRATION=864000
ENABLE_INVOICE_DELETION=false
DISABLE_READ_ONLY=false
ENCRYPTION_KEY=
ENCRYPTION_CIPHER=AES-256
SETUP_COMPLETED=false
REMOVE_INDEXPHP=true
'';
mkPhpValue =
v:
if isString v then
escapeShellArg v
# NOTE: If any value contains a , (comma) this will not get escaped
else if isList v && strings.isConvertibleWithToString v then
escapeShellArg (concatMapStringsSep "," toString v)
else if isInt v then
toString v
else if isBool v then
boolToString v
else
abort "The Invoiceplane config value ${lib.generators.toPretty { } v} can not be encoded.";
extraConfig =
hostName: cfg:
let
settings = mapAttrsToList (k: v: "${k}=${mkPhpValue v}") cfg.settings;
in
pkgs.writeText "extraConfig.php" (concatStringsSep "\n" settings);
pkg =
hostName: cfg:
pkgs.stdenv.mkDerivation rec {
pname = "invoiceplane-${hostName}";
version = src.version;
src = pkgs.invoiceplane;
postPatch = ''
# Patch index.php file to load additional config file
substituteInPlace index.php \
--replace-fail "require __DIR__ . '/vendor/autoload.php';" "require('vendor/autoload.php'); \$dotenv = Dotenv\Dotenv::createImmutable(__DIR__, 'extraConfig.php'); \$dotenv->load();";
'';
installPhase = ''
mkdir -p $out
cp -r * $out/
# symlink uploads and log directories
rm -r $out/uploads $out/application/logs $out/vendor/mpdf/mpdf/tmp
ln -sf ${cfg.stateDir}/uploads $out/
ln -sf ${cfg.stateDir}/logs $out/application/
ln -sf ${cfg.stateDir}/tmp $out/vendor/mpdf/mpdf/
# symlink the InvoicePlane config
ln -s ${cfg.stateDir}/ipconfig.php $out/ipconfig.php
# symlink the extraConfig file
ln -s ${extraConfig hostName cfg} $out/extraConfig.php
# symlink additional templates
${concatMapStringsSep "\n" (
template: "cp -r ${template}/. $out/application/views/invoice_templates/pdf/"
) cfg.invoiceTemplates}
${concatMapStringsSep "\n" (
template: "cp -r ${template}/. $out/application/views/quote_templates/pdf/"
) cfg.quoteTemplates}
'';
};
siteOpts =
{ lib, name, ... }:
{
options = {
enable = mkEnableOption "InvoicePlane web application";
stateDir = mkOption {
type = types.path;
default = "/var/lib/invoiceplane/${name}";
description = ''
This directory is used for uploads of attachments and cache.
The directory passed here is automatically created and permissions
adjusted as required.
'';
};
database = {
host = mkOption {
type = types.str;
default = "localhost";
description = "Database host address.";
};
port = mkOption {
type = types.port;
default = 3306;
description = "Database host port.";
};
name = mkOption {
type = types.str;
default = "invoiceplane";
description = "Database name.";
};
user = mkOption {
type = types.str;
default = "invoiceplane";
description = "Database user.";
};
passwordFile = mkOption {
type = types.nullOr types.path;
default = null;
example = "/run/keys/invoiceplane-dbpassword";
description = ''
A file containing the password corresponding to
{option}`database.user`.
'';
};
createLocally = mkOption {
type = types.bool;
default = true;
description = "Create the database and database user locally.";
};
};
invoiceTemplates = mkOption {
type = types.listOf types.path;
default = [ ];
description = ''
List of path(s) to respective template(s) which are copied from the 'invoice_templates/pdf' directory.
::: {.note}
These templates need to be packaged before use, see example.
:::
'';
example = literalExpression ''
let
# Let's package an example template
template-vtdirektmarketing = pkgs.stdenv.mkDerivation {
name = "vtdirektmarketing";
# Download the template from a public repository
src = pkgs.fetchgit {
url = "https://git.project-insanity.org/onny/invoiceplane-vtdirektmarketing.git";
sha256 = "1hh0q7wzsh8v8x03i82p6qrgbxr4v5fb05xylyrpp975l8axyg2z";
};
sourceRoot = ".";
# Installing simply means copying template php file to the output directory
installPhase = ""
mkdir -p $out
cp invoiceplane-vtdirektmarketing/vtdirektmarketing.php $out/
"";
};
# And then pass this package to the template list like this:
in [ template-vtdirektmarketing ]
'';
};
quoteTemplates = mkOption {
type = types.listOf types.path;
default = [ ];
description = ''
List of path(s) to respective template(s) which are copied from the 'quote_templates/pdf' directory.
::: {.note}
These templates need to be packaged before use, see example.
:::
'';
example = literalExpression ''
let
# Let's package an example template
template-vtdirektmarketing = pkgs.stdenv.mkDerivation {
name = "vtdirektmarketing";
# Download the template from a public repository
src = pkgs.fetchgit {
url = "https://git.project-insanity.org/onny/invoiceplane-vtdirektmarketing.git";
sha256 = "1hh0q7wzsh8v8x03i82p6qrgbxr4v5fb05xylyrpp975l8axyg2z";
};
sourceRoot = ".";
# Installing simply means copying template php file to the output directory
installPhase = ""
mkdir -p $out
cp invoiceplane-vtdirektmarketing/vtdirektmarketing.php $out/
"";
};
# And then pass this package to the template list like this:
in [ template-vtdirektmarketing ]
'';
};
poolConfig = mkOption {
type =
with types;
attrsOf (oneOf [
str
int
bool
]);
default = {
"pm" = "dynamic";
"pm.max_children" = 32;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 2;
"pm.max_spare_servers" = 4;
"pm.max_requests" = 500;
};
description = ''
Options for the InvoicePlane PHP pool. See the documentation on `php-fpm.conf`
for details on configuration directives.
'';
};
settings = mkOption {
type = types.attrsOf types.anything;
default = { };
description = ''
Structural InvoicePlane configuration. Refer to
<https://github.com/InvoicePlane/InvoicePlane/blob/master/ipconfig.php.example>
for details and supported values.
'';
example = literalExpression ''
{
SETUP_COMPLETED = true;
DISABLE_SETUP = true;
IP_URL = "https://invoice.example.com";
}
'';
};
cron = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable cron service which periodically runs Invoiceplane tasks.
Requires key taken from the administration page. Refer to
<https://wiki.invoiceplane.com/en/1.0/modules/recurring-invoices>
on how to configure it.
'';
};
key = mkOption {
type = types.str;
description = "Cron key taken from the administration page.";
};
};
};
};
in
{
# interface
options = {
services.invoiceplane = mkOption {
type = types.submodule {
options.sites = mkOption {
type = types.attrsOf (types.submodule siteOpts);
default = { };
description = "Specification of one or more InvoicePlane sites to serve";
};
options.webserver = mkOption {
type = types.enum [
"caddy"
"nginx"
];
default = "caddy";
example = "nginx";
description = ''
Which webserver to use for virtual host management.
'';
};
};
default = { };
description = "InvoicePlane configuration.";
};
};
# implementation
config = mkIf (eachSite != { }) (mkMerge [
{
assertions = flatten (
mapAttrsToList (hostName: cfg: [
{
assertion = cfg.database.createLocally -> cfg.database.user == user;
message = ''services.invoiceplane.sites."${hostName}".database.user must be ${user} if the database is to be automatically provisioned'';
}
{
assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
message = ''services.invoiceplane.sites."${hostName}".database.passwordFile cannot be specified if services.invoiceplane.sites."${hostName}".database.createLocally is set to true.'';
}
{
assertion = cfg.cron.enable -> cfg.cron.key != null;
message = ''services.invoiceplane.sites."${hostName}".cron.key must be set in order to use cron service.'';
}
]) eachSite
);
services.mysql = mkIf (any (v: v.database.createLocally) (attrValues eachSite)) {
enable = true;
package = mkDefault pkgs.mariadb;
ensureDatabases = mapAttrsToList (hostName: cfg: cfg.database.name) eachSite;
ensureUsers = mapAttrsToList (hostName: cfg: {
name = cfg.database.user;
ensurePermissions = {
"${cfg.database.name}.*" = "ALL PRIVILEGES";
};
}) eachSite;
};
services.phpfpm = {
phpPackage = pkgs.php81;
pools = mapAttrs' (
hostName: cfg:
(nameValuePair "invoiceplane-${hostName}" {
inherit user;
group = webserver.group;
settings = {
"listen.owner" = webserver.user;
"listen.group" = webserver.group;
}
// cfg.poolConfig;
})
) eachSite;
};
}
{
systemd.tmpfiles.rules = flatten (
mapAttrsToList (hostName: cfg: [
"d ${cfg.stateDir} 0750 ${user} ${webserver.group} - -"
"f ${cfg.stateDir}/ipconfig.php 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/logs 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/uploads 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/uploads/archive 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/uploads/customer_files 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/uploads/temp 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/uploads/temp/mpdf 0750 ${user} ${webserver.group} - -"
"d ${cfg.stateDir}/tmp 0750 ${user} ${webserver.group} - -"
]) eachSite
);
systemd.services.invoiceplane-config = {
serviceConfig.Type = "oneshot";
script = concatStrings (
mapAttrsToList (hostName: cfg: ''
mkdir -p ${cfg.stateDir}/logs \
${cfg.stateDir}/uploads
if ! grep -q IP_URL "${cfg.stateDir}/ipconfig.php"; then
cp "${invoiceplane-config hostName cfg}" "${cfg.stateDir}/ipconfig.php"
fi
if ! grep -q 'php exit' "${cfg.stateDir}/ipconfig.php"; then
sed -i "1i # <?php exit('No direct script access allowed'); ?>" "${cfg.stateDir}/ipconfig.php"
fi
'') eachSite
);
wantedBy = [ "multi-user.target" ];
};
users.users.${user} = {
group = webserver.group;
isSystemUser = true;
};
}
{
# Cron service implementation
systemd.timers = mapAttrs' (
hostName: cfg:
(nameValuePair "invoiceplane-cron-${hostName}" (
mkIf cfg.cron.enable {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "5m";
OnUnitActiveSec = "5m";
Unit = "invoiceplane-cron-${hostName}.service";
};
}
))
) eachSite;
systemd.services = mapAttrs' (
hostName: cfg:
(nameValuePair "invoiceplane-cron-${hostName}" (
mkIf cfg.cron.enable {
serviceConfig = {
Type = "oneshot";
User = user;
ExecStart = "${pkgs.curl}/bin/curl --header 'Host: ${hostName}' http://localhost/invoices/cron/recur/${cfg.cron.key}";
};
}
))
) eachSite;
}
(mkIf (cfg.webserver == "caddy") {
services.caddy = {
enable = true;
virtualHosts = mapAttrs' (
hostName: cfg:
(nameValuePair "http://${hostName}" {
extraConfig = ''
root * ${pkg hostName cfg}
file_server
php_fastcgi unix/${config.services.phpfpm.pools."invoiceplane-${hostName}".socket}
'';
})
) eachSite;
};
})
(mkIf (cfg.webserver == "nginx") {
services.nginx = {
enable = true;
virtualHosts = mapAttrs' (
hostName: cfg:
(nameValuePair hostName {
root = pkg hostName cfg;
extraConfig = ''
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}
'';
locations = {
"/setup".extraConfig = ''
rewrite ^(.*)$ http://${hostName}/ redirect;
'';
"~ .php$" = {
extraConfig = ''
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:${config.services.phpfpm.pools."invoiceplane-${hostName}".socket};
include ${config.services.nginx.package}/conf/fastcgi_params;
include ${config.services.nginx.package}/conf/fastcgi.conf;
'';
};
};
})
) eachSite;
};
})
]);
}
@@ -327,7 +327,7 @@ in
services.phpfpm.pools.limesurvey = {
inherit user group;
phpPackage = pkgs.php81;
phpPackage = pkgs.php83;
phpEnv.DBENGINE = "${cfg.database.dbEngine}";
phpEnv.LIMESURVEY_CONFIG = "${limesurveyConfig}";
# App code cannot access credentials directly since the service starts
@@ -419,8 +419,8 @@ in
environment.LIMESURVEY_CONFIG = limesurveyConfig;
script = ''
# update or install the database as required
${pkgs.php81}/bin/php ${cfg.package}/share/limesurvey/application/commands/console.php updatedb || \
${pkgs.php81}/bin/php ${cfg.package}/share/limesurvey/application/commands/console.php install admin password admin admin@example.com verbose
${pkgs.php83}/bin/php ${cfg.package}/share/limesurvey/application/commands/console.php updatedb || \
${pkgs.php83}/bin/php ${cfg.package}/share/limesurvey/application/commands/console.php install admin password admin admin@example.com verbose
'';
serviceConfig = {
User = user;
@@ -1,6 +1,7 @@
{
config,
lib,
pkgs,
...
}:
@@ -27,20 +28,11 @@ in
type = types.bool;
default = false;
description = ''
This enables Parallels Tools for Linux guests, along with provided
video, mouse and other hardware drivers.
This enables Parallels Tools for Linux guests.
'';
};
package = mkOption {
type = types.nullOr types.package;
default = config.boot.kernelPackages.prl-tools;
defaultText = "config.boot.kernelPackages.prl-tools";
example = literalExpression "config.boot.kernelPackages.prl-tools";
description = ''
Defines which package to use for prl-tools. Override to change the version.
'';
};
package = lib.mkPackageOption pkgs "prl-tools" { };
};
};
@@ -53,10 +45,6 @@ in
boot.extraModulePackages = [ prl-tools ];
boot.kernelModules = [
"prl_tg"
];
services.timesyncd.enable = false;
systemd.services.prltoolsd = {
+11 -12
View File
@@ -745,7 +745,6 @@ in
installer-systemd-stage-1 = handleTest ./installer-systemd-stage-1.nix { };
intune = runTest ./intune.nix;
invidious = runTest ./invidious.nix;
invoiceplane = runTest ./invoiceplane.nix;
iodine = runTest ./iodine.nix;
iosched = runTest ./iosched.nix;
ipget = runTest ./ipget.nix;
@@ -1173,10 +1172,6 @@ in
inherit runTest;
php = pkgs.php;
};
php81 = import ./php/default.nix {
inherit runTest;
php = pkgs.php81;
};
php82 = import ./php/default.nix {
inherit runTest;
php = pkgs.php82;
@@ -1218,7 +1213,6 @@ in
handleTest ./postfix-raise-smtpd-tls-security-level.nix
{ };
postfix-tlspol = runTest ./postfix-tlspol.nix;
postfixadmin = runTest ./postfixadmin.nix;
postgres-websockets = runTest ./postgres-websockets.nix;
postgresql = handleTest ./postgresql { };
postgrest = runTest ./postgrest.nix;
@@ -1408,12 +1402,16 @@ in
switchTest = runTest ./switch-test.nix;
sx = runTest ./sx.nix;
sympa = runTest ./sympa.nix;
syncthing = runTest ./syncthing.nix;
syncthing-folders = runTest ./syncthing-folders.nix;
syncthing-init = runTest ./syncthing-init.nix;
syncthing-many-devices = runTest ./syncthing-many-devices.nix;
syncthing-no-settings = runTest ./syncthing-no-settings.nix;
syncthing-relay = runTest ./syncthing-relay.nix;
syncthing = runTest ./syncthing/main.nix;
syncthing-folders = runTest ./syncthing/folders.nix;
syncthing-guiPassword = runTest ./syncthing/guiPassword.nix;
syncthing-guiPasswordFile = runTest ./syncthing/guiPasswordFile.nix;
syncthing-init = runTest ./syncthing/init.nix;
# FIXME: Test has been failing since 2025-07-06:
# https://github.com/NixOS/nixpkgs/issues/447674
# syncthing-many-devices = runTest ./syncthing/many-devices.nix;
syncthing-no-settings = runTest ./syncthing/no-settings.nix;
syncthing-relay = runTest ./syncthing/relay.nix;
sysfs = runTest ./sysfs.nix;
sysinit-reactivation = runTest ./sysinit-reactivation.nix;
systemd = runTest ./systemd.nix;
@@ -1462,6 +1460,7 @@ in
systemd-machinectl = runTest ./systemd-machinectl.nix;
systemd-misc = runTest ./systemd-misc.nix;
systemd-networkd = runTest ./systemd-networkd.nix;
systemd-networkd-batadv = runTest ./systemd-networkd-batadv.nix;
systemd-networkd-bridge = runTest ./systemd-networkd-bridge.nix;
systemd-networkd-dhcpserver = runTest ./systemd-networkd-dhcpserver.nix;
systemd-networkd-dhcpserver-static-leases = runTest ./systemd-networkd-dhcpserver-static-leases.nix;
+3 -3
View File
@@ -49,7 +49,7 @@
index = "index.php index.html";
};
};
phpPackage = pkgs.php81;
phpPackage = pkgs.php84;
enablePHP = true;
};
@@ -78,8 +78,8 @@
frps.wait_for_open_port(80)
frpc.wait_for_unit("frp.service")
response = frpc.succeed("curl -fvvv -s http://127.0.0.1/")
assert "PHP Version ${pkgs.php81.version}" in response, "PHP version not detected"
assert "PHP Version ${pkgs.php84.version}" in response, "PHP version not detected"
response = frpc.succeed("curl -fvvv -s http://10.0.0.1/")
assert "PHP Version ${pkgs.php81.version}" in response, "PHP version not detected"
assert "PHP Version ${pkgs.php84.version}" in response, "PHP version not detected"
'';
}
-116
View File
@@ -1,116 +0,0 @@
{ pkgs, ... }:
{
name = "invoiceplane";
meta = with pkgs.lib.maintainers; {
maintainers = [
onny
];
};
nodes = {
invoiceplane_caddy =
{ ... }:
{
services.invoiceplane.webserver = "caddy";
services.invoiceplane.sites = {
"site1.local" = {
database.name = "invoiceplane1";
database.createLocally = true;
enable = true;
};
"site2.local" = {
database.name = "invoiceplane2";
database.createLocally = true;
enable = true;
};
};
networking.firewall.allowedTCPPorts = [ 80 ];
networking.hosts."127.0.0.1" = [
"site1.local"
"site2.local"
];
};
invoiceplane_nginx =
{ ... }:
{
services.invoiceplane.webserver = "nginx";
services.invoiceplane.sites = {
"site1.local" = {
database.name = "invoiceplane1";
database.createLocally = true;
enable = true;
};
"site2.local" = {
database.name = "invoiceplane2";
database.createLocally = true;
enable = true;
};
};
networking.firewall.allowedTCPPorts = [ 80 ];
networking.hosts."127.0.0.1" = [
"site1.local"
"site2.local"
];
};
};
testScript = ''
start_all()
invoiceplane_caddy.wait_for_unit("caddy")
invoiceplane_nginx.wait_for_unit("nginx")
site_names = ["site1.local", "site2.local"]
machines = [invoiceplane_caddy, invoiceplane_nginx]
for machine in machines:
machine.wait_for_open_port(80)
machine.wait_for_open_port(3306)
for site_name in site_names:
machine.wait_for_unit(f"phpfpm-invoiceplane-{site_name}")
with subtest("Website returns welcome screen"):
assert "Please install InvoicePlane" in machine.succeed(f"curl -L {site_name}")
with subtest("Finish InvoicePlane setup"):
machine.succeed(
f"curl -sSfL --cookie-jar cjar {site_name}/setup/language"
)
csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
)
machine.succeed(
f"curl -sSfL --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&ip_lang=english&btn_continue=Continue' {site_name}/setup/language"
)
csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
)
machine.succeed(
f"curl -sSfL --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/setup/prerequisites"
)
csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
)
machine.succeed(
f"curl -sSfL --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/setup/configure_database"
)
csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
)
machine.succeed(
f"curl -sSfl --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/setup/install_tables"
)
csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
)
machine.succeed(
f"curl -sSfl --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/setup/upgrade_tables"
)
'';
}
-34
View File
@@ -1,34 +0,0 @@
{ pkgs, ... }:
{
name = "postfixadmin";
meta = with pkgs.lib.maintainers; {
maintainers = [ globin ];
};
nodes = {
postfixadmin =
{ config, pkgs, ... }:
{
services.postfixadmin = {
enable = true;
hostName = "postfixadmin";
setupPasswordFile = pkgs.writeText "insecure-test-setup-pw-file" "$2y$10$r0p63YCjd9rb9nHrV9UtVuFgGTmPDLKu.0UIJoQTkWCZZze2iuB1m";
};
services.nginx.virtualHosts.postfixadmin = {
forceSSL = false;
enableACME = false;
};
};
};
testScript = ''
postfixadmin.start
postfixadmin.wait_for_unit("postgresql.target")
postfixadmin.wait_for_unit("phpfpm-postfixadmin.service")
postfixadmin.wait_for_unit("nginx.service")
postfixadmin.succeed(
"curl -sSfL http://postfixadmin/setup.php -X POST -F 'setup_password=not production'"
)
postfixadmin.succeed("curl -sSfL http://postfixadmin/ | grep 'Mail admins login here'")
'';
}
+56
View File
@@ -0,0 +1,56 @@
{ lib, pkgs, ... }:
{
name = "syncthing-guiPassword";
meta.maintainers = with lib.maintainers; [ nullcube ];
enableOCR = true;
nodes.machine = {
imports = [ ../common/x11.nix ];
environment.systemPackages = with pkgs; [
syncthing
xdotool
];
programs.firefox = {
enable = true;
preferences = {
# Prevent firefox from asking to save the password
"signon.rememberSignons" = false;
};
};
services.syncthing = {
enable = true;
settings.options.urAccepted = -1;
settings.gui = {
insecureAdminAccess = false;
user = "alice";
password = "alice_password";
};
};
};
testScript = ''
machine.wait_for_unit("syncthing.service")
machine.wait_for_x()
machine.execute("xterm -e 'firefox 127.0.0.1:8384' >&2 &")
machine.wait_for_window("Syncthing")
machine.screenshot("pre-login")
with subtest("Syncthing requests authentication"):
machine.wait_for_text("Authentication Required", 10)
with subtest("Syncthing password is valid"):
machine.execute("xdotool type \"alice\"")
machine.execute("xdotool key Tab")
machine.execute("xdotool type \"alice_password\"")
machine.execute("xdotool key Enter")
machine.sleep(2)
machine.wait_for_text("This Device", 10)
machine.screenshot("post-login")
with subtest("Plaintext Syncthing password is not in final config"):
config = machine.succeed("cat /var/lib/syncthing/.config/syncthing/config.xml")
assert "alice_password" not in config
'';
}
+56
View File
@@ -0,0 +1,56 @@
{ lib, pkgs, ... }:
{
name = "syncthing-guiPasswordFile";
meta.maintainers = with lib.maintainers; [ nullcube ];
enableOCR = true;
nodes.machine = {
imports = [ ../common/x11.nix ];
environment.systemPackages = with pkgs; [
syncthing
xdotool
];
programs.firefox = {
enable = true;
preferences = {
# Prevent firefox from asking to save the password
"signon.rememberSignons" = false;
};
};
services.syncthing = {
enable = true;
settings.options.urAccepted = -1;
settings.gui = {
insecureAdminAccess = false;
user = "alice";
};
guiPasswordFile = (pkgs.writeText "syncthing-password-file" ''alice_password'').outPath;
};
};
testScript = ''
machine.wait_for_unit("syncthing.service")
machine.wait_for_x()
machine.execute("xterm -e 'firefox 127.0.0.1:8384' >&2 &")
machine.wait_for_window("Syncthing")
machine.screenshot("pre-login")
with subtest("Syncthing requests authentication"):
machine.wait_for_text("Authentication Required", 10)
with subtest("Syncthing password is valid"):
machine.execute("xdotool type \"alice\"")
machine.execute("xdotool key Tab")
machine.execute("xdotool type \"alice_password\"")
machine.execute("xdotool key Enter")
machine.sleep(2)
machine.wait_for_text("This Device", 10)
machine.screenshot("post-login")
with subtest("Plaintext Syncthing password is not in final config"):
config = machine.succeed("cat /var/lib/syncthing/.config/syncthing/config.xml")
assert "alice_password" not in config
'';
}
+134
View File
@@ -0,0 +1,134 @@
{ lib, ... }:
{
name = "systemd-networkd-batadv";
meta = with lib.maintainers; {
maintainers = [ herbetom ];
};
nodes = {
machineA =
{ config, pkgs, ... }:
{
virtualisation.vlans = [ 1 ];
systemd.services.systemd-networkd.environment.SYSTEMD_LOG_LEVEL = "debug";
networking = {
useNetworkd = true;
useDHCP = false;
firewall.enable = false;
};
# Use default batman_adv module from kernel
boot.extraModulePackages = [ ];
environment.systemPackages = [
pkgs.batctl
pkgs.jq
];
systemd.network = {
networks."10-eth1" = {
matchConfig.Name = "eth1";
networkConfig = {
BatmanAdvanced = config.systemd.network.netdevs."20-bat0".netdevConfig.Name;
IPv6AcceptRA = false;
};
};
netdevs."20-bat0" = {
netdevConfig = {
Name = "bat0";
Kind = "batadv";
MACAddress = "00:00:5e:00:53:00";
};
batmanAdvancedConfig = {
OriginatorIntervalSec = "5";
RoutingAlgorithm = "batman-iv";
};
};
networks."20-bat0" = {
matchConfig.Name = config.systemd.network.netdevs."20-bat0".netdevConfig.Name;
networkConfig.IPv6AcceptRA = false;
address = [
"10.0.0.1/24"
"2001:db8::a/64"
];
};
};
};
machineB =
{ config, pkgs, ... }:
{
virtualisation.vlans = [ 1 ];
systemd.services.systemd-networkd.environment.SYSTEMD_LOG_LEVEL = "debug";
networking = {
useNetworkd = true;
useDHCP = false;
firewall.enable = false;
};
# Use batman_adv module from nixpkgs
boot.extraModulePackages = [ config.boot.kernelPackages.batman_adv ];
environment.systemPackages = [
pkgs.batctl
pkgs.jq
];
systemd.network = {
networks."10-eth1" = {
matchConfig.Name = "eth1";
networkConfig = {
BatmanAdvanced = config.systemd.network.netdevs."20-bat0".netdevConfig.Name;
IPv6AcceptRA = false;
};
};
netdevs."20-bat0" = {
netdevConfig = {
Name = "bat0";
Kind = "batadv";
MACAddress = "00:00:5e:00:53:10";
};
batmanAdvancedConfig = {
OriginatorIntervalSec = "5";
RoutingAlgorithm = "batman-iv";
};
};
networks."20-bat0" = {
matchConfig.Name = config.systemd.network.netdevs."20-bat0".netdevConfig.Name;
networkConfig.IPv6AcceptRA = false;
address = [
"10.0.0.2/24"
"2001:db8::b/64"
];
};
};
};
};
testScript = ''
start_all()
machineA.wait_for_unit("default.target")
machineB.wait_for_unit("default.target")
print(machineA.succeed("batctl -v").strip())
print(machineB.succeed("batctl -v").strip())
machineA.wait_until_succeeds('batctl neighbors_json | jq -e ".[0].neigh_address | select(length > 0)"')
print(machineA.succeed("batctl n").strip())
print(machineB.succeed("batctl n").strip())
print(machineA.wait_until_succeeds("batctl ping -c 5 00:00:5e:00:53:10").strip())
print(machineB.wait_until_succeeds("batctl ping -c 5 00:00:5e:00:53:00").strip())
print(machineA.wait_until_succeeds("ping -c 5 2001:db8::b"))
print(machineB.wait_until_succeeds("ping -c 5 10.0.0.1"))
machineA.fail("ping -c 3 10.0.0.99")
'';
}
+5 -5
View File
@@ -18,15 +18,15 @@ in
services.unit = {
enable = true;
config = pkgs.lib.strings.toJSON {
listeners."*:9081".application = "php_81";
applications.php_81 = {
type = "php 8.1";
listeners."*:9081".application = "php_82";
applications.php_82 = {
type = "php 8.2";
processes = 1;
user = "testuser";
group = "testgroup";
root = "${testdir}/www";
index = "info.php";
options.file = "${pkgs.unit.usedPhp81}/lib/php.ini";
options.file = "${pkgs.unit.usedPhp82}/lib/php.ini";
};
};
};
@@ -49,7 +49,7 @@ in
# Check so we get an evaluated PHP back
response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9081/")
assert "PHP Version ${pkgs.unit.usedPhp81.version}" in response, "PHP version not detected"
assert "PHP Version ${pkgs.unit.usedPhp82.version}" in response, "PHP version not detected"
# Check so we have database and some other extensions loaded
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]:
@@ -55,7 +55,7 @@ mkDerivation rec {
# TODO: The tests are failing because it can't locate QT plugins. Is there a better way to do this?
+ (builtins.concatStringsSep "\n" (
lib.lists.flatten (
builtins.map (pkg: [
map (pkg: [
(lib.optionalString (pkg ? qtPluginPrefix) ''
export QT_PLUGIN_PATH="${pkg}/${pkg.qtPluginPrefix}"''${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH
'')
+1 -1
View File
@@ -84,7 +84,7 @@ let
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv -t $out/bin ${builtins.concatStringsSep " " (builtins.map (dir: "Pianoteq*/${dir}/*") archdirs)}
mv -t $out/bin ${builtins.concatStringsSep " " (map (dir: "Pianoteq*/${dir}/*") archdirs)}
install -Dm644 ${./pianoteq.svg} $out/share/icons/hicolor/scalable/apps/pianoteq.svg
for size in 16 22 32 48 64 128 256; do
dir=$out/share/icons/hicolor/"$size"x"$size"/apps
+1 -1
View File
@@ -19,7 +19,7 @@ vendorhash() {
findpath() {
path="$(nix --extra-experimental-features nix-command eval --json --impure -f "$nixpkgs" "$1.meta.position" | jq -r . | cut -d: -f1)"
outpath="$(nix --extra-experimental-features nix-command eval --json --impure --expr "builtins.fetchGit \"$nixpkgs\"")"
outpath="$(nix --extra-experimental-features nix-command eval --json --impure --expr "fetchGit \"$nixpkgs\"")"
if [ -n "$outpath" ]; then
path="${path/$(echo "$outpath" | jq -r .)/$nixpkgs}"
@@ -98,7 +98,7 @@ stdenv.mkDerivation (finalAttrs: {
echo "OK"
'';
in
builtins.concatStringsSep "\n" (builtins.map script builderKeys);
builtins.concatStringsSep "\n" (map script builderKeys);
in
''
pushd $(mktemp -d)
@@ -109,7 +109,7 @@ stdenv.mkDerivation (finalAttrs: {
echo "OK"
'';
in
builtins.concatStringsSep "\n" (builtins.map script builderKeys);
builtins.concatStringsSep "\n" (map script builderKeys);
in
''
pushd $(mktemp -d)
@@ -20,8 +20,8 @@ let
sha256Hash = "sha256-pet3uTmL4pQ/FxB2qKv+IZNx540gMC7hmfOaQ8iLQpQ=";
};
betaVersion = {
version = "2025.1.3.6"; # "Android Studio Narwhal 3 Feature Drop | 2025.1.3 RC 2"
sha256Hash = "sha256-S8KK/EGev0v03fVywIkD6Ym3LrciGKXJVorzyZ1ljdQ=";
version = "2025.1.4.7"; # "Android Studio Narwhal 4 Feature Drop | 2025.1.4 RC 2"
sha256Hash = "sha256-KrKUsA7wFeI7IBa9VOp+MERqWIiMnNzLFO8oF0rCiIw=";
};
latestVersion = {
version = "2025.2.1.3"; # "Android Studio Otter | 2025.2.1 Canary 3"
@@ -21,8 +21,8 @@
let
appPythonDeps = builtins.map (item: item.eafPythonDeps) enabledApps;
appOtherDeps = builtins.map (item: item.eafOtherDeps) enabledApps;
appPythonDeps = map (item: item.eafPythonDeps) enabledApps;
appOtherDeps = map (item: item.eafOtherDeps) enabledApps;
pythonPackageLists = [
(
@@ -38,7 +38,7 @@ let
)
]
++ appPythonDeps;
pythonPkgs = ps: builtins.concatLists (builtins.map (f: f ps) pythonPackageLists);
pythonPkgs = ps: builtins.concatLists (map (f: f ps) pythonPackageLists);
pythonEnv = python3.withPackages pythonPkgs;
otherPackageLists = [
@@ -172,7 +172,7 @@ stdenv.mkDerivation (finalAttrs: {
{
backendPath = (
lib.concatStringsSep " " (
builtins.map (x: ''"-B${x}"'') (
map (x: ''"-B${x}"'') (
[
# Paths necessary so the JIT compiler finds its libraries:
"${lib.getLib libgccjit}/lib"
@@ -59,7 +59,7 @@ in
plugins-for =
with lib.asserts;
ide:
builtins.map (plugin: plugin.name) (
map (plugin: plugin.name) (
builtins.filter (
plugin:
(
@@ -185,7 +185,7 @@ let
mkRepoEntry = entry: {
name = ".m2/repository/" + entry.path;
path = fetchurl {
urls = builtins.map (url: "${url}/${entry.url}") repositories;
urls = map (url: "${url}/${entry.url}") repositories;
sha256 = entry.hash;
};
};
@@ -18,7 +18,7 @@ rec {
{
extraClasspaths ? [ ],
}:
(builtins.map (dep: if builtins.hasAttr "jar" dep.path then dep.path.jar else dep.path) packages)
(map (dep: if builtins.hasAttr "jar" dep.path then dep.path.jar else dep.path) packages)
++ extraClasspaths;
makeClasspaths =
{
@@ -18,7 +18,7 @@ rec {
...
}:
stdenv.mkDerivation (
(builtins.removeAttrs attrs [
(removeAttrs attrs [
"namePrefix"
"path"
])
+1 -1
View File
@@ -230,7 +230,7 @@ let
nvimGrammars = lib.mapAttrsToList (
name: value:
value.origGrammar
or (builtins.throw "additions to `pkgs.vimPlugins.nvim-treesitter.grammarPlugins` set should be passed through `pkgs.neovimUtils.grammarToPlugin` first")
or (throw "additions to `pkgs.vimPlugins.nvim-treesitter.grammarPlugins` set should be passed through `pkgs.neovimUtils.grammarToPlugin` first")
) vimPlugins.nvim-treesitter.grammarPlugins;
isNvimGrammar = x: builtins.elem x nvimGrammars;
@@ -42,7 +42,7 @@ let
];
downloadUrl = "https://download.sublimetext.com/sublime_text_3_build_${buildVersion}_${arch}.tar.bz2";
versionUrl = "https://download.sublimetext.com/latest/${if dev then "dev" else "stable"}";
versionFile = builtins.toString ./packages.nix;
versionFile = toString ./packages.nix;
archSha256 = if stdenv.hostPlatform.system == "i686-linux" then x32sha256 else x64sha256;
arch = if stdenv.hostPlatform.system == "i686-linux" then "x32" else "x64";
@@ -46,7 +46,7 @@ let
downloadUrl =
arch: "https://download.sublimetext.com/sublime_text_build_${buildVersion}_${arch}.tar.xz";
versionUrl = "https://download.sublimetext.com/latest/${if dev then "dev" else "stable"}";
versionFile = builtins.toString ./packages.nix;
versionFile = toString ./packages.nix;
neededLibraries = [
xorg.libX11
@@ -111,7 +111,7 @@ in
tree-sitter-queries-are-present-for-custom-grammars =
let
pluginsToCheck =
builtins.map (grammar: grammarToPlugin grammar)
map (grammar: grammarToPlugin grammar)
# true is here because there is `recurseForDerivations = true`
(lib.remove true (lib.attrValues tree-sitter-grammars));
in
@@ -202,7 +202,7 @@ let
startWithDeps = findDependenciesRecursively start;
allPlugins = lib.unique (startWithDeps ++ depsOfOptionalPlugins);
allPython3Dependencies =
ps: lib.flatten (builtins.map (plugin: (plugin.python3Dependencies or (_: [ ])) ps) allPlugins);
ps: lib.flatten (map (plugin: (plugin.python3Dependencies or (_: [ ])) ps) allPlugins);
python3Env = python3.withPackages allPython3Dependencies;
packdirStart = vimFarm "pack/${packageName}/start" "packdir-start" allPlugins;
@@ -8,8 +8,8 @@ vscode-utils.buildVscodeMarketplaceExtension {
mktplcRef = {
name = "basedpyright";
publisher = "detachhead";
version = "1.31.4";
hash = "sha256-KpX268CYGHtBJdDVMzjn5vLYupplikgAHvi5i+FhbHo=";
version = "1.31.6";
hash = "sha256-kYy3rpDhyE8n0aBRE8tUYz9Ayvh0kzEDmHLclF9pBcc=";
};
meta = {
changelog = "https://github.com/detachhead/basedpyright/releases";
@@ -24,7 +24,7 @@ let
)'';
createEmptySettingsCmd = ''mkdir -p .vscode && echo "{}" > ${vscodeSettingsFile}'';
fileName = builtins.baseNameOf vscodeSettingsFile;
fileName = baseNameOf vscodeSettingsFile;
symlinkFromUserSettingCmd = lib.optionalString symlinkFromUserSetting ''&& mkdir -p "${userSettingsFolder}" && ln -sfv "$(pwd)/${vscodeSettingsFile}" "${userSettingsFolder}/" '';
in
@@ -127,7 +127,7 @@ let
extensionFromVscodeMarketplace = mktplcExtRefToExtDrv;
extensionsFromVscodeMarketplace =
mktplcExtRefList: builtins.map extensionFromVscodeMarketplace mktplcExtRefList;
mktplcExtRefList: map extensionFromVscodeMarketplace mktplcExtRefList;
vscodeWithConfiguration = import ./vscodeWithConfiguration.nix {
inherit lib extensionsFromVscodeMarketplace writeShellScriptBin;
@@ -5,13 +5,13 @@
}:
mkLibretroCore {
core = "mame2003-plus";
version = "0-unstable-2025-09-20";
version = "0-unstable-2025-09-30";
src = fetchFromGitHub {
owner = "libretro";
repo = "mame2003-plus-libretro";
rev = "a4239124d4da03ae4658610832e425febb0db134";
hash = "sha256-TPYYFfAGJqlKpfLS1qDpzQXIfSXXFjRj1W/3+FTYMRQ=";
rev = "59b8a9fb06a47a3ce6aecd09b07f3f001e3d9b08";
hash = "sha256-hfC/6UqUSDd2FWpcCVcw4pkAtyHJGCgvG4UKlkM+fpk=";
};
makefile = "Makefile";
@@ -1,44 +0,0 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
gtk2,
imlib2,
file,
lcms2,
libexif,
}:
stdenv.mkDerivation (rec {
version = "2.3.3";
pname = "qiv";
src = fetchurl {
url = "https://spiegl.de/qiv/download/${pname}-${version}.tgz";
sha256 = "sha256-7whf/eLUiwWzZlk55a4eNZ06OBAI+4J2hPfW/UxTNwQ=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
gtk2
imlib2
file
lcms2
libexif
];
preBuild = ''
substituteInPlace Makefile --replace /usr/local "$out"
substituteInPlace Makefile --replace /man/ /share/man/
substituteInPlace Makefile --replace /share/share/ /share/
'';
meta = with lib; {
description = "Quick image viewer";
homepage = "http://spiegl.de/qiv/";
license = licenses.gpl2;
platforms = platforms.linux;
mainProgram = "qiv";
};
})
@@ -169,7 +169,7 @@ stdenv.mkDerivation (finalAttrs: {
rmdir $out/share/sane/epjitsu
ln -svT ${scanSnapDriversPackage} $out/share/sane/epjitsu
''
+ lib.concatStrings (builtins.map installFirmware compatFirmware);
+ lib.concatStrings (map installFirmware compatFirmware);
# parallel install creates a bad symlink at $out/lib/sane/libsane.so.1 which prevents finding plugins
# https://github.com/NixOS/nixpkgs/issues/224569
+1 -1
View File
@@ -26,7 +26,7 @@ let
# TODO: Should we move this to `lib`? Seems like its would be useful in many cases.
extensionOf =
filePath: lib.concatStringsSep "." (lib.tail (lib.splitString "." (builtins.baseNameOf filePath)));
filePath: lib.concatStringsSep "." (lib.tail (lib.splitString "." (baseNameOf filePath)));
installIcons =
iconName: icons:
@@ -256,7 +256,7 @@ let
''
else
''
mkdir -p ${builtins.dirOf path}
mkdir -p ${dirOf path}
cp -r ${dep}/. ${path}
''
)
File diff suppressed because it is too large Load Diff
@@ -9,10 +9,10 @@
buildMozillaMach rec {
pname = "firefox";
version = "143.0.3";
version = "143.0.4";
src = fetchurl {
url = "mirror://mozilla/firefox/releases/${version}/source/firefox-${version}.source.tar.xz";
sha512 = "c092bd3aac79f856a804c908b76d40409ce052b00176269ea3029b5a3a6885d4d21ce26bd76c9ea13827ff75459b6b4b0566f5aa49035ac234ae5890c67845b0";
sha512 = "2bcbde4e72ea41e9ccc98836901635350b5dc7b50c618e19ab6103a27adc0f017ca3fa7555378c8af6ee1f3a14d02935289fe2b0d35d840d610f5ac07a88e4b6";
};
meta = {
@@ -76,7 +76,7 @@ let
# PCSC-Lite daemon (services.pcscd) also must be enabled for firefox to access smartcards
smartcardSupport = cfg.smartcardSupport or false;
allNativeMessagingHosts = builtins.map lib.getBin nativeMessagingHosts;
allNativeMessagingHosts = map lib.getBin nativeMessagingHosts;
libs =
lib.optionals stdenv.hostPlatform.isLinux (
@@ -130,7 +130,7 @@ let
usesNixExtensions = nixExtensions != null;
nameArray = builtins.map (a: a.name) (lib.optionals usesNixExtensions nixExtensions);
nameArray = map (a: a.name) (lib.optionals usesNixExtensions nixExtensions);
# Check that every extension has a unique .name attribute
# and an extid attribute
@@ -140,7 +140,7 @@ let
else if browser.requireSigning || !browser.allowAddonSideload then
throw "Nix addons are only supported with signature enforcement disabled and addon sideloading enabled (eg. LibreWolf)"
else
builtins.map (
map (
a:
if !(builtins.hasAttr "extid" a) then
throw "nixExtensions has an invalid entry. Missing extid attribute. Please use fetchFirefoxAddon"
@@ -516,7 +516,7 @@ let
rm -f "$POL_PATH"
cat ${policiesJson} >> "$POL_PATH"
extraPoliciesFiles=(${builtins.toString extraPoliciesFiles})
extraPoliciesFiles=(${toString extraPoliciesFiles})
for extraPoliciesFile in "''${extraPoliciesFiles[@]}"; do
jq -s '.[0] * .[1]' $extraPoliciesFile "$POL_PATH" > .tmp.json
mv .tmp.json "$POL_PATH"
@@ -533,7 +533,7 @@ let
${mozillaCfg}
EOF
extraPrefsFiles=(${builtins.toString extraPrefsFiles})
extraPrefsFiles=(${toString extraPrefsFiles})
for extraPrefsFile in "''${extraPrefsFiles[@]}"; do
cat "$extraPrefsFile" >> "$libDir/mozilla.cfg"
done
@@ -129,11 +129,11 @@ let
# bundled into the k3s binary
traefik = {
chart = fetchurl chartVersions.traefik;
name = builtins.baseNameOf chartVersions.traefik.url;
name = baseNameOf chartVersions.traefik.url;
};
traefik-crd = {
chart = fetchurl chartVersions.traefik-crd;
name = builtins.baseNameOf chartVersions.traefik-crd.url;
name = baseNameOf chartVersions.traefik-crd.url;
};
# a shortcut that provides the images archive for the host platform. Currently only supports
@@ -9,7 +9,7 @@ let
# let k3s_1_23 = (callPackage ./path/to/k3s {
# commonK3sArg = ....
# }).k3s_1_23;
extraArgs = builtins.removeAttrs args [ "callPackage" ];
extraArgs = removeAttrs args [ "callPackage" ];
in
{
k3s_1_31 = common (
@@ -14,7 +14,7 @@ let
...
}@attrs:
let
attrs' = builtins.removeAttrs attrs [
attrs' = removeAttrs attrs [
"version"
"sha256"
"rev"
@@ -18,7 +18,7 @@ let
...
}@attrs:
let
attrs' = builtins.removeAttrs attrs [
attrs' = removeAttrs attrs [
"buildGoModule"
"version"
"hash"
@@ -2,7 +2,7 @@
let
common = opts: callPackage (import ./builder.nix lib opts);
extraArgs = builtins.removeAttrs args [ "callPackage" ];
extraArgs = removeAttrs args [ "callPackage" ];
in
rec {
rke2_1_30 = common (
@@ -940,11 +940,11 @@
"vendorHash": "sha256-LRIfxQGwG988HE5fftGl6JmBG7tTknvmgpm4Fu1NbWI="
},
"oci": {
"hash": "sha256-xj7B4LQZalLA/APIe70JHmqPljRVDbDXfAUb3K2AtFg=",
"hash": "sha256-fEvo5R7HutlOmZ6DMvYKQiE0amwk/YPi1T2a55w70hQ=",
"homepage": "https://registry.terraform.io/providers/oracle/oci",
"owner": "oracle",
"repo": "terraform-provider-oci",
"rev": "v7.19.0",
"rev": "v7.21.0",
"spdx": "MPL-2.0",
"vendorHash": null
},
@@ -21,7 +21,7 @@ let
...
}@attrs:
let
attrs' = builtins.removeAttrs attrs [
attrs' = removeAttrs attrs [
"version"
"hash"
"vendorHash"
@@ -40,7 +40,7 @@
...
}@args:
let
cleanedArgs = builtins.removeAttrs args [
cleanedArgs = removeAttrs args [
"pname"
"name"
"version"
@@ -19,7 +19,7 @@ let
{
# Do not include PHP by default, because it bloats the closure, doesn't
# build on Darwin, and there are no official PHP scripts.
plugins = builtins.attrValues (builtins.removeAttrs availablePlugins [ "php" ]);
plugins = builtins.attrValues (removeAttrs availablePlugins [ "php" ]);
},
}:
@@ -122,7 +122,7 @@ let
ln -sf ${weechat}/share $out/share
'')
];
meta = builtins.removeAttrs weechat.meta [ "outputsToInstall" ];
meta = removeAttrs weechat.meta [ "outputsToInstall" ];
};
in
@@ -95,7 +95,7 @@ python3Packages.buildPythonApplication rec {
# Actually install plugins
postInstall = ''
for plug in ${builtins.toString userPlugins}; do
for plug in ${toString userPlugins}; do
lndir $plug/${python3Packages.python.sitePackages} $out/${python3Packages.python.sitePackages}
done
'';
@@ -7,5 +7,5 @@ callPackage ../../browsers/firefox/update.nix (
{
baseUrl = "https://archive.mozilla.org/pub/thunderbird/releases/";
}
// (builtins.removeAttrs args [ "callPackage" ])
// (removeAttrs args [ "callPackage" ])
)
@@ -67,8 +67,10 @@ let
tests = {
inherit (nixosTests)
syncthing
syncthing-folders
syncthing-guiPassword
syncthing-guiPasswordFile
syncthing-init
syncthing-many-devices
syncthing-no-settings
syncthing-relay
;
@@ -57,8 +57,8 @@ stdenvNoCC.mkDerivation {
passthru.updateScript =
let
defaultNixFile = builtins.toString ./default.nix;
updateNix = builtins.toString ./update.nix;
defaultNixFile = toString ./default.nix;
updateNix = toString ./update.nix;
aarch64Url = dist."aarch64-darwin".url;
x86_64Url = dist."x86_64-darwin".url;
in
@@ -67,13 +67,11 @@ let
"--prefix"
"QT_PLUGIN_PATH"
":"
"${lib.makeSearchPath unwrapped.qtbase.qtPluginPrefix (
builtins.map lib.getBin unwrapped.qtPackages
)}"
"${lib.makeSearchPath unwrapped.qtbase.qtPluginPrefix (map lib.getBin unwrapped.qtPackages)}"
"--prefix"
"QML2_IMPORT_PATH"
":"
"${lib.makeSearchPath unwrapped.qtbase.qtQmlPrefix (builtins.map lib.getBin unwrapped.qmlPackages)}"
"${lib.makeSearchPath unwrapped.qtbase.qtQmlPrefix (map lib.getBin unwrapped.qmlPackages)}"
]
++ [
# Add dictionaries from all NIX_PROFILES
+4 -4
View File
@@ -67,7 +67,7 @@ let
(unwrapped.python.pkgs.toPythonModule unwrapped.passthru.uhd)
]
# Add the extraPackages as python modules as well
++ (builtins.map unwrapped.python.pkgs.toPythonModule extraPackages)
++ (map unwrapped.python.pkgs.toPythonModule extraPackages)
++ lib.flatten (
lib.mapAttrsToList (
feat: info:
@@ -167,7 +167,7 @@ let
"QT_PLUGIN_PATH"
":"
"${lib.makeSearchPath unwrapped.qt.qtbase.qtPluginPrefix (
builtins.map lib.getBin (
map lib.getBin (
[
unwrapped.qt.qtbase
]
@@ -180,7 +180,7 @@ let
"QML2_IMPORT_PATH"
":"
"${lib.makeSearchPath unwrapped.qt.qtbase.qtQmlPrefix (
builtins.map lib.getBin (
map lib.getBin (
[
unwrapped.qt.qtbase
]
@@ -225,7 +225,7 @@ let
lndir -silent ${unwrapped}
${lib.optionalString (extraPackages != [ ]) (
builtins.concatStringsSep "\n" (
builtins.map (pkg: ''
map (pkg: ''
if [[ -d ${lib.getBin pkg}/bin/ ]]; then
lndir -silent ${pkg}/bin ./bin
fi
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
--replace "qe_git_submodule_update(external/d3q)" "" \
--replace "qe_git_submodule_update(external/qe-gipaw)" ""
${builtins.toString (
${toString (
builtins.attrValues (
builtins.mapAttrs (name: val: ''
cp -r ${val}/* external/${name}/.
@@ -62,7 +62,7 @@ stdenv.mkDerivation {
almost every other maxent package out there.
'';
homepage = "http://www.umiacs.umd.edu/~hal/megam";
license = "non-commercial";
license = lib.licenses.unfree;
maintainers = with maintainers; [ leixb ];
platforms = platforms.unix;
};
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
meta = with lib; {
description = "urxvt plugin that allows to switch color themes during runtime";
homepage = "https://github.com/felixr/urxvt-theme-switch";
license = "CCBYNC";
license = lib.licenses.cc-by-nc-30;
maintainers = [ ];
platforms = platforms.unix;
};
@@ -45,7 +45,7 @@ let
downloadUrl =
arch: "https://download.sublimetext.com/sublime_merge_build_${buildVersion}_${arch}.tar.xz";
versionUrl = "https://www.sublimemerge.com/${if dev then "dev" else "download"}";
versionFile = builtins.toString ./default.nix;
versionFile = toString ./default.nix;
neededLibraries = [
xorg.libX11
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
package: "--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : ${lib.getLib package}/lib/gstreamer-1.0";
in
with gst_all_1;
builtins.map gstreamerHook [
map gstreamerHook [
gstreamer
gst-plugins-base
gst-plugins-bad
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
package: "--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : ${lib.getLib package}/lib/gstreamer-1.0";
in
with gst_all_1;
builtins.map gstreamerHook [
map gstreamerHook [
gstreamer
gst-plugins-base
gst-plugins-bad
@@ -33,7 +33,7 @@ runCommand cri-o-unwrapped.name
preferLocalBuild = true;
meta = builtins.removeAttrs cri-o-unwrapped.meta [ "outputsToInstall" ];
meta = removeAttrs cri-o-unwrapped.meta [ "outputsToInstall" ];
outputs = [
"out"
@@ -481,7 +481,7 @@ stdenvNoCC.mkDerivation {
libc_dev
libc_lib
;
default_hardening_flags_str = builtins.toString defaultHardeningFlags;
default_hardening_flags_str = toString defaultHardeningFlags;
}
// lib.mapAttrs (_: lib.optionalString targetPlatform.isDarwin) {
# These will become empty strings when not targeting Darwin.
+1 -1
View File
@@ -79,7 +79,7 @@ lib.makeOverridable (
[ drv ]
)
# Add any extra outputs specified by the caller of `buildEnv`.
++ lib.filter (p: p != null) (builtins.map (outName: drv.${outName} or null) extraOutputsToInstall);
++ lib.filter (p: p != null) (map (outName: drv.${outName} or null) extraOutputsToInstall);
priority = drv.meta.priority or lib.meta.defaultPriority;
}) paths;
+1 -1
View File
@@ -980,7 +980,7 @@ stdenvNoCC.mkDerivation {
inherit suffixSalt coreutils_bin bintools;
inherit libc_bin libc_dev libc_lib;
inherit darwinPlatformForCC;
default_hardening_flags_str = builtins.toString defaultHardeningFlags;
default_hardening_flags_str = toString defaultHardeningFlags;
inherit useMacroPrefixMap;
}
// lib.mapAttrs (_: lib.optionalString targetPlatform.isDarwin) {
+1 -1
View File
@@ -66,7 +66,7 @@ let
in
lib.assertMsg (
matches == 1
) "compressor ${ext} needs to have exactly one '{}', found ${builtins.toString matches}";
) "compressor ${ext} needs to have exactly one '{}', found ${toString matches}";
mkCmd =
ext: prog:
assert validProg ext prog;
@@ -68,7 +68,7 @@ let
{
ext = "tar.gz";
fmt = "tarball";
fetchfun = builtins.fetchTarball;
fetchfun = fetchTarball;
};
in
with kind;
@@ -130,7 +130,7 @@ let
baseDerivation = stdenv.mkDerivation (
finalAttrs:
(builtins.removeAttrs args [
(removeAttrs args [
"gitHashes"
"sdkSourceBuilders"
"pubspecLock"
+4 -4
View File
@@ -582,7 +582,7 @@ rec {
...
}@args:
let
stream = streamLayeredImage (builtins.removeAttrs args [ "compressor" ]);
stream = streamLayeredImage (removeAttrs args [ "compressor" ]);
compress = compressorForImage compressor name;
in
runCommand "${baseNameOf name}.tar${compress.ext}" {
@@ -1043,8 +1043,8 @@ rec {
);
contentsList = if builtins.isList contents then contents else [ contents ];
bind-paths = builtins.toString (
builtins.map (path: "--bind=${path}:${path}!") [
bind-paths = toString (
map (path: "--bind=${path}:${path}!") [
"/dev/"
"/proc/"
"/sys/"
@@ -1413,7 +1413,7 @@ rec {
...
}@args:
let
stream = streamNixShellImage (builtins.removeAttrs args [ "compressor" ]);
stream = streamNixShellImage (removeAttrs args [ "compressor" ]);
compress = compressorForImage compressor drv.name;
in
runCommand "${drv.name}-env.tar${compress.ext}" {
+1 -1
View File
@@ -699,7 +699,7 @@ rec {
" --program-prefix=layeredImageWithFakeRootCommands-"
];
doCheck = false;
versionCheckProgram = "${builtins.placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
meta = prevAttrs.meta // {
mainProgram = "layeredImageWithFakeRootCommands-hello";
};
@@ -49,7 +49,7 @@ let
assert (lib.isPath nugetDeps);
callPackage nugetDeps { fetchNuGet = fetchNupkg; }
else
builtins.map fetchNupkg (lib.importJSON nugetDeps);
map fetchNupkg (lib.importJSON nugetDeps);
finalPackage = finalAttrs.finalPackage;
@@ -122,4 +122,4 @@ let
'';
};
in
stdenv.mkDerivation (attrs // (builtins.removeAttrs attrsOrig [ "nativeBuildInputs" ]))
stdenv.mkDerivation (attrs // (removeAttrs attrsOrig [ "nativeBuildInputs" ]))
@@ -21,7 +21,7 @@ lib.makeOverridable (
assert (lib.isPath sourceFile);
import sourceFile
else
{ fetchNuGet }: builtins.map fetchNuGet (lib.importJSON sourceFile);
{ fetchNuGet }: map fetchNuGet (lib.importJSON sourceFile);
in
loadDeps {
fetchNuGet = args: fetchNupkg (args // { inherit installable; });
+2 -2
View File
@@ -29,10 +29,10 @@ assert null == lib.findFirst (c: "/" == c) null (lib.stringToCharacters imageNam
let
# Abuse paths to collapse possible double slashes
repoTag0 = builtins.toString (/. + "/${stripScheme registry}/${repository}/${imageName}");
repoTag0 = toString (/. + "/${stripScheme registry}/${repository}/${imageName}");
repoTag1 = lib.removePrefix "/" repoTag0;
layers = builtins.map stripNixStore imageLayers;
layers = map stripNixStore imageLayers;
manifest = writeText "manifest.json" (
builtins.toJSON [
@@ -66,7 +66,7 @@ let
else
map mkJarUrl repos;
jar = fetchurl (
builtins.removeAttrs args [
removeAttrs args [
"groupId"
"artifactId"
"version"
+3 -3
View File
@@ -88,8 +88,8 @@ lib.throwIfNot (excludes == [ ] || includes == [ ])
filterdiff \
-p1 \
${builtins.toString (builtins.map (x: "-x ${lib.escapeShellArg x}") excludes)} \
${builtins.toString (builtins.map (x: "-i ${lib.escapeShellArg x}") includes)} \
${toString (map (x: "-x ${lib.escapeShellArg x}") excludes)} \
${toString (map (x: "-i ${lib.escapeShellArg x}") includes)} \
"$tmpfile" > "$out"
if [ ! -s "$out" ]; then
@@ -106,7 +106,7 @@ lib.throwIfNot (excludes == [ ] || includes == [ ])
''
+ postFetch;
}
// builtins.removeAttrs args [
// removeAttrs args [
"relative"
"stripLen"
"decode"
+2 -2
View File
@@ -43,7 +43,7 @@ let
);
in
compute (builtins.removeAttrs attrs [ "format" ]);
compute (removeAttrs attrs [ "format" ]);
in
makeOverridable (
@@ -55,7 +55,7 @@ makeOverridable (
}@attrs:
let
url = computeUrl (
builtins.removeAttrs attrs [
removeAttrs attrs [
"sha256"
"hash"
]
+1 -1
View File
@@ -6,7 +6,7 @@
lib.fetchers.withNormalizedHash { } (
{
s3url,
name ? builtins.baseNameOf s3url,
name ? baseNameOf s3url,
outputHash,
outputHashAlgo,
region ? "us-east-1",
+2 -2
View File
@@ -45,7 +45,7 @@
}@args:
let
sandboxPathsTests = builtins.map (path: "[[ ! -e '${path}' ]]") sandboxPaths;
sandboxPathsTests = map (path: "[[ ! -e '${path}' ]]") sandboxPaths;
sandboxPathsTest = lib.concatStringsSep " || " sandboxPathsTests;
sandboxPathsList = lib.concatStringsSep " " sandboxPaths;
@@ -71,7 +71,7 @@ let
passthru.runScript = runScript;
}
(
builtins.removeAttrs args [
removeAttrs args [
"lib"
"stdenv"
"writeShellScript"
+1 -1
View File
@@ -29,7 +29,7 @@ let
# this leaves actual dependencies of the derivations in `inputsFrom`, but never the derivations themselves
(lib.subtractLists inputsFrom (lib.flatten (lib.catAttrs name inputsFrom)));
rest = builtins.removeAttrs attrs [
rest = removeAttrs attrs [
"name"
"packages"
"inputsFrom"

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