diff --git a/flake.nix b/flake.nix index 85e08db..84c656f 100644 --- a/flake.nix +++ b/flake.nix @@ -11,9 +11,11 @@ ./modules/openssh.nix ]; }; - in { + in + { devShell.x86_64-linux = pkgs.mkShell { buildInputs = with pkgs; [ + nixpkgs-fmt terraform_0_14 sops ]; @@ -22,7 +24,7 @@ nixosConfigurations = { db1 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = common.modules ++[ + modules = common.modules ++ [ ./modules/postgresql.nix ({ environment.systemPackages = with pkgs; [ @@ -36,7 +38,7 @@ }; backend1 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = common.modules ++[ + modules = common.modules ++ [ ./modules/murmur.nix ./modules/synapse.nix ({ diff --git a/modules/openssh.nix b/modules/openssh.nix index f051e94..b4a0de4 100644 --- a/modules/openssh.nix +++ b/modules/openssh.nix @@ -2,6 +2,6 @@ { services.openssh.enable = true; users.users.root.openssh.authorizedKeys.keyFiles = [ - ../ssh_keys/phfroidmont-desktop.pub + ../ssh_keys/phfroidmont-desktop.pub ]; } diff --git a/modules/postgresql.nix b/modules/postgresql.nix index b35c36d..4f5f809 100644 --- a/modules/postgresql.nix +++ b/modules/postgresql.nix @@ -10,4 +10,4 @@ ''; }; users.users.postgres.extraGroups = [ "keys" ]; -} \ No newline at end of file +} diff --git a/modules/synapse.nix b/modules/synapse.nix index 95f56ad..271a0e9 100644 --- a/modules/synapse.nix +++ b/modules/synapse.nix @@ -3,8 +3,10 @@ let fqdn = let join = hostName: domain: hostName + lib.optionalString (domain != null) ".${domain}"; - in join "matrix" config.networking.domain; -in { + in + join "matrix" config.networking.domain; +in +{ security.acme.email = "letsencrypt.account@banditlair.com"; security.acme.acceptTerms = true; @@ -30,18 +32,20 @@ in { # use 443 instead of the default 8448 port to unite # the client-server and server-server port for simplicity server = { "m.server" = "${fqdn}:443"; }; - in '' + in + '' add_header Content-Type application/json; return 200 '${builtins.toJSON server}'; ''; locations."= /.well-known/matrix/client".extraConfig = let client = { - "m.homeserver" = { "base_url" = "https://${fqdn}"; }; - "m.identity_server" = { "base_url" = "https://vector.im"; }; + "m.homeserver" = { "base_url" = "https://${fqdn}"; }; + "m.identity_server" = { "base_url" = "https://vector.im"; }; }; - # ACAO required to allow element-web on any URL to request this json file - in '' + # ACAO required to allow element-web on any URL to request this json file + in + '' add_header Content-Type application/json; add_header Access-Control-Allow-Origin *; return 200 '${builtins.toJSON client}';