Merge master into staging-next
This commit is contained in:
@@ -233,7 +233,10 @@ let
|
||||
# Notes about grub:
|
||||
# * Yes, the grubMenuCfg has to be repeated in all submenus. Otherwise you
|
||||
# will get white-on-black console-like text on sub-menus. *sigh*
|
||||
efiDir = pkgs.runCommand "efi-directory" {} ''
|
||||
efiDir = pkgs.runCommand "efi-directory" {
|
||||
nativeBuildInputs = [ pkgs.buildPackages.grub2_efi ];
|
||||
strictDeps = true;
|
||||
} ''
|
||||
mkdir -p $out/EFI/boot/
|
||||
|
||||
# ALWAYS required modules.
|
||||
@@ -263,7 +266,7 @@ let
|
||||
|
||||
# Make our own efi program, we can't rely on "grub-install" since it seems to
|
||||
# probe for devices, even with --skip-fs-probe.
|
||||
${grubPkgs.grub2_efi}/bin/grub-mkimage -o $out/EFI/boot/boot${targetArch}.efi -p /EFI/boot -O ${grubPkgs.grub2_efi.grubTarget} \
|
||||
grub-mkimage --directory=${grubPkgs.grub2_efi}/lib/grub/${grubPkgs.grub2_efi.grubTarget} -o $out/EFI/boot/boot${targetArch}.efi -p /EFI/boot -O ${grubPkgs.grub2_efi.grubTarget} \
|
||||
$MODULES
|
||||
cp ${grubPkgs.grub2_efi}/share/grub/unicode.pf2 $out/EFI/boot/
|
||||
|
||||
@@ -388,7 +391,10 @@ let
|
||||
${refind}
|
||||
'';
|
||||
|
||||
efiImg = pkgs.runCommand "efi-image_eltorito" { buildInputs = [ pkgs.mtools pkgs.libfaketime ]; }
|
||||
efiImg = pkgs.runCommand "efi-image_eltorito" {
|
||||
nativeBuildInputs = [ pkgs.buildPackages.mtools pkgs.buildPackages.libfaketime pkgs.buildPackages.dosfstools ];
|
||||
strictDeps = true;
|
||||
}
|
||||
# Be careful about determinism: du --apparent-size,
|
||||
# dates (cp -p, touch, mcopy -m, faketime for label), IDs (mkfs.vfat -i)
|
||||
''
|
||||
@@ -408,10 +414,10 @@ let
|
||||
echo "Usage size: $usage_size"
|
||||
echo "Image size: $image_size"
|
||||
truncate --size=$image_size "$out"
|
||||
${pkgs.libfaketime}/bin/faketime "2000-01-01 00:00:00" ${pkgs.dosfstools}/sbin/mkfs.vfat -i 12345678 -n EFIBOOT "$out"
|
||||
faketime "2000-01-01 00:00:00" mkfs.vfat -i 12345678 -n EFIBOOT "$out"
|
||||
mcopy -psvm -i "$out" ./EFI ./boot ::
|
||||
# Verify the FAT partition.
|
||||
${pkgs.dosfstools}/sbin/fsck.vfat -vn "$out"
|
||||
fsck.vfat -vn "$out"
|
||||
''; # */
|
||||
|
||||
# Name used by UEFI for architectures.
|
||||
@@ -420,6 +426,8 @@ let
|
||||
"ia32"
|
||||
else if pkgs.stdenv.isx86_64 then
|
||||
"x64"
|
||||
else if pkgs.stdenv.isAarch32 then
|
||||
"arm"
|
||||
else if pkgs.stdenv.isAarch64 then
|
||||
"aa64"
|
||||
else
|
||||
|
||||
@@ -471,6 +471,7 @@
|
||||
./services/misc/cgminer.nix
|
||||
./services/misc/confd.nix
|
||||
./services/misc/couchpotato.nix
|
||||
./services/misc/dendrite.nix
|
||||
./services/misc/devmon.nix
|
||||
./services/misc/dictd.nix
|
||||
./services/misc/duckling.nix
|
||||
@@ -513,7 +514,6 @@
|
||||
./services/misc/mame.nix
|
||||
./services/misc/matrix-appservice-discord.nix
|
||||
./services/misc/matrix-appservice-irc.nix
|
||||
./services/misc/matrix-dendrite.nix
|
||||
./services/misc/matrix-synapse.nix
|
||||
./services/misc/mautrix-telegram.nix
|
||||
./services/misc/mbpfan.nix
|
||||
|
||||
+18
-18
@@ -1,12 +1,12 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.matrix-dendrite;
|
||||
cfg = config.services.dendrite;
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
configurationYaml = settingsFormat.generate "dendrite.yaml" cfg.settings;
|
||||
workingDir = "/var/lib/matrix-dendrite";
|
||||
workingDir = "/var/lib/dendrite";
|
||||
in
|
||||
{
|
||||
options.services.matrix-dendrite = {
|
||||
options.services.dendrite = {
|
||||
enable = lib.mkEnableOption "matrix.org dendrite";
|
||||
httpPort = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.port;
|
||||
@@ -24,31 +24,31 @@ in
|
||||
};
|
||||
tlsCert = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
example = "/var/lib/matrix-dendrite/server.cert";
|
||||
example = "/var/lib/dendrite/server.cert";
|
||||
default = null;
|
||||
description = ''
|
||||
The path to the TLS certificate.
|
||||
|
||||
<programlisting>
|
||||
nix-shell -p matrix-dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key"
|
||||
nix-shell -p dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key"
|
||||
</programlisting>
|
||||
'';
|
||||
};
|
||||
tlsKey = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
example = "/var/lib/matrix-dendrite/server.key";
|
||||
example = "/var/lib/dendrite/server.key";
|
||||
default = null;
|
||||
description = ''
|
||||
The path to the TLS key.
|
||||
|
||||
<programlisting>
|
||||
nix-shell -p matrix-dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key"
|
||||
nix-shell -p dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key"
|
||||
</programlisting>
|
||||
'';
|
||||
};
|
||||
environmentFile = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
example = "/var/lib/matrix-dendrite/registration_secret";
|
||||
example = "/var/lib/dendrite/registration_secret";
|
||||
default = null;
|
||||
description = ''
|
||||
Environment file as defined in <citerefentry>
|
||||
@@ -62,7 +62,7 @@ in
|
||||
|
||||
<programlisting>
|
||||
# snippet of dendrite-related config
|
||||
services.matrix-dendrite.settings.client_api.registration_shared_secret = "$REGISTRATION_SHARED_SECRET";
|
||||
services.dendrite.settings.client_api.registration_shared_secret = "$REGISTRATION_SHARED_SECRET";
|
||||
</programlisting>
|
||||
|
||||
<programlisting>
|
||||
@@ -95,7 +95,7 @@ in
|
||||
requests and events.
|
||||
|
||||
<programlisting>
|
||||
nix-shell -p matrix-dendrite --command "generate-keys --private-key matrix_key.pem"
|
||||
nix-shell -p dendrite --command "generate-keys --private-key matrix_key.pem"
|
||||
</programlisting>
|
||||
'';
|
||||
};
|
||||
@@ -136,11 +136,11 @@ in
|
||||
message = ''
|
||||
If Dendrite is configured to use https, tlsCert and tlsKey must be provided.
|
||||
|
||||
nix-shell -p matrix-dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key"
|
||||
nix-shell -p dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key"
|
||||
'';
|
||||
}];
|
||||
|
||||
systemd.services.matrix-dendrite = {
|
||||
systemd.services.dendrite = {
|
||||
description = "Dendrite Matrix homeserver";
|
||||
after = [
|
||||
"network.target"
|
||||
@@ -149,22 +149,22 @@ in
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
DynamicUser = true;
|
||||
StateDirectory = "matrix-dendrite";
|
||||
StateDirectory = "dendrite";
|
||||
WorkingDirectory = workingDir;
|
||||
RuntimeDirectory = "matrix-dendrite";
|
||||
RuntimeDirectory = "dendrite";
|
||||
RuntimeDirectoryMode = "0700";
|
||||
EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
|
||||
ExecStartPre =
|
||||
if (cfg.environmentFile != null) then ''
|
||||
${pkgs.envsubst}/bin/envsubst \
|
||||
-i ${configurationYaml} \
|
||||
-o /run/matrix-dendrite/dendrite.yaml
|
||||
-o /run/dendrite/dendrite.yaml
|
||||
'' else ''
|
||||
${pkgs.coreutils}/bin/cp ${configurationYaml} /run/matrix-dendrite/dendrite.yaml
|
||||
${pkgs.coreutils}/bin/cp ${configurationYaml} /run/dendrite/dendrite.yaml
|
||||
'';
|
||||
ExecStart = lib.strings.concatStringsSep " " ([
|
||||
"${pkgs.matrix-dendrite}/bin/dendrite-monolith-server"
|
||||
"--config /run/matrix-dendrite/dendrite.yaml"
|
||||
"${pkgs.dendrite}/bin/dendrite-monolith-server"
|
||||
"--config /run/dendrite/dendrite.yaml"
|
||||
] ++ lib.optionals (cfg.httpPort != null) [
|
||||
"--http-bind-address :${builtins.toString cfg.httpPort}"
|
||||
] ++ lib.optionals (cfg.httpsPort != null) [
|
||||
@@ -22,8 +22,8 @@ in {
|
||||
package = mkOption {
|
||||
type = types.path;
|
||||
description = "The SSM agent package to use";
|
||||
default = pkgs.ssm-agent;
|
||||
defaultText = "pkgs.ssm-agent";
|
||||
default = pkgs.ssm-agent.override { overrideEtc = false; };
|
||||
defaultText = "pkgs.ssm-agent.override { overrideEtc = false; }";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -37,8 +37,10 @@ in {
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/bin/amazon-ssm-agent";
|
||||
KillMode = "process";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "15min";
|
||||
# We want this restating pretty frequently. It could be our only means
|
||||
# of accessing the instance.
|
||||
Restart = "always";
|
||||
RestartSec = "1min";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -62,5 +64,10 @@ in {
|
||||
isNormalUser = true;
|
||||
group = "ssm-user";
|
||||
};
|
||||
|
||||
environment.etc."amazon/ssm/seelog.xml".source = "${cfg.package}/seelog.xml.template";
|
||||
|
||||
environment.etc."amazon/ssm/amazon-ssm-agent.json".source = "${cfg.package}/etc/amazon/ssm/amazon-ssm-agent.json.template";
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user