mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
drop support for environment variables
The configuration file is now the canonical way to, well, configure. This change is desirable because it gives us much more flexibility with how configuration is structured. Environment variables are insufficient because, for example, they're a flat namespace and have no built-in way to represent lists.
This commit is contained in:
parent
9b115b4110
commit
9a92a8047e
2 changed files with 2 additions and 14 deletions
|
|
@ -25,15 +25,6 @@ in
|
||||||
pkgsText = "inputs.grapevine.packages.\${pkgs.system}";
|
pkgsText = "inputs.grapevine.packages.\${pkgs.system}";
|
||||||
};
|
};
|
||||||
|
|
||||||
extraEnvironment = lib.mkOption {
|
|
||||||
type = types.attrsOf types.str;
|
|
||||||
description = ''
|
|
||||||
Extra environment variables to set for the process.
|
|
||||||
'';
|
|
||||||
default = {};
|
|
||||||
example = { RUST_BACKTRACE="yes"; };
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = lib.mkOption {
|
settings = lib.mkOption {
|
||||||
type = types.submodule {
|
type = types.submodule {
|
||||||
freeformType = format.type;
|
freeformType = format.type;
|
||||||
|
|
@ -85,7 +76,6 @@ in
|
||||||
systemd.services.grapevine = {
|
systemd.services.grapevine = {
|
||||||
description = "Grapevine (Matrix homeserver)";
|
description = "Grapevine (Matrix homeserver)";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
environment = cfg.extraEnvironment;
|
|
||||||
|
|
||||||
# Keep sorted
|
# Keep sorted
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ use axum_server::{
|
||||||
bind, bind_rustls, tls_rustls::RustlsConfig, Handle as ServerHandle,
|
bind, bind_rustls, tls_rustls::RustlsConfig, Handle as ServerHandle,
|
||||||
};
|
};
|
||||||
use figment::{
|
use figment::{
|
||||||
providers::{Env, Format, Toml},
|
providers::{Format, Toml},
|
||||||
Figment,
|
Figment,
|
||||||
};
|
};
|
||||||
use http::{
|
use http::{
|
||||||
|
|
@ -111,9 +111,7 @@ async fn try_main() -> Result<(), error::Main> {
|
||||||
let args = args::parse();
|
let args = args::parse();
|
||||||
|
|
||||||
// Initialize config
|
// Initialize config
|
||||||
let raw_config = Figment::new()
|
let raw_config = Figment::new().merge(Toml::file(&args.config).nested());
|
||||||
.merge(Toml::file(&args.config).nested())
|
|
||||||
.merge(Env::prefixed("GRAPEVINE_").global());
|
|
||||||
|
|
||||||
let config = raw_config.extract::<Config>()?;
|
let config = raw_config.extract::<Config>()?;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue