all repos — dotfiles @ 8d7fa12973b26de946f01bd7be65988d38c8c796

my *nix dotfiles

bin/default.nix (view raw)

 1{ pkgs, host, ... }:
 2
 3let
 4
 5  # open a window with live video feed from the camera
 6  webcam = pkgs.writeScriptBin "webcam" ''
 7    ${pkgs.mpv}/bin/mpv av://v4l2:/dev/video0 --profile=low-latency --untimed
 8  '';
 9
10  # create new repo on git.icyphox.sh
11  git-new-repo = pkgs.writeScriptBin "git-new-repo" ''
12    repo="$1"
13    [[ "$1" == "" ]] && repo="$(basename "$PWD")"
14    ssh git@denna git init --bare "$repo"
15    read -p "descripton: " desc
16    printf '%s' "$desc" > .git/description
17    rsync .git/description git@denna:"$repo"
18  '';
19
20  # adds a new push-only remote
21  git-new-push-remote = pkgs.writeScriptBin "git-new-push-remote" ''
22    [[ "$@" == "" ]] && {
23      printf '%s\n' "usage: git new-push-remote <remote url>"
24      exit
25    }
26
27    old_push_remote="$(git remote -v | grep '(push)' | awk '{print $2}')"
28    git remote set-url "$(git remote show)" --add --push "$1"
29    git remote set-url "$(git remote show)" --add --push "$old_push_remote"
30  '';
31
32  # json pretty
33  jp = pkgs.writeScriptBin "jp" ''
34    ${pkgs.coreutils}/bin/cat | ${pkgs.jq}/bin/jq "$@"
35  '';
36
37  # screen record with ffmpeg and slop
38  record = import ./record.nix pkgs;
39
40  # xurls
41  xurls = import ./xurls.nix pkgs;
42
43  # file uploader
44  # uploader = import ./up.nix pkgs;
45
46  # nvidia offload
47  nvidia-offload = import ./nvidia-offload.nix pkgs;
48
49  # power profiles script
50  cputil = import ./cputil.nix pkgs;
51
52  # password manager
53  pw = import ./pw.nix pkgs;
54
55  # kubectx wrapper
56  kctx = import ./kctx.nix pkgs;
57
58  # kubeconfig manager
59  kcfg = import ./kcfg.nix pkgs;
60
61in
62[
63  git-new-push-remote
64  git-new-repo
65  jp
66  kctx
67  kcfg
68]