From 3f1f3112dfc2b193fb33943e9094a9b5d991c491 Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@private.storage>
Date: Wed, 3 Nov 2021 15:38:26 +0000
Subject: [PATCH] Don't literalExample all the examples.

literalExample is deprecated and overused. See:
https://whetstone.privatestorage.io/privatestorage/PrivateStorageio/-/merge_requests/201#note_16966
---
 nixos/modules/100tb.nix                     | 14 +++++++-------
 nixos/modules/deployment.nix                |  4 ++--
 nixos/modules/issuer.nix                    |  6 +++---
 nixos/modules/monitoring/server/grafana.nix | 12 ++++++------
 nixos/modules/monitoring/vpn/client.nix     | 12 ++++++------
 nixos/modules/monitoring/vpn/server.nix     | 12 ++++++------
 nixos/modules/private-storage.nix           | 12 ++++++------
 nixos/modules/spending.nix                  |  4 ++--
 nixos/modules/ssh.nix                       |  2 +-
 nixos/modules/tahoe.nix                     |  4 ++--
 10 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/nixos/modules/100tb.nix b/nixos/modules/100tb.nix
index a8db0e8b..87554ef3 100644
--- a/nixos/modules/100tb.nix
+++ b/nixos/modules/100tb.nix
@@ -34,39 +34,39 @@ let
   options = {
     hostId = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "abcdefab";
+      example = "abcdefab";
       description = "The 32-bit host ID of the machine, formatted as 8 hexadecimal characters.";
     };
     interface = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "eno0";
+      example = "eno0";
       description = "The name of the network interface on which to configure a static address.";
 
     };
     publicIPv4 = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "192.0.2.0";
+      example = "192.0.2.0";
       description = "The IPv4 address to statically assign to `interface`.";
     };
     prefixLength = lib.mkOption
     { type = lib.types.int;
-      example = lib.literalExample 24;
+      example = 24;
       description = "The statically configured network's prefix length.";
     };
     gateway = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "192.0.2.1";
+      example = "192.0.2.1";
       description = "The statically configured address of the network gateway.";
     };
     gatewayInterface = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "eno0";
+      example = "eno0";
       description = "The name of the network interface for the default route.";
       default = cfg.interface;
     };
     grubDeviceID = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "wwn-0x5000c500936410b9";
+      example = "wwn-0x5000c500936410b9";
       description = "The ID of the disk on which to install grub.";
     };
   };
