Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 904e9ab04859
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3aaab7ca3d5b
Choose a head ref
  • 12 commits
  • 8 files changed
  • 5 contributors

Commits on Feb 1, 2019

  1. Copy the full SHA
    61552cf View commit details
  2. Copy the full SHA
    63d2dbf View commit details
  3. Copy the full SHA
    ebf4f63 View commit details

Commits on Feb 2, 2019

  1. minecraft-server: 1.12.2 -> 1.13.2

    Update minecraft client to 1.13.2. The url is not as nice as before
    but it is the one provided by mojang. Adds 1_13_2, 1_13_1 as well.
    
    https://minecraft.net/en-us/download/server
    costrouc committed Feb 2, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    costrouc Christopher Ostrouchov
    Copy the full SHA
    9080b2e View commit details

Commits on Feb 3, 2019

  1. nixos/mincraft-server: refactor

     - allow for options to (added 2 options):
       - agree to eula (eula.txt) true/false will create symlink over
         existing eula.txt to `/nix/store/...`.
       - whitelist users (optional and will symlink over existing
         whitelist.json and create backup)
       - server.properties can be configured with the serverProperties
         option. If there is an existing server.properties it will
         copy it to a server.properties.old to keep the old
         one. server.properties MUST be writable thus symlinking is not
         an option.
      - all ports that are stated in `server.properties` are exposed
        properly in the firewall.
    
    (infinisil) nixos/minecraft-server: Fix, refactor and polish
    
    Adds an option `declarative` (defaulted to false), in order to stay
    (mostly) backwards compatible. The only thing that's not backwards
    compatible is that you now need to agree to the EULA on evaluation time,
    but that's guarded by an assertion and therefore doesn't need a release
    note.
    costrouc authored and infinisil committed Feb 3, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    infinisil Silvan Mosberger
    Copy the full SHA
    58c89ec View commit details

Commits on Feb 4, 2019

  1. swift: 4.2.1 -> 4.2.2

    dtzWill committed Feb 4, 2019
    Copy the full SHA
    4a3f06a View commit details
  2. papirus-icon-theme: 20190106 -> 20190203

    Semi-automatic update generated by
    https://github.com/ryantm/nixpkgs-update tools. This update was made
    based on information from
    https://repology.org/metapackage/papirus-icon-theme/versions
    r-ryantm committed Feb 4, 2019
    Copy the full SHA
    ff06495 View commit details

Commits on Feb 5, 2019

  1. Merge pull request #45412 from costrouc/costrouc/minecraft-server

    minecraft-server: 1.12.2 -> 1.13.2 + service refactor
    infinisil authored Feb 5, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2d6f84c View commit details
  2. Merge pull request #55228 from dtzWill/update/swift-4.2.2

    swift: 4.2.1 -> 4.2.2
    dtzWill authored Feb 5, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9985092 View commit details
  3. Merge pull request #55231 from r-ryantm/auto-update/papirus-icon-theme

    papirus-icon-theme: 20190106 -> 20190203
    dtzWill authored Feb 5, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e792db3 View commit details
  4. Merge pull request #55064 from dtzWill/update/libva-2.4.0

    libva[,-utils}: 2.3.0 -> 2.4.0
    dtzWill authored Feb 5, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b46ff71 View commit details
  5. Merge pull request #55063 from dtzWill/update/intel-media-driver-18.4.0

    intel-media-driver: 18.3.0 -> 18.4.0
    dtzWill authored Feb 5, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3aaab7c View commit details
201 changes: 181 additions & 20 deletions nixos/modules/services/games/minecraft-server.nix
Original file line number Diff line number Diff line change
@@ -4,49 +4,167 @@ with lib;

