tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
passthrough config if there are no secrets defined
Jack Cummings
3 years ago
75f2f8e7
28cf7126
+16
-11
1 changed file
expand all
collapse all
unified
split
nixos
modules
services
networking
resilio.nix
+16
-11
nixos/modules/services/networking/resilio.nix
···
52
52
53
53
runConfigPath = "/run/rslsync/config.json";
54
54
55
55
-
createConfig = pkgs.writeShellScriptBin "create-resilio-config" ''
56
56
-
${pkgs.jq}/bin/jq \
57
57
-
'.shared_folders |= map(.secret = $ARGS.named[.dir])' \
58
58
-
${
59
59
-
lib.concatMapStringsSep " \\\n "
60
60
-
(entry: ''--arg '${entry.dir}' "$(cat '${entry.secretFile}')"'')
61
61
-
sharedFoldersSecretFiles
62
62
-
} \
63
63
-
<${configFile} \
64
64
-
>${runConfigPath}
65
65
-
'';
55
55
+
createConfig = pkgs.writeShellScriptBin "create-resilio-config" (
56
56
+
if cfg.sharedFolders != [ ] then ''
57
57
+
${pkgs.jq}/bin/jq \
58
58
+
'.shared_folders |= map(.secret = $ARGS.named[.dir])' \
59
59
+
${
60
60
+
lib.concatMapStringsSep " \\\n "
61
61
+
(entry: ''--arg '${entry.dir}' "$(cat '${entry.secretFile}')"'')
62
62
+
sharedFoldersSecretFiles
63
63
+
} \
64
64
+
<${configFile} \
65
65
+
>${runConfigPath}
66
66
+
'' else ''
67
67
+
# no secrets, passing through config
68
68
+
cp ${configFile} ${runConfigPath};
69
69
+
''
70
70
+
);
66
71
67
72
in
68
73
{