summary refs log tree commit diff
path: root/nixos/modules/services/games
diff options
context:
space:
mode:
authorlom <legendofmiracles@protonmail.com>2022-06-03 08:13:08 -0600
committerlom <legendofmiracles@protonmail.com>2022-06-04 12:00:45 -0600
commit0df7cba1b0ad4dc019a54aa2fec107a8ae5bf404 (patch)
treecd6b1733e5a45391be984f004fd11ba249d3670c /nixos/modules/services/games
parent032f15e566ad9f68017c23db0f2b70345a19b74e (diff)
downloadnixpkgs-0df7cba1b0ad4dc019a54aa2fec107a8ae5bf404.tar
nixpkgs-0df7cba1b0ad4dc019a54aa2fec107a8ae5bf404.tar.gz
nixpkgs-0df7cba1b0ad4dc019a54aa2fec107a8ae5bf404.tar.bz2
nixpkgs-0df7cba1b0ad4dc019a54aa2fec107a8ae5bf404.tar.lz
nixpkgs-0df7cba1b0ad4dc019a54aa2fec107a8ae5bf404.tar.xz
nixpkgs-0df7cba1b0ad4dc019a54aa2fec107a8ae5bf404.tar.zst
nixpkgs-0df7cba1b0ad4dc019a54aa2fec107a8ae5bf404.zip
nixos/asf: ipcPasswordFile use nullOr
Diffstat (limited to 'nixos/modules/services/games')
-rw-r--r--nixos/modules/services/games/asf.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/nixos/modules/services/games/asf.nix b/nixos/modules/services/games/asf.nix
index 86845fe3b55..ed1a5544d7a 100644
--- a/nixos/modules/services/games/asf.nix
+++ b/nixos/modules/services/games/asf.nix
@@ -13,7 +13,7 @@ let
     # is in theory not needed as this is already the default for default builds
     UpdateChannel = 0;
     Headless = true;
-  } // lib.optionalAttrs (cfg.ipcPasswordFile != "") {
+  } // lib.optionalAttrs (cfg.ipcPasswordFile != null) {
     IPCPassword = "#ipcPassword#";
   });
 
@@ -94,7 +94,8 @@ in
     };
 
     ipcPasswordFile = mkOption {
-      type = types.path;
+      type = types.nullOr types.path;
+      default = null;
       description = "Path to a file containig the password. The file must be readable by the <literal>asf</literal> user/group.";
     };
 
@@ -225,7 +226,10 @@ in
             mkdir -p config
 
             cp --no-preserve=mode ${asf-config} config/ASF.json
-            ${replaceSecretBin} '#ipcPassword#' '${cfg.ipcPasswordFile}' config/ASF.json
+
+            ${optionalString (cfg.ipcPasswordFile != null) ''
+              ${replaceSecretBin} '#ipcPassword#' '${cfg.ipcPasswordFile}' config/ASF.json
+            ''}
 
             ${optionalString (cfg.ipcSettings != {}) ''
               ln -fs ${ipc-config} config/IPC.config