1
0
Fork 0

Compare commits

..

No commits in common. "6d2274218df229248bcbaec8f7805b2c14805ebc" and "77af60d5c7776b9b748908b801a8402fdf8f1914" have entirely different histories.

20 changed files with 152 additions and 3411 deletions

View File

@ -6,26 +6,16 @@ let
in rec {
janus-gateway = callPackage ./pkgs/janus-gateway { };
janus-gateway = callPackage ./pkgs/janus-gateway { inherit usrsctp; };
nextcloud-spreed-signaling = callPackage ./pkgs/nextcloud-spreed-signaling { };
snipe-it = callPackage ./pkgs/snipe-it { };
usrsctp = callPackage ./pkgs/usrsctp { };
} // optionalAttrs (pkgs.system == "x86_64-linux") rec {
chrysalis-bin = callPackage ./pkgs/chrysalis-bin { };
navidrome-bin = callPackage ./pkgs/navidrome-bin { };
} // optionalAttrs (pkgs.system == "x86_64-linux") {
ryzenadj = callPackage ./pkgs/ryzenadj { };
ryzen_smu = callPackage ./pkgs/ryzen_smu { kernel = pkgs.linux; };
} // optionalAttrs (builtins.elem pkgs.system pkgs.lib.platforms.linux) rec {
xmm7360-pci = callPackage ./pkgs/xmm7360-pci { kernel = pkgs.linux; };
xmm7360-pci-tools = callPackage ./pkgs/xmm7360-pci/tools.nix { inherit xmm7360-pci; };
}

View File

@ -2,16 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1628427351,
"narHash": "sha256-WuZUIQ07AvRw+T9wvQ3qFf8MXmKZ+ktZz9drNgWXDbs=",
"lastModified": 1615583000,
"narHash": "sha256-ysd3ntUs8qeVuYdmp2Y5J992NVdoKji9i92StU3IJ7M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "348bc5de8bca09c624f5c4975f538684da4713d2",
"rev": "60b18a066e8ce5dd21ebff5324345d3586a67ad9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-21.05-small",
"ref": "nixos-20.09-small",
"repo": "nixpkgs",
"type": "github"
}

View File

@ -1,7 +1,7 @@
{
description = "meterriblecrew.net package flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05-small";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09-small";
outputs = inputs@{ self, nixpkgs }: let
@ -19,13 +19,10 @@
nixosModules = {
ryzenSMU = import ./modules/ryzenSMU;
servicesNavidrome = import ./modules/services/navidrome.nix;
servicesSnipeIT = import ./modules/services/snipe-it.nix;
};
packages = forAllSystems (system: import ./. {
pkgs = import nixpkgs { inherit system; config = { allowUnfree = true; }; };
pkgs = import nixpkgs { inherit system; };
});
overlay = next: prev:
@ -34,20 +31,13 @@
inherit (localPkgs)
janus-gateway
nextcloud-spreed-signaling
snipe-it
usrsctp
;
} // prev.lib.optionalAttrs (prev.system == "x86_64-linux") rec {
} // prev.lib.optionalAttrs (prev.system == "x86_64-linux") {
inherit (localPkgs)
chrysalis-bin
navidrome-bin
ryzenadj
ryzen_smu
;
} // prev.lib.optionalAttrs (builtins.elem prev.system prev.lib.platforms.linux) rec {
inherit (localPkgs)
xmm7360-pci
xmm7360-pci-tools
;
};
};

View File

@ -1,82 +0,0 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) callPackageWith mkEnableOption mkIf mkOption
recursiveUpdate types;
cfg = config.services.navidrome;
package = callPackageWith pkgs ../../pkgs/navidrome-bin { };
settingsFormat = pkgs.formats.json {};
in lib.optionalAttrs (lib.versionOlder lib.version "21.11pre") {
options = {
services.navidrome = {
enable = mkEnableOption package.meta.description;
package = mkOption {
type = types.package;
default = package;
description = "Navidrome package to use.";
};
settings = mkOption rec {
type = settingsFormat.type;
apply = recursiveUpdate default;
default = {
Address = "127.0.0.1";
Port = 4533;
};
example = {
MusicFolder = "/mnt/music";
};
description = ''
Configuration for Navidrome, see <link xlink:href="https://www.navidrome.org/docs/usage/configuration-options/"/> for supported values.
'';
};
};
};
config = mkIf cfg.enable {
systemd.services.navidrome = {
description = "Navidrome Media Server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''
${cfg.package}/bin/navidrome --configfile ${settingsFormat.generate "navidrome.json" cfg.settings}
'';
DynamicUser = true;
StateDirectory = "navidrome";
WorkingDirectory = "/var/lib/navidrome";
RuntimeDirectory = "navidrome";
RootDirectory = "/run/navidrome";
ReadWritePaths = "";
BindReadOnlyPaths = [
builtins.storeDir
] ++ lib.optional (cfg.settings ? MusicFolder) cfg.settings.MusicFolder;
CapabilityBoundingSet = "";
RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
RestrictNamespaces = true;
PrivateDevices = true;
PrivateUsers = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
SystemCallArchitectures = "native";
SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ];
RestrictRealtime = true;
LockPersonality = true;
MemoryDenyWriteExecute = true;
UMask = "0066";
ProtectHostname = true;
};
};
};
}