diff --git a/nixos/modules/deployment.nix b/nixos/modules/deployment.nix
index b0a5e3c4..41381ce5 100755
--- a/nixos/modules/deployment.nix
+++ b/nixos/modules/deployment.nix
@@ -16,7 +16,7 @@ in {
   options = {
     services.private-storage.deployment.authorizedKey = lib.mkOption {
       type = lib.types.str;
-      example = lib.literalExample ''
+      example = ''
         ssh-ed25519 AAAAC3N...
       '';
       description = ''
@@ -25,7 +25,7 @@ in {
     };
     services.private-storage.deployment.gridName = lib.mkOption {
       type = lib.types.str;
-      example = lib.literalExample "staging";
+      example = "staging";
       description = ''
         The name of the grid configuration to use to update this deployment.
       '';
diff --git a/nixos/modules/issuer.nix b/nixos/modules/issuer.nix
index da3eed73..d7d62c65 100644
--- a/nixos/modules/issuer.nix
+++ b/nixos/modules/issuer.nix
@@ -8,14 +8,14 @@ in {
     services.private-storage-issuer.package = lib.mkOption {
       default = ourpkgs.zkapissuer;
       type = lib.types.package;
-      example = lib.literalExample "pkgs.zkapissuer.components.exes.\"PaymentServer-exe\"";
+      example = "pkgs.zkapissuer.components.exes.\"PaymentServer-exe\"";
       description = ''
         The package to use for the ZKAP issuer.
       '';
     };
     services.private-storage-issuer.domains = lib.mkOption {
       type = lib.types.listOf lib.types.str;
-      example = lib.literalExample [ "payments.example.com" ];
+      example = [ "payments.example.com" ];
       description = ''
         The domain names at which the issuer is reachable.
       '';
@@ -32,7 +32,7 @@ in {
     services.private-storage-issuer.issuer = lib.mkOption {
       default = "Ristretto";
       type = lib.types.enum [ "Trivial" "Ristretto" ];
-      example = lib.literalExample "Trivial";
+      example = "Trivial";
       description = ''
         The issuer algorithm to use.  Either Trivial for a fake no-crypto
         algorithm or Ristretto for Ristretto-flavored PrivacyPass.
diff --git a/nixos/modules/monitoring/server/grafana.nix b/nixos/modules/monitoring/server/grafana.nix
index 1b51abd4..af5f216c 100644
--- a/nixos/modules/monitoring/server/grafana.nix
+++ b/nixos/modules/monitoring/server/grafana.nix
@@ -22,18 +22,18 @@ in {
   options.services.private-storage.monitoring.grafana = {
     domain = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "grafana.grid.private.storage";
+      example = "grafana.grid.private.storage";
       description = "The FQDN of the Grafana host";
     };
     prometheusUrl = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "http://prometheus:9090/";
+      example = "http://prometheus:9090/";
       default = "http://localhost:9090/";
       description = "The URL of the Prometheus host to access";
     };
     lokiUrl = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "http://loki:3100/";
+      example = "http://loki:3100/";
       default = "http://localhost:3100/";
       description = "The URL of the Loki host to access";
     };
@@ -46,19 +46,19 @@ in {
     };
     googleOAuthClientID = lib.mkOption
     { type = lib.types.str;
-      example = lib.literalExample "grafana-staging-345678";
+      example = "grafana-staging-345678";
       default = "replace-by-your-client-id-or-set-empty-string-for-anonymous-access";
       description = "The GSuite OAuth2 SSO Client ID.  Empty string turns SSO auth off and anonymous (free for all) access on.";
     };
     googleOAuthClientSecretFile = lib.mkOption
     { type = lib.types.path;
-      example = lib.literalExample "/var/secret/monitoring-gsuite-client-secret";
+      example = "/var/secret/monitoring-gsuite-client-secret";
       default = /run/keys/grafana-google-sso.secret;
       description = "The path to the GSuite SSO secret file.";
     };
     adminPasswordFile = lib.mkOption
     { type = lib.types.path;
-      example = lib.literalExample "/var/secret/monitoring-admin-password";
+      example = "/var/secret/monitoring-admin-password";
       default = /run/keys/grafana-admin.password;
       description = "A file containing the password for the Grafana Admin account.";
     };
diff --git a/nixos/modules/monitoring/vpn/client.nix b/nixos/modules/monitoring/vpn/client.nix
index ed1933e3..afa4f77c 100644
--- a/nixos/modules/monitoring/vpn/client.nix
+++ b/nixos/modules/monitoring/vpn/client.nix
@@ -8,7 +8,7 @@ in {
     enable = lib.mkEnableOption "PrivateStorageio Monitoring VPN client service";
     privateKeyFile = lib.mkOption {
       type = lib.types.path;
-      example = lib.literalExample /run/keys/monitoringvpn/host.key;
+      example = /run/keys/monitoringvpn/host.key;
       default = /run/keys/monitoringvpn/client.key;
       description = ''
         File with base64 private key generated by <command>wg genkey</command>.
@@ -18,7 +18,7 @@ in {
     };
     presharedKeyFile = lib.mkOption {
       type = lib.types.path;
-      example = lib.literalExample /run/keys/monitoringvpn/preshared.key;
+      example = /run/keys/monitoringvpn/preshared.key;
       default = /run/keys/monitoringvpn/preshared.key;
       description = ''
         File with base64 preshared key generated by <command>wg genpsk</command>.
@@ -26,7 +26,7 @@ in {
     };
     allowedIPs = lib.mkOption {
       type = lib.types.listOf lib.types.str;
-      example = lib.literalExample [ "172.23.23.1/32" ];
+      example = [ "172.23.23.1/32" ];
       default = [ "172.23.23.1/32" ];
       description = ''
         Limits which IPs this client receives data from.
@@ -34,21 +34,21 @@ in {
     };
     ip = lib.mkOption {
       type = lib.types.str;
-      example = lib.literalExample "172.23.23.11";
+      example = "172.23.23.11";
       description = ''
         The IP addresses of the interface.
       '';
     };
     endpoint = lib.mkOption {
       type = lib.types.str;
-      example = lib.literalExample "vpn.monitoring.private.storage:54321";
+      example = "vpn.monitoring.private.storage:54321";
       description = ''
         The address and port number of the server to establish the VPN with.
       '';
     };
     endpointPublicKeyFile = lib.mkOption {
       type = lib.types.path;
-      example = lib.literalExample ./monitoringvpn/server.pub;
+      example = ./monitoringvpn/server.pub;
       description = ''
         File with base64 public key generated by <command>cat private.key | wg pubkey > pubkey.pub</command>.
       '';
diff --git a/nixos/modules/monitoring/vpn/server.nix b/nixos/modules/monitoring/vpn/server.nix
index 3c41e020..80881a20 100644
--- a/nixos/modules/monitoring/vpn/server.nix
+++ b/nixos/modules/monitoring/vpn/server.nix
@@ -13,7 +13,7 @@ in {
     enable = lib.mkEnableOption "PrivateStorageio Monitoring VPN server service";
     privateKeyFile = lib.mkOption {
       type = lib.types.path;
-      example = lib.literalExample /run/keys/monitoringvpn/server.key;
+      example = /run/keys/monitoringvpn/server.key;
       default = /run/keys/monitoringvpn/server.key;
       description = ''
         File with base64 private key generated by <command>wg genkey</command>.
@@ -21,7 +21,7 @@ in {
     };
     presharedKeyFile = lib.mkOption {
       type = lib.types.path;
-      example = lib.literalExample /run/keys/monitoringvpn/preshared.key;
+      example = /run/keys/monitoringvpn/preshared.key;
       default = /run/keys/monitoringvpn/preshared.key;
       description = ''
         File with base64 preshared key generated by <command>wg genpsk</command>.
@@ -29,14 +29,14 @@ in {
     };
     ip = lib.mkOption {
       type = lib.types.str;
-      example = lib.literalExample [ "172.23.23.23" ];
+      example = [ "172.23.23.23" ];
       description = ''
         The IP address of the interface.
       '';
     };
     port = lib.mkOption {
       type = lib.types.port;
-      example = lib.literalExample 54321;
+      example = 54321;
       default = 51820;
       description = ''
         The UDP port to listen on.
@@ -44,14 +44,14 @@ in {
     };
     vpnClientIPs = lib.mkOption {
       type = lib.types.listOf lib.types.str;
-      example = lib.literalExample [ "172.23.23.23" "172.23.23.42" ];
+      example = [ "172.23.23.23" "172.23.23.42" ];
       description = ''
         The IP addresses to allow connections from.
       '';
     };
     pubKeysPath = lib.mkOption {
       type = lib.types.path;
-      example = lib.literalExample ./monitoringvpn;
+      example = ./monitoringvpn;
       description = ''
         The path to the directory that holds the public keys.
       '';
diff --git a/nixos/modules/private-storage.nix b/nixos/modules/private-storage.nix
index c119a3d3..5c4dbca4 100644
--- a/nixos/modules/private-storage.nix
+++ b/nixos/modules/private-storage.nix
@@ -37,7 +37,7 @@ in
     services.private-storage.tahoe.package = lib.mkOption
     { default = ourpkgs.privatestorage;
       type = lib.types.package;
-      example = lib.literalExample "pkgs.tahoelafs";
+      example = "pkgs.tahoelafs";
       description = ''
         The package to use for the Tahoe-LAFS daemon.
       '';
@@ -45,7 +45,7 @@ in
     services.private-storage.publicAddress = lib.mkOption
     { default = "${fqdn}";
       type = lib.types.str;
-      example = lib.literalExample "storage.example.invalid";
+      example = "storage.example.invalid";
       description = ''
         A publicly-visible address to use in Tahoe-LAFS advertisements for
         this storage service.
@@ -54,7 +54,7 @@ in
     services.private-storage.introducerFURL = lib.mkOption
     { default = null;
       type = lib.types.nullOr lib.types.str;
-      example = lib.literalExample "pb://<tubid>@<location hint>/<swissnum>";
+      example = "pb://<tubid>@<location hint>/<swissnum>";
       description = ''
         A Tahoe-LAFS introducer node fURL at which this storage node should announce itself.
       '';
@@ -62,7 +62,7 @@ in
     services.private-storage.publicStoragePort = lib.mkOption
     { default = 8898;
       type = lib.types.int;
-      example = lib.literalExample 8098;
+      example = 8098;
       description = ''
         The port number on which to service storage clients.
       '';
@@ -70,14 +70,14 @@ in
     services.private-storage.issuerRootURL = lib.mkOption
     { default = "https://issuer.${config.networking.domain}/";
       type = lib.types.str;
-      example = lib.literalExample "https://example.invalid/";
+      example = "https://example.invalid/";
       description = ''
         The URL of the Ristretto issuer service to announce.
       '';
     };
     services.private-storage.ristrettoSigningKeyPath = lib.mkOption
     { type = lib.types.path;
-      example = lib.literalExample "/var/run/secrets/signing-key.private";
+      example = "/var/run/secrets/signing-key.private";
       description = ''
         The path to the Ristretto signing key for the service.
       '';
diff --git a/nixos/modules/spending.nix b/nixos/modules/spending.nix
index 325dd147..ccbce1d3 100644
--- a/nixos/modules/spending.nix
+++ b/nixos/modules/spending.nix
@@ -10,7 +10,7 @@ in
       package = lib.mkOption {
         default = ourpkgs.zkap-spending-service;
         type = lib.types.package;
-        example = lib.literalExample "ourpkgs.zkap-spending-service";
+        example = "ourpkgs.zkap-spending-service";
         description = ''
           The package to use for the spending service.
         '';
@@ -26,7 +26,7 @@ in
     services.private-storage-spending.domain = lib.mkOption {
       default = config.networking.fqdn;
       type = lib.types.str;
-      example = lib.literalExample [ "spending.example.com" ];
+      example = [ "spending.example.com" ];
       description = ''
         The domain name at which the spending service is reachable.
       '';
diff --git a/nixos/modules/ssh.nix b/nixos/modules/ssh.nix
index 3e905283..eb55fbf2 100644
--- a/nixos/modules/ssh.nix
+++ b/nixos/modules/ssh.nix
@@ -7,7 +7,7 @@
   options = {
     services.private-storage.sshUsers = lib.mkOption {
       type = lib.types.attrsOf lib.types.str;
-      example = lib.literalExample { root = "ssh-ed25519 AAA..."; };
+      example = { root = "ssh-ed25519 AAA..."; };
       description = ''
         Users to configure on the issuer server and the storage servers and
         the SSH public keys to use to authenticate them.
diff --git a/nixos/modules/tahoe.nix b/nixos/modules/tahoe.nix
index 33047491..e0b6eb4d 100644
--- a/nixos/modules/tahoe.nix
+++ b/nixos/modules/tahoe.nix
@@ -48,7 +48,7 @@ in
               default = pkgs.tahoelafs;
               defaultText = "pkgs.tahoelafs";
               type = types.package;
-              example = literalExample "pkgs.tahoelafs";
+              example = "pkgs.tahoelafs";
               description = ''
                 The package to use for the Tahoe LAFS daemon.
               '';
@@ -78,7 +78,7 @@ in
               default = pkgs.tahoelafs;
               defaultText = "pkgs.tahoelafs";
               type = types.package;
-              example = literalExample "pkgs.tahoelafs";
+              example = "pkgs.tahoelafs";
               description = ''
                 The package to use for the Tahoe LAFS daemon.
               '';
-- 
GitLab