let
cfg = config.services.minecraft-server;
in
{

# We don't allow eula=false anyways
eulaFile = builtins.toFile "eula.txt" ''
# eula.txt managed by NixOS Configuration
eula=true
'';

whitelistFile = pkgs.writeText "whitelist.json"
(builtins.toJSON
(mapAttrsToList (n: v: { name = n; uuid = v; }) cfg.whitelist));

cfgToString = v: if builtins.isBool v then boolToString v else toString v;

serverPropertiesFile = pkgs.writeText "server.properties" (''
# server.properties managed by NixOS configuration
'' + concatStringsSep "\n" (mapAttrsToList
(n: v: "${n}=${cfgToString v}") cfg.serverProperties));


# To be able to open the firewall, we need to read out port values in the
# server properties, but fall back to the defaults when those don't exist.
# These defaults are from https://minecraft.gamepedia.com/Server.properties#Java_Edition_3
defaultServerPort = 25565;

serverPort = cfg.serverProperties.server-port or defaultServerPort;

rconPort = if cfg.serverProperties.enable-rcon or false
then cfg.serverProperties."rcon.port" or 25575
else null;

queryPort = if cfg.serverProperties.enable-query or false
then cfg.serverProperties."query.port" or 25565
else null;

in {
options = {
services.minecraft-server = {

enable = mkOption {
type = types.bool;
default = false;
description = ''
If enabled, start a Minecraft Server. The listening port for
the server is always <literal>25565</literal>. The server
If enabled, start a Minecraft Server. The server
data will be loaded from and saved to
<literal>${cfg.dataDir}</literal>.
<option>services.minecraft-server.dataDir</option>.
'';
};

declarative = mkOption {
type = types.bool;
default = false;
description = ''
Whether to use a declarative Minecraft server configuration.
Only if set to <literal>true</literal>, the options
<option>services.minecraft-server.whitelist</option> and
<option>services.minecraft-server.serverProperties</option> will be
applied.
'';
};

eula = mkOption {
type = types.bool;
default = false;
description = ''
Whether you agree to
<link xlink:href="https://account.mojang.com/documents/minecraft_eula">
Mojangs EULA</link>. This option must be set to
<literal>true</literal> to run Minecraft server.
'';
};

dataDir = mkOption {
type = types.path;
default = "/var/lib/minecraft";
description = ''
Directory to store minecraft database and other state/data files.
Directory to store Minecraft database and other state/data files.
'';
};

openFirewall = mkOption {
type = types.bool;
default = false;
description = ''
Whether to open ports in the firewall (if enabled) for the server.
Whether to open ports in the firewall for the server.
'';
};

whitelist = mkOption {
type = let
minecraftUUID = types.strMatching
"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" // {
description = "Minecraft UUID";
};
in types.attrsOf minecraftUUID;
default = {};
description = ''
Whitelisted players, only has an effect when
<option>services.minecraft-server.declarative</option> is
<literal>true</literal> and the whitelist is enabled
via <option>services.minecraft-server.serverProperties</option> by
setting <literal>white-list</literal> to <literal>true</literal>.
This is a mapping from Minecraft usernames to UUIDs.
You can use <link xlink:href="https://mcuuid.net/"/> to get a
Minecraft UUID for a username.
'';
example = literalExample ''
{
username1 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
username2 = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy";
};
'';
};

serverProperties = mkOption {
type = with types; attrsOf (either bool (either int str));
default = {};
example = literalExample ''
{
server-port = 43000;
difficulty = 3;
gamemode = 1;
max-players = 5;
motd = "NixOS Minecraft server!";
white-list = true;
enable-rcon = true;
"rcon.password" = "hunter2";
}
'';
description = ''
Minecraft server properties for the server.properties file. Only has
an effect when <option>services.minecraft-server.declarative</option>
is set to <literal>true</literal>. See
<link xlink:href="https://minecraft.gamepedia.com/Server.properties#Java_Edition_3"/>
for documentation on these values.
'';
};

package = mkOption {
type = types.package;
default = pkgs.minecraft-server;
defaultText = "pkgs.minecraft-server";
example = literalExample "pkgs.minecraft-server_1_12_2";
description = "Version of minecraft-server to run.";
};

jvmOpts = mkOption {
type = types.str;
type = types.separatedString " ";
default = "-Xmx2048M -Xms2048M";
description = "JVM options for the Minecraft Service.";
# Example options from https://minecraft.gamepedia.com/Tutorials/Server_startup_script
example = "-Xmx2048M -Xms4092M -XX:+UseG1GC -XX:+CMSIncrementalPacing "
+ "-XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 "
+ "-XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10";
description = "JVM options for the Minecraft server.";
};
};
};

config = mkIf cfg.enable {

users.users.minecraft = {
description = "Minecraft Server Service user";
description = "Minecraft server service user";
home = cfg.dataDir;
createHome = true;
uid = config.ids.uids.minecraft;
@@ -57,17 +175,60 @@ in
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];

serviceConfig.Restart = "always";
serviceConfig.User = "minecraft";
script = ''
cd ${cfg.dataDir}
exec ${pkgs.minecraft-server}/bin/minecraft-server ${cfg.jvmOpts}
'';
};
serviceConfig = {
ExecStart = "${cfg.package}/bin/minecraft-server ${cfg.jvmOpts}";
Restart = "always";
User = "minecraft";
WorkingDirectory = cfg.dataDir;
};

preStart = ''
ln -sf ${eulaFile} eula.txt
'' + (if cfg.declarative then ''
if [ -e .declarative ]; then
# Was declarative before, no need to back up anything
ln -sf ${whitelistFile} whitelist.json
cp -f ${serverPropertiesFile} server.properties
else
networking.firewall = mkIf cfg.openFirewall {
allowedUDPPorts = [ 25565 ];
allowedTCPPorts = [ 25565 ];
# Declarative for the first time, backup stateful files
ln -sb --suffix=.stateful ${whitelistFile} whitelist.json
cp -b --suffix=.stateful ${serverPropertiesFile} server.properties
# server.properties must have write permissions, because every time
# the server starts it first parses the file and then regenerates it..
chmod +w server.properties
echo "Autogenerated file that signifies that this server configuration is managed declaratively by NixOS" \
> .declarative
fi
'' else ''
if [ -e .declarative ]; then
rm .declarative
fi
'');
};

networking.firewall = mkIf cfg.openFirewall (if cfg.declarative then {
allowedUDPPorts = [ serverPort ];
allowedTCPPorts = [ serverPort ]
++ optional (! isNull queryPort) queryPort
++ optional (! isNull rconPort) rconPort;
} else {
allowedUDPPorts = [ defaultServerPort ];
allowedTCPPorts = [ defaultServerPort ];
});

assertions = [
{ assertion = cfg.eula;
message = "You must agree to Mojangs EULA to run minecraft-server."
+ " Read https://account.mojang.com/documents/minecraft_eula and"
+ " set `services.minecraft-server.eula` to `true` if you agree.";
}
];

};
}
4 changes: 2 additions & 2 deletions pkgs/data/icons/papirus-icon-theme/default.nix
Original file line number Diff line number Diff line change
@@ -2,13 +2,13 @@