View File

@ -1,498 +0,0 @@
{ config, lib, pkgs, modulesPath, ... }:
let
inherit (lib) mkDefault mkEnableOption mkForce mkIf mkMerge mkOption types
boolToString callPackageWith optional optionals optionalString recursiveUpdate;
cfg = config.services.snipe-it;
phpPackage = cfg.phpPackage.withExtensions ({ enabled, all }:
enabled ++ (with all; [
json
openssl
pdo
mbstring
tokenizer
curl
ldap
zip
fileinfo
bcmath
gd
] ++ optionals useMysql [
pdo_mysql
])
);
nginxPackage = config.services.nginx.package;
user = cfg.user;
group = cfg.group;
db = cfg.database;
useMysql = db.type == "mysql";
useSqlite = db.type == "sqlite";
mail = cfg.mail;
useSSL = with cfg.nginx; (addSSL || forceSSL || onlySSL || enableACME);
snipe-it = cfg.package.override { inherit (cfg) cacheDir dataDir; };
artisan = pkgs.writeShellScriptBin "snipe-it" ''
cd ${snipe-it}
sudo=exec
if [[ "$USER" != ${user} ]]; then
sudo='exec /run/wrappers/bin/sudo -u ${user}'
fi
$sudo ${phpPackage}/bin/php artisan $*
'';
in {
options.services.snipe-it = {
enable = mkEnableOption "Snipe-IT free open source IT asset management";
package = mkOption {
type = types.package;
default = callPackageWith pkgs ../../pkgs/snipe-it { };
description = "Snipe-IT derivation to use.";
};
phpPackage = mkOption {
type = types.package;
default = pkgs.php74;
description = "PHP package to use.";
};
user = mkOption {
type = types.str;
default = "snipe-it";
description = "User Snipe-IT runs as.";
};
group = mkOption {
type = types.str;
default = "snipe-it";
description = "Group Snipe-IT runs as.";
};
hostName = mkOption {
type = types.str;
example = "assets.example.com";
description = "FQDN for the Snipe-IT instance.";
};
maxResults = mkOption {
type = types.int;
default = 500;
description = ''
The result limit. This value determines the maximum number of results to return,
even if a higher limit is passed in an API request. This is done to prevent
timeouts when custom scripts are requesting large numbers of assets at a time.
'';
};
# Basic app settings
appKeyFile = mkOption {
type = types.path;
example = "/run/keys/snipe-it-appkey";
description = ''
A file containing the app key. Used for encryption where needed.
Can be generated with <code>head -c32 /dev/urandom | base64</code>.
'';
};
dataDir = mkOption {
type = types.path;
default = "/var/lib/snipe-it";
description = "Snipe-IT's data directory.";
};
cacheDir = mkOption {
type = types.path;
default = "/var/cache/snipe-it";
description = "Snipe-IT's cache directory";
};
database = {
type = mkOption {
type = types.enum [ "mysql" "sqlite" ];
default = "mysql";
description = "Database engine to use.";
};
host = mkOption {
type = types.str;
default = "localhost";
description = "Database host address.";
};
port = mkOption {
type = types.port;
default = if useMysql then 3306 else 5432;
description = ''
Database host port. This currently only has
an effect when using MySQL.
'';
};
name = mkOption {
type = types.str;
default = "snipe-it";
description = "Name of the MySQL database.";
};
username = mkOption {
type = types.str;
default = user;
description = "Username to use to connect to database.";
};
passwordFile = mkOption {
type = types.nullOr types.path;
example = "/run/keys/snipe-it-dbpass";
description = ''
File containing the password corresponding to
<option>database.username</option>.
'';
};
};
mail = {
host = mkOption {
type = types.str;
default = "localhost";
description = "Mail server host address.";
};
port = mkOption {
type = types.port;
default = 25;
description = "Mail server host port.";
};
encryption = mkOption {
type = types.nullOr (types.enum [ "ssl" "tls" ]);
default = null;
example = "tls";
description = ''
Type of transport encryption to use.
'';
};
username = mkOption {
type = types.nullOr types.str;
default = null;
description = "User to use to connect to mail server.";
};
passwordFile = mkOption {
type = types.path;
example = "/run/keys/snipe-it-mailpass";
description = ''
File containing the password corresponding to
<option>mail.username</option>.
'';
};
fromAddress = mkOption {
type = types.str;
description = ''Global "From" address.'';
};
fromName = mkOption {
type = types.str;
default = "Snipe-IT";
description = ''Global "From" name.'';
};
replytoAddress = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Global "Reply-To" address. If null (the default),
"Reply-To" won't be set.
'';
};
replytoName = mkOption {
type = types.str;
default = "Snipe-IT";
description = ''
Global "Reply-To" name. <option>mail.replytoAddress</option>
also has to be set for this to have any effect.
'';
};
autoEmbed = {
enable = mkEnableOption "Embed images into mails instead of hyperlinking them.";
method = mkOption {
type = types.enum [ "attachment" "base64" ];
default = "attachment";
description = "Embedding method to use.";
};
};
};
memcached = {
enable = mkEnableOption "memcached as caching backend";
host = mkOption {
type = types.str;
default = "localhost";
description = "Memcached host address.";
};
port = mkOption {
type = types.port;
default = 11211;
description = "Memcached host port.";
};
};
session = {
lifeTime = mkOption {
type = types.int;
default = 12000;
description = "Session lifetime in minutes.";
};
expireOnClose = mkOption {
type = types.bool;
default = false;
description = "Expire sessions when closing browser window.";
};
encrypt = mkOption {
type = types.bool;
default = false;
description = "Encrypt stored session data.";
};
};
maxUploadSize = mkOption {
type = types.str;
default = "16M";
example = "1G";
description = "The maximum size for uploads (e.g. images).";
};
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 Snipe-IT PHP pool. See the documentation on
<literal>php-fpm.conf</literal> for details on configuration directives.
'';
};
nginx = mkOption {
type = types.submodule (
recursiveUpdate
(import
(modulesPath + "/services/web-servers/nginx/vhost-options.nix")
{ inherit config lib; })
{}
);
default = {};
example = {
serverAliases = [
"snipe-it.\${config.networking.domain}"
];
# To enable encryption and let letsencrypt take care of certificate
forceSSL = true;
enableACME = true;
};
description = ''
With this option, you can customize the nginz virtualHost settings.
'';
};
extraConfig = mkOption {
type = types.nullOr types.lines;
default = null;
example = ''
LOGIN_MAX_ATTEMPTS=3
LOGIN_LOCKOUT_DURATION=300
'';
};
};
config = mkIf cfg.enable {
warnings =
optional (!useMysql) ''
Please note: Using another database than MySQL isn't officially supported.
'';
environment.systemPackages = [ artisan ];
services.mysql = mkIf (useMysql && db.host == "localhost") {
enable = mkDefault true;
package = mkDefault pkgs.mariadb;
ensureDatabases = [ db.name ];
ensureUsers = [{
name = db.username;
ensurePermissions = { "${db.name}.*" = "ALL PRIVILEGES"; };
}];
};
services.phpfpm.pools.snipe-it = {
inherit user group phpPackage;
phpOptions = ''
log_errors = on
post_max_size = ${cfg.maxUploadSize}
upload_max_filesize = ${cfg.maxUploadSize}
'';
settings = {
"listen.mode" = "0660";
"listen.owner" = user;
"listen.group" = group;
} // cfg.poolConfig;
};
services.nginx = {
enable = mkDefault true;
virtualHosts."${cfg.hostName}" = mkMerge [ cfg.nginx {
root = mkForce "${snipe-it}/public";
extraConfig = ''
index index.php index.html index.htm;
${optionalString useSSL "fastcgi_param HTTPS on;"}
'';
locations = {
"/" = {
extraConfig = ''try_files $uri $uri/ /index.php$is_args$args;'';
};
"~ \.php$" = {
extraConfig = ''
try_files $uri $uri/ =404;
include ${nginxPackage}/conf/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:${config.services.phpfpm.pools."snipe-it".socket};
${optionalString useSSL "fastcgi_param HTTPS on;"}
'';
};
};
}];
};
systemd.tmpfiles.rules = [
"d ${cfg.cacheDir} 0700 ${user} ${group} - -"
"d ${cfg.cacheDir}/bootstrap 0700 ${user} ${group} - -"
"d ${cfg.dataDir} 0710 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/accessories 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/assets 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/avatars 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/barcodes 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/categories 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/companies 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/components 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/consumables 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/departments 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/locations 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/manufacturers 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/models 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/uploads/suppliers 0750 ${user} ${group} - -"
"d ${cfg.dataDir}/storage 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/app 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/app/backups 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/app/backups/env-backups 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/debugbar 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/framework 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/framework/cache 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/framework/sessions 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/framework/views 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/logs 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/private_uploads 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/private_uploads/assetmodels 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/private_uploads/assets 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/private_uploads/audits 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/private_uploads/imports 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/private_uploads/licenses 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/private_uploads/signatures 0700 ${user} ${group} - -"
"d ${cfg.dataDir}/storage/private_uploads/users 0700 ${user} ${group} - -"
] ++ optionals useSqlite [
"f ${cfg.dataDir}/database.sqlite 0600 ${user} ${group} -"
];
systemd.services.snipe-it-setup = {
description = "Preparation tasks for Snipe-IT";
before = [ "phpfpm-snipe-it.service" ];
after = optional useMysql "mysql.service";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
User = user;
WorkingDirectory = "${snipe-it}";
};
script = ''
# create .env file
cat > ${cfg.dataDir}/.env << EOF
APP_KEY="base64:$(head -n1 ${cfg.appKeyFile})"
APP_URL="http${optionalString useSSL "s"}://${cfg.hostName}"
APP_LOG=syslog
MAX_RESULTS=${toString cfg.maxResults}
'' + optionalString useSSL ''
ENABLE_HSTS=true
SECURE_COOKIES=true
'' + ''
SESSION_DRIVER=file
SESSION_LIFETIME=${toString cfg.session.lifeTime}
EXPIRE_ON_CLOSE=${boolToString cfg.session.expireOnClose}
ENCRYPT=${boolToString cfg.session.encrypt}
DB_CONNECTION=${db.type}
'' + optionalString (db.type != "sqlite") ''
DB_HOST=${db.host}
DB_PORT=${toString db.port}
DB_PASSWORD="$(head -n1 ${db.passwordFile})"
DB_USERNAME=${db.username}
DB_DATABASE=${db.name}
'' + ''
MAIL_DRIVER=smtp
MAIL_HOST=${mail.host}
MAIL_PORT=${toString mail.port}
${optionalString (mail.encryption != null) "MAIL_ENCRYPTION=${mail.encryption}"}
MAIL_FROM_ADDR=${mail.fromAddress}
MAIL_FROM_NAME=${mail.fromName}
MAIL_AUTO_EMBED=${boolToString mail.autoEmbed.enable}
MAIL_AUTO_EMBED_METHOD=${mail.autoEmbed.method}
'' + optionalString (mail.username != null) ''
MAIL_USERNAME=${mail.username}
MAIL_PASSWORD="$(head -n1 ${mail.passwordFile})"
'' + optionalString (mail.replytoAddress != null) ''
MAIL_REPLYTO_ADDR=${mail.replytoAddress}
MAIL_REPLYTO_NAME=${mail.replytoName}
'' + optionalString cfg.memcached.enable ''
CACHE_DRIVER=memcached
MEMCACHED_HOST=${cfg.memcached.host}
MEMCACHED_PORT=${toString cfg.memcached.port}
'' + ''
${optionalString (cfg.extraConfig != null) cfg.extraConfig}
EOF
chmod 600 ${cfg.dataDir}/.env
# re-evaluate configuration
${phpPackage}/bin/php artisan config:clear
${phpPackage}/bin/php artisan config:cache
# migrate db
${phpPackage}/bin/php artisan migrate --force
# create caches
${phpPackage}/bin/php artisan event:cache
${phpPackage}/bin/php artisan view:cache
'';
};
users = {
users."${user}" = {
isSystemUser = true;
home = cfg.dataDir;
group = group;
};
groups."${group}" = {};
users."${config.services.nginx.user}".extraGroups = [ group ];
};
};
}

