Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 3, 2024
2 parents ce19166 + b387a48 commit a07f612
Show file tree
Hide file tree
Showing 49 changed files with 734 additions and 268 deletions.
7 changes: 4 additions & 3 deletions lib/strings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ rec {
start ? false,
end ? false,
}:
s:
let
# Define our own whitespace character class instead of using
# `[:space:]`, which is not well-defined.
Expand All @@ -425,12 +424,14 @@ rec {
"(.*[^${chars}])[${chars}]*"
else
"(.*)";

in
s:
let
# If the string was empty or entirely whitespace,
# then the regex may not match and `res` will be `null`.
res = match regex s;
in
optionalString (res != null) (head res);
optionalString (res != null) (head res);

/**
Construct a Unix-style, colon-separated search path consisting of
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@

- Two build helpers in `singularity-tools`, i.e., `mkLayer` and `shellScript`, are deprecated, as they are no longer involved in image-building. Maintainers will remove them in future releases.

- The `rust.toTargetArch`, `rust.toTargetOs`, `rust.toTargetFamily`, `rust.toTargetVendor`, `rust.toRustTarget`, `rust.toRustTargetSpec`, `rust.toRustTargetSpecShort`, and `rust.IsNoStdTarget` functions are deprecated in favour of the `rust.platform.arch`, `rust.platform.os`, `rust.platform.target-family`, `rust.platform.vendor`, `rust.rustcTarget`, `rust.rustcTargetSpec`, `rust.cargoShortTarget`, `rust.cargoEnvVarTarget`, and `rust.isNoStdTarget` platform attributes respectively.

- The `budgie` and `budgiePlugins` scope have been removed and their packages
moved into the top level scope (i.e., `budgie.budgie-desktop` is now
`budgie-desktop`)
Expand Down
105 changes: 51 additions & 54 deletions nixos/modules/services/development/zammad.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.zammad;
settingsFormat = pkgs.formats.yaml { };
filterNull = filterAttrs (_: v: v != null);
filterNull = lib.filterAttrs (_: v: v != null);
serviceConfig = {
Type = "simple";
Restart = "always";
Expand All @@ -29,88 +26,88 @@ in

options = {
services.zammad = {
enable = mkEnableOption "Zammad, a web-based, open source user support/ticketing solution";
enable = lib.mkEnableOption "Zammad, a web-based, open source user support/ticketing solution";

package = mkPackageOption pkgs "zammad" { };
package = lib.mkPackageOption pkgs "zammad" { };

dataDir = mkOption {
type = types.path;
dataDir = lib.mkOption {
type = lib.types.path;
default = "/var/lib/zammad";
description = ''
Path to a folder that will contain Zammad working directory.
'';
};

host = mkOption {
type = types.str;
host = lib.mkOption {
type = lib.types.str;
default = "127.0.0.1";
example = "192.168.23.42";
description = "Host address.";
};

openPorts = mkOption {
type = types.bool;
openPorts = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to open firewall ports for Zammad";
};

port = mkOption {
type = types.port;
port = lib.mkOption {
type = lib.types.port;
default = 3000;
description = "Web service port.";
};

websocketPort = mkOption {
type = types.port;
websocketPort = lib.mkOption {
type = lib.types.port;
default = 6042;
description = "Websocket service port.";
};

redis = {
createLocally = mkOption {
type = types.bool;
createLocally = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to create a local redis automatically.";
};

name = mkOption {
type = types.str;
name = lib.mkOption {
type = lib.types.str;
default = "zammad";
description = ''
Name of the redis server. Only used if `createLocally` is set to true.
'';
};

host = mkOption {
type = types.str;
host = lib.mkOption {
type = lib.types.str;
default = "localhost";
description = ''
Redis server address.
'';
};

port = mkOption {
type = types.port;
port = lib.mkOption {
type = lib.types.port;
default = 6379;
description = "Port of the redis server.";
};
};

database = {
type = mkOption {
type = types.enum [ "PostgreSQL" "MySQL" ];
type = lib.mkOption {
type = lib.types.enum [ "PostgreSQL" "MySQL" ];
default = "PostgreSQL";
example = "MySQL";
description = "Database engine to use.";
};

host = mkOption {
type = types.nullOr types.str;
host = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = {
PostgreSQL = "/run/postgresql";
MySQL = "localhost";
}.${cfg.database.type};
defaultText = literalExpression ''
defaultText = lib.literalExpression ''
{
PostgreSQL = "/run/postgresql";
MySQL = "localhost";
Expand All @@ -121,45 +118,45 @@ in
'';
};

port = mkOption {
type = types.nullOr types.port;
port = lib.mkOption {
type = lib.types.nullOr lib.types.port;
default = null;
description = "Database port. Use `null` for default port.";
};

name = mkOption {
type = types.str;
name = lib.mkOption {
type = lib.types.str;
default = "zammad";
description = ''
Database name.
'';
};

user = mkOption {
type = types.nullOr types.str;
user = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = "zammad";
description = "Database user.";
};

passwordFile = mkOption {
type = types.nullOr types.path;
passwordFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
example = "/run/keys/zammad-dbpassword";
description = ''
A file containing the password for {option}`services.zammad.database.user`.
'';
};

createLocally = mkOption {
type = types.bool;
createLocally = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to create a local database automatically.";
};

settings = mkOption {
settings = lib.mkOption {
type = settingsFormat.type;
default = { };
example = literalExpression ''
example = lib.literalExpression ''
{
}
'';
Expand All @@ -171,8 +168,8 @@ in
};
};

secretKeyBaseFile = mkOption {
type = types.nullOr types.path;
secretKeyBaseFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
example = "/run/keys/secret_key_base";
description = ''
Expand All @@ -197,10 +194,10 @@ in
};
};

config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {

services.zammad.database.settings = {
production = mapAttrs (_: v: mkDefault v) (filterNull {
production = lib.mapAttrs (_: v: lib.mkDefault v) (filterNull {
adapter = {
PostgreSQL = "postgresql";
MySQL = "mysql2";
Expand All @@ -215,7 +212,7 @@ in
});
};

networking.firewall.allowedTCPPorts = mkIf cfg.openPorts [
networking.firewall.allowedTCPPorts = lib.mkIf cfg.openPorts [
config.services.zammad.port
config.services.zammad.websocketPort
];
Expand Down Expand Up @@ -243,9 +240,9 @@ in
}
];

services.mysql = optionalAttrs (cfg.database.createLocally && cfg.database.type == "MySQL") {
services.mysql = lib.optionalAttrs (cfg.database.createLocally && cfg.database.type == "MySQL") {
enable = true;
package = mkDefault pkgs.mariadb;
package = lib.mkDefault pkgs.mariadb;
ensureDatabases = [ cfg.database.name ];
ensureUsers = [
{
Expand All @@ -255,7 +252,7 @@ in
];
};

services.postgresql = optionalAttrs (cfg.database.createLocally && cfg.database.type == "PostgreSQL") {
services.postgresql = lib.optionalAttrs (cfg.database.createLocally && cfg.database.type == "PostgreSQL") {
enable = true;
ensureDatabases = [ cfg.database.name ];
ensureUsers = [
Expand All @@ -266,7 +263,7 @@ in
];
};

services.redis = optionalAttrs cfg.redis.createLocally {
services.redis = lib.optionalAttrs cfg.redis.createLocally {
servers."${cfg.redis.name}" = {
enable = true;
port = cfg.redis.port;
Expand All @@ -282,7 +279,7 @@ in
after = [
"network.target"
"postgresql.service"
] ++ optionals cfg.redis.createLocally [
] ++ lib.optionals cfg.redis.createLocally [
"redis-${cfg.redis.name}.service"
];
requires = [
Expand All @@ -301,13 +298,13 @@ in
# config file
cp ${databaseConfig} ./config/database.yml
chmod -R +w .
${optionalString (cfg.database.passwordFile != null) ''
${lib.optionalString (cfg.database.passwordFile != null) ''
{
echo -n " password: "
cat ${cfg.database.passwordFile}
} >> ./config/database.yml
''}
${optionalString (cfg.secretKeyBaseFile != null) ''
${lib.optionalString (cfg.secretKeyBaseFile != null) ''
{
echo "production: "
echo -n " secret_key_base: "
Expand All @@ -317,7 +314,7 @@ in
if [ `${config.services.postgresql.package}/bin/psql \
--host ${cfg.database.host} \
${optionalString
${lib.optionalString
(cfg.database.port != null)
"--port ${toString cfg.database.port}"} \
--username ${cfg.database.user} \
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/hardware/thinkfan.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let
tuple = ts: lib.mkOptionType {
name = "tuple";
merge = lib.mergeOneOption;
check = xs: all id (zipListsWith (t: x: t.check x) ts xs);
check = xs: lib.all lib.id (zipListsWith (t: x: t.check x) ts xs);
description = "tuple of" + lib.concatMapStrings (t: " (${t.description})") ts;
};
level = ints.unsigned;
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/zigbee2mqtt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
machine.wait_for_unit("multi-user.target")
machine.wait_until_fails("systemctl status zigbee2mqtt.service")
machine.succeed(
"journalctl -eu zigbee2mqtt | grep 'Failed to connect to the adapter'"
"journalctl -eu zigbee2mqtt | grep 'Error: Inappropriate ioctl for device, cannot set'"
)
machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service"))
Expand Down
12 changes: 12 additions & 0 deletions pkgs/applications/editors/vim/plugins/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8751,6 +8751,18 @@ final: prev:
meta.homepage = "https://github.com/samjwill/nvim-unception/";
};

nvim-various-textobjs = buildVimPlugin {
pname = "nvim-various-textobjs";
version = "2024-08-17";
src = fetchFromGitHub {
owner = "chrisgrieser";
repo = "nvim-various-textobjs";
rev = "8dbc655f794202f45ab6a1cac1cb323a218ac6a1";
sha256 = "0fj02l74ibcp4b8j6jkyjfq2k25a3jllf6cd1mddhhj7laa4zhfw";
};
meta.homepage = "https://github.com/chrisgrieser/nvim-various-textobjs/";
};

nvim-web-devicons = buildVimPlugin {
pname = "nvim-web-devicons";
version = "2024-08-04";
Expand Down
1 change: 1 addition & 0 deletions pkgs/applications/editors/vim/plugins/vim-plugin-names
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ https://github.com/windwp/nvim-ts-autotag/,,
https://github.com/joosepalviste/nvim-ts-context-commentstring/,,
https://github.com/kevinhwang91/nvim-ufo/,HEAD,
https://github.com/samjwill/nvim-unception/,HEAD,
https://github.com/chrisgrieser/nvim-various-textobjs/,HEAD,
https://github.com/kyazdani42/nvim-web-devicons/,,
https://github.com/AckslD/nvim-whichkey-setup.lua/,,
https://github.com/s1n7ax/nvim-window-picker/,HEAD,
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/graphics/ImageMagick/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ in

stdenv.mkDerivation (finalAttrs: {
pname = "imagemagick";
version = "7.1.1-37";
version = "7.1.1-38";

src = fetchFromGitHub {
owner = "ImageMagick";
repo = "ImageMagick";
rev = finalAttrs.version;
hash = "sha256-dlcyCJw/tytb6z5VaogblUlzBRYBtijUJbkX3vZdeEU=";
hash = "sha256-dyk9kCH1w76Jhy/yBhVFLthTKYaMgXLBn7QGWAFS0XU=";
};

outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ in rustPlatform.buildRustPackage rec {
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
node_modules/.bin/neon build --release -- --target ${rust.toRustTargetSpec stdenv.hostPlatform} -Z unstable-options --out-dir target/release
node_modules/.bin/neon build --release -- --target ${stdenv.hostPlatform.rust.rustcTarget} -Z unstable-options --out-dir target/release
runHook postBuild
'';

Expand Down
Loading

0 comments on commit a07f612

Please sign in to comment.