Merge staging-next into staging

This commit is contained in:
github-actions[bot] 2022-07-22 12:02:21 +00:00 committed by GitHub
commit dec2508b80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 143 additions and 65 deletions

View File

@ -55,6 +55,7 @@ let
concatMapStringsSep concatMapStringsSep
concatStringsSep concatStringsSep
escapeNixString escapeNixString
hasInfix
isCoercibleToString isCoercibleToString
; ;
inherit (lib.trivial) inherit (lib.trivial)
@ -360,6 +361,11 @@ rec {
deprecationMessage = "See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types."; deprecationMessage = "See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.";
}; };
passwdEntry = entryType: addCheck entryType (str: !(hasInfix ":" str || hasInfix "\n" str)) // {
name = "passwdEntry ${entryType.name}";
description = "${entryType.description}, not containing newlines or colons";
};
attrs = mkOptionType { attrs = mkOptionType {
name = "attrs"; name = "attrs";
description = "attribute set"; description = "attribute set";

View File

@ -6,12 +6,6 @@ let
ids = config.ids; ids = config.ids;
cfg = config.users; cfg = config.users;
isPasswdCompatible = str: !(hasInfix ":" str || hasInfix "\n" str);
passwdEntry = type: lib.types.addCheck type isPasswdCompatible // {
name = "passwdEntry ${type.name}";
description = "${type.description}, not containing newlines or colons";
};
# Check whether a password hash will allow login. # Check whether a password hash will allow login.
allowsLogin = hash: allowsLogin = hash:
hash == "" # login without password hash == "" # login without password
@ -60,7 +54,7 @@ let
options = { options = {
name = mkOption { name = mkOption {
type = passwdEntry types.str; type = types.passwdEntry types.str;
apply = x: assert (builtins.stringLength x < 32 || abort "Username '${x}' is longer than 31 characters which is not allowed!"); x; apply = x: assert (builtins.stringLength x < 32 || abort "Username '${x}' is longer than 31 characters which is not allowed!"); x;
description = '' description = ''
The name of the user account. If undefined, the name of the The name of the user account. If undefined, the name of the
@ -69,7 +63,7 @@ let
}; };
description = mkOption { description = mkOption {
type = passwdEntry types.str; type = types.passwdEntry types.str;
default = ""; default = "";
example = "Alice Q. User"; example = "Alice Q. User";
description = '' description = ''
@ -134,7 +128,7 @@ let
}; };
home = mkOption { home = mkOption {
type = passwdEntry types.path; type = types.passwdEntry types.path;
default = "/var/empty"; default = "/var/empty";
description = "The user's home directory."; description = "The user's home directory.";
}; };
@ -169,7 +163,7 @@ let
}; };
shell = mkOption { shell = mkOption {
type = types.nullOr (types.either types.shellPackage (passwdEntry types.path)); type = types.nullOr (types.either types.shellPackage (types.passwdEntry types.path));
default = pkgs.shadow; default = pkgs.shadow;
defaultText = literalExpression "pkgs.shadow"; defaultText = literalExpression "pkgs.shadow";
example = literalExpression "pkgs.bashInteractive"; example = literalExpression "pkgs.bashInteractive";
@ -349,7 +343,7 @@ let
options = { options = {
name = mkOption { name = mkOption {
type = passwdEntry types.str; type = types.passwdEntry types.str;
description = '' description = ''
The name of the group. If undefined, the name of the attribute set The name of the group. If undefined, the name of the attribute set
will be used. will be used.

View File

@ -44,7 +44,13 @@ let
transport_file_type: hash transport_file_type: hash
''; '';
mailmanCfg = lib.generators.toINI {} cfg.settings; mailmanCfg = lib.generators.toINI {}
(recursiveUpdate cfg.settings
((optionalAttrs (cfg.restApiPassFile != null) {
webservice.admin_pass = "#NIXOS_MAILMAN_REST_API_PASS_SECRET#";
})));
mailmanCfgFile = pkgs.writeText "mailman-raw.cfg" mailmanCfg;
mailmanHyperkittyCfg = pkgs.writeText "mailman-hyperkitty.cfg" '' mailmanHyperkittyCfg = pkgs.writeText "mailman-hyperkitty.cfg" ''
[general] [general]
@ -247,6 +253,14 @@ in {
''; '';
}; };
restApiPassFile = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
Path to the file containing the value for <literal>MAILMAN_REST_API_PASS</literal>.
'';
};
serve = { serve = {
enable = mkEnableOption "Automatic nginx and uwsgi setup for mailman-web"; enable = mkEnableOption "Automatic nginx and uwsgi setup for mailman-web";
}; };
@ -363,8 +377,6 @@ in {
}; };
users.groups.mailman = {}; users.groups.mailman = {};
environment.etc."mailman.cfg".text = mailmanCfg;
environment.etc."mailman3/settings.py".text = '' environment.etc."mailman3/settings.py".text = ''
import os import os
@ -383,6 +395,11 @@ in {
with open('/var/lib/mailman-web/settings_local.json') as f: with open('/var/lib/mailman-web/settings_local.json') as f:
globals().update(json.load(f)) globals().update(json.load(f))
${optionalString (cfg.restApiPassFile != null) ''
with open('${cfg.restApiPassFile}') as f:
MAILMAN_REST_API_PASS = f.read().rstrip('\n')
''}
${optionalString (cfg.ldap.enable) '' ${optionalString (cfg.ldap.enable) ''
import ldap import ldap
from django_auth_ldap.config import LDAPSearch, ${cfg.ldap.groupSearch.type} from django_auth_ldap.config import LDAPSearch, ${cfg.ldap.groupSearch.type}
@ -456,7 +473,7 @@ in {
after = [ "network.target" ] after = [ "network.target" ]
++ lib.optional cfg.enablePostfix "postfix-setup.service" ++ lib.optional cfg.enablePostfix "postfix-setup.service"
++ lib.optional withPostgresql "postgresql.service"; ++ lib.optional withPostgresql "postgresql.service";
restartTriggers = [ config.environment.etc."mailman.cfg".source ]; restartTriggers = [ mailmanCfgFile ];
requires = optional withPostgresql "postgresql.service"; requires = optional withPostgresql "postgresql.service";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
@ -480,6 +497,14 @@ in {
requires = optional withPostgresql "postgresql.service"; requires = optional withPostgresql "postgresql.service";
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script = '' script = ''
install -m0750 -o mailman -g mailman ${mailmanCfgFile} /etc/mailman.cfg
${optionalString (cfg.restApiPassFile != null) ''
${pkgs.replace-secret}/bin/replace-secret \
'#NIXOS_MAILMAN_REST_API_PASS_SECRET#' \
${cfg.restApiPassFile} \
/etc/mailman.cfg
''}
mailmanDir=/var/lib/mailman mailmanDir=/var/lib/mailman
mailmanWebDir=/var/lib/mailman-web mailmanWebDir=/var/lib/mailman-web
@ -560,7 +585,7 @@ in {
mailman-daily = { mailman-daily = {
description = "Trigger daily Mailman events"; description = "Trigger daily Mailman events";
startAt = "daily"; startAt = "daily";
restartTriggers = [ config.environment.etc."mailman.cfg".source ]; restartTriggers = [ mailmanCfgFile ];
serviceConfig = { serviceConfig = {
ExecStart = "${mailmanEnv}/bin/mailman digests --send"; ExecStart = "${mailmanEnv}/bin/mailman digests --send";
User = "mailman"; User = "mailman";

View File

@ -8,21 +8,22 @@ let
pkg = cfg.package.override (optionalAttrs cfg.sso.enable { pkg = cfg.package.override (optionalAttrs cfg.sso.enable {
enableSSO = cfg.sso.enable; enableSSO = cfg.sso.enable;
crowdProperties = ''
application.name ${cfg.sso.applicationName}
application.password ${cfg.sso.applicationPassword}
application.login.url ${cfg.sso.crowd}/console/
crowd.server.url ${cfg.sso.crowd}/services/
crowd.base.url ${cfg.sso.crowd}/
session.isauthenticated session.isauthenticated
session.tokenkey session.tokenkey
session.validationinterval ${toString cfg.sso.validationInterval}
session.lastvalidation session.lastvalidation
'';
}); });
crowdProperties = pkgs.writeText "crowd.properties" ''
application.name ${cfg.sso.applicationName}
application.password ${if cfg.sso.applicationPassword != null then cfg.sso.applicationPassword else "@NIXOS_CONFLUENCE_CROWD_SSO_PWD@"}
application.login.url ${cfg.sso.crowd}/console/
crowd.server.url ${cfg.sso.crowd}/services/
crowd.base.url ${cfg.sso.crowd}/
session.isauthenticated session.isauthenticated
session.tokenkey session.tokenkey
session.validationinterval ${toString cfg.sso.validationInterval}
session.lastvalidation session.lastvalidation
'';
in in
{ {
@ -107,10 +108,17 @@ in
}; };
applicationPassword = mkOption { applicationPassword = mkOption {
type = types.str; type = types.nullOr types.str;
default = null;
description = "Application password of this Confluence instance in Crowd"; description = "Application password of this Confluence instance in Crowd";
}; };
applicationPasswordFile = mkOption {
type = types.nullOr types.str;
default = null;
description = "Path to the application password for Crowd of Confluence.";
};
validationInterval = mkOption { validationInterval = mkOption {
type = types.int; type = types.int;
default = 2; default = 2;
@ -147,6 +155,16 @@ in
group = cfg.group; group = cfg.group;
}; };
assertions = [
{ assertion = cfg.sso.enable -> ((cfg.sso.applicationPassword == null) != (cfg.sso.applicationPasswordFile));
message = "Please set either applicationPassword or applicationPasswordFile";
}
];
warnings = mkIf (cfg.sso.enable && cfg.sso.applicationPassword != null) [
"Using `services.confluence.sso.applicationPassword` is deprecated! Use `applicationPasswordFile` instead!"
];
users.groups.${cfg.group} = {}; users.groups.${cfg.group} = {};
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
@ -173,6 +191,7 @@ in
CONF_USER = cfg.user; CONF_USER = cfg.user;
JAVA_HOME = "${cfg.jrePackage}"; JAVA_HOME = "${cfg.jrePackage}";
CATALINA_OPTS = concatStringsSep " " cfg.catalinaOptions; CATALINA_OPTS = concatStringsSep " " cfg.catalinaOptions;
JAVA_OPTS = mkIf cfg.sso.enable "-Dcrowd.properties=${cfg.home}/crowd.properties";
}; };
preStart = '' preStart = ''
@ -183,6 +202,16 @@ in
-e 's,protocol="org.apache.coyote.http11.Http11NioProtocol",protocol="org.apache.coyote.http11.Http11NioProtocol" proxyName="${cfg.proxy.name}" proxyPort="${toString cfg.proxy.port}" scheme="${cfg.proxy.scheme}",' \ -e 's,protocol="org.apache.coyote.http11.Http11NioProtocol",protocol="org.apache.coyote.http11.Http11NioProtocol" proxyName="${cfg.proxy.name}" proxyPort="${toString cfg.proxy.port}" scheme="${cfg.proxy.scheme}",' \
'') + '' '') + ''
${pkg}/conf/server.xml.dist > ${cfg.home}/server.xml ${pkg}/conf/server.xml.dist > ${cfg.home}/server.xml
${optionalString cfg.sso.enable ''
install -m660 ${crowdProperties} ${cfg.home}/crowd.properties
${optionalString (cfg.sso.applicationPasswordFile != null) ''
${pkgs.replace-secret}/bin/replace-secret \
'@NIXOS_CONFLUENCE_CROWD_SSO_PWD@' \
${cfg.sso.applicationPasswordFile} \
${cfg.home}/crowd.properties
''}
''}
''; '';
serviceConfig = { serviceConfig = {

View File

@ -192,7 +192,7 @@ in {
}; };
emergencyAccess = mkOption { emergencyAccess = mkOption {
type = with types; oneOf [ bool singleLineStr ]; type = with types; oneOf [ bool (nullOr (passwdEntry str)) ];
visible = false; visible = false;
description = '' description = ''
Set to true for unauthenticated emergency access, and false for Set to true for unauthenticated emergency access, and false for

View File

@ -5,16 +5,16 @@
buildGoModule rec { buildGoModule rec {
pname = "lightning-loop"; pname = "lightning-loop";
version = "0.19.1-beta"; version = "0.20.0-beta";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "lightninglabs"; owner = "lightninglabs";
repo = "loop"; repo = "loop";
rev = "v${version}"; rev = "v${version}";
sha256 = "08jn1ybh9l9qy4j9b3psvgk7b869aaabpxh73v81980qflb9snnc"; sha256 = "1nx7i4i96982z756r79655hjf0yyz5l9lqjkvyvb62pbzqgm6my8";
}; };
vendorSha256 = "0wirlf43jl888bh2qxis1ihsr1g2lp2rx7p100dsb3imqbm25q3b"; vendorSha256 = "0gp89fw6g8mz2ifn9wcbj84dgm736cspfxj2x34b524l2d8wz3lb";
subPackages = [ "cmd/loop" "cmd/loopd" ]; subPackages = [ "cmd/loop" "cmd/loopd" ];

View File

@ -11,6 +11,8 @@
url_hint = callPackage ./url_hint { }; url_hint = callPackage ./url_hint { };
weechat-grep = callPackage ./weechat-grep { };
weechat-matrix-bridge = callPackage ./weechat-matrix-bridge { weechat-matrix-bridge = callPackage ./weechat-matrix-bridge {
inherit (luaPackages) cjson luaffi; inherit (luaPackages) cjson luaffi;
}; };

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "weechat-autosort"; pname = "weechat-autosort";
version = "3.8"; version = "3.9";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "de-vri-es"; owner = "de-vri-es";
repo = pname; repo = pname;
rev = version; rev = "d62fa8633015ebc2676060fcdae88c402977be46";
sha256 = "0a2gc8nhklvlivradhqy2pkymsqyy01pvzrmwg60cln8snmcqpd5"; sha256 = "sha256-doYDRIWiuHam2i3r3J3BZuWEhopoN4jms/xPXGyypok=";
}; };
passthru.scripts = [ "autosort.py" ]; passthru.scripts = [ "autosort.py" ];
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
meta = with lib; { meta = with lib; {
description = "Autosort is a weechat script to automatically or manually keep your buffers sorted"; description = "Autosort is a weechat script to automatically or manually keep your buffers sorted";
homepage = "https://github.com/de-vri-es/weechat-autosort"; homepage = "https://github.com/de-vri-es/weechat-autosort";
license = licenses.gpl3; license = licenses.gpl3Plus;
maintainers = with maintainers; [ emily ]; maintainers = with maintainers; [ emily flokli ];
}; };
} }

View File

@ -0,0 +1,29 @@
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "weechat-grep";
version = "0.8.5";
src = fetchurl {
url = "https://github.com/weechat/scripts/raw/5ee93d56f371c829d2798a5446a14292c180f70b/python/grep.py";
sha256 = "sha256-EVcoxjTTjXOYD8DppD+IULxpKerEdolmlgphrulFGC0=";
};
dontUnpack = true;
installPhase = ''
mkdir -p $out/share
cp $src $out/share/grep.py
'';
passthru = {
scripts = [ "grep.py" ];
};
meta = with lib; {
description = "Search in Weechat buffers and logs (for Weechat 0.3.*)";
homepage = "https://github.com/weechat/scripts/blob/master/python/grep.py";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ flokli ];
};
}

View File

@ -2,26 +2,14 @@
, xercesc, xml-security-c, pkg-config, xsd, zlib, xalanc, xxd }: , xercesc, xml-security-c, pkg-config, xsd, zlib, xalanc, xxd }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "3.14.8"; version = "3.14.10";
pname = "libdigidocpp"; pname = "libdigidocpp";
src = fetchurl { src = fetchurl {
url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz"; url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
sha256 = "sha256-U5i5IAyJF4359q6M6mQemEuG7+inPYIXqLy8GHv4dkg="; hash = "sha256-n/+R4ho1Qcft3YSKE12oxZjbFHAsUDwoLFNuk5GXf5c=";
}; };
patches = [
(fetchpatch {
# fix runtime crashes when signing with OpenSSL>1.1.1l
# https://github.com/open-eid/libdigidocpp/issues/474 asks for a new release
url = "https://github.com/open-eid/libdigidocpp/commit/42a8cfd834c10bdd206fe784a13217df222b1c8e.patch";
sha256 = "sha256-o3ZT0dXhIu79C5ZR+2HPdLMZ3YwPG1v3vly5bseuxtU=";
excludes = [
".github/workflows/build.yml" # failed hunk
];
})
];
nativeBuildInputs = [ cmake pkg-config xxd ]; nativeBuildInputs = [ cmake pkg-config xxd ];
buildInputs = [ buildInputs = [

View File

@ -10,14 +10,14 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "jupyterlab"; pname = "jupyterlab";
version = "3.4.3"; version = "3.4.4";
format = "setuptools"; format = "setuptools";
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.7";
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
sha256 = "sha256-4tzEDpQ2bd5d5LGejEPuEzzwQbhS0Bo2JafPKVMtpJ0="; sha256 = "sha256-WioP3SK9hiitRbYY41IDh8MqSBjjrxEtutH2STBN/CA=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -23,14 +23,12 @@
buildPythonApplication rec { buildPythonApplication rec {
pname = "python-manilaclient"; pname = "python-manilaclient";
version = "3.4.0"; version = "4.0.0";
format = "setuptools"; format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
hash = "sha256-F41/k7NJigwFNw2946sj3dZDKDH+PkgOjkml9t3Mgtw="; hash = "sha256-TEGzUNgYTkb2VrvW2E3lurD6N1XcIhH2tjmPlsJ/5MI=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -6,7 +6,14 @@
assert withMysql -> (mysql_jdbc != null); assert withMysql -> (mysql_jdbc != null);
stdenvNoCC.mkDerivation rec { let
optionalWarning = cond: msg:
if cond then lib.warn msg
else lib.id;
in
optionalWarning (crowdProperties != null) "Using `crowdProperties` is deprecated!"
(stdenvNoCC.mkDerivation rec {
pname = "atlassian-confluence"; pname = "atlassian-confluence";
version = "7.18.1"; version = "7.18.1";
@ -45,6 +52,6 @@ stdenvNoCC.mkDerivation rec {
homepage = "https://www.atlassian.com/software/confluence"; homepage = "https://www.atlassian.com/software/confluence";
sourceProvenance = with sourceTypes; [ binaryBytecode ]; sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.unfree; license = licenses.unfree;
maintainers = with maintainers; [ fpletz globin willibutz ciil techknowlogick ]; maintainers = with maintainers; [ fpletz globin willibutz ciil techknowlogick ma27 ];
}; };
} })

View File

@ -2,15 +2,15 @@
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "vimv-rs"; pname = "vimv-rs";
version = "1.7.5"; version = "1.7.7";
src = fetchCrate { src = fetchCrate {
inherit version; inherit version;
crateName = "vimv"; crateName = "vimv";
sha256 = "sha256-VOHQLdwJ6c8KB/IjMDZe9/pNHmLuouNggIK8uJPu+NQ="; sha256 = "sha256-Y8xFoI/1zpaeT9jMuOME/g2vTLenhNSwGepncc1Ji+0=";
}; };
cargoHash = "sha256-qXT44h4f4Zw1bi/gblczxehA6hqLLjQBpSwVpYd0PE4="; cargoHash = "sha256-yJHOeIjbWQTxLkkVv+YALrAhP5HBZpmbPDiLd+/bWZA=";
buildInputs = lib.optionals stdenv.isDarwin [ Foundation ]; buildInputs = lib.optionals stdenv.isDarwin [ Foundation ];