stdenv.mkDerivation rec {
name = "papirus-icon-theme-${version}";
version = "20190106";
version = "20190203";

src = fetchFromGitHub {
owner = "PapirusDevelopmentTeam";
repo = "papirus-icon-theme";
rev = version;
sha256 = "0i5dmpqq65nipps800iijxd6krnvrdbnd6zrf7f145dg7r6hfk8p";
sha256 = "02vx8sqpd3rpcypjd99rqkci0fj1bcjznn46p660vpdddpadxya4";
};

nativeBuildInputs = [ gtk3 ];
6 changes: 3 additions & 3 deletions pkgs/development/compilers/swift/default.nix
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
}:

let
v_base = "4.2.1";
v_base = "4.2.2";
version = "${v_base}-RELEASE";
version_friendly = "${v_base}";

@@ -84,7 +84,7 @@ let
};
foundation = fetch {
repo = "swift-corelibs-foundation";
sha256 = "1bfnkj8s3v327cy0czkngz0ryzmz7amjzkkxbsg2zyrhf9a9f0f7";
sha256 = "1ki9vc723r13zgm6bcmif43aypavb2hz299gbhp93qkndz8hqkx5";
};
libdispatch = fetch {
repo = "swift-corelibs-libdispatch";
@@ -93,7 +93,7 @@ let
};
swift = fetch {
repo = "swift";
sha256 = "0y277wi0m6zp1yph9s14mmc65m21q5fm6lgzkn2rkrbaz25fdzak";
sha256 = "1hwi6hi9ss1kj1s65v5q8v8d872c0914qfy1018xijd029lwq694";
};
};

