all repos — dotfiles @ 45b1048dfc8a41d4144790fee6ec7672969100da

my *nix dotfiles

nix/bin/default.nix (view raw)

 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
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
{ pkgs, host, ... }:

let

  # open a window with live video feed from the camera
  webcam = pkgs.writeScriptBin "webcam" ''
    ${pkgs.mpv}/bin/mpv av://v4l2:/dev/video0 --profile=low-latency --untimed
  '';

  # create new repo on git.icyphox.sh
  git-new-repo = pkgs.writeScriptBin "git-new-repo" ''
    repo="$1"
    [[ "$1" == "" ]] && repo="$(basename "$PWD")"
    ssh git@jade git init --bare "$repo"
    read -p "descripton: " desc
    printf '%s' "$desc" > .git/description
    rsync .git/description git@jade:"$repo"
  '';

  # adds a new push-only remote
  git-new-push-remote = pkgs.writeScriptBin "git-new-push-remote" ''
    [[ "$@" == "" ]] && {
      printf '%s\n' "usage: git new-push-remote <remote url>"
      exit
    }

    old_push_remote="$(git remote -v | grep '(push)' | awk '{print $2}')"
    git remote set-url "$(git remote show)" --add --push "$1"
    git remote set-url "$(git remote show)" --add --push "$old_push_remote"
  '';

  # json pretty
  jp = pkgs.writeScriptBin "jp" ''
    ${pkgs.coreutils}/bin/cat | ${pkgs.jq}/bin/jq "$@"
  '';

  # screen record with ffmpeg and slop
  record = import ./record.nix pkgs;

  # xurls
  xurls = import ./xurls.nix pkgs;

  # file uploader
  # uploader = import ./up.nix pkgs;

  # nvidia offload
  nvidia-offload = import ./nvidia-offload.nix pkgs;

  # power profiles script
  cputil = import ./cputil.nix pkgs;

  # password manager
  pw = import ./pw.nix pkgs;

  # kubectx wrapper
  kctx = import ./kctx.nix pkgs;

  # kubeconfig manager
  kcfg = import ./kcfg.nix pkgs;

in
[
  git-new-push-remote
  git-new-repo
  jp
  kctx
  kcfg
]