blob: 0997b41a83180ffa7330ac8e7ebc7ecc3013e3ae (
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
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
|
{ config, pkgs, ... }:
## TODO sort and split up
{
environment.systemPackages = with pkgs; [
aria2
generate-secrets
gnupg1compat
htop
i3lock
l-gen-secrets
mosh
pass
pavucontrol
pv
pwgen
remmina
ripgrep
silver-searcher
transmission
wget
xsel
yt-dlp
(pkgs.writeDashBin "youtube-dl" ''
exec ${pkgs.yt-dlp}/bin/yt-dlp "$@"
'')
(pkgs.writeDashBin "tether-on" ''
adb shell svc usb setFunctions rndis
'')
(pkgs.writeDashBin "tether-off" ''
adb shell svc usb setFunctions
'')
(pkgs.writeDashBin "deploy" ''
set -eu
export SYSTEM="$1"
$(nix-build $HOME/sync/stockholm/lass/krops.nix --no-out-link --argstr name "$SYSTEM" -A deploy)
'')
(pkgs.writeDashBin "krebsco.de" ''
TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d)
${pkgs.brain}/bin/brain show krebs-secrets/ovh-secrets.json > "$TMPDIR"/ovh-secrets.json
OVH_ZONE_CONFIG="$TMPDIR"/ovh-secrets.json ${pkgs.krebszones}/bin/krebszones import
${pkgs.coreutils}/bin/rm -rf "$TMPDIR"
'')
(pkgs.writeDashBin "lassul.us" ''
TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d)
${pkgs.pass}/bin/pass show admin/ovh/api.config > "$TMPDIR"/ovh-secrets.json
OVH_ZONE_CONFIG="$TMPDIR"/ovh-secrets.json ${pkgs.ovh-zone}/bin/ovh-zone import /etc/zones/lassul.us lassul.us
${pkgs.coreutils}/bin/rm -rf "$TMPDIR"
'')
(pkgs.writeDashBin "btc-coinbase" ''
${pkgs.curl}/bin/curl -Ss 'https://api.coinbase.com/v2/prices/spot?currency=EUR' | ${pkgs.jq}/bin/jq '.data.amount'
'')
(pkgs.writeDashBin "btc-wex" ''
${pkgs.curl}/bin/curl -Ss 'https://wex.nz/api/3/ticker/btc_eur' | ${pkgs.jq}/bin/jq '.btc_eur.avg'
'')
(pkgs.writeDashBin "btc-kraken" ''
${pkgs.curl}/bin/curl -Ss 'https://api.kraken.com/0/public/Ticker?pair=BTCEUR' | ${pkgs.jq}/bin/jq '.result.XXBTZEUR.a[0]'
'')
];
}
|