summaryrefslogtreecommitdiffstats
path: root/pkgs/simple/xdpytools/default.nix
blob: 7d1ee071eba51bbd3fb8e92ba6efda7ff50d0be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ lib, pkgs }:

let
  install = name: { path }: /* sh */ ''
    (
      mkdir -p $out/bin
      touch $out/bin/${name}
      chmod +x $out/bin/${name}
      exec >$out/bin/${name}

      echo '#! ${pkgs.dash}/bin/dash'
      echo export PATH=${lib.makeBinPath path}
      sed 1d ${./src + "/${name}"}
    )
  '';
in

pkgs.runCommand "xdpytools" {}
  (toString
    (lib.mapAttrsToList install {
      xdpychvt.path = [
        "$out"
        "/run/wrappers/'$LOGNAME'"
        "/run/wrappers"
      ];
      xdpysel.path = [
        "$out"
        pkgs.findutils
        pkgs.jq
      ];
    }))