View File

@ -1,29 +0,0 @@
{ lib, appimageTools, fetchurl }:
let
pname = "chrysalis";
version = "0.8.4";
in appimageTools.wrapType2 rec {
name = "${pname}-${version}-binary";
src = fetchurl {
url = "https://github.com/keyboardio/${pname}/releases/download/v${version}/${pname}-${version}.AppImage";
sha256 = "sha256-tB8+I9rIVbFYjP8UHj0xf5a6/5KaBUPHn8zuDG8JW8c=";
};
multiPkgs = null;
extraPkgs = p: (appimageTools.defaultFhsEnvArgs.multiPkgs p) ++ [
p.glib
p.xorg.libxshmfence
];
extraInstallCommands = "mv $out/bin/${name} $out/bin/${pname}";
meta = with lib; {
description = "A graphical configurator for Kaleidoscope-powered keyboards";
homepage = "https://github.com/keyboardio/Chrysalis";
license = licenses.gpl3;
maintainers = with maintainers; [ aw ];
platforms = [ "x86_64-linux" ];
};
}

View File

@ -1,59 +1,79 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gengetopt
, glib, libconfig, libnice, jansson, boringssl, zlib, srtp, libuv
, libmicrohttpd, curl, libwebsockets, sofia_sip, libogg, libopus
, usrsctp, ffmpeg
{ stdenv, lib, fetchFromGitHub
, jansson
, libconfig
, libnice
, openssl
, srtp
, usrsctp
, libmicrohttpd
, libwebsockets
, gnumake
#, cmake
, rabbitmq-c
#, paho-mqtt-c
, nanomsg
, curl
, sofia_sip
, libopus
, libogg
, lua
, glib
, zlib
, pkgconfig
, gengetopt
, autoconf
, automake
, libtool
, libuv
}:
let
libwebsockets_janus = libwebsockets.overrideAttrs (_: {
configureFlags = [
"-DLWS_MAX_SMP=1"
"-DLWS_WITHOUT_EXTENSIONS=0"
];
});
in
stdenv.mkDerivation rec {
pname = "janus-gateway";
version = "0.11.4";
version = "0.10.10";
src = fetchFromGitHub {
owner = "meetecho";
repo = pname;
rev = "v${version}";
sha256 = "sha256-K+6r7Nz+zzEDNd5Y44+V7x80DPxjaithregEg+goXk0=";
sha256 = "sha256-aMyae2jpP4ipgRl5Mp2m0v2M4PQtss3EeAil/MWfYrs=";
};
nativeBuildInputs = [ autoreconfHook pkg-config gengetopt ];
nativeBuildInputs = [
jansson
libconfig
libnice
openssl
srtp
usrsctp
libmicrohttpd
libwebsockets
gnumake
#cmake
rabbitmq-c
#paho-mqtt-c
nanomsg
curl
sofia_sip
libopus
libogg
lua
glib
zlib
pkgconfig
gengetopt
libuv
buildInputs = [
glib libconfig libnice jansson boringssl zlib srtp libuv libmicrohttpd
curl libwebsockets_janus sofia_sip libogg libopus usrsctp ffmpeg
autoconf
automake
libtool
];
enableParallelBuilding = true;
configureFlags = [
"--enable-boringssl=${boringssl}"
"--enable-libsrtp2"
"--enable-turn-rest-api"
"--enable-json-logger"
"--enable-gelf-event-handler"
"--enable-post-processing"
];
outputs = [ "out" "dev" "doc" "man" ];
postInstall = ''
moveToOutput share/janus "$doc"
moveToOutput etc "$doc"
'';
preConfigure = "./autogen.sh";
meta = with lib; {
description = "General purpose WebRTC server";
homepage = "https://janus.conf.meetecho.com/";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = with maintainers; [ fpletz ];
description = "Janus WebRTC server";
homepage = src.meta.homepage;
license = licenses.gpl3;
maintainers = with maintainers; [ aw ];
};
}

View File

@ -1,49 +0,0 @@
{ lib, stdenv, pkgs, fetchurl, ffmpeg, ffmpegSupport ? true, makeWrapper, nixosTests }:
with lib;
stdenv.mkDerivation rec {
pname = "navidrome-bin";
version = "0.46.0";
src = fetchurl (if pkgs.system == "x86_64-linux"
then {
url = "https://github.com/navidrome/navidrome/releases/download/v${version}/navidrome_${version}_Linux_x86_64.tar.gz";
sha256 = "sha256-baBSQZnlcC5zq7wKWbia8xEMqZuCgkn/zyQWwtfHn/w=";
}
else {
url = "https://github.com/navidrome/navidrome/releases/download/v${version}/navidrome_${version}_Linux_arm64.tar.gz";
sha256 = "sha256-Km58BMc2ngv6CLqXkNpDIxC+nFb/fbvz7iBF0/xNcsU=";
});
nativeBuildInputs = [ makeWrapper ];
unpackPhase = ''
tar xvf $src navidrome
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp navidrome $out/bin
runHook postInstall
'';
postFixup = ''
wrapProgram $out/bin/navidrome \
--prefix PATH : ${makeBinPath (optional ffmpegSupport ffmpeg)}
'';
passthru.tests.navidrome = nixosTests.navidrome;
meta = {
description = "Navidrome Music Server and Streamer compatible with Subsonic/Airsonic";
homepage = "https://www.navidrome.org/";
license = licenses.gpl3Only;
platforms = [ "x86_64-linux" "aarch64-linux" ];
maintainers = with maintainers; [ aciceri ];
};
}

View File

@ -2,21 +2,21 @@
buildGoPackage rec {
pname = "nextcloud-spreed-signaling";
version = "0.3.0";
version = "0.2.0";
goPackagePath = "github.com/strukturag/nextcloud-spreed-signaling";
subPackages = [
"client"
"server"
"proxy"
"src/signaling"
"src/server"
"src/proxy"
];
src = fetchFromGitHub {
owner = "strukturag";
repo = pname;
rev = "v${version}";
sha256 = "sha256-oKH9rpZa+CGnqgQD6Wa1KPi26ePrGZJzz9WXOauNs+U=";
sha256 = "sha256-heDi/kWyPDZ9oPjBhNRBAkiKkkEnXmfSanYvCUSB5Ls=";
};
nativeBuildInputs = [ easyjson ];
@ -24,7 +24,8 @@ buildGoPackage rec {
goDeps = ./deps.nix;
preBuild = ''
easyjson -all go/src/github.com/strukturag/nextcloud-spreed-signaling/{api_signaling,api_backend,api_proxy,natsclient,room}.go
ln -s $PWD/go/src/${goPackagePath}/src/* go/src
easyjson -all go/src/signaling/{api_signaling,api_backend,api_proxy,natsclient,room}.go
'';
meta = with lib; {

File diff suppressed because it is too large Load Diff

View File

@ -2,13 +2,13 @@
kernel.stdenv.mkDerivation rec {
pname = "ryzen_smu";
version = "0.1.2";
version = "0.1.1";
src = fetchFromGitLab {
owner = "leogx9r";
repo = pname;
rev = "v${version}";
sha256 = "sha256-d/UtfcTYl3Qqd15248qeIEMXzyZmkYMfqs5xQIadeyM=";
sha256 = "sha256-1VxpJKKl/Og7Q6NpJ3Y+i8U9RKZkTCjv6LJzsLOC5vk=";
};
hardeningDisable = [ "pic" ];

View File

@ -1,14 +1,18 @@
{ stdenv, lib, fetchFromGitHub, cmake, pciutils, ... }:
stdenv.mkDerivation rec {
pname = "ryzenadj";
version = "0.8.2";
let
src = fetchFromGitHub {
owner = "FlyGoat";
repo = pname;
rev = "v${version}";
sha256 = "sha256-jRrIhKlejX0Yt1wkF/MBJk/6DAIGWWRK9oReCplNVKA=";
repo = "RyzenAdj";
rev = "a48d42addaad90832ab55b1ab56a0e2445338984";
sha256 = "sha256-rZPjmrloTMbzi7n1p6XrIaDWNgiU7hvY8XTnk2XMtrE=";
};
version = "unstable-2021-03-12";
in stdenv.mkDerivation rec {
pname = "ryzenadj";
inherit version src;
nativeBuildInputs = [ cmake pciutils ];
installPhase = ''

View File

@ -1,239 +0,0 @@
# This file originates from composer2nix
{ stdenv, lib, writeTextFile, fetchurl, php, unzip, phpPackages }:
let
inherit (phpPackages) composer;
buildZipPackage = { name, src }:
stdenv.mkDerivation {
inherit name src;
buildInputs = [ unzip ];
buildCommand = ''
unzip $src
baseDir=$(find . -type d -mindepth 1 -maxdepth 1)
cd $baseDir
mkdir -p $out
mv * $out
'';
};
buildPackage =
{ name
, src
, packages ? {}
, devPackages ? {}
, buildInputs ? []
, symlinkDependencies ? false
, executable ? false
, removeComposerArtifacts ? false
, postInstall ? ""
, noDev ? false
, composerExtraArgs ? ""
, unpackPhase ? "true"
, buildPhase ? "true"
, ...}@args:
let
reconstructInstalled = writeTextFile {
name = "reconstructinstalled.php";
executable = true;
text = ''
#! ${php}/bin/php
<?php
if(file_exists($argv[1]))
{
$composerLockStr = file_get_contents($argv[1]);
if($composerLockStr === false)
{
fwrite(STDERR, "Cannot open composer.lock contents\n");
exit(1);
}
else
{
$config = json_decode($composerLockStr, true);
if(array_key_exists("packages", $config))
$allPackages = $config["packages"];
else
$allPackages = array();
${lib.optionalString (!noDev) ''
if(array_key_exists("packages-dev", $config))
$allPackages = array_merge($allPackages, $config["packages-dev"]);
''}
$packagesStr = json_encode($allPackages, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
print($packagesStr);
}
}
else
print("[]");
?>
'';
};
constructBin = writeTextFile {
name = "constructbin.php";
executable = true;
text = ''
#! ${php}/bin/php
<?php
$composerJSONStr = file_get_contents($argv[1]);
if($composerJSONStr === false)
{
fwrite(STDERR, "Cannot open composer.json contents\n");
exit(1);
}
else
{
$config = json_decode($composerJSONStr, true);
if(array_key_exists("bin-dir", $config))
$binDir = $config["bin-dir"];
else
$binDir = "bin";
if(array_key_exists("bin", $config))
{
if(!file_exists("vendor/".$binDir))
mkdir("vendor/".$binDir);
foreach($config["bin"] as $bin)
symlink("../../".$bin, "vendor/".$binDir."/".basename($bin));
}
}
?>
'';
};
bundleDependencies = dependencies:
lib.concatMapStrings (dependencyName:
let
dependency = dependencies.${dependencyName};
in
''
${if dependency.targetDir == "" then ''
vendorDir="$(dirname ${dependencyName})"
mkdir -p "$vendorDir"
${if symlinkDependencies then
''ln -s "${dependency.src}" "$vendorDir/$(basename "${dependencyName}")"''
else
''cp -av "${dependency.src}" "$vendorDir/$(basename "${dependencyName}")"''
}
'' else ''
namespaceDir="${dependencyName}/$(dirname "${dependency.targetDir}")"
mkdir -p "$namespaceDir"
${if symlinkDependencies then
''ln -s "${dependency.src}" "$namespaceDir/$(basename "${dependency.targetDir}")"''
else
''cp -av "${dependency.src}" "$namespaceDir/$(basename "${dependency.targetDir}")"''
}
''}
'') (builtins.attrNames dependencies);
extraArgs = removeAttrs args [ "name" "packages" "devPackages" "buildInputs" ];
in
stdenv.mkDerivation ({
name = "composer-${name}";
buildInputs = [ php composer ] ++ buildInputs;
inherit unpackPhase buildPhase;
installPhase = ''
${if executable then ''
mkdir -p $out/share/php
cp -av $src $out/share/php/$name
chmod -R u+w $out/share/php/$name
cd $out/share/php/$name
'' else ''
cp -av $src $out
chmod -R u+w $out
cd $out
''}
# Remove unwanted files
rm -f *.nix
export HOME=$TMPDIR
# Remove the provided vendor folder if it exists
rm -Rf vendor
# If there is no composer.lock file, compose a dummy file.
# Otherwise, composer attempts to download the package.json file from
# the registry which we do not want.
if [ ! -f composer.lock ]
then
cat > composer.lock <<EOF
{
"packages": []
}
EOF
fi
# Reconstruct the installed.json file from the lock file
mkdir -p vendor/composer
${php}/bin/php ${reconstructInstalled} composer.lock > vendor/composer/installed.json
# Copy or symlink the provided dependencies
cd vendor
${bundleDependencies packages}
${lib.optionalString (!noDev) (bundleDependencies devPackages)}
cd ..
# Reconstruct autoload scripts
# We use the optimize feature because Nix packages cannot change after they have been built
# Using the dynamic loader for a Nix package is useless since there is nothing to dynamically reload.
composer dump-autoload --optimize ${lib.optionalString noDev "--no-dev"} ${composerExtraArgs}
# Run the install step as a validation to confirm that everything works out as expected
composer install --optimize-autoloader ${lib.optionalString noDev "--no-dev"} ${composerExtraArgs}
${lib.optionalString executable ''
# Reconstruct the bin/ folder if we deploy an executable project
${php}/bin/php ${constructBin} composer.json
ln -s $(pwd)/vendor/bin $out/bin
''}
${lib.optionalString (!symlinkDependencies) ''
# Patch the shebangs if possible
if [ -d $(pwd)/vendor/bin ]
then
# Look for all executables in bin/
for i in $(pwd)/vendor/bin/*
do
# Look for their location
realFile=$(readlink -f "$i")
# Restore write permissions
chmod u+wx "$(dirname "$realFile")"
chmod u+w "$realFile"
# Patch shebang
sed -e "s|#!/usr/bin/php|#!${php}/bin/php|" \
-e "s|#!/usr/bin/env php|#!${php}/bin/php|" \
"$realFile" > tmp
mv tmp "$realFile"
chmod u+x "$realFile"
done
fi
''}
if [ "$removeComposerArtifacts" = "1" ]
then
# Remove composer stuff
rm -f composer.json composer.lock
fi
# Execute post install hook
runHook postInstall
'';
} // extraArgs);
in
{
composer = lib.makeOverridable composer;
buildZipPackage = lib.makeOverridable buildZipPackage;
buildPackage = lib.makeOverridable buildPackage;
}

View File

@ -1,13 +0,0 @@
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, noDev ? false}:
let
composerEnv = import ./composer-env.nix {
inherit (pkgs) stdenv lib writeTextFile fetchurl php unzip phpPackages;
};
in
import ./php-packages.nix {
inherit composerEnv noDev;
inherit (pkgs) fetchurl fetchgit fetchhg fetchsvn;
}

View File

@ -1,39 +0,0 @@
{ pkgs, system, lib, fetchFromGitHub
, dataDir ? "/var/lib/snipe-it"
, cacheDir ? "/var/cache/snipe-it"
}:
let
package = (import ./composition.nix {
inherit pkgs system;
noDev = true;
}).overrideAttrs (oldAttrs: {
installPhase = oldAttrs.installPhase + ''
rm -R $out/storage $out/public/uploads $out/bootstrap/cache
ln -s ${dataDir}/.env $out/.env
ln -s ${dataDir}/storage $out/storage
ln -s ${dataDir}/uploads $out/public/uploads
ln -s ${dataDir}/database.sqlite $out/database/database.sqlite
ln -s ${cacheDir}/bootstrap $out/bootstrap/cache
'';
});
in package.override rec {
name = "snipe-it";
version = "5.2.0";
src = fetchFromGitHub {
owner = "snipe";
repo = "snipe-it";
rev = "v${version}";
sha256 = "sha256-LT1JVHwmprLS52+OWgnddTKam5dEHDSuyHKxFG9WadM=";
};
meta = with lib; {
description = "A free open source IT asset management system";
homepage = "https://www.snipeitapp.com/";
license = licenses.agpl3;
maintainers = with maintainers; [ aw ];
platforms = platforms.unix;
};
}

File diff suppressed because it is too large Load Diff

26
pkgs/usrsctp/default.nix Normal file
View File

@ -0,0 +1,26 @@
{ lib, stdenv, fetchFromGitHub, which, libtool, autoconf, automake }:
stdenv.mkDerivation rec {
pname = "usrsctp";
version = "0.9.5.0";
src = fetchFromGitHub {
owner = "sctplab";
repo = pname;
rev = version;
sha256 = "sha256-Sengtkg4UoA03cPy5+dRSr5qKIttWHEKn48udOP8zYI=";
};
nativeBuildInputs = [ which libtool autoconf automake ];
NIX_CFLAGS_COMPILE = "-O2";
preConfigure = "./bootstrap";
meta = with lib; {
description = "A userland SCTP stack supporting FreeBSD, Linux, Mac OS X and Windows";
homepage = src.meta.homepage;
maintainers = with maintainers; [ aw ];
license = licenses.bsd3;
};
}

View File

@ -1,33 +0,0 @@
{ lib, fetchFromGitHub, kernel }:
kernel.stdenv.mkDerivation rec {
pname = "xmm7360-pci";
version = "unstable-20210802";
src = fetchFromGitHub {
owner = "xmm7360";
repo = pname;
rev = "b28714b6fb73887ecd5c0c25ffc0613d6eab6533";
sha256 = "sha256-wNSQZvPL297pTAVT9Hj4IgcsHSc7KVNe7K0raS0bObg=";
};
nativeBuildInputs = kernel.moduleBuildDependencies;
patches = [ ./fix.patch ];
makeFlags = [
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
installPhase = ''
install -m0644 -D xmm7360.ko $out/lib/modules/${kernel.modDirVersion}/misc/xmm7360.ko
'';
meta = with lib; {
description = "PCI driver for Fibocom L850-GL modem base on Intel XMM7360 modem";
homepage = src.meta.homepage;
license = licenses.gpl2;
maintainers = with maintainers; [ aw ];
platforms = platforms.linux;
};
}

View File

@ -1,22 +0,0 @@
diff --git a/xmm7360.c b/xmm7360.c
index ccd149d..5a4dc74 100644
--- a/xmm7360.c
+++ b/xmm7360.c
@@ -1272,7 +1272,7 @@ static int xmm7360_tty_write(struct tty_struct *tty,
return written;
}
-static int xmm7360_tty_write_room(struct tty_struct *tty)
+static unsigned int xmm7360_tty_write_room(struct tty_struct *tty)
{
struct queue_pair *qp = tty->driver_data;
if (!xmm7360_qp_can_write(qp))
@@ -1555,7 +1555,7 @@ static void xmm7360_exit(void)
pci_unregister_driver(&xmm7360_driver);
unregister_chrdev_region(xmm_base, 8);
tty_unregister_driver(xmm7360_tty_driver);
- put_tty_driver(xmm7360_tty_driver);
+ tty_driver_kref_put(xmm7360_tty_driver);
}
module_init(xmm7360_init);

View File

@ -1,46 +0,0 @@
{ lib, stdenv, fetchFromGitHub, xmm7360-pci, python3Packages, makeWrapper }:
let
inherit (xmm7360-pci) pname version src;
pythonPath = with python3Packages; makePythonPath [
python
configargparse
dbus-python
pyroute2
];
in stdenv.mkDerivation {
pname = "${pname}-tools";
inherit version src;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ python3Packages.python ];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/lib
cp -a rpc/* $out/lib
pushd $out/lib
find . -executable -type f | while read file; do
makeWrapper ${python3Packages.python.interpreter} $out/bin/''${file%.py} \
--add-flags "$out/lib/''${file}" \
--prefix NIX_PYTHONPATH : "${pythonPath}"
done
runHook postInstall
'';
meta = with lib; {
description = xmm7360-pci.meta.description + " (tools)";
homepage = src.meta.homepage;
license = licenses.gpl2;
maintainers = with maintainers; [ aw ];
platforms = platforms.linux;
};
}