From 244cf195c88acff952ff0304c8e48a109f4b6754 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 30 Oct 2013 18:30:23 +0100 Subject: Use the "assertions" option instead of mkAssert --- nixos/modules/services/databases/4store-endpoint.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'nixos/modules/services/databases/4store-endpoint.nix') diff --git a/nixos/modules/services/databases/4store-endpoint.nix b/nixos/modules/services/databases/4store-endpoint.nix index 7b03b4d8f1dc5..7872ea2dc6a3d 100644 --- a/nixos/modules/services/databases/4store-endpoint.nix +++ b/nixos/modules/services/databases/4store-endpoint.nix @@ -24,12 +24,12 @@ with pkgs.lib; }; listenAddress = mkOption { - default = null; + default = null; description = "IP address to listen on."; }; port = mkOption { - default = 8080; + default = 8080; description = "port to listen on."; }; @@ -45,9 +45,12 @@ with pkgs.lib; ###### implementation - config = mkIf cfg.enable ( - mkAssert (cfg.enable -> cfg.database != "") - "Must specify database name" { + config = mkIf cfg.enable { + + assertions = singleton + { assertion = cfg.enable -> cfg.database != ""; + message = "Must specify 4Store database name"; + }; users.extraUsers = singleton { name = endpointUser; @@ -63,10 +66,10 @@ with pkgs.lib; startOn = "filesystem"; exec = '' - ${run} '${pkgs.rdf4store}/bin/4s-httpd -D ${cfg.options} ${if cfg.listenAddress!=null then "-H ${cfg.listenAddress}" else "" } -p ${toString cfg.port} ${cfg.database}' + ${run} '${pkgs.rdf4store}/bin/4s-httpd -D ${cfg.options} ${if cfg.listenAddress!=null then "-H ${cfg.listenAddress}" else "" } -p ${toString cfg.port} ${cfg.database}' ''; }; - }); + }; } -- cgit 1.4.1