mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 09:34:36 +00:00
Merge master into staging-next
This commit is contained in:
commit
104c9ec59b
@ -499,6 +499,7 @@
|
||||
./services/games/quake3-server.nix
|
||||
./services/games/teeworlds.nix
|
||||
./services/games/terraria.nix
|
||||
./services/games/xonotic.nix
|
||||
./services/hardware/acpid.nix
|
||||
./services/hardware/actkbd.nix
|
||||
./services/hardware/argonone.nix
|
||||
|
198
nixos/modules/services/games/xonotic.nix
Normal file
198
nixos/modules/services/games/xonotic.nix
Normal file
@ -0,0 +1,198 @@
|
||||
{ config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.services.xonotic;
|
||||
|
||||
serverCfg = pkgs.writeText "xonotic-server.cfg" (
|
||||
toString cfg.prependConfig
|
||||
+ "\n"
|
||||
+ builtins.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (key: option:
|
||||
let
|
||||
escape = s: lib.escape [ "\"" ] s;
|
||||
quote = s: "\"${s}\"";
|
||||
|
||||
toValue = x: quote (escape (toString x));
|
||||
|
||||
value = (if lib.isList option then
|
||||
builtins.concatStringsSep
|
||||
" "
|
||||
(builtins.map (x: toValue x) option)
|
||||
else
|
||||
toValue option
|
||||
);
|
||||
in
|
||||
"${key} ${value}"
|
||||
) cfg.settings
|
||||
)
|
||||
+ "\n"
|
||||
+ toString cfg.appendConfig
|
||||
);
|
||||
in
|
||||
|
||||
{
|
||||
options.services.xonotic = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "Xonotic dedicated server");
|
||||
|
||||
package = lib.mkPackageOption pkgs "xonotic-dedicated" {};
|
||||
|
||||
openFirewall = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
Open the firewall for TCP and UDP on the specified port.
|
||||
'';
|
||||
};
|
||||
|
||||
dataDir = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
readOnly = true;
|
||||
default = "/var/lib/xonotic";
|
||||
description = lib.mdDoc ''
|
||||
Data directory.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
description = lib.mdDoc ''
|
||||
Generates the `server.cfg` file. Refer to [upstream's example][0] for
|
||||
details.
|
||||
|
||||
[0]: https://gitlab.com/xonotic/xonotic/-/blob/master/server/server.cfg
|
||||
'';
|
||||
default = {};
|
||||
type = lib.types.submodule {
|
||||
freeformType = with lib.types; let
|
||||
scalars = oneOf [ singleLineStr int float ];
|
||||
in
|
||||
attrsOf (oneOf [ scalars (nonEmptyListOf scalars) ]);
|
||||
|
||||
options.sv_public = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
example = [ (-1) 1 ];
|
||||
description = lib.mdDoc ''
|
||||
Controls whether the server will be publicly listed.
|
||||
'';
|
||||
};
|
||||
|
||||
options.hostname = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "Xonotic $g_xonoticversion Server";
|
||||
description = lib.mdDoc ''
|
||||
The name that will appear in the server list. `$g_xonoticversion`
|
||||
gets replaced with the current version.
|
||||
'';
|
||||
};
|
||||
|
||||
options.sv_motd = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "";
|
||||
description = lib.mdDoc ''
|
||||
Text displayed when players join the server.
|
||||
'';
|
||||
};
|
||||
|
||||
options.sv_termsofservice_url = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "";
|
||||
description = lib.mdDoc ''
|
||||
URL for the Terms of Service for playing on your server.
|
||||
'';
|
||||
};
|
||||
|
||||
options.maxplayers = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 16;
|
||||
description = lib.mdDoc ''
|
||||
Number of player slots on the server, including spectators.
|
||||
'';
|
||||
};
|
||||
|
||||
options.net_address = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "0.0.0.0";
|
||||
description = lib.mdDoc ''
|
||||
The address Xonotic will listen on.
|
||||
'';
|
||||
};
|
||||
|
||||
options.port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 26000;
|
||||
description = lib.mdDoc ''
|
||||
The port Xonotic will listen on.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Still useful even though we're using RFC 42 settings because *some* keys
|
||||
# can be repeated.
|
||||
appendConfig = lib.mkOption {
|
||||
type = with lib.types; nullOr lines;
|
||||
default = null;
|
||||
description = lib.mdDoc ''
|
||||
Literal text to insert at the end of `server.cfg`.
|
||||
'';
|
||||
};
|
||||
|
||||
# Certain changes need to happen at the beginning of the file.
|
||||
prependConfig = lib.mkOption {
|
||||
type = with lib.types; nullOr lines;
|
||||
default = null;
|
||||
description = lib.mdDoc ''
|
||||
Literal text to insert at the start of `server.cfg`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.services.xonotic = {
|
||||
description = "Xonotic server";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
environment = {
|
||||
# Required or else it tries to write the lock file into the nix store
|
||||
HOME = cfg.dataDir;
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
DynamicUser = true;
|
||||
User = "xonotic";
|
||||
StateDirectory = "xonotic";
|
||||
ExecStart = "${cfg.package}/bin/xonotic-dedicated";
|
||||
|
||||
# Symlink the configuration from the nix store to where Xonotic actually
|
||||
# looks for it
|
||||
ExecStartPre = [
|
||||
"${pkgs.coreutils}/bin/mkdir -p ${cfg.dataDir}/.xonotic/data"
|
||||
''
|
||||
${pkgs.coreutils}/bin/ln -sf ${serverCfg} \
|
||||
${cfg.dataDir}/.xonotic/data/server.cfg
|
||||
''
|
||||
];
|
||||
|
||||
# Cargo-culted from search results about writing Xonotic systemd units
|
||||
ExecReload = "${pkgs.util-linux}/bin/kill -HUP $MAINPID";
|
||||
|
||||
Restart = "on-failure";
|
||||
RestartSec = 10;
|
||||
StartLimitBurst = 5;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = lib.mkIf cfg.openFirewall [
|
||||
cfg.settings.port
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = lib.mkIf cfg.openFirewall [
|
||||
cfg.settings.port
|
||||
];
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ CobaltCause ];
|
||||
}
|
@ -34,14 +34,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
+ lib.optionalString enableQt "-qt"
|
||||
+ lib.optionalString (!enableQt) "-sdl"
|
||||
+ lib.optionalString forceWayland "-wayland";
|
||||
version = "1.16.1";
|
||||
version = "1.16.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hrydgard";
|
||||
repo = "ppsspp";
|
||||
rev = "v${finalAttrs.version}";
|
||||
fetchSubmodules = true;
|
||||
sha256 = "sha256-bKRb7a5lEfE1uUeVl7i1He3qLJ4wI5HmKmWAk2oKdYI=";
|
||||
sha256 = "sha256-Ygi7ioLOBQbD+QTD7pO2hIATV8HUDyrdhw7gBSSiHmc=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
|
75
pkgs/by-name/gi/gitmoji-cli/package.nix
Normal file
75
pkgs/by-name/gi/gitmoji-cli/package.nix
Normal file
@ -0,0 +1,75 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchYarnDeps
|
||||
, makeWrapper
|
||||
, nodejs
|
||||
, prefetch-yarn-deps
|
||||
, yarn
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "gitmoji-cli";
|
||||
version = "8.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "carloscuesta";
|
||||
repo = "gitmoji-cli";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-ZM6jOi0FnomkIZeK6ln1Z0d6R5cjav67qyly3yqR1HQ=";
|
||||
};
|
||||
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = "${finalAttrs.src}/yarn.lock";
|
||||
hash = "sha256-HSAWFVOTlXlG7N5591hpfPAYaSrP413upW5u/HN9X2o=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
nodejs
|
||||
prefetch-yarn-deps
|
||||
yarn
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
export HOME=$(mktemp -d)
|
||||
yarn config --offline set yarn-offline-mirror $offlineCache
|
||||
fixup-yarn-lock yarn.lock
|
||||
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
|
||||
patchShebangs node_modules
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
yarn --offline build
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
yarn --offline --production install
|
||||
|
||||
mkdir -p "$out/lib/node_modules/gitmoji-cli"
|
||||
cp -r lib node_modules "$out/lib/node_modules/gitmoji-cli"
|
||||
|
||||
makeWrapper "${nodejs}/bin/node" "$out/bin/gitmoji" \
|
||||
--add-flags "$out/lib/node_modules/gitmoji-cli/lib/cli.js"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Gitmoji client for using emojis on commit messages";
|
||||
homepage = "https://github.com/carloscuesta/gitmoji-cli";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "gitmoji";
|
||||
maintainers = with lib.maintainers; [ nequissimus ];
|
||||
};
|
||||
})
|
@ -6,11 +6,11 @@
|
||||
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "rectangle-pro";
|
||||
version = "3.0.9";
|
||||
version = "3.0.11";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://rectangleapp.com/pro/downloads/Rectangle%20Pro%20${finalAttrs.version}.dmg";
|
||||
hash = "sha256-wD8yi2Pbgrn1fW/xrocepDcpzSMsQH5yjB/Jv90PuGQ=";
|
||||
hash = "sha256-Hs2eRO5DpYoY0rLfcmGZRHjmg+wddz/+LE0u4E9gCTk=";
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
|
@ -71,7 +71,9 @@ mapAliases {
|
||||
eslint_d = pkgs.eslint_d; # Added 2023-05-26
|
||||
inherit (pkgs) firebase-tools; # added 2023-08-18
|
||||
flood = pkgs.flood; # Added 2023-07-25
|
||||
generator-code = throw "generator-code was removed because it provides no executable"; # added 2023-09-24
|
||||
git-ssb = throw "git-ssb was removed because it was broken"; # added 2023-08-21
|
||||
inherit (pkgs) gitmoji-cli; # added 2023-09-23
|
||||
glob = pkgs.node-glob; # added 2023-08-18
|
||||
inherit (pkgs) gqlint; # added 2023-08-19
|
||||
inherit (pkgs) graphqurl; # added 2023-08-19
|
||||
|
@ -37,7 +37,6 @@
|
||||
fkill-cli = "fkill";
|
||||
fleek-cli = "fleek";
|
||||
git-run = "gr";
|
||||
gitmoji-cli = "gitmoji";
|
||||
graphql-cli = "graphql";
|
||||
graphql-language-service-cli = "graphql-lsp";
|
||||
grunt-cli = "grunt";
|
||||
|
@ -120,12 +120,10 @@
|
||||
, "fx"
|
||||
, "ganache"
|
||||
, "gatsby-cli"
|
||||
, "generator-code"
|
||||
, "get-graphql-schema"
|
||||
, "git-run"
|
||||
, "git-standup"
|
||||
, "@gitbeaker/cli"
|
||||
, "gitmoji-cli"
|
||||
, "gramma"
|
||||
, "grammarly-languageserver"
|
||||
, "graphql"
|
||||
|
1163
pkgs/development/node-packages/node-packages.nix
generated
1163
pkgs/development/node-packages/node-packages.nix
generated
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,7 @@
|
||||
, bazel_self
|
||||
, lr, xe, zip, unzip, bash, writeCBin, coreutils
|
||||
, which, gawk, gnused, gnutar, gnugrep, gzip, findutils
|
||||
, diffutils, gnupatch
|
||||
# updater
|
||||
, python3, writeScript
|
||||
# Apple dependencies
|
||||
@ -110,10 +111,12 @@ let
|
||||
[
|
||||
bash
|
||||
coreutils
|
||||
diffutils
|
||||
file
|
||||
findutils
|
||||
gawk
|
||||
gnugrep
|
||||
gnupatch
|
||||
gnused
|
||||
gnutar
|
||||
gzip
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ stdenv, lib, fetchurl, ncurses, perl, help2man
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, fetchpatch
|
||||
, ncurses
|
||||
, perl
|
||||
, help2man
|
||||
, apparmorRulesFromClosure
|
||||
, libxcrypt
|
||||
}:
|
||||
@ -17,6 +23,11 @@ stdenv.mkDerivation rec {
|
||||
patches = [
|
||||
# https://git.congatec.com/yocto/meta-openembedded/commit/3402bfac6b595c622e4590a8ff5eaaa854e2a2a3
|
||||
./inetutils-1_9-PATH_PROCNET_DEV.patch
|
||||
(fetchpatch {
|
||||
name = "CVE-2023-40303.patch";
|
||||
url = "https://git.savannah.gnu.org/cgit/inetutils.git/patch/?id=e4e65c03f4c11292a3e40ef72ca3f194c8bffdd6";
|
||||
hash = "sha256-I5skN537owfpFpAZr4vDKPHuERI6+oq5/hFW2RQeUxI=";
|
||||
})
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
@ -40,9 +51,7 @@ stdenv.mkDerivation rec {
|
||||
"--disable-rexec"
|
||||
] ++ lib.optional stdenv.isDarwin "--disable-servers";
|
||||
|
||||
# Test fails with "UNIX socket name too long", probably because our
|
||||
# $TMPDIR is too long.
|
||||
doCheck = false;
|
||||
doCheck = true;
|
||||
|
||||
installFlags = [ "SUIDMODE=" ];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user