about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2021-08-04 13:45:45 +0300
committerVika <vika@fireburn.ru>2021-08-04 13:45:45 +0300
commitc081d65fcea1b4fcf3688d3ab752f62c20c87169 (patch)
treeac7cc4db3262d2f7454aad739c7bcd3705608663
parentb88d8508cf3c0ccf1746795e7c04a173e6e0d0e4 (diff)
downloadkittybox-c081d65fcea1b4fcf3688d3ab752f62c20c87169.tar.zst
Turns out nulls are evil
-rw-r--r--flake.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/flake.nix b/flake.nix
index b8ba086..2e3f40d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -138,9 +138,11 @@
           };
 
           script = ''
-            if [[ -f ${cfg.internalTokenFile} ]]; then
-              export KITTYBOX_INTERNAL_TOKEN=$(${pkgs.coreutils}/bin/cat ${cfg.internalTokenFile})
-            fi
+            ${lib.optionalString (cfg.internalTokenFile != null) ''
+              if [[ -f ${cfg.internalTokenFile} ]]; then
+                export KITTYBOX_INTERNAL_TOKEN=$(${pkgs.coreutils}/bin/cat ${cfg.internalTokenFile})
+              fi
+            ''}
             exec ${cfg.package}/bin/kittybox
           '';