~kaction/config

ref: 83c87e60d180bd2c8e650a0ccd22da806e6fc456 config/universe/selectors/default.nix -rw-r--r-- 884 bytes
83c87e60 — Dmitry Bogatov hub: drop rebuild derivation 3 months ago
                                                                                
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
{ fzy, git, git-bug, substituteAll, execline, busybox, runCommandLocal
, writeScript }:
let
  bug = writeScript "bug-selector" ''
    #!${execline}/bin/execlineb -WS0
    pipeline { ${git-bug}/bin/git-bug ls $@ }
    pipeline { ${fzy}/bin/fzy }
    ${busybox}/bin/cut -d " " -f1
  '';
  commit = writeScript "commit-selector" ''
    #!${execline}/bin/execlineb -WS0
    pipeline {
      ${git}/bin/git
        log --date=short
            --format="%h %cd %s"
            --since="last month" $@
    } pipeline { ${fzy}/bin/fzy }
    ${busybox}/bin/cut -d " " -f1
  '';
  file = writeScript "file-selector" ''
    #!${execline}/bin/execlineb -WS0
    pipeline { ${git}/bin/git ls-files $@ }
    ${fzy}/bin/fzy
  '';
in runCommandLocal "selectors" { } ''
  mkdir -p $out/bin
  ln -sf ${bug} $out/bin/fzy-bug
  ln -sf ${commit} $out/bin/fzy-commit
  ln -sf ${file} $out/bin/fzy-file
''