13 changes: 6 additions & 7 deletions pkgs/development/libraries/intel-media-driver/default.nix
Original file line number Diff line number Diff line change
@@ -5,20 +5,19 @@

stdenv.mkDerivation rec {
name = "intel-media-driver-${version}";
version = "18.3.0";
version = "18.4.0";

src = fetchFromGitHub {
owner = "intel";
repo = "media-driver";
rev = "intel-media-${version}";
sha256 = "15kcyg9ss2v1bbw6yvxqb833h1vs0h659n8ix0x5x03cfm1wsi57";
sha256 = "0mvb1dq2014gc60lz22dag230flqw859dcqi08hdmmci30qgw88x";
};

cmakeFlags = [ "-DINSTALL_DRIVER_SYSCONF=OFF" ];

preConfigure = ''
cmakeFlags="$cmakeFlags -DLIBVA_DRIVERS_PATH=$out/lib/dri"
'';
cmakeFlags = [
"-DINSTALL_DRIVER_SYSCONF=OFF"
"-DLIBVA_DRIVERS_PATH=${placeholder "out"}/lib/dri"
];

nativeBuildInputs = [ cmake pkgconfig ];

16 changes: 11 additions & 5 deletions pkgs/development/libraries/libva-utils/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
, libdrm, libva
{ stdenv, fetchFromGitHub, pkgconfig
, libdrm, libva, libX11, libXext, libXfixes, wayland, meson, ninja
}:

stdenv.mkDerivation rec {
@@ -10,12 +10,18 @@ stdenv.mkDerivation rec {
owner = "01org";
repo = "libva-utils";
rev = version;
sha256 = "0k5v72prcq462x780j9vpqf4ckrpqf536z6say81wpna0l0qbd98";
sha256 = "1yk9bg1wg4nqva3l01s6bghcvc3hb02gp62p1sy5qk0r9mn5kpik";
};

nativeBuildInputs = [ autoreconfHook pkgconfig ];
nativeBuildInputs = [ meson ninja pkgconfig ];

buildInputs = [ libdrm libva ];
buildInputs = [ libdrm libva libX11 libXext libXfixes wayland ];

mesonFlags = [
"-Ddrm=true"
"-Dx11=true"
"-Dwayland=true"
];

enableParallelBuilding = true;

4 changes: 2 additions & 2 deletions pkgs/development/libraries/libva/default.nix
Original file line number Diff line number Diff line change
@@ -6,14 +6,14 @@

stdenv.mkDerivation rec {
name = "libva-${lib.optionalString minimal "minimal-"}${version}";
version = "2.3.0";
version = "2.4.0";

# update libva-utils and vaapiIntel as well
src = fetchFromGitHub {
owner = "01org";
repo = "libva";
rev = version;
sha256 = "0zip22b5qwyjygsmrmjq62hdpl9z77d84h5hni8cn6xz5cmbw29z";
sha256 = "1b58n6rjfsfjfw1s5kdfa0jpfiqs83g2w14s7sfp1qkckkz3988l";
};

outputs = [ "dev" "out" ];
Loading