Merge branch 'master' into staging-next

Choose binwalk 2.3.1, 27 is legacy version for Python 2.
This commit is contained in:
Jan Tojnar
2021-04-25 02:50:48 +02:00
121 changed files with 987 additions and 616 deletions
+1
View File
@@ -133,6 +133,7 @@
./programs/file-roller.nix
./programs/firejail.nix
./programs/fish.nix
./programs/flexoptix-app.nix
./programs/freetds.nix
./programs/fuse.nix
./programs/geary.nix
+25
View File
@@ -0,0 +1,25 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.programs.flexoptix-app;
in {
options = {
programs.flexoptix-app = {
enable = mkEnableOption "FLEXOPTIX app + udev rules";
package = mkOption {
description = "FLEXOPTIX app package to use";
type = types.package;
default = pkgs.flexoptix-app;
defaultText = "\${pkgs.flexoptix-app}";
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
services.udev.packages = [ cfg.package ];
};
}
+1 -1
View File
@@ -192,6 +192,7 @@ in
path = [ pkgs.nagios ] ++ cfg.plugins;
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
restartTriggers = [ nagiosCfgFile ];
serviceConfig = {
User = "nagios";
@@ -201,7 +202,6 @@ in
LogsDirectory = "nagios";
StateDirectory = "nagios";
ExecStart = "${pkgs.nagios}/bin/nagios /etc/nagios.cfg";
X-ReloadIfChanged = nagiosCfgFile;
};
};
+12 -1
View File
@@ -31,6 +31,8 @@ let
// (if cfg.smtp.authenticate then { SMTP_LOGIN = cfg.smtp.user; } else {})
// cfg.extraConfig;
systemCallsList = [ "@clock" "@cpu-emulation" "@debug" "@keyring" "@module" "@mount" "@obsolete" "@raw-io" "@reboot" "@resources" "@setuid" "@swap" ];
cfgService = {
# User and group
User = cfg.user;
@@ -68,7 +70,6 @@ let
PrivateMounts = true;
# System Call Filtering
SystemCallArchitectures = "native";
SystemCallFilter = "~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @reboot @resources @setuid @swap";
};
envFile = pkgs.writeText "mastodon.env" (lib.concatMapStrings (s: s + "\n") (
@@ -432,6 +433,8 @@ in {
serviceConfig = {
Type = "oneshot";
WorkingDirectory = cfg.package;
# System Call Filtering
SystemCallFilter = "~" + lib.concatStringsSep " " systemCallsList;
} // cfgService;
after = [ "network.target" ];
@@ -457,6 +460,8 @@ in {
Type = "oneshot";
EnvironmentFile = "/var/lib/mastodon/.secrets_env";
WorkingDirectory = cfg.package;
# System Call Filtering
SystemCallFilter = "~" + lib.concatStringsSep " " systemCallsList;
} // cfgService;
after = [ "mastodon-init-dirs.service" "network.target" ] ++ (if databaseActuallyCreateLocally then [ "postgresql.service" ] else []);
wantedBy = [ "multi-user.target" ];
@@ -481,6 +486,8 @@ in {
# Runtime directory and mode
RuntimeDirectory = "mastodon-streaming";
RuntimeDirectoryMode = "0750";
# System Call Filtering
SystemCallFilter = "~" + lib.concatStringsSep " " (systemCallsList ++ [ "@privileged" ]);
} // cfgService;
};
@@ -503,6 +510,8 @@ in {
# Runtime directory and mode
RuntimeDirectory = "mastodon-web";
RuntimeDirectoryMode = "0750";
# System Call Filtering
SystemCallFilter = "~" + lib.concatStringsSep " " (systemCallsList ++ [ "@privileged" ]);
} // cfgService;
path = with pkgs; [ file imagemagick ffmpeg ];
};
@@ -522,6 +531,8 @@ in {
RestartSec = 20;
EnvironmentFile = "/var/lib/mastodon/.secrets_env";
WorkingDirectory = cfg.package;
# System Call Filtering
SystemCallFilter = "~" + lib.concatStringsSep " " (systemCallsList ++ [ "@privileged" ]);
} // cfgService;
path = with pkgs; [ file imagemagick ffmpeg ];
};
@@ -887,6 +887,7 @@ in
users.users = optionalAttrs (cfg.user == "nginx") {
nginx = {
group = cfg.group;
isSystemUser = true;
uid = config.ids.uids.nginx;
};
};
+5 -1
View File
@@ -118,6 +118,8 @@ let
metricProvider = {
services.bird2.enable = true;
services.bird2.config = ''
router id 127.0.0.1;
protocol kernel MyObviousTestString {
ipv4 {
import all;
@@ -132,7 +134,9 @@ let
exporterTest = ''
wait_for_unit("prometheus-bird-exporter.service")
wait_for_open_port(9324)
succeed("curl -sSf http://localhost:9324/metrics | grep -q 'MyObviousTestString'")
wait_until_succeeds(
"curl -sSf http://localhost:9324/metrics | grep -q 'MyObviousTestString'"
)
'';
};