all repos — dotfiles @ 7370c9c8a57c265e1ff7e0810f4ed72c1631b47c

my *nix dotfiles

nix/bin/default.nix (view raw)

 1{ pkgs, theme, ... }:
 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@jade git init --bare "$repo"
15    read -p "descripton: " desc
16    printf '%s' "$desc" > .git/description
17    rsync .git/description git@jade:"$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  # screen record with ffmpeg and slop
33  record = import ./record.nix pkgs;
34
35  # bar
36  bar = import ./bar.nix { inherit pkgs theme; };
37
38  # file uploader
39  # uploader = import ./up.nix pkgs;
40
41  # battery script
42  battery = import ./battery.nix pkgs;
43in
44[
45  git-new-push-remote
46  git-new-repo
47  webcam
48  record
49  battery
50  bar
51]