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: f55c7cfa9402
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: 13938acd034c
Choose a head ref
  • 5 commits
  • 9 files changed
  • 3 contributors

Commits on Dec 11, 2018

  1. mxisd: init at 1.2.0

    (cherry picked from commit e40eb38)
    mguentner authored and fpletz committed Dec 11, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5f75865 View commit details
  2. modules: add mxisd with test

    (cherry picked from commit 44bb1c30b4ecfbe60bac1205a7f2af2e1323f2df)
    mguentner authored and fpletz committed Dec 11, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    dtzWill Will Dietz
    Copy the full SHA
    d975883 View commit details
  3. php71: 7.1.24 -> 7.1.25

    (cherry picked from commit 374be65)
    Izorkin authored and fpletz committed Dec 11, 2018
    Copy the full SHA
    043a2be View commit details
  4. php72: 7.2.12 -> 7.2.13

    (cherry picked from commit f80e7df)
    Izorkin authored and fpletz committed Dec 11, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    davidtwco David Wood
    Copy the full SHA
    6e0efb3 View commit details
  5. Merge #51836: nixos/nvidia: fix inverted assertion

    (cherry picked from commit ac19d5e)
    vcunat committed Dec 11, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    davidtwco David Wood
    Copy the full SHA
    13938ac View commit details
2 changes: 1 addition & 1 deletion nixos/modules/hardware/video/nvidia.nix
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ in
config = mkIf enabled {
assertions = [
{
assertion = config.services.xserver.displayManager.gdm.wayland;
assertion = !config.services.xserver.displayManager.gdm.wayland;
message = "NVidia drivers don't support wayland";
}
{
4 changes: 2 additions & 2 deletions nixos/modules/misc/ids.nix
Original file line number Diff line number Diff line change
@@ -175,7 +175,7 @@
dnsmasq = 141;
uhub = 142;
yandexdisk = 143;
#collectd = 144; #unused
mxisd = 144; # was once collectd
consul = 145;
mailpile = 146;
redmine = 147;
@@ -476,7 +476,7 @@
#dnsmasq = 141; # unused
uhub = 142;
#yandexdisk = 143; # unused
#collectd = 144; # unused
mxisd = 144; # was once collectd
#consul = 145; # unused
mailpile = 146;
redmine = 147;
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
@@ -540,6 +540,7 @@
./services/networking/miredo.nix
./services/networking/mstpd.nix
./services/networking/murmur.nix
./services/networking/mxisd.nix
./services/networking/namecoind.nix
./services/networking/nat.nix
./services/networking/ndppd.nix
128 changes: 128 additions & 0 deletions nixos/modules/services/networking/mxisd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.mxisd;

server = {
${ if cfg.server.name != "" then "name" else null }= cfg.server.name;
${ if cfg.server.port != -1 then "port" else null }= cfg.server.port;
};

baseConfig = {
matrix.domain = cfg.matrix.domain;
${ if server != {} then "server" else null }= server;
key.path = "${cfg.dataDir}/signing.key";
storage = {
provider.sqlite.database = "${cfg.dataDir}/mxisd.db";
};
};

# merges baseConfig and extraConfig into a single file
fullConfig = recursiveUpdate baseConfig cfg.extraConfig;

configFile = pkgs.writeText "mxisd-config.yaml" (builtins.toJSON fullConfig);

in {
options = {
services.mxisd = {
enable = mkEnableOption "mxisd matrix federated identity server";

package = mkOption {
type = types.package;
default = pkgs.mxisd;
defaultText = "pkgs.mxisd";
};

dataDir = mkOption {
type = types.str;
default = "/var/lib/mxisd";
description = "where data mxisd uses resides";
};

extraConfig = mkOption {
type = types.attrs;
default = {};
description = "extra option that is merged into the mxisd configuration";
};

matrix = {

domain = mkOption {
type = types.str;
default = "mxisd.example.org";
description = ''
the domain of the matrix homeserver
'';
};

};

server = {

name = mkOption {
type = types.str;
default = "";
description = ''
Public hostname of mxisd, if different from the Matrix domain.
'';
};

port = mkOption {
type = types.int;
default = -1;
description = ''
HTTP port to listen on (unencrypted)
'';
};

};

};
};

config = mkIf cfg.enable {
users.users = [
{
name = "mxisd";
group = "mxisd";
home = cfg.dataDir;
createHome = true;
shell = "${pkgs.bash}/bin/bash";
uid = config.ids.uids.mxisd;
}
];

users.groups = [
{
name = "mxisd";
gid = config.ids.gids.mxisd;
}
];

systemd.services.mxisd = {
description = "a federated identity server for the matrix ecosystem";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];

# mxisd / spring.boot needs the configuration to be named "application.yaml"
preStart = ''
config=${cfg.dataDir}/application.yaml
cp ${configFile} $config
chmod 444 $config
'';

serviceConfig = {
Type = "simple";
User = "mxisd";
Group = "mxisd";
ExecStart = "${cfg.package}/bin/mxisd --spring.config.location=${cfg.dataDir}/ --spring.profiles.active=systemd --java.security.egd=file:/dev/./urandom";
WorkingDirectory = cfg.dataDir;
PermissionsStartOnly = true;
SuccessExitStatus = 143;
Restart = "on-failure";
};
};
};
}
20 changes: 20 additions & 0 deletions nixos/tests/mxisd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import ./make-test.nix ({ pkgs, ... } : {

name = "mxisd";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ mguentner ];
};

nodes = {
server_mxisd = args : {
services.mxisd.enable = true;
};
};

testScript = ''
startAll;
$server_mxisd->waitForUnit("mxisd.service");
$server_mxisd->waitUntilSucceeds("curl \"http://127.0.0.1:8090/_matrix/identity/api/v1\"");
$server_mxisd->succeed("curl \"http://127.0.0.1:8090/_matrix/identity/api/v1\"")
'';
})
8 changes: 4 additions & 4 deletions pkgs/development/interpreters/php/default.nix
Original file line number Diff line number Diff line change
@@ -227,16 +227,16 @@ let

