Merge master into staging-next

Changed files
+1385 -255
nixos
doc
manual
release-notes
modules
services
monitoring
security
tests
pkgs
applications
audio
mbrola
misc
simplenote
networking
browsers
build-support
fetchgit
by-name
wa
waycheck
data
misc
xorg-rgb
development
libraries
speech-tools
python-modules
apprise
command_runner
et-xmlfile
guzzle-sphinx-theme
guzzle_sphinx_theme
openpyxl
pythonnet
tools
guile
guile-lint
servers
monitoring
tang
tools
backup
borgbackup
misc
cloud-sql-proxy
google-cloud-bigtable-tool
google-cloud-sql-proxy
networking
sockdump
top-level
+1 -1
CONTRIBUTING.md
···
When adding yourself as maintainer, in the same pull request, make a separate
commit with the message `maintainers: add <handle>`.
Add the commit before those making changes to the package or module.
-
See [Nixpkgs Maintainers](../maintainers/README.md) for details.
### Writing good commit messages
···
When adding yourself as maintainer, in the same pull request, make a separate
commit with the message `maintainers: add <handle>`.
Add the commit before those making changes to the package or module.
+
See [Nixpkgs Maintainers](./maintainers/README.md) for details.
### Writing good commit messages
+4
nixos/doc/manual/release-notes/rl-2311.section.md
···
- [Prometheus MySQL exporter](https://github.com/prometheus/mysqld_exporter), a MySQL server exporter for Prometheus. Available as [services.prometheus.exporters.mysqld](#opt-services.prometheus.exporters.mysqld.enable).
- [sitespeed-io](https://sitespeed.io), a tool that can generate metrics (timings, diagnostics) for websites. Available as [services.sitespeed-io](#opt-services.sitespeed-io.enable).
- [stalwart-mail](https://stalw.art), an all-in-one email server (SMTP, IMAP, JMAP). Available as [services.stalwart-mail](#opt-services.stalwart-mail.enable).
···
- Package `noto-fonts-emoji` was renamed to `noto-fonts-color-emoji`;
see [#221181](https://github.com/NixOS/nixpkgs/issues/221181).
- Package `pash` was removed due to being archived upstream. Use `powershell` as an alternative.
···
- [Prometheus MySQL exporter](https://github.com/prometheus/mysqld_exporter), a MySQL server exporter for Prometheus. Available as [services.prometheus.exporters.mysqld](#opt-services.prometheus.exporters.mysqld.enable).
+
- [LibreNMS](https://www.librenms.org), a auto-discovering PHP/MySQL/SNMP based network monitoring. Available as [services.librenms](#opt-services.librenms.enable).
+
- [sitespeed-io](https://sitespeed.io), a tool that can generate metrics (timings, diagnostics) for websites. Available as [services.sitespeed-io](#opt-services.sitespeed-io.enable).
- [stalwart-mail](https://stalw.art), an all-in-one email server (SMTP, IMAP, JMAP). Available as [services.stalwart-mail](#opt-services.stalwart-mail.enable).
···
- Package `noto-fonts-emoji` was renamed to `noto-fonts-color-emoji`;
see [#221181](https://github.com/NixOS/nixpkgs/issues/221181).
+
+
- Package `cloud-sql-proxy` was renamed to `google-cloud-sql-proxy` as it cannot be used with other cloud providers.;
- Package `pash` was removed due to being archived upstream. Use `powershell` as an alternative.
+2
nixos/modules/module-list.nix
···
./services/monitoring/kapacitor.nix
./services/monitoring/karma.nix
./services/monitoring/kthxbye.nix
./services/monitoring/loki.nix
./services/monitoring/longview.nix
./services/monitoring/mackerel-agent.nix
···
./services/security/sshguard.nix
./services/security/sslmate-agent.nix
./services/security/step-ca.nix
./services/security/tor.nix
./services/security/torify.nix
./services/security/torsocks.nix
···
./services/monitoring/kapacitor.nix
./services/monitoring/karma.nix
./services/monitoring/kthxbye.nix
+
./services/monitoring/librenms.nix
./services/monitoring/loki.nix
./services/monitoring/longview.nix
./services/monitoring/mackerel-agent.nix
···
./services/security/sshguard.nix
./services/security/sslmate-agent.nix
./services/security/step-ca.nix
+
./services/security/tang.nix
./services/security/tor.nix
./services/security/torify.nix
./services/security/torsocks.nix
+624
nixos/modules/services/monitoring/librenms.nix
···
···
+
{ config, lib, pkgs, ... }:
+
+
let
+
cfg = config.services.librenms;
+
settingsFormat = pkgs.formats.json {};
+
configJson = settingsFormat.generate "librenms-config.json" cfg.settings;
+
+
package = pkgs.librenms.override {
+
logDir = cfg.logDir;
+
dataDir = cfg.dataDir;
+
};
+
+
phpOptions = ''
+
log_errors = on
+
post_max_size = 100M
+
upload_max_filesize = 100M
+
date.timezone = "${config.time.timeZone}"
+
'';
+
phpIni = pkgs.runCommand "php.ini" {
+
inherit (package) phpPackage;
+
inherit phpOptions;
+
preferLocalBuild = true;
+
passAsFile = [ "phpOptions" ];
+
} ''
+
cat $phpPackage/etc/php.ini $phpOptionsPath > $out
+
'';
+
+
artisanWrapper = pkgs.writeShellScriptBin "librenms-artisan" ''
+
cd ${package}
+
sudo=exec
+
if [[ "$USER" != ${cfg.user} ]]; then
+
sudo='exec /run/wrappers/bin/sudo -u ${cfg.user}'
+
fi
+
$sudo ${package}/artisan $*
+
'';
+
+
lnmsWrapper = pkgs.writeShellScriptBin "lnms" ''
+
cd ${package}
+
exec ${package}/lnms $*
+
'';
+
+
configFile = pkgs.writeText "config.php" ''
+
<?php
+
$new_config = json_decode(file_get_contents("${cfg.dataDir}/config.json"), true);
+
$config = ($config == null) ? $new_config : array_merge($config, $new_config);
+
+
${lib.optionalString (cfg.extraConfig != null) cfg.extraConfig}
+
'';
+
+
in {
+
options.services.librenms = with lib; {
+
enable = mkEnableOption "LibreNMS network monitoring system";
+
+
user = mkOption {
+
type = types.str;
+
default = "librenms";
+
description = ''
+
Name of the LibreNMS user.
+
'';
+
};
+
+
group = mkOption {
+
type = types.str;
+
default = "librenms";
+
description = ''
+
Name of the LibreNMS group.
+
'';
+
};
+
+
hostname = mkOption {
+
type = types.str;
+
default = config.networking.fqdnOrHostName;
+
defaultText = literalExpression "config.networking.fqdnOrHostName";
+
description = ''
+
The hostname to serve LibreNMS on.
+
'';
+
};
+
+
pollerThreads = mkOption {
+
type = types.int;
+
default = 16;
+
description = ''
+
Amount of threads of the cron-poller.
+
'';
+
};
+
+
enableOneMinutePolling = mkOption {
+
type = types.bool;
+
default = false;
+
description = ''
+
Enables the [1-Minute Polling](https://docs.librenms.org/Support/1-Minute-Polling/).
+
Changing this option will automatically convert your existing rrd files.
+
'';
+
};
+
+
useDistributedPollers = mkOption {
+
type = types.bool;
+
default = false;
+
description = ''
+
Enables (distributed pollers)[https://docs.librenms.org/Extensions/Distributed-Poller/]
+
for this LibreNMS instance. This will enable a local `rrdcached` and `memcached` server.
+
+
To use this feature, make sure to configure your firewall that the distributed pollers
+
can reach the local `mysql`, `rrdcached` and `memcached` ports.
+
'';
+
};
+
+
distributedPoller = {
+
enable = mkOption {
+
type = types.bool;
+
default = false;
+
description = ''
+
Configure this LibreNMS instance as a (distributed poller)[https://docs.librenms.org/Extensions/Distributed-Poller/].
+
This will disable all web features and just configure the poller features.
+
Use the `mysql` database of your main LibreNMS instance in the database settings.
+
'';
+
};
+
+
name = mkOption {
+
type = types.nullOr types.str;
+
default = null;
+
description = ''
+
Custom name of this poller.
+
'';
+
};
+
+
group = mkOption {
+
type = types.str;
+
default = "0";
+
example = "1,2";
+
description = ''
+
Group(s) of this poller.
+
'';
+
};
+
+
distributedBilling = mkOption {
+
type = types.bool;
+
default = false;
+
description = ''
+
Enable distributed billing on this poller.
+
'';
+
};
+
+
memcachedHost = mkOption {
+
type = types.str;
+
description = ''
+
Hostname or IP of the `memcached` server.
+
'';
+
};
+
+
memcachedPort = mkOption {
+
type = types.port;
+
default = 11211;
+
description = ''
+
Port of the `memcached` server.
+
'';
+
};
+
+
rrdcachedHost = mkOption {
+
type = types.str;
+
description = ''
+
Hostname or IP of the `rrdcached` server.
+
'';
+
};
+
+
rrdcachedPort = mkOption {
+
type = types.port;
+
default = 42217;
+
description = ''
+
Port of the `memcached` server.
+
'';
+
};
+
};
+
+
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 LibreNMS PHP pool. See the documentation on `php-fpm.conf`
+
for details on configuration directives.
+
'';
+
};
+
+
nginx = mkOption {
+
type = types.submodule (
+
recursiveUpdate
+
(import ../web-servers/nginx/vhost-options.nix { inherit config lib; }) {}
+
);
+
default = { };
+
example = literalExpression ''
+
{
+
serverAliases = [
+
"librenms.''${config.networking.domain}"
+
];
+
# To enable encryption and let let's encrypt take care of certificate
+
forceSSL = true;
+
enableACME = true;
+
# To set the LibreNMS virtualHost as the default virtualHost;
+
default = true;
+
}
+
'';
+
description = ''
+
With this option, you can customize the nginx virtualHost settings.
+
'';
+
};
+
+
dataDir = mkOption {
+
type = types.path;
+
default = "/var/lib/librenms";
+
description = ''
+
Path of the LibreNMS state directory.
+
'';
+
};
+
+
logDir = mkOption {
+
type = types.path;
+
default = "/var/log/librenms";
+
description = ''
+
Path of the LibreNMS logging directory.
+
'';
+
};
+
+
database = {
+
createLocally = mkOption {
+
type = types.bool;
+
default = false;
+
description = ''
+
Whether to create a local database automatically.
+
'';
+
};
+
+
host = mkOption {
+
default = "localhost";
+
description = ''
+
Hostname or IP of the MySQL/MariaDB server.
+
'';
+
};
+
+
port = mkOption {
+
type = types.port;
+
default = 3306;
+
description = ''
+
Port of the MySQL/MariaDB server.
+
'';
+
};
+
+
database = mkOption {
+
type = types.str;
+
default = "librenms";
+
description = ''
+
Name of the database on the MySQL/MariaDB server.
+
'';
+
};
+
+
username = mkOption {
+
type = types.str;
+
default = "librenms";
+
description = ''
+
Name of the user on the MySQL/MariaDB server.
+
'';
+
};
+
+
passwordFile = mkOption {
+
type = types.path;
+
example = "/run/secrets/mysql.pass";
+
description = ''
+
A file containing the password for the user of the MySQL/MariaDB server.
+
Must be readable for the LibreNMS user.
+
'';
+
};
+
};
+
+
environmentFile = mkOption {
+
type = types.nullOr types.str;
+
default = null;
+
description = ''
+
File containing env-vars to be substituted into the final config. Useful for secrets.
+
Does not apply to settings defined in `extraConfig`.
+
'';
+
};
+
+
settings = mkOption {
+
type = types.submodule {
+
freeformType = settingsFormat.type;
+
options = {};
+
};
+
description = ''
+
Attrset of the LibreNMS configuration.
+
See https://docs.librenms.org/Support/Configuration/ for reference.
+
All possible options are listed [here](https://github.com/librenms/librenms/blob/master/misc/config_definitions.json).
+
See https://docs.librenms.org/Extensions/Authentication/ for setting other authentication methods.
+
'';
+
default = { };
+
example = {
+
base_url = "/librenms/";
+
top_devices = true;
+
top_ports = false;
+
};
+
};
+
+
extraConfig = mkOption {
+
type = types.nullOr types.str;
+
default = null;
+
description = ''
+
Additional config for LibreNMS that will be appended to the `config.php`. See
+
https://github.com/librenms/librenms/blob/master/misc/config_definitions.json
+
for possible options. Useful if you want to use PHP-Functions in your config.
+
'';
+
};
+
};
+
+
config = lib.mkIf cfg.enable {
+
assertions = [
+
{
+
assertion = config.time.timeZone != null;
+
message = "You must set `time.timeZone` to use the LibreNMS module.";
+
}
+
{
+
assertion = cfg.database.createLocally -> cfg.database.host == "localhost";
+
message = "The database host must be \"localhost\" if services.librenms.database.createLocally is set to true.";
+
}
+
{
+
assertion = !(cfg.useDistributedPollers && cfg.distributedPoller.enable);
+
message = "The LibreNMS instance can't be a distributed poller and a full instance at the same time.";
+
}
+
];
+
+
users.users.${cfg.user} = {
+
group = "${cfg.group}";
+
isSystemUser = true;
+
};
+
+
users.groups.${cfg.group} = { };
+
+
services.librenms.settings = {
+
# basic configs
+
"user" = cfg.user;
+
"own_hostname" = cfg.hostname;
+
"base_url" = lib.mkDefault "/";
+
"auth_mechanism" = lib.mkDefault "mysql";
+
+
# disable auto update function (won't work with NixOS)
+
"update" = false;
+
+
# enable fast ping by default
+
"ping_rrd_step" = 60;
+
+
# one minute polling
+
"rrd.step" = if cfg.enableOneMinutePolling then 60 else 300;
+
"rrd.heartbeat" = if cfg.enableOneMinutePolling then 120 else 600;
+
} // (lib.optionalAttrs cfg.distributedPoller.enable {
+
"distributed_poller" = true;
+
"distributed_poller_name" = lib.mkIf (cfg.distributedPoller.name != null) cfg.distributedPoller.name;
+
"distributed_poller_group" = cfg.distributedPoller.group;
+
"distributed_billing" = cfg.distributedPoller.distributedBilling;
+
"distributed_poller_memcached_host" = cfg.distributedPoller.memcachedHost;
+
"distributed_poller_memcached_port" = cfg.distributedPoller.memcachedPort;
+
"rrdcached" = "${cfg.distributedPoller.rrdcachedHost}:${toString cfg.distributedPoller.rrdcachedPort}";
+
}) // (lib.optionalAttrs cfg.useDistributedPollers {
+
"distributed_poller" = true;
+
# still enable a local poller with distributed polling
+
"distributed_poller_group" = lib.mkDefault "0";
+
"distributed_billing" = lib.mkDefault true;
+
"distributed_poller_memcached_host" = "localhost";
+
"distributed_poller_memcached_port" = 11211;
+
"rrdcached" = "localhost:42217";
+
});
+
+
services.memcached = lib.mkIf cfg.useDistributedPollers {
+
enable = true;
+
listen = "0.0.0.0";
+
};
+
+
systemd.services.rrdcached = lib.mkIf cfg.useDistributedPollers {
+
description = "rrdcached";
+
after = [ "librenms-setup.service" ];
+
wantedBy = [ "multi-user.target" ];
+
serviceConfig = {
+
Type = "forking";
+
User = cfg.user;
+
Group = cfg.group;
+
LimitNOFILE = 16384;
+
RuntimeDirectory = "rrdcached";
+
PidFile = "/run/rrdcached/rrdcached.pid";
+
# rrdcached params from https://docs.librenms.org/Extensions/Distributed-Poller/#config-sample
+
ExecStart = "${pkgs.rrdtool}/bin/rrdcached -l 0:42217 -R -j ${cfg.dataDir}/rrdcached-journal/ -F -b ${cfg.dataDir}/rrd -B -w 1800 -z 900 -p /run/rrdcached/rrdcached.pid";
+
};
+
};
+
+
services.mysql = lib.mkIf cfg.database.createLocally {
+
enable = true;
+
package = lib.mkDefault pkgs.mariadb;
+
settings.mysqld = {
+
innodb_file_per_table = 1;
+
lower_case_table_names = 0;
+
} // (lib.optionalAttrs cfg.useDistributedPollers {
+
bind-address = "0.0.0.0";
+
});
+
ensureDatabases = [ cfg.database.database ];
+
ensureUsers = [
+
{
+
name = cfg.database.username;
+
ensurePermissions = {
+
"${cfg.database.database}.*" = "ALL PRIVILEGES";
+
};
+
}
+
];
+
initialScript = lib.mkIf cfg.useDistributedPollers (pkgs.writeText "mysql-librenms-init" ''
+
CREATE USER IF NOT EXISTS '${cfg.database.username}'@'%';
+
GRANT ALL PRIVILEGES ON ${cfg.database.database}.* TO '${cfg.database.username}'@'%';
+
'');
+
};
+
+
services.nginx = lib.mkIf (!cfg.distributedPoller.enable) {
+
enable = true;
+
virtualHosts."${cfg.hostname}" = lib.mkMerge [
+
cfg.nginx
+
{
+
root = lib.mkForce "${package}/html";
+
locations."/" = {
+
index = "index.php";
+
tryFiles = "$uri $uri/ /index.php?$query_string";
+
};
+
locations."~ .php$".extraConfig = ''
+
fastcgi_pass unix:${config.services.phpfpm.pools."librenms".socket};
+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
+
'';
+
}
+
];
+
};
+
+
services.phpfpm.pools.librenms = lib.mkIf (!cfg.distributedPoller.enable) {
+
user = cfg.user;
+
group = cfg.group;
+
inherit (package) phpPackage;
+
inherit phpOptions;
+
settings = {
+
"listen.mode" = "0660";
+
"listen.owner" = config.services.nginx.user;
+
"listen.group" = config.services.nginx.group;
+
} // cfg.poolConfig;
+
};
+
+
systemd.services.librenms-scheduler = {
+
description = "LibreNMS Scheduler";
+
path = [ pkgs.unixtools.whereis ];
+
serviceConfig = {
+
Type = "oneshot";
+
WorkingDirectory = package;
+
User = cfg.user;
+
Group = cfg.group;
+
ExecStart = "${artisanWrapper}/bin/librenms-artisan schedule:run";
+
};
+
};
+
+
systemd.timers.librenms-scheduler = {
+
description = "LibreNMS Scheduler";
+
wantedBy = [ "timers.target" ];
+
timerConfig = {
+
OnCalendar = "minutely";
+
AccuracySec = "1second";
+
};
+
};
+
+
systemd.services.librenms-setup = {
+
description = "Preparation tasks for LibreNMS";
+
before = [ "phpfpm-librenms.service" ];
+
after = [ "systemd-tmpfiles-setup.service" ]
+
++ (lib.optional (cfg.database.host == "localhost") "mysql.service");
+
wantedBy = [ "multi-user.target" ];
+
restartTriggers = [ package configFile ];
+
path = [ pkgs.mariadb pkgs.unixtools.whereis pkgs.gnused ];
+
serviceConfig = {
+
Type = "oneshot";
+
RemainAfterExit = true;
+
EnvironmentFile = lib.mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
+
User = cfg.user;
+
Group = cfg.group;
+
ExecStartPre = lib.mkIf cfg.database.createLocally [ "!${pkgs.writeShellScript "librenms-db-init" ''
+
DB_PASSWORD=$(cat ${cfg.database.passwordFile} | tr -d '\n')
+
echo "ALTER USER '${cfg.database.username}'@'localhost' IDENTIFIED BY '$DB_PASSWORD';" | ${pkgs.mariadb}/bin/mysql
+
${lib.optionalString cfg.useDistributedPollers ''
+
echo "ALTER USER '${cfg.database.username}'@'%' IDENTIFIED BY '$DB_PASSWORD';" | ${pkgs.mariadb}/bin/mysql
+
''}
+
''}"];
+
};
+
script = ''
+
set -euo pipefail
+
+
# config setup
+
ln -sf ${configFile} ${cfg.dataDir}/config.php
+
${pkgs.envsubst}/bin/envsubst -i ${configJson} -o ${cfg.dataDir}/config.json
+
export PHPRC=${phpIni}
+
+
if [[ ! -s ${cfg.dataDir}/.env ]]; then
+
# init .env file
+
echo "APP_KEY=" > ${cfg.dataDir}/.env
+
${artisanWrapper}/bin/librenms-artisan key:generate --ansi
+
${artisanWrapper}/bin/librenms-artisan webpush:vapid
+
echo "" >> ${cfg.dataDir}/.env
+
echo -n "NODE_ID=" >> ${cfg.dataDir}/.env
+
${package.phpPackage}/bin/php -r "echo uniqid();" >> ${cfg.dataDir}/.env
+
echo "" >> ${cfg.dataDir}/.env
+
else
+
# .env file already exists --> only update database and cache config
+
${pkgs.gnused}/bin/sed -i /^DB_/d ${cfg.dataDir}/.env
+
${pkgs.gnused}/bin/sed -i /^CACHE_DRIVER/d ${cfg.dataDir}/.env
+
fi
+
${lib.optionalString (cfg.useDistributedPollers || cfg.distributedPoller.enable) ''
+
echo "CACHE_DRIVER=memcached" >> ${cfg.dataDir}/.env
+
''}
+
echo "DB_HOST=${cfg.database.host}" >> ${cfg.dataDir}/.env
+
echo "DB_PORT=${toString cfg.database.port}" >> ${cfg.dataDir}/.env
+
echo "DB_DATABASE=${cfg.database.database}" >> ${cfg.dataDir}/.env
+
echo "DB_USERNAME=${cfg.database.username}" >> ${cfg.dataDir}/.env
+
echo -n "DB_PASSWORD=" >> ${cfg.dataDir}/.env
+
cat ${cfg.database.passwordFile} >> ${cfg.dataDir}/.env
+
+
# clear cache after update
+
OLD_VERSION=$(cat ${cfg.dataDir}/version)
+
if [[ $OLD_VERSION != "${package.version}" ]]; then
+
rm -r ${cfg.dataDir}/cache/*
+
echo "${package.version}" > ${cfg.dataDir}/version
+
fi
+
+
# convert rrd files when the oneMinutePolling option is changed
+
OLD_ENABLED=$(cat ${cfg.dataDir}/one_minute_enabled)
+
if [[ $OLD_ENABLED != "${lib.boolToString cfg.enableOneMinutePolling}" ]]; then
+
${package}/scripts/rrdstep.php -h all
+
echo "${lib.boolToString cfg.enableOneMinutePolling}" > ${cfg.dataDir}/one_minute_enabled
+
fi
+
+
# migrate db
+
${artisanWrapper}/bin/librenms-artisan migrate --force --no-interaction
+
'';
+
};
+
+
programs.mtr.enable = true;
+
+
services.logrotate = {
+
enable = true;
+
settings."${cfg.logDir}/librenms.log" = {
+
su = "${cfg.user} ${cfg.group}";
+
create = "0640 ${cfg.user} ${cfg.group}";
+
rotate = 6;
+
frequency = "weekly";
+
compress = true;
+
delaycompress = true;
+
missingok = true;
+
notifempty = true;
+
};
+
};
+
+
services.cron = {
+
enable = true;
+
systemCronJobs = let
+
env = "PHPRC=${phpIni}";
+
in [
+
# based on crontab provided by LibreNMS
+
"33 */6 * * * ${cfg.user} ${env} ${package}/cronic ${package}/discovery-wrapper.py 1"
+
"*/5 * * * * ${cfg.user} ${env} ${package}/discovery.php -h new >> /dev/null 2>&1"
+
+
"${if cfg.enableOneMinutePolling then "*" else "*/5"} * * * * ${cfg.user} ${env} ${package}/cronic ${package}/poller-wrapper.py ${toString cfg.pollerThreads}"
+
"* * * * * ${cfg.user} ${env} ${package}/alerts.php >> /dev/null 2>&1"
+
+
"*/5 * * * * ${cfg.user} ${env} ${package}/poll-billing.php >> /dev/null 2>&1"
+
"01 * * * * ${cfg.user} ${env} ${package}/billing-calculate.php >> /dev/null 2>&1"
+
"*/5 * * * * ${cfg.user} ${env} ${package}/check-services.php >> /dev/null 2>&1"
+
+
# extra: fast ping
+
"* * * * * ${cfg.user} ${env} ${package}/ping.php >> /dev/null 2>&1"
+
+
# daily.sh tasks are split to exclude update
+
"19 0 * * * ${cfg.user} ${env} ${package}/daily.sh cleanup >> /dev/null 2>&1"
+
"19 0 * * * ${cfg.user} ${env} ${package}/daily.sh notifications >> /dev/null 2>&1"
+
"19 0 * * * ${cfg.user} ${env} ${package}/daily.sh peeringdb >> /dev/null 2>&1"
+
"19 0 * * * ${cfg.user} ${env} ${package}/daily.sh mac_oui >> /dev/null 2>&1"
+
];
+
};
+
+
security.wrappers = {
+
fping = {
+
setuid = true;
+
owner = "root";
+
group = "root";
+
source = "${pkgs.fping}/bin/fping";
+
};
+
};
+
+
environment.systemPackages = [ artisanWrapper lnmsWrapper ];
+
+
systemd.tmpfiles.rules = [
+
"d ${cfg.logDir} 0750 ${cfg.user} ${cfg.group} - -"
+
"f ${cfg.logDir}/librenms.log 0640 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir} 0750 ${cfg.user} ${cfg.group} - -"
+
"f ${cfg.dataDir}/.env 0600 ${cfg.user} ${cfg.group} - -"
+
"f ${cfg.dataDir}/version 0600 ${cfg.user} ${cfg.group} - -"
+
"f ${cfg.dataDir}/one_minute_enabled 0600 ${cfg.user} ${cfg.group} - -"
+
"f ${cfg.dataDir}/config.json 0600 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/storage 0700 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/storage/app 0700 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/storage/debugbar 0700 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/storage/framework 0700 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/storage/framework/cache 0700 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/storage/framework/sessions 0700 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/storage/framework/views 0700 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/storage/logs 0700 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/rrd 0700 ${cfg.user} ${cfg.group} - -"
+
"d ${cfg.dataDir}/cache 0700 ${cfg.user} ${cfg.group} - -"
+
] ++ lib.optionals cfg.useDistributedPollers [
+
"d ${cfg.dataDir}/rrdcached-journal 0700 ${cfg.user} ${cfg.group} - -"
+
];
+
+
};
+
+
meta.maintainers = lib.teams.wdz.members;
+
}
+95
nixos/modules/services/security/tang.nix
···
···
+
{ config, lib, pkgs, ... }:
+
with lib;
+
let
+
cfg = config.services.tang;
+
in
+
{
+
options.services.tang = {
+
enable = mkEnableOption "tang";
+
+
package = mkOption {
+
type = types.package;
+
default = pkgs.tang;
+
defaultText = literalExpression "pkgs.tang";
+
description = mdDoc "The tang package to use.";
+
};
+
+
listenStream = mkOption {
+
type = with types; listOf str;
+
default = [ "7654" ];
+
example = [ "198.168.100.1:7654" "[2001:db8::1]:7654" "7654" ];
+
description = mdDoc ''
+
Addresses and/or ports on which tang should listen.
+
For detailed syntax see ListenStream in {manpage}`systemd.socket(5)`.
+
'';
+
};
+
+
ipAddressAllow = mkOption {
+
example = [ "192.168.1.0/24" ];
+
type = types.listOf types.str;
+
description = ''
+
Whitelist a list of address prefixes.
+
Preferably, internal addresses should be used.
+
'';
+
};
+
+
};
+
config = mkIf cfg.enable {
+
environment.systemPackages = [ cfg.package ];
+
+
systemd.services."tangd@" = {
+
description = "Tang server";
+
path = [ cfg.package ];
+
serviceConfig = {
+
StandardInput = "socket";
+
StandardOutput = "socket";
+
StandardError = "journal";
+
DynamicUser = true;
+
StateDirectory = "tang";
+
RuntimeDirectory = "tang";
+
StateDirectoryMode = "700";
+
UMask = "0077";
+
CapabilityBoundingSet = [ "" ];
+
ExecStart = "${cfg.package}/libexec/tangd %S/tang";
+
LockPersonality = true;
+
MemoryDenyWriteExecute = true;
+
NoNewPrivileges = true;
+
DeviceAllow = [ "/dev/stdin" ];
+
RestrictAddressFamilies = [ "AF_UNIX" ];
+
DevicePolicy = "strict";
+
PrivateDevices = true;
+
PrivateTmp = true;
+
PrivateUsers = true;
+
ProcSubset = "pid";
+
ProtectClock = true;
+
ProtectControlGroups = true;
+
ProtectHome = true;
+
ProtectHostname = true;
+
ProtectKernelLogs = true;
+
ProtectKernelModules = true;
+
ProtectKernelTunables = true;
+
ProtectProc = "invisible";
+
ProtectSystem = "strict";
+
RestrictNamespaces = true;
+
RestrictRealtime = true;
+
RestrictSUIDSGID = true;
+
SystemCallArchitectures = "native";
+
SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ];
+
IPAddressDeny = "any";
+
IPAddressAllow = cfg.ipAddressAllow;
+
};
+
};
+
+
systemd.sockets.tangd = {
+
description = "Tang server";
+
wantedBy = [ "sockets.target" ];
+
socketConfig = {
+
ListenStream = cfg.listenStream;
+
Accept = "yes";
+
IPAddressDeny = "any";
+
IPAddressAllow = cfg.ipAddressAllow;
+
};
+
};
+
};
+
meta.maintainers = with lib.maintainers; [ jfroche julienmalka ];
+
}
+2
nixos/tests/all-tests.nix
···
lemmy = handleTest ./lemmy.nix {};
libinput = handleTest ./libinput.nix {};
libreddit = handleTest ./libreddit.nix {};
libresprite = handleTest ./libresprite.nix {};
libreswan = handleTest ./libreswan.nix {};
librewolf = handleTest ./firefox.nix { firefoxPackage = pkgs.librewolf; };
···
systemd-userdbd = handleTest ./systemd-userdbd.nix {};
systemd-homed = handleTest ./systemd-homed.nix {};
tandoor-recipes = handleTest ./tandoor-recipes.nix {};
taskserver = handleTest ./taskserver.nix {};
tayga = handleTest ./tayga.nix {};
teeworlds = handleTest ./teeworlds.nix {};
···
lemmy = handleTest ./lemmy.nix {};
libinput = handleTest ./libinput.nix {};
libreddit = handleTest ./libreddit.nix {};
+
librenms = handleTest ./librenms.nix {};
libresprite = handleTest ./libresprite.nix {};
libreswan = handleTest ./libreswan.nix {};
librewolf = handleTest ./firefox.nix { firefoxPackage = pkgs.librewolf; };
···
systemd-userdbd = handleTest ./systemd-userdbd.nix {};
systemd-homed = handleTest ./systemd-homed.nix {};
tandoor-recipes = handleTest ./tandoor-recipes.nix {};
+
tang = handleTest ./tang.nix {};
taskserver = handleTest ./taskserver.nix {};
tayga = handleTest ./tayga.nix {};
teeworlds = handleTest ./teeworlds.nix {};
+108
nixos/tests/librenms.nix
···
···
+
import ./make-test-python.nix ({ pkgs, lib, ... }:
+
+
let
+
api_token = "f87f42114e44b63ad1b9e3c3d33d6fbe"; # random md5 hash
+
wrong_api_token = "e68ba041fcf1eab923a7a6de3af5f726"; # another random md5 hash
+
in {
+
name = "librenms";
+
meta.maintainers = lib.teams.wdz.members;
+
+
nodes.librenms = {
+
time.timeZone = "Europe/Berlin";
+
+
environment.systemPackages = with pkgs; [
+
curl
+
jq
+
];
+
+
services.librenms = {
+
enable = true;
+
hostname = "librenms";
+
database = {
+
createLocally = true;
+
host = "localhost";
+
database = "librenms";
+
username = "librenms";
+
passwordFile = pkgs.writeText "librenms-db-pass" "librenmsdbpass";
+
};
+
nginx = {
+
default = true;
+
};
+
enableOneMinutePolling = true;
+
settings = {
+
enable_billing = true;
+
};
+
};
+
+
# systemd oneshot to create a dummy admin user and a API token for testing
+
systemd.services.lnms-api-init = {
+
description = "LibreNMS API init";
+
after = [ "librenms-setup.service" ];
+
wantedBy = [ "multi-user.target" ];
+
serviceConfig = {
+
Type = "oneshot";
+
RemainAfterExit = true;
+
User = "root";
+
Group = "root";
+
};
+
script = ''
+
API_USER_NAME=api
+
API_TOKEN=${api_token} # random md5 hash
+
+
# we don't need to know the password, it just has to exist
+
API_USER_PASS=$(${pkgs.pwgen}/bin/pwgen -s 64 1)
+
${pkgs.librenms}/artisan user:add $API_USER_NAME -r admin -p $API_USER_PASS
+
API_USER_ID=$(${pkgs.mariadb}/bin/mysql -D librenms -N -B -e "SELECT user_id FROM users WHERE username = '$API_USER_NAME';")
+
+
${pkgs.mariadb}/bin/mysql -D librenms -e "INSERT INTO api_tokens (user_id, token_hash, description) VALUES ($API_USER_ID, '$API_TOKEN', 'API User')"
+
'';
+
};
+
};
+
+
nodes.snmphost = {
+
networking.firewall.allowedUDPPorts = [ 161 ];
+
+
systemd.services.snmpd = {
+
description = "snmpd";
+
after = [ "network-online.target" ];
+
wants = [ "network-online.target" ];
+
wantedBy = [ "multi-user.target" ];
+
serviceConfig = {
+
Type = "forking";
+
User = "root";
+
Group = "root";
+
ExecStart = let
+
snmpd-config = pkgs.writeText "snmpd-config" ''
+
com2sec readonly default public
+
+
group MyROGroup v2c readonly
+
view all included .1 80
+
access MyROGroup "" any noauth exact all none none
+
+
syslocation Testcity, Testcountry
+
syscontact Testi mc Test <test@example.com>
+
'';
+
in "${pkgs.net-snmp}/bin/snmpd -c ${snmpd-config} -C";
+
};
+
};
+
};
+
+
testScript = ''
+
start_all()
+
+
snmphost.wait_until_succeeds("pgrep snmpd")
+
+
librenms.wait_for_unit("lnms-api-init.service")
+
librenms.wait_for_open_port(80)
+
+
# Test that we can authenticate against the API
+
librenms.succeed("curl --fail -H 'X-Auth-Token: ${api_token}' http://localhost/api/v0")
+
librenms.fail("curl --fail -H 'X-Auth-Token: ${wrong_api_token}' http://localhost/api/v0")
+
+
# add snmphost as a device
+
librenms.succeed("curl --fail -X POST -d '{\"hostname\":\"snmphost\",\"version\":\"v2c\",\"community\":\"public\"}' -H 'X-Auth-Token: ${api_token}' http://localhost/api/v0/devices")
+
+
# wait until snmphost gets polled
+
librenms.wait_until_succeeds("test $(curl -H 'X-Auth-Token: ${api_token}' http://localhost/api/v0/devices/snmphost | jq -Mr .devices[0].last_polled) != 'null'")
+
'';
+
})
+81
nixos/tests/tang.nix
···
···
+
import ./make-test-python.nix ({ pkgs, ... }: {
+
name = "tang";
+
meta = with pkgs.lib.maintainers; {
+
maintainers = [ jfroche ];
+
};
+
+
nodes.server =
+
{ config
+
, pkgs
+
, modulesPath
+
, ...
+
}: {
+
imports = [
+
"${modulesPath}/../tests/common/auto-format-root-device.nix"
+
];
+
virtualisation = {
+
emptyDiskImages = [ 512 ];
+
useBootLoader = true;
+
useEFIBoot = true;
+
# This requires to have access
+
# to a host Nix store as
+
# the new root device is /dev/vdb
+
# an empty 512MiB drive, containing no Nix store.
+
mountHostNixStore = true;
+
};
+
+
boot.loader.systemd-boot.enable = true;
+
+
networking.interfaces.eth1.ipv4.addresses = [
+
{ address = "192.168.0.1"; prefixLength = 24; }
+
];
+
+
environment.systemPackages = with pkgs; [ clevis tang cryptsetup ];
+
services.tang = {
+
enable = true;
+
ipAddressAllow = [ "127.0.0.1/32" ];
+
};
+
};
+
testScript = ''
+
start_all()
+
machine.wait_for_unit("sockets.target")
+
+
with subtest("Check keys are generated"):
+
machine.wait_until_succeeds("curl -v http://127.0.0.1:7654/adv")
+
key = machine.wait_until_succeeds("tang-show-keys 7654")
+
+
with subtest("Check systemd access list"):
+
machine.succeed("ping -c 3 192.168.0.1")
+
machine.fail("curl -v --connect-timeout 3 http://192.168.0.1:7654/adv")
+
+
with subtest("Check basic encrypt and decrypt message"):
+
machine.wait_until_succeeds(f"""echo 'Hello World' | clevis encrypt tang '{{ "url": "http://127.0.0.1:7654", "thp":"{key}"}}' > /tmp/encrypted""")
+
decrypted = machine.wait_until_succeeds("clevis decrypt < /tmp/encrypted")
+
assert decrypted.strip() == "Hello World"
+
machine.wait_until_succeeds("tang-show-keys 7654")
+
+
with subtest("Check encrypt and decrypt disk"):
+
machine.succeed("cryptsetup luksFormat --force-password --batch-mode /dev/vdb <<<'password'")
+
machine.succeed(f"""clevis luks bind -s1 -y -f -d /dev/vdb tang '{{ "url": "http://127.0.0.1:7654", "thp":"{key}" }}' <<< 'password' """)
+
clevis_luks = machine.succeed("clevis luks list -d /dev/vdb")
+
assert clevis_luks.strip() == """1: tang '{"url":"http://127.0.0.1:7654"}'"""
+
machine.succeed("clevis luks unlock -d /dev/vdb")
+
machine.succeed("find /dev/mapper -name 'luks*' -exec cryptsetup close {} +")
+
machine.succeed("clevis luks unlock -d /dev/vdb")
+
machine.succeed("find /dev/mapper -name 'luks*' -exec cryptsetup close {} +")
+
# without tang available, unlock should fail
+
machine.succeed("systemctl stop tangd.socket")
+
machine.fail("clevis luks unlock -d /dev/vdb")
+
machine.succeed("systemctl start tangd.socket")
+
+
with subtest("Rotate server keys"):
+
machine.succeed("${pkgs.tang}/libexec/tangd-rotate-keys -d /var/lib/tang")
+
machine.succeed("clevis luks unlock -d /dev/vdb")
+
machine.succeed("find /dev/mapper -name 'luks*' -exec cryptsetup close {} +")
+
+
with subtest("Test systemd service security"):
+
output = machine.succeed("systemd-analyze security tangd@.service")
+
machine.log(output)
+
assert output[-9:-1] == "SAFE :-}"
+
'';
+
})
+1 -1
pkgs/applications/audio/mbrola/default.nix
···
meta = with lib; {
license = licenses.agpl3Plus;
maintainers = with maintainers; [ davidak ];
-
platforms = platforms.linux;
description = "Speech synthesizer based on the concatenation of diphones";
homepage = "https://github.com/numediart/MBROLA";
};
···
meta = with lib; {
license = licenses.agpl3Plus;
maintainers = with maintainers; [ davidak ];
+
platforms = platforms.all;
description = "Speech synthesizer based on the concatenation of diphones";
homepage = "https://github.com/numediart/MBROLA";
};
-110
pkgs/applications/misc/simplenote/default.nix
···
-
{ autoPatchelfHook
-
, dpkg
-
, fetchurl
-
, makeDesktopItem
-
, makeWrapper
-
, lib
-
, stdenv
-
, udev
-
, alsa-lib
-
, mesa
-
, nss
-
, nspr
-
, systemd
-
, wrapGAppsHook
-
, xorg
-
}:
-
-
let
-
inherit (stdenv.hostPlatform) system;
-
-
throwSystem = throw "Unsupported system: ${system}";
-
-
pname = "simplenote";
-
-
version = "2.9.0";
-
-
sha256 = {
-
x86_64-linux = "sha256-uwd9fYqZepJ/BBttprqkJhswqMepGsHDTd5Md9gjI68=";
-
}.${system} or throwSystem;
-
-
meta = with lib; {
-
description = "The simplest way to keep notes";
-
homepage = "https://github.com/Automattic/simplenote-electron";
-
license = licenses.gpl2;
-
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
-
maintainers = with maintainers; [
-
kiwi
-
];
-
platforms = [
-
"x86_64-linux"
-
];
-
};
-
-
linux = stdenv.mkDerivation rec {
-
inherit pname version meta;
-
-
src = fetchurl {
-
url = "https://github.com/Automattic/simplenote-electron/releases/download/v${version}/Simplenote-linux-${version}-amd64.deb";
-
inherit sha256;
-
};
-
-
desktopItem = makeDesktopItem {
-
categories = [ "Development" ];
-
comment = "Simplenote for Linux";
-
desktopName = "Simplenote";
-
exec = "simplenote %U";
-
icon = "simplenote";
-
name = "simplenote";
-
startupNotify = true;
-
};
-
-
dontBuild = true;
-
dontConfigure = true;
-
dontPatchELF = true;
-
dontWrapGApps = true;
-
-
# TODO: migrate off autoPatchelfHook and use nixpkgs' electron
-
nativeBuildInputs = [
-
autoPatchelfHook
-
dpkg
-
makeWrapper
-
wrapGAppsHook
-
];
-
-
buildInputs = [
-
alsa-lib
-
mesa
-
xorg.libXScrnSaver
-
xorg.libXtst
-
nss
-
nspr
-
stdenv.cc.cc
-
systemd
-
];
-
-
unpackPhase = "dpkg-deb -x $src .";
-
-
installPhase = ''
-
mkdir -p "$out/bin"
-
cp -R "opt" "$out"
-
cp -R "usr/share" "$out/share"
-
chmod -R g-w "$out"
-
-
mkdir -p "$out/share/applications"
-
cp "${desktopItem}/share/applications/"* "$out/share/applications"
-
'';
-
-
runtimeDependencies = [
-
(lib.getLib udev)
-
];
-
-
postFixup = ''
-
makeWrapper $out/opt/Simplenote/simplenote $out/bin/simplenote \
-
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ] }" \
-
"''${gappsWrapperArgs[@]}"
-
'';
-
};
-
-
in
-
linux
···
+23 -1
pkgs/applications/networking/browsers/chromium/common.nix
···
{ stdenv, lib, fetchurl, fetchpatch
, buildPackages
, pkgsBuildBuild
, pkgsBuildTarget
···
inherit (upstream-info) version;
inherit packageName buildType buildPath;
-
src = fetchurl {
url = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz";
inherit (upstream-info) sha256;
};
nativeBuildInputs = [
···
{ stdenv, lib, fetchurl, fetchpatch
+
, fetchzip, zstd
, buildPackages
, pkgsBuildBuild
, pkgsBuildTarget
···
inherit (upstream-info) version;
inherit packageName buildType buildPath;
+
src = fetchzip {
+
name = "chromium-${version}.tar.zstd";
url = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz";
inherit (upstream-info) sha256;
+
+
nativeBuildInputs = [ zstd ];
+
+
postFetch = ''
+
echo removing unused code from tarball to stay under hydra limit
+
rm -r $out/third_party/{rust-src,llvm}
+
+
echo moving remains out of \$out
+
mv $out source
+
+
echo recompressing final contents into new tarball
+
# try to make a deterministic tarball
+
tar \
+
--use-compress-program "zstd -T$NIX_BUILD_CORES" \
+
--sort name \
+
--mtime 1970-01-01 \
+
--owner=root --group=root \
+
--numeric-owner --mode=go=rX,u+rw,a-s \
+
-cf $out source
+
'';
};
nativeBuildInputs = [
+4 -4
pkgs/applications/networking/browsers/chromium/upstream-info.nix
···
version = "2023-08-01";
};
};
-
sha256 = "1wf0j189cxpayy6ffmj5j6h5yg3amivryilimjc2ap0jkyj4xrbi";
sha256bin64 = "11w1di146mjb9ql30df9yk9x4b9amc6514jzyfbf09mqsrw88dvr";
version = "117.0.5938.22";
};
···
version = "2023-08-10";
};
};
-
sha256 = "1z01b6w4sgndrlcd26jgimk3rhv3wzpn67nv1fd5ln7dwfwkyq20";
sha256bin64 = "11y09hsy7y1vg65xfilq44ffsmn15dqy80fa57psj1kin4a52v2x";
version = "118.0.5966.0";
};
···
version = "2023-08-10";
};
};
-
sha256 = "0gcrnvm3ar7x0fv38kjvdzgb8lflx1sckcqy89yawgfy6jkh1vj9";
sha256bin64 = "1bq170l0g9yq17x6xlg6fjar6gv3hdi0zijwmx4s02pmw6727484";
version = "118.0.5993.70";
};
···
sha256 = "0k6684cy1ks6yba2bdz17g244f05qy9769cvis4h2jzhgbf5rysh";
};
};
-
sha256 = "0gcrnvm3ar7x0fv38kjvdzgb8lflx1sckcqy89yawgfy6jkh1vj9";
sha256bin64 = "1bq170l0g9yq17x6xlg6fjar6gv3hdi0zijwmx4s02pmw6727484";
version = "118.0.5993.70";
};
···
version = "2023-08-01";
};
};
+
sha256 = "0c3adrrgpnhm8g1546ask9pf17qj1sjgb950mj0rv4snxvddi75j";
sha256bin64 = "11w1di146mjb9ql30df9yk9x4b9amc6514jzyfbf09mqsrw88dvr";
version = "117.0.5938.22";
};
···
version = "2023-08-10";
};
};
+
sha256 = "16dq27lsywrn2xlgr5g46gdv15p30sihfamli4vkv3zxzfxdjisv";
sha256bin64 = "11y09hsy7y1vg65xfilq44ffsmn15dqy80fa57psj1kin4a52v2x";
version = "118.0.5966.0";
};
···
version = "2023-08-10";
};
};
+
sha256 = "1g8rllmnmhmmpjzrmi3cww0nszxicq0kim2wd0l0ip2mzk2p8qlp";
sha256bin64 = "1bq170l0g9yq17x6xlg6fjar6gv3hdi0zijwmx4s02pmw6727484";
version = "118.0.5993.70";
};
···
sha256 = "0k6684cy1ks6yba2bdz17g244f05qy9769cvis4h2jzhgbf5rysh";
};
};
+
sha256 = "1g8rllmnmhmmpjzrmi3cww0nszxicq0kim2wd0l0ip2mzk2p8qlp";
sha256bin64 = "1bq170l0g9yq17x6xlg6fjar6gv3hdi0zijwmx4s02pmw6727484";
version = "118.0.5993.70";
};
+11 -5
pkgs/build-support/fetchgit/nix-prefetch-git
···
cd "$repo"
# Remove files that contain timestamps or otherwise have non-deterministic
# properties.
-
rm -rf .git/logs/ .git/hooks/ .git/index .git/FETCH_HEAD .git/ORIG_HEAD \
-
.git/refs/remotes/origin/HEAD .git/config
-
# Remove all remote branches.
git branch -r | while read -r branch; do
clean_git branch -rD "$branch"
···
# Do a full repack. Must run single-threaded, or else we lose determinism.
clean_git config pack.threads 1
clean_git repack -A -d -f
-
rm -f .git/config
# Garbage collect unreferenced objects.
# Note: --keep-largest-pack prevents non-deterministic ordering of packs
···
find "$dir" -name .git -print0 | xargs -0 rm -rf
else
find "$dir" -name .git | while read -r gitdir; do
-
make_deterministic_repo "$(readlink -f "$gitdir/..")"
done
fi
}
···
cd "$repo"
# Remove files that contain timestamps or otherwise have non-deterministic
# properties.
+
if [ -f .git ]; then
+
local dotgit_content=$(<.git)
+
local dotgit_dir="${dotgit_content#gitdir: }"
+
else
+
local dotgit_dir=".git"
+
fi
+
pushd "$dotgit_dir"
+
rm -rf logs/ hooks/ index FETCH_HEAD ORIG_HEAD refs/remotes/origin/HEAD config
+
popd
# Remove all remote branches.
git branch -r | while read -r branch; do
clean_git branch -rD "$branch"
···
# Do a full repack. Must run single-threaded, or else we lose determinism.
clean_git config pack.threads 1
clean_git repack -A -d -f
+
rm -f "$dotgit_dir/config"
# Garbage collect unreferenced objects.
# Note: --keep-largest-pack prevents non-deterministic ordering of packs
···
find "$dir" -name .git -print0 | xargs -0 rm -rf
else
find "$dir" -name .git | while read -r gitdir; do
+
make_deterministic_repo "$(readlink -f "$(dirname "$gitdir")")"
done
fi
}
+6 -6
pkgs/by-name/wa/waycheck/package.nix
···
, wrapGAppsHook
}:
-
stdenv.mkDerivation rec {
pname = "waycheck";
-
version = "0.1.3";
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "serebit";
repo = "waycheck";
-
rev = "v${version}";
-
hash = "sha256-DbXc1Q/ZIqlIMocFld3fOmUp44rU3fEzazHKSDdqMNs=";
};
nativeBuildInputs = [
···
description = "Simple GUI that displays the protocols implemented by a Wayland compositor";
homepage = "https://gitlab.freedesktop.org/serebit/waycheck";
license = licenses.asl20;
-
maintainers = with maintainers; [ julienmalka ];
mainProgram = "waycheck";
platforms = platforms.linux;
};
-
}
···
, wrapGAppsHook
}:
+
stdenv.mkDerivation (finalAttrs: {
pname = "waycheck";
+
version = "1.0.0";
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "serebit";
repo = "waycheck";
+
rev = "v${finalAttrs.version}";
+
hash = "sha256-oGpiFwbPBQHF0wRHliltU8B+QmClcoFfbjpAYzOFPqs=";
};
nativeBuildInputs = [
···
description = "Simple GUI that displays the protocols implemented by a Wayland compositor";
homepage = "https://gitlab.freedesktop.org/serebit/waycheck";
license = licenses.asl20;
+
maintainers = with maintainers; [ julienmalka federicoschonborn ];
mainProgram = "waycheck";
platforms = platforms.linux;
};
+
})
+6 -6
pkgs/data/misc/xorg-rgb/default.nix
···
{ lib, stdenv, fetchurl, pkg-config, xorgproto }:
-
stdenv.mkDerivation rec {
pname = "rgb";
-
version = "1.0.6";
src = fetchurl {
-
url = "https://xorg.freedesktop.org/archive/individual/app/rgb-${version}.tar.bz2";
-
sha256 = "1c76zcjs39ljil6f6jpx1x17c8fnvwazz7zvl3vbjfcrlmm7rjmv";
};
nativeBuildInputs = [ pkg-config ];
···
meta = with lib; {
description = "X11 colorname to RGB mapping database";
license = licenses.mit;
-
maintainers = [ maintainers.raskin ];
platforms = platforms.linux;
homepage = "https://xorg.freedesktop.org/";
};
-
}
···
{ lib, stdenv, fetchurl, pkg-config, xorgproto }:
+
stdenv.mkDerivation (finalAttrs: {
pname = "rgb";
+
version = "1.1.0";
src = fetchurl {
+
url = "https://xorg.freedesktop.org/archive/individual/app/rgb-${finalAttrs.version}.tar.xz";
+
hash = "sha256-/APX9W5bKmF2aBZ/iSeUjM5U+TCX58zZ8FYHf0ee03s=";
};
nativeBuildInputs = [ pkg-config ];
···
meta = with lib; {
description = "X11 colorname to RGB mapping database";
license = licenses.mit;
+
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
homepage = "https://xorg.freedesktop.org/";
};
+
})
+30 -3
pkgs/development/libraries/speech-tools/default.nix
···
-
{ lib, stdenv, fetchurl, alsa-lib, ncurses }:
stdenv.mkDerivation rec {
pname = "speech_tools";
···
sha256 = "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4";
};
-
buildInputs = [ alsa-lib ncurses ];
# Workaround build failure on -fno-common toolchains:
# ld: libestools.a(editline.o):(.bss+0x28): multiple definition of
···
meta = with lib; {
description = "Text-to-speech engine";
maintainers = with maintainers; [ raskin ];
-
platforms = platforms.linux;
license = licenses.free;
};
···
+
{ lib
+
, stdenv
+
, fetchurl
+
, fetchpatch
+
, ncurses
+
, alsa-lib
+
, CoreServices
+
, AudioUnit
+
, Cocoa
+
}:
stdenv.mkDerivation rec {
pname = "speech_tools";
···
sha256 = "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4";
};
+
patches = [
+
# Fix build on Apple Silicon. Remove in the next release.
+
(fetchpatch {
+
url = "https://github.com/festvox/speech_tools/commit/06141f69d21bf507a9becb5405265dc362edb0df.patch";
+
hash = "sha256-tRestCBuRhak+2ccsB6mvDxGm/TIYX4eZ3oppCOEP9s=";
+
})
+
];
+
+
buildInputs = [
+
ncurses
+
] ++ lib.optionals stdenv.isLinux [
+
alsa-lib
+
] ++ lib.optionals stdenv.isDarwin [
+
CoreServices
+
AudioUnit
+
Cocoa
+
];
+
+
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "CXX=${stdenv.cc.targetPrefix}c++" ];
# Workaround build failure on -fno-common toolchains:
# ld: libestools.a(editline.o):(.bss+0x28): multiple definition of
···
meta = with lib; {
description = "Text-to-speech engine";
maintainers = with maintainers; [ raskin ];
+
platforms = platforms.unix;
license = licenses.free;
};
+2 -2
pkgs/development/python-modules/apprise/default.nix
···
buildPythonPackage rec {
pname = "apprise";
-
version = "1.5.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
-
hash = "sha256-PFgRQQd6EBeQ7eDKsW+ig60DKpsvl9xtNWX7LZGBP9c=";
};
nativeBuildInputs = [
···
buildPythonPackage rec {
pname = "apprise";
+
version = "1.6.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
+
hash = "sha256-Pu+rHF15eLDmXFCR0c2+kgaGXcPLXRnKXPvdt26Kr/4=";
};
nativeBuildInputs = [
+23
pkgs/development/python-modules/command_runner/default.nix
···
···
+
{ lib, buildPythonPackage, fetchPypi, psutil }:
+
+
buildPythonPackage rec {
+
pname = "command_runner";
+
version = "1.5.0";
+
+
src = fetchPypi {
+
inherit pname version;
+
sha256 = "sha256-UIDzLLIm69W53jvS9M2LVclM+OqRYmLtvuXVAv54ltg=";
+
};
+
+
propagatedBuildInputs = [ psutil ];
+
+
meta = with lib; {
+
homepage = "https://github.com/netinvent/command_runner";
+
description = ''
+
Platform agnostic command execution, timed background jobs with live
+
stdout/stderr output capture, and UAC/sudo elevation
+
'';
+
license = licenses.bsd3;
+
maintainers = teams.wdz.members;
+
};
+
}
pkgs/development/python-modules/et_xmlfile/default.nix pkgs/development/python-modules/et-xmlfile/default.nix
+37
pkgs/development/python-modules/guzzle-sphinx-theme/default.nix
···
···
+
{ lib
+
, buildPythonPackage
+
, fetchPypi
+
, setuptools
+
, sphinx
+
}:
+
+
buildPythonPackage rec {
+
pname = "guzzle-sphinx-theme";
+
version = "0.7.11";
+
pyproject = true;
+
+
src = fetchPypi {
+
pname = "guzzle_sphinx_theme";
+
inherit version;
+
hash = "sha256-m4wWOcNDwCw/PbffZg3fb1M7VFTukqX3sC7apXP+0+Y=";
+
};
+
+
nativeBuildInputs = [
+
setuptools
+
];
+
+
doCheck = false; # no tests
+
+
propagatedBuildInputs = [ sphinx ];
+
+
pythonImportsCheck = [
+
"guzzle_sphinx_theme"
+
];
+
+
meta = with lib; {
+
description = "Sphinx theme used by Guzzle: http://guzzlephp.org";
+
homepage = "https://github.com/guzzle/guzzle_sphinx_theme/";
+
license = licenses.mit;
+
maintainers = with maintainers; [ flokli ];
+
};
+
}
-22
pkgs/development/python-modules/guzzle_sphinx_theme/default.nix
···
-
{ lib, buildPythonPackage, sphinx, fetchPypi }:
-
-
buildPythonPackage rec {
-
pname = "guzzle_sphinx_theme";
-
version = "0.7.11";
-
src = fetchPypi {
-
inherit pname version;
-
sha256 = "1rnkzrrsbnifn3vsb4pfaia3nlvgvw6ndpxp7lzjrh23qcwid34v";
-
};
-
-
doCheck = false; # no tests
-
-
propagatedBuildInputs = [ sphinx ];
-
-
meta = with lib; {
-
description = "Sphinx theme used by Guzzle: http://guzzlephp.org";
-
homepage = "https://github.com/guzzle/guzzle_sphinx_theme/";
-
license = licenses.mit;
-
maintainers = with maintainers; [ flokli ];
-
platforms = platforms.unix;
-
};
-
}
···
+2 -2
pkgs/development/python-modules/openpyxl/default.nix
···
{ lib
, buildPythonPackage
-
, et_xmlfile
, fetchFromGitLab
, jdcal
, lxml
···
propagatedBuildInputs = [
jdcal
-
et_xmlfile
lxml
];
···
{ lib
, buildPythonPackage
+
, et-xmlfile
, fetchFromGitLab
, jdcal
, lxml
···
propagatedBuildInputs = [
jdcal
+
et-xmlfile
lxml
];
+3 -2
pkgs/development/python-modules/pythonnet/default.nix
···
let
pname = "pythonnet";
-
version = "3.0.2";
src = fetchPypi {
pname = "pythonnet";
inherit version;
-
sha256 = "sha256-LN0cztxkp8m9cRvj0P0MSniTJHQTncVKppe+3edBx0Y=";
};
# This buildDotnetModule is used only to get nuget sources, the actual
···
meta = with lib; {
description = ".NET integration for Python";
homepage = "https://pythonnet.github.io";
license = licenses.mit;
# <https://github.com/pythonnet/pythonnet/issues/898>
badPlatforms = [ "aarch64-linux" ];
···
let
pname = "pythonnet";
+
version = "3.0.3";
src = fetchPypi {
pname = "pythonnet";
inherit version;
+
hash = "sha256-jUsulxWKAjh1+GR0WKWPOIF/T+Oa9gq91rDYrfHXfnU=";
};
# This buildDotnetModule is used only to get nuget sources, the actual
···
meta = with lib; {
description = ".NET integration for Python";
homepage = "https://pythonnet.github.io";
+
changelog = "https://github.com/pythonnet/pythonnet/releases/tag/v${version}";
license = licenses.mit;
# <https://github.com/pythonnet/pythonnet/issues/898>
badPlatforms = [ "aarch64-linux" ];
-30
pkgs/development/tools/guile/guile-lint/default.nix
···
-
{ lib, stdenv, fetchurl, guile }:
-
-
stdenv.mkDerivation rec {
-
pname = "guile-lint";
-
version = "14";
-
-
src = fetchurl {
-
url = "https://download.tuxfamily.org/user42/${pname}-${version}.tar.bz2";
-
sha256 = "1gnhnmki05pkmzpbfc07vmb2iwza6vhy75y03bw2x2rk4fkggz2v";
-
};
-
-
buildInputs = [ guile ];
-
-
unpackPhase = ''tar xjvf "$src" && sourceRoot="$PWD/${pname}-${version}"'';
-
-
prePatch = ''
-
substituteInPlace guile-lint.in --replace \
-
"exec guile" "exec ${guile}/bin/guile"
-
'';
-
-
doCheck = !stdenv.isDarwin;
-
-
meta = with lib; {
-
description = "Checks syntax and semantics in a Guile program or module";
-
homepage = "https://user42.tuxfamily.org/guile-lint/index.html";
-
license = licenses.gpl3Plus;
-
maintainers = with maintainers; [ vyp ];
-
platforms = platforms.all;
-
};
-
}
···
+79 -9
pkgs/servers/monitoring/kapacitor/default.nix
···
-
{ lib, fetchFromGitHub, buildGoPackage }:
-
buildGoPackage rec {
pname = "kapacitor";
-
version = "1.5.7";
-
-
goPackagePath = "github.com/influxdata/kapacitor";
src = fetchFromGitHub {
owner = "influxdata";
repo = "kapacitor";
rev = "v${version}";
-
sha256 = "0lzx25d4y5d8rsddgnypfskcxa5qlwc294sdzmn8dlq995yphpac";
};
meta = with lib; {
description = "Open source framework for processing, monitoring, and alerting on time series data";
license = licenses.mit;
-
homepage = "https://influxdata.com/time-series-platform/kapacitor/";
-
maintainers = with maintainers; [ offline ];
-
platforms = with platforms; linux;
};
}
···
+
{ stdenv
+
, lib
+
, rustPlatform
+
, fetchFromGitHub
+
, fetchpatch
+
, libiconv
+
, buildGoModule
+
, pkg-config
+
}:
+
let
+
libflux_version = "0.171.0";
+
flux = rustPlatform.buildRustPackage rec {
+
pname = "libflux";
+
version = "v${libflux_version}";
+
src = fetchFromGitHub {
+
owner = "influxdata";
+
repo = "flux";
+
rev = "v${libflux_version}";
+
hash = "sha256-v9MUR+PcxAus91FiHYrMN9MbNOTWewh7MT6/t/QWQcM=";
+
};
+
patches = [
+
# https://github.com/influxdata/flux/pull/5273
+
# fix compile error with Rust 1.64
+
(fetchpatch {
+
url = "https://github.com/influxdata/flux/commit/20ca62138a0669f2760dd469ca41fc333e04b8f2.patch";
+
stripLen = 2;
+
extraPrefix = "";
+
hash = "sha256-Fb4CuH9ZvrPha249dmLLI8MqSNQRKqKPxPbw2pjqwfY=";
+
})
+
];
+
sourceRoot = "${src.name}/libflux";
+
cargoSha256 = "sha256-oAMoGGdR0QEjSzZ0/J5J9s/ekSlryCcRBSo5N2r70Ko=";
+
nativeBuildInputs = [ rustPlatform.bindgenHook ];
+
buildInputs = lib.optional stdenv.isDarwin libiconv;
+
pkgcfg = ''
+
Name: flux
+
Version: ${libflux_version}
+
Description: Library for the InfluxData Flux engine
+
Cflags: -I/out/include
+
Libs: -L/out/lib -lflux -lpthread
+
'';
+
passAsFile = [ "pkgcfg" ];
+
postInstall = ''
+
mkdir -p $out/include $out/pkgconfig
+
cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include
+
substitute $pkgcfgPath $out/pkgconfig/flux.pc \
+
--replace /out $out
+
'' + lib.optionalString stdenv.isDarwin ''
+
install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib
+
'';
+
};
+
in
+
buildGoModule rec {
pname = "kapacitor";
+
version = "1.7.0";
src = fetchFromGitHub {
owner = "influxdata";
repo = "kapacitor";
rev = "v${version}";
+
hash = "sha256-vDluZZrct1x+OMVU8MNO56YBZq7JNlpW68alOrAGYSM=";
};
+
vendorHash = "sha256-OX4QAthg15lwMyhOPyLTS++CMvGI5Um+FSd025PhW3E=";
+
+
nativeBuildInputs = [ pkg-config ];
+
+
PKG_CONFIG_PATH = "${flux}/pkgconfig";
+
+
# Check that libflux is at the right version
+
preBuild = ''
+
flux_ver=$(grep github.com/influxdata/flux go.mod | awk '{print $2}')
+
if [ "$flux_ver" != "v${libflux_version}" ]; then
+
echo "go.mod wants libflux $flux_ver, but nix derivation provides ${libflux_version}"
+
exit 1
+
fi
+
'';
+
+
# Remove failing server tests
+
preCheck = ''
+
rm server/server_test.go
+
'';
+
meta = with lib; {
description = "Open source framework for processing, monitoring, and alerting on time series data";
+
homepage = "https://influxdata.com/time-series-platform/kapacitor/";
+
downloadPage = "https://github.com/influxdata/kapacitor/releases";
license = licenses.mit;
+
changelog = "https://github.com/influxdata/kapacitor/blob/master/CHANGELOG.md";
+
maintainers = with maintainers; [ offline totoroot ];
};
}
+18
pkgs/servers/monitoring/librenms/broken-binary-paths.diff
···
···
+
diff --git a/LibreNMS/Config.php b/LibreNMS/Config.php
+
index 5ed6b71..de7718a 100644
+
--- a/LibreNMS/Config.php
+
+++ b/LibreNMS/Config.php
+
@@ -460,13 +460,6 @@ class Config
+
self::persist('device_display_default', $display_value);
+
}
+
+
- // make sure we have full path to binaries in case PATH isn't set
+
- foreach (['fping', 'fping6', 'snmpgetnext', 'rrdtool', 'traceroute'] as $bin) {
+
- if (! is_executable(self::get($bin))) {
+
- self::persist($bin, self::locateBinary($bin));
+
- }
+
- }
+
-
+
if (! self::has('rrdtool_version')) {
+
self::persist('rrdtool_version', Rrd::version());
+
}
+116
pkgs/servers/monitoring/librenms/default.nix
···
···
+
{ lib
+
, fetchFromGitHub
+
, unixtools
+
, php82
+
, python3
+
, makeWrapper
+
, nixosTests
+
# run-time dependencies
+
, graphviz
+
, ipmitool
+
, libvirt
+
, monitoring-plugins
+
, mtr
+
, net-snmp
+
, nfdump
+
, nmap
+
, rrdtool
+
, system-sendmail
+
, whois
+
, dataDir ? "/var/lib/librenms", logDir ? "/var/log/librenms" }:
+
+
+
let
+
phpPackage = php82.withExtensions ({ enabled, all }: enabled ++ [ all.memcached ]);
+
in phpPackage.buildComposerProject rec {
+
name = pname + "-" + version;
+
pname = "librenms";
+
version = "23.9.1";
+
+
src = fetchFromGitHub {
+
owner = "librenms";
+
repo = pname;
+
rev = "${version}";
+
sha256 = "sha256-glcD9AhxkvMmGo/7/RhQFeOtvHJ4pSiEFxaAjeVrTaI=";
+
};
+
+
vendorHash = "sha256-s6vdGfM7Ehy1bbkB44EQaHBBvTkpVw9yxhVsc/O8dHc=";
+
+
php = phpPackage;
+
+
buildInputs = [
+
unixtools.whereis
+
(python3.withPackages (ps: with ps; [
+
pymysql
+
python-dotenv
+
redis
+
setuptools
+
psutil
+
command_runner
+
]))
+
];
+
+
nativeBuildInputs = [ makeWrapper ];
+
+
installPhase = ''
+
runHook preInstall
+
+
mv $out/share/php/librenms/* $out
+
rm -r $out/share
+
+
# This broken logic leads to bad settings being persisted in the database
+
patch -p1 -d $out -i ${./broken-binary-paths.diff}
+
+
substituteInPlace \
+
$out/misc/config_definitions.json \
+
--replace '"default": "/bin/ping",' '"default": "/run/wrappers/bin/ping",' \
+
--replace '"default": "fping",' '"default": "/run/wrappers/bin/fping",' \
+
--replace '"default": "fping6",' '"default": "/run/wrappers/bin/fping6",' \
+
--replace '"default": "rrdtool",' '"default": "${rrdtool}/bin/rrdtool",' \
+
--replace '"default": "snmpgetnext",' '"default": "${net-snmp}/bin/snmpgetnext",' \
+
--replace '"default": "traceroute",' '"default": "/run/wrappers/bin/traceroute",' \
+
--replace '"default": "/usr/bin/dot",' '"default": "${graphviz}/bin/dot",' \
+
--replace '"default": "/usr/bin/ipmitool",' '"default": "${ipmitool}/bin/ipmitool",' \
+
--replace '"default": "/usr/bin/mtr",' '"default": "${mtr}/bin/mtr",' \
+
--replace '"default": "/usr/bin/nfdump",' '"default": "${nfdump}/bin/nfdump",' \
+
--replace '"default": "/usr/bin/nmap",' '"default": "${nmap}/bin/nmap",' \
+
--replace '"default": "/usr/bin/sfdp",' '"default": "${graphviz}/bin/sfdp",' \
+
--replace '"default": "/usr/bin/snmpbulkwalk",' '"default": "${net-snmp}/bin/snmpbulkwalk",' \
+
--replace '"default": "/usr/bin/snmpget",' '"default": "${net-snmp}/bin/snmpget",' \
+
--replace '"default": "/usr/bin/snmptranslate",' '"default": "${net-snmp}/bin/snmptranslate",' \
+
--replace '"default": "/usr/bin/snmpwalk",' '"default": "${net-snmp}/bin/snmpwalk",' \
+
--replace '"default": "/usr/bin/virsh",' '"default": "${libvirt}/bin/virsh",' \
+
--replace '"default": "/usr/bin/whois",' '"default": "${whois}/bin/whois",' \
+
--replace '"default": "/usr/lib/nagios/plugins",' '"default": "${monitoring-plugins}/libexec",' \
+
--replace '"default": "/usr/sbin/sendmail",' '"default": "${system-sendmail}/bin/sendmail",'
+
+
substituteInPlace $out/LibreNMS/wrapper.py --replace '/usr/bin/env php' '${phpPackage}/bin/php'
+
substituteInPlace $out/LibreNMS/__init__.py --replace '"/usr/bin/env", "php"' '"${phpPackage}/bin/php"'
+
substituteInPlace $out/snmp-scan.py --replace '"/usr/bin/env", "php"' '"${phpPackage}/bin/php"'
+
+
wrapProgram $out/daily.sh --prefix PATH : ${phpPackage}/bin
+
+
rm -rf $out/logs $out/rrd $out/bootstrap/cache $out/storage $out/.env
+
ln -s ${logDir} $out/logs
+
ln -s ${dataDir}/config.php $out/config.php
+
ln -s ${dataDir}/.env $out/.env
+
ln -s ${dataDir}/rrd $out/rrd
+
ln -s ${dataDir}/storage $out/storage
+
ln -s ${dataDir}/cache $out/bootstrap/cache
+
+
runHook postInstall
+
'';
+
+
passthru = {
+
phpPackage = phpPackage;
+
tests.librenms = nixosTests.librenms;
+
};
+
+
meta = with lib; {
+
description = "A auto-discovering PHP/MySQL/SNMP based network monitoring";
+
homepage = "https://www.librenms.org/";
+
license = licenses.gpl3Only;
+
maintainers = teams.wdz.members;
+
platforms = platforms.linux;
+
};
+
}
+9 -4
pkgs/servers/tang/default.nix
···
, testers
, tang
, gitUpdater
}:
stdenv.mkDerivation rec {
···
'';
passthru = {
-
tests.version = testers.testVersion {
-
package = tang;
-
command = "${tang}/libexec/tangd --version";
-
version = "tangd ${version}";
};
updateScript = gitUpdater { };
};
···
changelog = "https://github.com/latchset/tang/releases/tag/v${version}";
maintainers = with lib.maintainers; [ fpletz ];
license = lib.licenses.gpl3Plus;
};
}
···
, testers
, tang
, gitUpdater
+
, nixosTests
}:
stdenv.mkDerivation rec {
···
'';
passthru = {
+
tests = {
+
inherit (nixosTests) tang;
+
version = testers.testVersion {
+
package = tang;
+
command = "${tang}/libexec/tangd --version";
+
version = "tangd ${version}";
+
};
};
updateScript = gitUpdater { };
};
···
changelog = "https://github.com/latchset/tang/releases/tag/v${version}";
maintainers = with lib.maintainers; [ fpletz ];
license = lib.licenses.gpl3Plus;
+
mainProgram = "tangd";
};
}
+1 -1
pkgs/tools/backup/borgbackup/default.nix
···
# docs
sphinxHook
-
guzzle_sphinx_theme
# shell completions
installShellFiles
···
# docs
sphinxHook
+
guzzle-sphinx-theme
# shell completions
installShellFiles
-32
pkgs/tools/misc/cloud-sql-proxy/default.nix
···
-
{ lib
-
, buildGoModule
-
, fetchFromGitHub
-
}:
-
-
buildGoModule rec {
-
pname = "cloud-sql-proxy";
-
version = "2.7.0";
-
-
src = fetchFromGitHub {
-
owner = "GoogleCloudPlatform";
-
repo = "cloud-sql-proxy";
-
rev = "v${version}";
-
hash = "sha256-4PB9Eaqb8teF+gmiHD2VAIFnxqiK2Nb0u+xSNAM8iMs=";
-
};
-
-
subPackages = [ "." ];
-
-
vendorHash = "sha256-LaI7IdSyB7ETTjqIcIPDf3noEbvwlN3+KqrkSm8B6m8=";
-
-
preCheck = ''
-
buildFlagsArray+="-short"
-
'';
-
-
meta = with lib; {
-
description = "Utility for ensuring secure connections to Google Cloud SQL instances";
-
homepage = "https://github.com/GoogleCloudPlatform/cloud-sql-proxy";
-
license = licenses.asl20;
-
maintainers = with maintainers; [ nicknovitski totoroot ];
-
mainProgram = "cloud-sql-proxy";
-
};
-
}
···
+37
pkgs/tools/misc/google-cloud-bigtable-tool/default.nix
···
···
+
{ lib
+
, buildGoModule
+
, fetchFromGitHub
+
}:
+
+
buildGoModule rec {
+
pname = "google-cloud-bigtable-tool";
+
version = "0.12.0";
+
+
src = fetchFromGitHub {
+
owner = "googleapis";
+
repo = "cloud-bigtable-cbt-cli";
+
rev = "v.${version}";
+
hash = "sha256-N5nbWMj7kLIdRiwBUWFz4Rat88Wx01i3hceMxAvSjaA=";
+
};
+
+
vendorHash = "sha256-kwvEfvHs6XF84bB3Ss1307OjId0nh/0Imih1fRFdY0M=";
+
+
preCheck = ''
+
buildFlagsArray+="-short"
+
'';
+
+
meta = with lib; {
+
description = "Google Cloud Bigtable Tool";
+
longDescription = ''
+
`cbt` is the Google Cloud Bigtable Tool. A CLI utility to interact with Google Cloud Bigtable.
+
The cbt CLI is a command-line interface for performing several different operations on Cloud Bigtable.
+
It is written in Go using the Go client library for Cloud Bigtable.
+
An overview of its usage can be found in the [Google Cloud docs](https://cloud.google.com/bigtable/docs/cbt-overview).
+
For information about Bigtable in general, see the [overview of Bigtable](https://cloud.google.com/bigtable/docs/overview).
+
'';
+
homepage = "https://github.com/googleapis/cloud-bigtable-cbt-cli";
+
license = licenses.asl20;
+
maintainers = with maintainers; [ totoroot ];
+
mainProgram = "cbt";
+
};
+
}
+40
pkgs/tools/misc/google-cloud-sql-proxy/default.nix
···
···
+
{ lib
+
, buildGoModule
+
, fetchFromGitHub
+
}:
+
+
buildGoModule rec {
+
pname = "google-cloud-sql-proxy";
+
version = "2.7.0";
+
+
src = fetchFromGitHub {
+
owner = "GoogleCloudPlatform";
+
repo = "cloud-sql-proxy";
+
rev = "v${version}";
+
hash = "sha256-4PB9Eaqb8teF+gmiHD2VAIFnxqiK2Nb0u+xSNAM8iMs=";
+
};
+
+
subPackages = [ "." ];
+
+
vendorHash = "sha256-LaI7IdSyB7ETTjqIcIPDf3noEbvwlN3+KqrkSm8B6m8=";
+
+
preCheck = ''
+
buildFlagsArray+="-short"
+
'';
+
+
meta = with lib; {
+
description = "Utility for ensuring secure connections to Google Cloud SQL instances";
+
longDescription = ''
+
The Cloud SQL Auth Proxy is a utility for ensuring secure connections to your Cloud SQL instances.
+
It provides IAM authorization, allowing you to control who can connect to your instance through IAM permissions,
+
and TLS 1.3 encryption, without having to manage certificates.
+
See the [Connecting Overview](https://cloud.google.com/sql/docs/mysql/connect-overview) page for more information
+
on connecting to a Cloud SQL instance, or the [About the Proxy](https://cloud.google.com/sql/docs/mysql/sql-proxy)
+
page for details on how the Cloud SQL Proxy works.
+
'';
+
homepage = "https://github.com/GoogleCloudPlatform/cloud-sql-proxy";
+
license = licenses.asl20;
+
maintainers = with maintainers; [ nicknovitski totoroot ];
+
mainProgram = "cloud-sql-proxy";
+
};
+
}
+3 -3
pkgs/tools/networking/sockdump/default.nix
···
python3.pkgs.buildPythonApplication rec {
pname = "sockdump";
-
version = "unstable-2022-10-12";
src = fetchFromGitHub {
owner = "mechpen";
repo = pname;
-
rev = "005dcb056238c2e37ff378aef27c953208ffa08f";
-
hash = "sha256-X8PIUDxlcdPoD7+aLDWzlWV++P3mmu52BwY7irhypww=";
};
propagatedBuildInputs = [ bcc ];
···
python3.pkgs.buildPythonApplication rec {
pname = "sockdump";
+
version = "unstable-2023-09-16";
src = fetchFromGitHub {
owner = "mechpen";
repo = pname;
+
rev = "713759e383366feae76863881e851a6411c73b68";
+
hash = "sha256-q6jdwFhl2G9o2C0BVU6Xz7xizO00yaSQ2KSR/z4fixY=";
};
propagatedBuildInputs = [ bcc ];
+2
pkgs/top-level/aliases.nix
···
gr-rds = throw "'gr-rds' has been renamed to/replaced by 'gnuradio3_7.pkgs.rds'"; # Converted to throw 2023-09-10
grub2_full = grub2; # Added 2022-11-18
grub = throw "grub1 was removed after not being maintained upstream for a decade. Please switch to another bootloader"; # Added 2023-04-11
### H ###
···
shhgit = throw "shhgit is broken and is no longer maintained. See https://github.com/eth0izzle/shhgit#-shhgit-is-no-longer-maintained-" ; # Added 2023-08-08
shipyard = jumppad; # Added 2023-06-06
signumone-ks = throw "signumone-ks has been removed from nixpkgs because the developers stopped offering the binaries"; # Added 2023-08-17
slack-dark = slack; # Added 2020-03-27
slmenu = throw "slmenu has been removed (upstream is gone)"; # Added 2023-04-06
slurm-llnl = slurm; # renamed July 2017
···
gr-rds = throw "'gr-rds' has been renamed to/replaced by 'gnuradio3_7.pkgs.rds'"; # Converted to throw 2023-09-10
grub2_full = grub2; # Added 2022-11-18
grub = throw "grub1 was removed after not being maintained upstream for a decade. Please switch to another bootloader"; # Added 2023-04-11
+
guile-lint = throw "'guile-lint' has been removed, please use 'guild lint' instead"; # Added 2023-10-16
### H ###
···
shhgit = throw "shhgit is broken and is no longer maintained. See https://github.com/eth0izzle/shhgit#-shhgit-is-no-longer-maintained-" ; # Added 2023-08-08
shipyard = jumppad; # Added 2023-06-06
signumone-ks = throw "signumone-ks has been removed from nixpkgs because the developers stopped offering the binaries"; # Added 2023-08-17
+
simplenote = throw "'simplenote' has been removed because it is no longer maintained and insecure"; # Added 2023-10-09
slack-dark = slack; # Added 2020-03-27
slmenu = throw "slmenu has been removed (upstream is gone)"; # Added 2023-04-06
slurm-llnl = slurm; # renamed July 2017
+9 -9
pkgs/top-level/all-packages.nix
···
clairvoyance = callPackage ../tools/security/clairvoyance { };
-
cloud-sql-proxy = callPackage ../tools/misc/cloud-sql-proxy { };
-
cloudfox = callPackage ../tools/security/cloudfox { };
cloudhunter = callPackage ../tools/security/cloudhunter { };
···
libnss-mysql = callPackage ../os-specific/linux/libnss-mysql { };
libnvme = callPackage ../os-specific/linux/libnvme { };
libxnd = callPackage ../development/libraries/libxnd { };
···
python = python3;
with-gce = true;
};
google-fonts = callPackage ../data/fonts/google-fonts { };
···
guile-hall = callPackage ../development/tools/guile/guile-hall { };
-
guile-lint = callPackage ../development/tools/guile/guile-lint {
-
guile = guile_1_8;
-
};
-
gwrap = callPackage ../development/tools/guile/g-wrap {
guile = guile_2_2;
};
···
speechd = callPackage ../development/libraries/speechd { };
-
speech-tools = callPackage ../development/libraries/speech-tools { };
speex = callPackage ../development/libraries/speex {
fftw = fftwFloat;
···
nitrokey-app2 = libsForQt5.callPackage ../tools/security/nitrokey-app2 { };
fpm2 = callPackage ../tools/security/fpm2 { };
-
-
simplenote = callPackage ../applications/misc/simplenote { };
hy = with python3Packages; toPythonApplication hy;
···
clairvoyance = callPackage ../tools/security/clairvoyance { };
cloudfox = callPackage ../tools/security/cloudfox { };
cloudhunter = callPackage ../tools/security/cloudhunter { };
···
libnss-mysql = callPackage ../os-specific/linux/libnss-mysql { };
libnvme = callPackage ../os-specific/linux/libnvme { };
+
+
librenms = callPackage ../servers/monitoring/librenms { };
libxnd = callPackage ../development/libraries/libxnd { };
···
python = python3;
with-gce = true;
};
+
+
google-cloud-bigtable-tool = callPackage ../tools/misc/google-cloud-bigtable-tool { };
+
+
google-cloud-sql-proxy = callPackage ../tools/misc/google-cloud-sql-proxy { };
google-fonts = callPackage ../data/fonts/google-fonts { };
···
guile-hall = callPackage ../development/tools/guile/guile-hall { };
gwrap = callPackage ../development/tools/guile/g-wrap {
guile = guile_2_2;
};
···
speechd = callPackage ../development/libraries/speechd { };
+
speech-tools = callPackage ../development/libraries/speech-tools {
+
inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa;
+
};
speex = callPackage ../development/libraries/speex {
fftw = fftwFloat;
···
nitrokey-app2 = libsForQt5.callPackage ../tools/security/nitrokey-app2 { };
fpm2 = callPackage ../tools/security/fpm2 { };
hy = with python3Packages; toPythonApplication hy;
+2
pkgs/top-level/python-aliases.nix
···
eebrightbox = throw "eebrightbox is unmaintained upstream and has therefore been removed"; # added 2022-02-03
EasyProcess = easyprocess; # added 2023-02-19
email_validator = email-validator; # added 2022-06-22
ev3dev2 = python-ev3dev2; # added 2023-06-19
Fabric = fabric; # addedd 2023-02-19
face_recognition = face-recognition; # added 2022-10-15
···
graphite_beacon = throw "graphite_beacon was removed, because it is no longer maintained"; # added 2022-07-09
grappelli_safe = grappelli-safe; # added 2023-10-08
grpc_google_iam_v1 = grpc-google-iam-v1; # added 2021-08-21
ha-av = throw "ha-av was removed, because it is no longer maintained"; # added 2022-04-06
HAP-python = hap-python; # added 2021-06-01
hangups = throw "hangups was removed because Google Hangouts has been shut down"; # added 2023-02-13
···
eebrightbox = throw "eebrightbox is unmaintained upstream and has therefore been removed"; # added 2022-02-03
EasyProcess = easyprocess; # added 2023-02-19
email_validator = email-validator; # added 2022-06-22
+
et_xmlfile = et-xmlfile; # added 2023-10-16
ev3dev2 = python-ev3dev2; # added 2023-06-19
Fabric = fabric; # addedd 2023-02-19
face_recognition = face-recognition; # added 2022-10-15
···
graphite_beacon = throw "graphite_beacon was removed, because it is no longer maintained"; # added 2022-07-09
grappelli_safe = grappelli-safe; # added 2023-10-08
grpc_google_iam_v1 = grpc-google-iam-v1; # added 2021-08-21
+
guzzle_sphinx_theme = guzzle-sphinx-theme; # added 2023-10-16
ha-av = throw "ha-av was removed, because it is no longer maintained"; # added 2022-04-06
HAP-python = hap-python; # added 2021-06-01
hangups = throw "hangups was removed because Google Hangouts has been shut down"; # added 2023-02-13
+4 -2
pkgs/top-level/python-packages.nix
···
comicon = callPackage ../development/python-modules/comicon { };
connect-box = callPackage ../development/python-modules/connect_box { };
connection-pool = callPackage ../development/python-modules/connection-pool { };
···
etuples = callPackage ../development/python-modules/etuples { };
-
et_xmlfile = callPackage ../development/python-modules/et_xmlfile { };
eufylife-ble-client = callPackage ../development/python-modules/eufylife-ble-client { };
···
else
throw "gurobipy not yet supported on ${stdenv.hostPlatform.system}";
-
guzzle_sphinx_theme = callPackage ../development/python-modules/guzzle_sphinx_theme { };
gvm-tools = callPackage ../development/python-modules/gvm-tools { };
···
comicon = callPackage ../development/python-modules/comicon { };
+
command_runner = callPackage ../development/python-modules/command_runner { };
+
connect-box = callPackage ../development/python-modules/connect_box { };
connection-pool = callPackage ../development/python-modules/connection-pool { };
···
etuples = callPackage ../development/python-modules/etuples { };
+
et-xmlfile = callPackage ../development/python-modules/et-xmlfile { };
eufylife-ble-client = callPackage ../development/python-modules/eufylife-ble-client { };
···
else
throw "gurobipy not yet supported on ${stdenv.hostPlatform.system}";
+
guzzle-sphinx-theme = callPackage ../development/python-modules/guzzle-sphinx-theme { };
gvm-tools = callPackage ../development/python-modules/gvm-tools { };