From 339f51a5a04ec35b25dc3ad4bf29536d3d18a57d Mon Sep 17 00:00:00 2001 From: niten Date: Sun, 28 Jan 2024 12:26:11 -0800 Subject: [PATCH] Allow disabled registrations --- flake.nix | 2 +- mastodon-container.nix | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 83881d4..58faa6e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Mastodon running in a container"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.05"; + nixpkgs.url = "nixpkgs/nixos-23.11"; arion.url = "github:hercules-ci/arion"; }; diff --git a/mastodon-container.nix b/mastodon-container.nix index cf25ad6..b819939 100644 --- a/mastodon-container.nix +++ b/mastodon-container.nix @@ -44,6 +44,9 @@ in { default = 4; }; + close-registrations = + mkEnableOption "Disable the creation of new accounts."; + smtp = { host = mkOption { type = str; @@ -105,7 +108,6 @@ in { configuration = { boot.tmp.useTmpfs = true; system.nssModules = mkForce [ ]; - environment.systemPackages = with pkgs; [ dig inetutils ]; services = { nscd.enable = false; postgresql.enable = true; @@ -126,6 +128,7 @@ in { configureNginx = true; automaticMigrations = true; streamingProcesses = cfg.streaming-processes; + extraConfig.registrations_open = !cfg.closed-registrations; }; nginx = { recommendedTlsSettings = true;