Set up matrix-rooms.cryto.net

master
Sven Slootweg 5 years ago
parent a26c526e93
commit b23b4e9ea9

@ -8,6 +8,7 @@ let
nodeApplication = self.callPackage ./lib/node-application.nix {}; nodeApplication = self.callPackage ./lib/node-application.nix {};
unpack = self.callPackage ./lib/unpack.nix {}; unpack = self.callPackage ./lib/unpack.nix {};
mobileProxy = self.callPackage ./packages/mobile-proxy { configFile = null; }; mobileProxy = self.callPackage ./packages/mobile-proxy { configFile = null; };
matrixRooms = self.callPackage ./packages/matrix-rooms {};
}; };
}) })
]; ];
@ -103,6 +104,7 @@ in {
"iomfats.cryto.net" "iomfats.cryto.net"
"castleroland.cryto.net" "castleroland.cryto.net"
"awesomedude.cryto.net" "awesomedude.cryto.net"
"matrix-rooms.cryto.net"
]) ])
(httpsHosts [ (httpsHosts [
# "haless.cryto.net" # "haless.cryto.net"
@ -111,6 +113,7 @@ in {
"iomfats.cryto.net" "iomfats.cryto.net"
"castleroland.cryto.net" "castleroland.cryto.net"
"awesomedude.cryto.net" "awesomedude.cryto.net"
"matrix-rooms.cryto.net"
]) ])
]; ];
@ -210,6 +213,10 @@ in {
(nginxPresets.letsEncrypt) (nginxPresets.letsEncrypt)
(nginxPresets.reverseProxy "http://127.0.0.1:3000/") (nginxPresets.reverseProxy "http://127.0.0.1:3000/")
]; ];
"matrix-rooms.cryto.net" = lib.mkMerge [
(nginxPresets.letsEncrypt)
(nginxPresets.reverseProxy "http://127.0.0.1:3842/")
];
}; };
}; };
@ -272,5 +279,35 @@ in {
HOME = "/tmp/mobile-proxy-home"; HOME = "/tmp/mobile-proxy-home";
}; };
}; };
users.extraUsers.matrix-rooms = {
description = "mobile-proxy Service User";
};
systemd.services.matrix-rooms = let
package = pkgs.cryto.matrixRooms;
in {
description = "Matrix Room List Viewer";
wantedBy = ["multi-user.target"];
after = ["network.target"];
serviceConfig = {
ExecStart = "${package}/bin/matrix-room-list-viewer"; /* FIXME: Change binary name in its package.json at some point */
User = "matrix-rooms";
Restart = "on-failure";
PermissionsStartOnly = true;
};
# FIXME: Is a fake homes necessary for this application?
preStart = ''
mkdir -m 0700 -p /tmp/matrix-rooms-home
chown matrix-rooms /tmp/matrix-rooms-home
'';
environment = {
HOME = "/tmp/matrix-rooms-home";
NODE_ENV = "production";
};
};
}; };
} }

@ -0,0 +1,18 @@
{ pkgs, ... }:
pkgs.cryto.nodeApplication {
name = "matrix-rooms";
source = pkgs.stdenv.mkDerivation {
name = "matrix-rooms-application";
src = pkgs.cryto.fetchFromCrytoGit {
owner = "joepie91";
repo = "matrix-room-list-viewer";
rev = "5912b79024cba33ee7e291f325d0286b8304af99";
sha256 = "199in3m3vll0i0qsz869x2q6zqn1xxgyvia3fxnmschvfmybbf8r";
};
buildCommand = ''
mkdir -p $out
tar -xzvf $src -C $out
'';
};
}
Loading…
Cancel
Save