summaryrefslogtreecommitdiff
path: root/custom/uucp-mediaserver/scripts.nix
diff options
context:
space:
mode:
Diffstat (limited to 'custom/uucp-mediaserver/scripts.nix')
-rw-r--r--custom/uucp-mediaserver/scripts.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/custom/uucp-mediaserver/scripts.nix b/custom/uucp-mediaserver/scripts.nix
new file mode 100644
index 00000000..21eab6de
--- /dev/null
+++ b/custom/uucp-mediaserver/scripts.nix
@@ -0,0 +1,32 @@
1{ stdenv, zsh, config }:
2
3let
4 mkSymlinks = name: ''
5 ln -s $out/libexec/mediaspace $out/bin/mediaspace.${name}
6 ln -s $out/libexec/queue $out/bin/queue.${name}
7 ln -s $out/libexec/queuesize $out/bin/queuesize.${name}
8 ln -s $out/libexec/queuestatus $out/bin/queuestatus.${name}
9 ln -s $out/libexec/update-queuesize $out/bin/update-queuesize.${name}
10 '';
11in stdenv.mkDerivation {
12 name = "uucp-mediaserver";
13 src = ./scripts;
14
15 phases = [ "installPhase" ];
16
17 inherit (config) queueDir;
18
19 installPhase = ''
20 mkdir -p $out/libexec
21
22 substituteFile $src/mediaspace $out/libexec/mediaspace
23 substituteFile $src/queue $out/libexec/queue
24 substituteFile $src/queuesize $out/libexec/queuesize
25 substituteFile $src/queuestatus $out/libexec/queuestatus
26 substituteFile $src/update-queuesize $out/libexec/update-queuesize
27
28 mkdir -p $out/bin
29
30 ${concatStringsSep "\n" (map mkSymlinks config.remoteNodes)}
31 '';
32}