in {
php71 = generic {
version = "7.1.24";
sha256 = "02qy76krbdhlbkzs9k1sa5mgmj0qnbb8gcf1j3q0cq3z7kkj9pk6";
version = "7.1.25";
sha256 = "1b5az5vhap593ggjxirs1zdlg20hcv9h94iq5kgaxky71a4dqb00";

# https://bugs.php.net/bug.php?id=76826
extraPatches = optional stdenv.isDarwin ./php71-darwin-isfinite.patch;
};

php72 = generic {
version = "7.2.12";
sha256 = "1dpnbsv4bdlc5v40ddddi971f456jp1qrn89w5di1dj70g1c895p";
version = "7.2.13";
sha256 = "0bg9nfc250p24hxn4bdjz7ngcw75h8rpf4qjxqzcs6s9fvxlcjjv";

# https://bugs.php.net/bug.php?id=76826
extraPatches = optional stdenv.isDarwin ./php72-darwin-isfinite.patch;
22 changes: 22 additions & 0 deletions pkgs/servers/mxisd/0001-gradle.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- a/build.gradle 2018-11-16 15:15:29.021469758 +0100
+++ b/build.gradle 2018-11-16 15:16:50.982289782 +0100
@@ -64,7 +64,7 @@

buildscript {
repositories {
- mavenCentral()
+ REPLACE
}

dependencies {
@@ -73,9 +73,7 @@
}

repositories {
- mavenCentral()
- maven { url "https://kamax.io/maven/releases/" }
- maven { url "https://kamax.io/maven/snapshots/" }
+REPLACE
}

dependencies {
70 changes: 70 additions & 0 deletions pkgs/servers/mxisd/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{ stdenv, fetchFromGitHub, jdk, jre, git, gradle_2_5, perl, makeWrapper, writeText }:

let
name = "mxisd-${version}";
version = "1.2.0";
rev = "8c4ddd2e6526c1d2b284ba88cce3c2b926d99c62";

src = fetchFromGitHub {
inherit rev;
owner = "kamax-matrix";
repo = "mxisd";
sha256 = "083plqg0rxsqwzyskin78wkmylhb7cqz37lpsa1zy56sxpdw1a3l";
};


deps = stdenv.mkDerivation {
name = "${name}-deps";
inherit src;
nativeBuildInputs = [ gradle_2_5 perl git ];

buildPhase = ''
export MXISD_BUILD_VERSION=${rev}
export GRADLE_USER_HOME=$(mktemp -d);
gradle --no-daemon build -x test
'';

# perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar)
installPhase = ''
find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
| perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
| sh
'';

dontStrip = true;

outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "0shshn05nzv23shry1xpcgvqg59gx929n0qngpfjhbq0kp7px68m";
};

in
stdenv.mkDerivation {
inherit name src version;
nativeBuildInputs = [ gradle_2_5 perl makeWrapper ];
buildInputs = [ jre ];

patches = [ ./0001-gradle.patch ];

buildPhase = ''
export MXISD_BUILD_VERSION=${rev}
export GRADLE_USER_HOME=$(mktemp -d)
sed -ie "s#REPLACE#mavenLocal(); maven { url '${deps}' }#g" build.gradle
gradle --offline --no-daemon build -x test
'';

installPhase = ''
install -D build/libs/source.jar $out/lib/mxisd.jar
makeWrapper ${jre}/bin/java $out/bin/mxisd --add-flags "-jar $out/lib/mxisd.jar"
'';

meta = with stdenv.lib; {
description = "a federated matrix identity server";
homepage = https://github.com/kamax-matrix/mxisd;
license = licenses.agpl3;
maintainers = with maintainers; [ mguentner ];
platforms = platforms.all;
};

}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -3629,6 +3629,8 @@ with pkgs;

mxt-app = callPackage ../misc/mxt-app { };

mxisd = callPackage ../servers/mxisd { };

nagstamon = callPackage ../tools/misc/nagstamon {
pythonPackages = python3Packages;
};