diff options
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/databases/foundationdb.nix | 19 | ||||
-rw-r--r-- | nixos/modules/services/databases/foundationdb.xml | 10 |
2 files changed, 23 insertions, 6 deletions
diff --git a/nixos/modules/services/databases/foundationdb.nix b/nixos/modules/services/databases/foundationdb.nix index 443cc6d5e456..693d2fde9916 100644 --- a/nixos/modules/services/databases/foundationdb.nix +++ b/nixos/modules/services/databases/foundationdb.nix @@ -4,6 +4,7 @@ with lib; let cfg = config.services.foundationdb; + pkg = cfg.package; # used for initial cluster configuration initialIpAddr = if (cfg.publicAddress != "auto") then cfg.publicAddress else "127.0.0.1"; @@ -24,7 +25,7 @@ let group = ${cfg.group} [fdbserver] - command = ${pkgs.foundationdb}/bin/fdbserver + command = ${pkg}/bin/fdbserver public_address = ${cfg.publicAddress}:$ID listen_address = ${cfg.listenAddress} datadir = ${cfg.dataDir}/$ID @@ -36,7 +37,7 @@ let storage_memory = ${cfg.storageMemory} ${optionalString (cfg.tls != null) '' - tls_plugin = ${pkgs.foundationdb}/libexec/plugins/FDBLibTLS.so + tls_plugin = ${pkg}/libexec/plugins/FDBLibTLS.so tls_certificate_file = ${cfg.tls.certificate} tls_key_file = ${cfg.tls.key} tls_verify_peers = ${cfg.tls.allowedPeers} @@ -50,7 +51,7 @@ let ${fdbServers cfg.serverProcesses} [backup_agent] - command = ${pkgs.foundationdb}/libexec/backup_agent + command = ${pkg}/libexec/backup_agent ${backupAgents cfg.backupProcesses} ''; in @@ -59,6 +60,14 @@ in enable = mkEnableOption "FoundationDB Server"; + package = mkOption { + type = types.package; + description = '' + The FoundationDB package to use for this server. This must be specified by the user + in order to ensure migrations and upgrades are controlled appropriately. + ''; + }; + publicAddress = mkOption { type = types.str; default = "auto"; @@ -314,7 +323,7 @@ in meta.doc = ./foundationdb.xml; meta.maintainers = with lib.maintainers; [ thoughtpolice ]; - environment.systemPackages = [ pkgs.foundationdb ]; + environment.systemPackages = [ pkg ]; users.extraUsers = optionalAttrs (cfg.user == "foundationdb") (singleton { name = "foundationdb"; @@ -368,7 +377,7 @@ in ReadWritePaths = lib.concatStringsSep " " (map (x: "-" + x) rwpaths); }; - path = [ pkgs.foundationdb pkgs.coreutils ]; + path = [ pkg pkgs.coreutils ]; preStart = '' rm -f ${cfg.pidfile} && \ diff --git a/nixos/modules/services/databases/foundationdb.xml b/nixos/modules/services/databases/foundationdb.xml index 045193f4b75b..def9cc436691 100644 --- a/nixos/modules/services/databases/foundationdb.xml +++ b/nixos/modules/services/databases/foundationdb.xml @@ -12,7 +12,7 @@ <para><emphasis>Maintainer:</emphasis> Austin Seipp</para> -<para><emphasis>Default version:</emphasis> 5.1.x</para> +<para><emphasis>Available version(s):</emphasis> 5.1.x</para> <para>FoundationDB (or "FDB") is a distributed, open source, high performance, transactional key-value store. It can store petabytes of data and deliver @@ -26,9 +26,17 @@ exceptional performance while maintaining consistency and ACID semantics <programlisting> services.foundationdb.enable = true; +services.foundationdb.package = pkgs.foundationdb51; # FoundationDB 5.1.x </programlisting> </para> +<para>The <option>services.foundationdb.package</option> option is required, +and must always be specified. Because FoundationDB network protocols and +on-disk storage formats may change between (major) versions, and upgrades must +be explicitly handled by the user, you must always manually specify this +yourself so that the NixOS module will use the proper version. Note that minor, +bugfix releases are always compatible.</para> + <para>After running <command>nixos-rebuild</command>, you can verify whether FoundationDB is running by executing <command>fdbcli</command> (which is added to <option>environment.systemPackages</option>): |