summary refs log tree commit diff
path: root/nixos/modules/services/games
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2021-10-03 18:06:03 +0200
committerNaïm Favier <n@monade.li>2021-10-04 12:47:20 +0200
commit2ddc335e6f32b875e14ad9610101325b306a0add (patch)
tree2a4591c137cb363a6ec09f529d587a10aa7a0bc7 /nixos/modules/services/games
parent330b1e08b8df4e1f0100a0a7810ec3157749e5ee (diff)
downloadnixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.gz
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.bz2
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.lz
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.xz
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.zst
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.zip
nixos/doc: clean up defaults and examples
Diffstat (limited to 'nixos/modules/services/games')
-rw-r--r--nixos/modules/services/games/crossfire-server.nix54
-rw-r--r--nixos/modules/services/games/deliantra-server.nix38
-rw-r--r--nixos/modules/services/games/factorio.nix6
-rw-r--r--nixos/modules/services/games/minecraft-server.nix8
4 files changed, 55 insertions, 51 deletions
diff --git a/nixos/modules/services/games/crossfire-server.nix b/nixos/modules/services/games/crossfire-server.nix
index 974aea0cd67..a33025e0c3e 100644
--- a/nixos/modules/services/games/crossfire-server.nix
+++ b/nixos/modules/services/games/crossfire-server.nix
@@ -18,7 +18,7 @@ in {
     package = mkOption {
       type = types.package;
       default = pkgs.crossfire-server;
-      defaultText = "pkgs.crossfire-server";
+      defaultText = literalExpression "pkgs.crossfire-server";
       description = ''
         The package to use for the Crossfire server (and map/arch data, if you
         don't change dataDir).
@@ -28,7 +28,7 @@ in {
     dataDir = mkOption {
       type = types.str;
       default = "${cfg.package}/share/crossfire";
-      defaultText = "\${config.services.crossfire.package}/share/crossfire";
+      defaultText = literalExpression ''"''${config.services.crossfire.package}/share/crossfire"'';
       description = ''
         Where to load readonly data from -- maps, archetypes, treasure tables,
         and the like. If you plan to edit the data on the live server (rather
@@ -72,30 +72,32 @@ in {
         overwrite the example files that come with the server, rather than being
         appended to them as the other configuration files are.
       '';
-      example = literalExample ''
-        dm_file = '''
-          admin:secret_password:localhost
-          jane:xyzzy:*
-        ''';
-        ban_file = '''
-          # Bob is a jerk
-          bob@*
-          # So is everyone on 192.168.86.255/24
-          *@192.168.86.
-        ''';
-        metaserver2 = '''
-          metaserver2_notification on
-          localhostname crossfire.example.net
-        ''';
-        motd = "Welcome to CrossFire!";
-        news = "No news yet.";
-        rules = "Don't be a jerk.";
-        settings = '''
-          # be nicer to newbies and harsher to experienced players
-          balanced_stat_loss true
-          # don't let players pick up and use admin-created items
-          real_wiz false
-        ''';
+      example = literalExpression ''
+        {
+          dm_file = '''
+            admin:secret_password:localhost
+            jane:xyzzy:*
+          ''';
+          ban_file = '''
+            # Bob is a jerk
+            bob@*
+            # So is everyone on 192.168.86.255/24
+            *@192.168.86.
+          ''';
+          metaserver2 = '''
+            metaserver2_notification on
+            localhostname crossfire.example.net
+          ''';
+          motd = "Welcome to CrossFire!";
+          news = "No news yet.";
+          rules = "Don't be a jerk.";
+          settings = '''
+            # be nicer to newbies and harsher to experienced players
+            balanced_stat_loss true
+            # don't let players pick up and use admin-created items
+            real_wiz false
+          ''';
+        }
       '';
       default = {};
     };
diff --git a/nixos/modules/services/games/deliantra-server.nix b/nixos/modules/services/games/deliantra-server.nix
index 36bf6041762..b7011f4c354 100644
--- a/nixos/modules/services/games/deliantra-server.nix
+++ b/nixos/modules/services/games/deliantra-server.nix
@@ -18,7 +18,7 @@ in {
     package = mkOption {
       type = types.package;
       default = pkgs.deliantra-server;
-      defaultText = "pkgs.deliantra-server";
+      defaultText = literalExpression "pkgs.deliantra-server";
       description = ''
         The package to use for the Deliantra server (and map/arch data, if you
         don't change dataDir).
@@ -28,7 +28,7 @@ in {
     dataDir = mkOption {
       type = types.str;
       default = "${pkgs.deliantra-data}";
-      defaultText = "\${pkgs.deliantra-data}";
+      defaultText = literalExpression ''"''${pkgs.deliantra-data}"'';
       description = ''
         Where to store readonly data (maps, archetypes, sprites, etc).
         Note that if you plan to use the live map editor (rather than editing
@@ -69,22 +69,24 @@ in {
         The example here is not comprehensive. See the files in
         /etc/deliantra-server after enabling this module for full documentation.
       '';
-      example = literalExample ''
-        dm_file = '''
-          admin:secret_password:localhost
-          jane:xyzzy:*
-        ''';
-        motd = "Welcome to Deliantra!";
-        settings = '''
-          # Settings for game mechanics.
-          stat_loss_on_death true
-          armor_max_enchant 7
-        ''';
-        config = '''
-          # Settings for the server daemon.
-          hiscore_url https://deliantra.example.net/scores/
-          max_map_reset 86400
-        ''';
+      example = literalExpression ''
+        {
+          dm_file = '''
+            admin:secret_password:localhost
+            jane:xyzzy:*
+          ''';
+          motd = "Welcome to Deliantra!";
+          settings = '''
+            # Settings for game mechanics.
+            stat_loss_on_death true
+            armor_max_enchant 7
+          ''';
+          config = '''
+            # Settings for the server daemon.
+            hiscore_url https://deliantra.example.net/scores/
+            max_map_reset 86400
+          ''';
+        }
       '';
       default = {
         motd = "";
diff --git a/nixos/modules/services/games/factorio.nix b/nixos/modules/services/games/factorio.nix
index 3cb14275792..0e8860a0281 100644
--- a/nixos/modules/services/games/factorio.nix
+++ b/nixos/modules/services/games/factorio.nix
@@ -86,7 +86,7 @@ in
       configFile = mkOption {
         type = types.path;
         default = configFile;
-        defaultText = "configFile";
+        defaultText = literalExpression "configFile";
         description = ''
           The server's configuration file.
 
@@ -162,8 +162,8 @@ in
       package = mkOption {
         type = types.package;
         default = pkgs.factorio-headless;
-        defaultText = "pkgs.factorio-headless";
-        example = "pkgs.factorio-headless-experimental";
+        defaultText = literalExpression "pkgs.factorio-headless";
+        example = literalExpression "pkgs.factorio-headless-experimental";
         description = ''
           Factorio version to use. This defaults to the stable channel.
         '';
diff --git a/nixos/modules/services/games/minecraft-server.nix b/nixos/modules/services/games/minecraft-server.nix
index 458e57fef84..ddbe9508a4d 100644
--- a/nixos/modules/services/games/minecraft-server.nix
+++ b/nixos/modules/services/games/minecraft-server.nix
@@ -109,7 +109,7 @@ in {
           You can use <link xlink:href="https://mcuuid.net/"/> to get a
           Minecraft UUID for a username.
         '';
-        example = literalExample ''
+        example = literalExpression ''
           {
             username1 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
             username2 = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy";
@@ -120,7 +120,7 @@ in {
       serverProperties = mkOption {
         type = with types; attrsOf (oneOf [ bool int str ]);
         default = {};
-        example = literalExample ''
+        example = literalExpression ''
           {
             server-port = 43000;
             difficulty = 3;
@@ -144,8 +144,8 @@ in {
       package = mkOption {
         type = types.package;
         default = pkgs.minecraft-server;
-        defaultText = "pkgs.minecraft-server";
-        example = literalExample "pkgs.minecraft-server_1_12_2";
+        defaultText = literalExpression "pkgs.minecraft-server";
+        example = literalExpression "pkgs.minecraft-server_1_12_2";
         description = "Version of minecraft-server to run.";
       };