From fbd485cd86c7e9984819357398f912a2d5510845 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 12 Sep 2023 12:56:39 +0200 Subject: [PATCH] tv: emigrate --- kartei/tv/hosts/alnus.nix | 1 - kartei/tv/hosts/au.nix | 1 - kartei/tv/hosts/bu.nix | 1 - kartei/tv/hosts/mu.nix | 1 - kartei/tv/hosts/nomic.nix | 1 - kartei/tv/hosts/querel.nix | 1 - kartei/tv/hosts/ru.nix | 1 - kartei/tv/hosts/xu.nix | 1 - kartei/tv/hosts/zu.nix | 1 - tv/1systems/alnus/config.nix | 87 --- tv/1systems/alnus/lib | 1 - tv/1systems/au/config.nix | 23 - tv/1systems/au/disks.nix | 19 - tv/1systems/au/lib | 1 - tv/1systems/bu/config.nix | 35 -- tv/1systems/bu/disks.nix | 19 - tv/1systems/bu/lib | 1 - tv/1systems/lib | 1 - tv/1systems/mu/config.nix | 127 ----- tv/1systems/mu/lib | 1 - tv/1systems/nomic/config.nix | 62 --- tv/1systems/nomic/lib | 1 - tv/1systems/querel/config.nix | 86 --- tv/1systems/querel/lib | 1 - tv/1systems/ru/config.nix | 37 -- tv/1systems/xu/config.nix | 154 ------ tv/1systems/xu/lib | 1 - tv/1systems/zu/config.nix | 51 -- tv/2configs/autotether.nix | 19 - tv/2configs/backup.nix | 109 ---- tv/2configs/bash/default.nix | 67 --- tv/2configs/bash/lib | 1 - tv/2configs/binary-cache/default.nix | 29 - tv/2configs/binary-cache/lib | 1 - tv/2configs/br.nix | 49 -- tv/2configs/default.nix | 137 ----- tv/2configs/elm-packages-proxy.nix | 359 ------------ tv/2configs/exim-retiolum.nix | 9 - tv/2configs/exim-smarthost.nix | 46 -- tv/2configs/fs/CAC-CentOS-7-64bit.nix | 20 - tv/2configs/gitconfig.nix | 16 - tv/2configs/gitrepos.nix | 233 -------- tv/2configs/htop.nix | 40 -- tv/2configs/hw/AO753.nix | 48 -- tv/2configs/hw/lib | 1 - tv/2configs/hw/winmax2.nix | 48 -- tv/2configs/hw/x220.nix | 89 --- tv/2configs/imgur.nix | 22 - tv/2configs/initrd/sshd.nix | 17 - tv/2configs/lib | 1 - tv/2configs/mail-client.nix | 9 - tv/2configs/man.nix | 13 - tv/2configs/nets/hkw.nix | 68 --- tv/2configs/networkd.nix | 4 - tv/2configs/nginx/default.nix | 22 - tv/2configs/nginx/lib | 1 - tv/2configs/nginx/public_html.nix | 18 - tv/2configs/nix.nix | 9 - tv/2configs/pki/certs/tv.crt | 31 -- tv/2configs/pki/default.nix | 68 --- tv/2configs/pki/lib | 1 - tv/2configs/ppp.nix | 86 --- tv/2configs/pulse.nix | 120 ---- tv/2configs/repo-sync/lib | 1 - tv/2configs/repo-sync/wiki.nix | 40 -- tv/2configs/retiolum.nix | 27 - tv/2configs/smartd.nix | 17 - tv/2configs/ssh.nix | 22 - tv/2configs/sshd.nix | 27 - tv/2configs/urlwatch.nix | 117 ---- tv/2configs/vim.nix | 183 ------ tv/2configs/weechat-server.nix | 24 - tv/2configs/wiregrill.nix | 37 -- tv/2configs/xdg.nix | 11 - tv/2configs/xserver/Xmodmap.nix | 28 - tv/2configs/xserver/default.nix | 167 ------ tv/2configs/xserver/lib | 1 - tv/2configs/xserver/sxiv.nix | 12 - tv/2configs/xserver/urxvt.nix | 73 --- tv/2configs/xserver/xkiller.nix | 14 - tv/2configs/xserver/xserver.conf.nix | 39 -- tv/2configs/xsessions/default.nix | 5 - tv/2configs/xsessions/urxvtd.nix | 15 - tv/3modules/Xresources.nix | 38 -- tv/3modules/charybdis/config.nix | 519 ------------------ tv/3modules/charybdis/default.nix | 81 --- tv/3modules/charybdis/lib | 1 - tv/3modules/default.nix | 8 - tv/3modules/dnsmasq.nix | 58 -- tv/3modules/ejabberd/default.nix | 275 ---------- tv/3modules/ejabberd/lib | 1 - tv/3modules/focus.nix | 4 - tv/3modules/hosts.nix | 9 - tv/3modules/hw.nix | 16 - tv/3modules/im.nix | 110 ---- tv/3modules/iptables.nix | 208 ------- tv/3modules/lib | 1 - tv/3modules/lidControl.nix | 45 -- .../org.freedesktop.machine1.host-shell.nix | 29 - tv/3modules/slock.nix | 78 --- tv/3modules/systemd.nix | 47 -- tv/3modules/unbound.nix | 84 --- tv/3modules/wwan.nix | 182 ------ tv/3modules/x0vncserver.nix | 45 -- tv/5pkgs/compat/default.nix | 1 - tv/5pkgs/default.nix | 19 - tv/5pkgs/haskell/default.nix | 28 - tv/5pkgs/haskell/lib | 1 - tv/5pkgs/haskell/th-env/default.nix | 10 - tv/5pkgs/haskell/th-env/src/THEnv.hs | 49 -- tv/5pkgs/haskell/th-env/th-env.cabal | 20 - tv/5pkgs/haskell/xmonad-tv/default.nix | 16 - tv/5pkgs/haskell/xmonad-tv/shell.nix | 83 --- tv/5pkgs/haskell/xmonad-tv/src/Shutdown.hs | 113 ---- .../haskell/xmonad-tv/src/XMonad/Extra.hs | 14 - .../src/XMonad/Hooks/EwmhDesktops/Extra.hs | 117 ---- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 227 -------- .../haskell/xmonad-tv/src/xmonad-tv.cabal | 29 - tv/5pkgs/lib | 1 - tv/5pkgs/override/alacritty.nix | 16 - tv/5pkgs/override/anbox.nix | 72 --- tv/5pkgs/override/default.nix | 4 - tv/5pkgs/override/fzf/complete1.patch | 77 --- tv/5pkgs/override/fzf/default.nix | 7 - tv/5pkgs/override/gitAndTools.nix | 5 - tv/5pkgs/override/input-fonts.nix | 13 - tv/5pkgs/override/iosevka-tv-1.nix | 20 - tv/5pkgs/override/iosevka-tv-2.nix | 20 - tv/5pkgs/override/jc.nix | 21 - tv/5pkgs/override/lib | 1 - tv/5pkgs/override/uqmi.nix | 10 - .../RPi_utils.codesend.codestring.patch | 24 - tv/5pkgs/rpi/433Utils/default.nix | 42 -- .../rpi/433Utils/rc-switch.protocols.patch | 10 - tv/5pkgs/rpi/433Utils/src.json | 7 - tv/5pkgs/rpi/WiringPi/default.nix | 61 -- tv/5pkgs/rpi/WiringPi/src.json | 6 - tv/5pkgs/rpi/default.nix | 7 - tv/5pkgs/rpi/lib | 1 - tv/5pkgs/simple/alacritty-tv.nix | 152 ----- tv/5pkgs/simple/bash-fzf-history.nix | 102 ---- tv/5pkgs/simple/cr.nix | 16 - tv/5pkgs/simple/default.nix | 18 - tv/5pkgs/simple/diff-so-fancy.nix | 50 -- tv/5pkgs/simple/disko.nix | 13 - tv/5pkgs/simple/editor-input.nix | 18 - tv/5pkgs/simple/ff.nix | 8 - tv/5pkgs/simple/field.nix | 6 - tv/5pkgs/simple/flameshot-once-tv.nix | 48 -- tv/5pkgs/simple/font-size-alacritty.nix | 67 --- tv/5pkgs/simple/fzmenu/bin/otpmenu | 44 -- tv/5pkgs/simple/fzmenu/bin/passmenu | 45 -- tv/5pkgs/simple/fzmenu/default.nix | 50 -- tv/5pkgs/simple/hc.nix | 39 -- tv/5pkgs/simple/iosevka-tv-1.nix | 18 - tv/5pkgs/simple/iosevka-tv-2.nix | 20 - tv/5pkgs/simple/lib | 1 - tv/5pkgs/simple/libinput-tv.nix | 11 - tv/5pkgs/simple/mpvterm/default.nix | 8 - tv/5pkgs/simple/mpvterm/mpvterm.patch | 146 ----- tv/5pkgs/simple/pinentry-urxvt/default.nix | 124 ----- tv/5pkgs/simple/pinentry-urxvt/lib | 1 - tv/5pkgs/simple/q/default.nix | 171 ------ tv/5pkgs/simple/q/lib | 1 - tv/5pkgs/simple/rox-filer.nix | 95 ---- .../default.nix | 16 - .../rxvt-unicode-256color.terminfo | Bin 2239 -> 0 bytes tv/5pkgs/simple/stardict/default.nix | 235 -------- tv/5pkgs/simple/viljetic-pages/default.nix | 17 - tv/5pkgs/simple/viljetic-pages/index.html | 11 - tv/5pkgs/simple/viljetic-pages/logo.xpm | 24 - tv/5pkgs/simple/weechat-tv.nix | 9 - tv/5pkgs/simple/xdpytools/default.nix | 31 -- tv/5pkgs/simple/xdpytools/src/xdpychvt | 11 - tv/5pkgs/simple/xdpytools/src/xdpysel | 49 -- tv/5pkgs/simple/xkiller.nix | 25 - tv/5pkgs/simple/xtoggledpms.nix | 16 - tv/5pkgs/vim/default.nix | 11 - tv/5pkgs/vim/elixir.nix | 9 - tv/5pkgs/vim/file-line.nix | 10 - tv/5pkgs/vim/fzf.nix | 11 - tv/5pkgs/vim/hack.nix | 49 -- tv/5pkgs/vim/jq.nix | 10 - tv/5pkgs/vim/lib | 1 - tv/5pkgs/vim/nix.nix | 225 -------- tv/5pkgs/vim/showsyntax.nix | 26 - tv/5pkgs/vim/tv.nix | 42 -- tv/5pkgs/vim/vim.nix | 16 - tv/default.nix | 15 - tv/dummy_secrets/default.nix | 8 - tv/dummy_secrets/o2.pin | 1 - tv/dummy_secrets/repos.nix | 1 - tv/dummy_secrets/ssh.id_ed25519 | 3 - tv/dummy_secrets/ssh.id_rsa | 3 - tv/krops.nix | 23 - tv/lib | 1 - tv/tombstone | 1 + 197 files changed, 1 insertion(+), 8560 deletions(-) delete mode 100644 tv/1systems/alnus/config.nix delete mode 120000 tv/1systems/alnus/lib delete mode 100644 tv/1systems/au/config.nix delete mode 100644 tv/1systems/au/disks.nix delete mode 120000 tv/1systems/au/lib delete mode 100644 tv/1systems/bu/config.nix delete mode 100644 tv/1systems/bu/disks.nix delete mode 120000 tv/1systems/bu/lib delete mode 120000 tv/1systems/lib delete mode 100644 tv/1systems/mu/config.nix delete mode 120000 tv/1systems/mu/lib delete mode 100644 tv/1systems/nomic/config.nix delete mode 120000 tv/1systems/nomic/lib delete mode 100644 tv/1systems/querel/config.nix delete mode 120000 tv/1systems/querel/lib delete mode 100644 tv/1systems/ru/config.nix delete mode 100644 tv/1systems/xu/config.nix delete mode 120000 tv/1systems/xu/lib delete mode 100644 tv/1systems/zu/config.nix delete mode 100644 tv/2configs/autotether.nix delete mode 100644 tv/2configs/backup.nix delete mode 100644 tv/2configs/bash/default.nix delete mode 120000 tv/2configs/bash/lib delete mode 100644 tv/2configs/binary-cache/default.nix delete mode 120000 tv/2configs/binary-cache/lib delete mode 100644 tv/2configs/br.nix delete mode 100644 tv/2configs/default.nix delete mode 100644 tv/2configs/elm-packages-proxy.nix delete mode 100644 tv/2configs/exim-retiolum.nix delete mode 100644 tv/2configs/exim-smarthost.nix delete mode 100644 tv/2configs/fs/CAC-CentOS-7-64bit.nix delete mode 100644 tv/2configs/gitconfig.nix delete mode 100644 tv/2configs/gitrepos.nix delete mode 100644 tv/2configs/htop.nix delete mode 100644 tv/2configs/hw/AO753.nix delete mode 120000 tv/2configs/hw/lib delete mode 100644 tv/2configs/hw/winmax2.nix delete mode 100644 tv/2configs/hw/x220.nix delete mode 100644 tv/2configs/imgur.nix delete mode 100644 tv/2configs/initrd/sshd.nix delete mode 120000 tv/2configs/lib delete mode 100644 tv/2configs/mail-client.nix delete mode 100644 tv/2configs/man.nix delete mode 100644 tv/2configs/nets/hkw.nix delete mode 100644 tv/2configs/networkd.nix delete mode 100644 tv/2configs/nginx/default.nix delete mode 120000 tv/2configs/nginx/lib delete mode 100644 tv/2configs/nginx/public_html.nix delete mode 100644 tv/2configs/nix.nix delete mode 100644 tv/2configs/pki/certs/tv.crt delete mode 100644 tv/2configs/pki/default.nix delete mode 120000 tv/2configs/pki/lib delete mode 100644 tv/2configs/ppp.nix delete mode 100644 tv/2configs/pulse.nix delete mode 120000 tv/2configs/repo-sync/lib delete mode 100644 tv/2configs/repo-sync/wiki.nix delete mode 100644 tv/2configs/retiolum.nix delete mode 100644 tv/2configs/smartd.nix delete mode 100644 tv/2configs/ssh.nix delete mode 100644 tv/2configs/sshd.nix delete mode 100644 tv/2configs/urlwatch.nix delete mode 100644 tv/2configs/vim.nix delete mode 100644 tv/2configs/weechat-server.nix delete mode 100644 tv/2configs/wiregrill.nix delete mode 100644 tv/2configs/xdg.nix delete mode 100644 tv/2configs/xserver/Xmodmap.nix delete mode 100644 tv/2configs/xserver/default.nix delete mode 120000 tv/2configs/xserver/lib delete mode 100644 tv/2configs/xserver/sxiv.nix delete mode 100644 tv/2configs/xserver/urxvt.nix delete mode 100644 tv/2configs/xserver/xkiller.nix delete mode 100644 tv/2configs/xserver/xserver.conf.nix delete mode 100644 tv/2configs/xsessions/default.nix delete mode 100644 tv/2configs/xsessions/urxvtd.nix delete mode 100644 tv/3modules/Xresources.nix delete mode 100644 tv/3modules/charybdis/config.nix delete mode 100644 tv/3modules/charybdis/default.nix delete mode 120000 tv/3modules/charybdis/lib delete mode 100644 tv/3modules/default.nix delete mode 100644 tv/3modules/dnsmasq.nix delete mode 100644 tv/3modules/ejabberd/default.nix delete mode 120000 tv/3modules/ejabberd/lib delete mode 100644 tv/3modules/focus.nix delete mode 100644 tv/3modules/hosts.nix delete mode 100644 tv/3modules/hw.nix delete mode 100644 tv/3modules/im.nix delete mode 100644 tv/3modules/iptables.nix delete mode 120000 tv/3modules/lib delete mode 100644 tv/3modules/lidControl.nix delete mode 100644 tv/3modules/org.freedesktop.machine1.host-shell.nix delete mode 100644 tv/3modules/slock.nix delete mode 100644 tv/3modules/systemd.nix delete mode 100644 tv/3modules/unbound.nix delete mode 100644 tv/3modules/wwan.nix delete mode 100644 tv/3modules/x0vncserver.nix delete mode 100644 tv/5pkgs/compat/default.nix delete mode 100644 tv/5pkgs/default.nix delete mode 100644 tv/5pkgs/haskell/default.nix delete mode 120000 tv/5pkgs/haskell/lib delete mode 100644 tv/5pkgs/haskell/th-env/default.nix delete mode 100644 tv/5pkgs/haskell/th-env/src/THEnv.hs delete mode 100644 tv/5pkgs/haskell/th-env/th-env.cabal delete mode 100644 tv/5pkgs/haskell/xmonad-tv/default.nix delete mode 100644 tv/5pkgs/haskell/xmonad-tv/shell.nix delete mode 100644 tv/5pkgs/haskell/xmonad-tv/src/Shutdown.hs delete mode 100644 tv/5pkgs/haskell/xmonad-tv/src/XMonad/Extra.hs delete mode 100644 tv/5pkgs/haskell/xmonad-tv/src/XMonad/Hooks/EwmhDesktops/Extra.hs delete mode 100644 tv/5pkgs/haskell/xmonad-tv/src/main.hs delete mode 100644 tv/5pkgs/haskell/xmonad-tv/src/xmonad-tv.cabal delete mode 120000 tv/5pkgs/lib delete mode 100644 tv/5pkgs/override/alacritty.nix delete mode 100644 tv/5pkgs/override/anbox.nix delete mode 100644 tv/5pkgs/override/default.nix delete mode 100644 tv/5pkgs/override/fzf/complete1.patch delete mode 100644 tv/5pkgs/override/fzf/default.nix delete mode 100644 tv/5pkgs/override/gitAndTools.nix delete mode 100644 tv/5pkgs/override/input-fonts.nix delete mode 100644 tv/5pkgs/override/iosevka-tv-1.nix delete mode 100644 tv/5pkgs/override/iosevka-tv-2.nix delete mode 100644 tv/5pkgs/override/jc.nix delete mode 120000 tv/5pkgs/override/lib delete mode 100644 tv/5pkgs/override/uqmi.nix delete mode 100644 tv/5pkgs/rpi/433Utils/RPi_utils.codesend.codestring.patch delete mode 100644 tv/5pkgs/rpi/433Utils/default.nix delete mode 100644 tv/5pkgs/rpi/433Utils/rc-switch.protocols.patch delete mode 100644 tv/5pkgs/rpi/433Utils/src.json delete mode 100644 tv/5pkgs/rpi/WiringPi/default.nix delete mode 100644 tv/5pkgs/rpi/WiringPi/src.json delete mode 100644 tv/5pkgs/rpi/default.nix delete mode 120000 tv/5pkgs/rpi/lib delete mode 100644 tv/5pkgs/simple/alacritty-tv.nix delete mode 100644 tv/5pkgs/simple/bash-fzf-history.nix delete mode 100644 tv/5pkgs/simple/cr.nix delete mode 100644 tv/5pkgs/simple/default.nix delete mode 100644 tv/5pkgs/simple/diff-so-fancy.nix delete mode 100644 tv/5pkgs/simple/disko.nix delete mode 100644 tv/5pkgs/simple/editor-input.nix delete mode 100644 tv/5pkgs/simple/ff.nix delete mode 100644 tv/5pkgs/simple/field.nix delete mode 100644 tv/5pkgs/simple/flameshot-once-tv.nix delete mode 100644 tv/5pkgs/simple/font-size-alacritty.nix delete mode 100755 tv/5pkgs/simple/fzmenu/bin/otpmenu delete mode 100755 tv/5pkgs/simple/fzmenu/bin/passmenu delete mode 100644 tv/5pkgs/simple/fzmenu/default.nix delete mode 100644 tv/5pkgs/simple/hc.nix delete mode 100644 tv/5pkgs/simple/iosevka-tv-1.nix delete mode 100644 tv/5pkgs/simple/iosevka-tv-2.nix delete mode 120000 tv/5pkgs/simple/lib delete mode 100644 tv/5pkgs/simple/libinput-tv.nix delete mode 100644 tv/5pkgs/simple/mpvterm/default.nix delete mode 100644 tv/5pkgs/simple/mpvterm/mpvterm.patch delete mode 100644 tv/5pkgs/simple/pinentry-urxvt/default.nix delete mode 120000 tv/5pkgs/simple/pinentry-urxvt/lib delete mode 100644 tv/5pkgs/simple/q/default.nix delete mode 120000 tv/5pkgs/simple/q/lib delete mode 100644 tv/5pkgs/simple/rox-filer.nix delete mode 100644 tv/5pkgs/simple/rxvt-unicode-256color-terminfo/default.nix delete mode 100644 tv/5pkgs/simple/rxvt-unicode-256color-terminfo/rxvt-unicode-256color.terminfo delete mode 100644 tv/5pkgs/simple/stardict/default.nix delete mode 100644 tv/5pkgs/simple/viljetic-pages/default.nix delete mode 100644 tv/5pkgs/simple/viljetic-pages/index.html delete mode 100644 tv/5pkgs/simple/viljetic-pages/logo.xpm delete mode 100644 tv/5pkgs/simple/weechat-tv.nix delete mode 100644 tv/5pkgs/simple/xdpytools/default.nix delete mode 100755 tv/5pkgs/simple/xdpytools/src/xdpychvt delete mode 100755 tv/5pkgs/simple/xdpytools/src/xdpysel delete mode 100644 tv/5pkgs/simple/xkiller.nix delete mode 100644 tv/5pkgs/simple/xtoggledpms.nix delete mode 100644 tv/5pkgs/vim/default.nix delete mode 100644 tv/5pkgs/vim/elixir.nix delete mode 100644 tv/5pkgs/vim/file-line.nix delete mode 100644 tv/5pkgs/vim/fzf.nix delete mode 100644 tv/5pkgs/vim/hack.nix delete mode 100644 tv/5pkgs/vim/jq.nix delete mode 120000 tv/5pkgs/vim/lib delete mode 100644 tv/5pkgs/vim/nix.nix delete mode 100644 tv/5pkgs/vim/showsyntax.nix delete mode 100644 tv/5pkgs/vim/tv.nix delete mode 100644 tv/5pkgs/vim/vim.nix delete mode 100644 tv/default.nix delete mode 100644 tv/dummy_secrets/default.nix delete mode 100644 tv/dummy_secrets/o2.pin delete mode 100644 tv/dummy_secrets/repos.nix delete mode 100644 tv/dummy_secrets/ssh.id_ed25519 delete mode 100644 tv/dummy_secrets/ssh.id_rsa delete mode 100644 tv/krops.nix delete mode 120000 tv/lib create mode 100644 tv/tombstone diff --git a/kartei/tv/hosts/alnus.nix b/kartei/tv/hosts/alnus.nix index e66236f1f..099f3c741 100644 --- a/kartei/tv/hosts/alnus.nix +++ b/kartei/tv/hosts/alnus.nix @@ -1,5 +1,4 @@ { - ci = true; nets = { retiolum = { ip4.addr = "10.243.21.1"; diff --git a/kartei/tv/hosts/au.nix b/kartei/tv/hosts/au.nix index 44279b687..c897f9cb1 100644 --- a/kartei/tv/hosts/au.nix +++ b/kartei/tv/hosts/au.nix @@ -1,5 +1,4 @@ { - ci = true; nets = { retiolum = { ip4.addr = "10.243.13.39"; diff --git a/kartei/tv/hosts/bu.nix b/kartei/tv/hosts/bu.nix index cbdf5af22..ca544c912 100644 --- a/kartei/tv/hosts/bu.nix +++ b/kartei/tv/hosts/bu.nix @@ -1,5 +1,4 @@ { - ci = true; nets = { retiolum = { ip4.addr = "10.243.13.36"; diff --git a/kartei/tv/hosts/mu.nix b/kartei/tv/hosts/mu.nix index e10694ec1..4fb7165f6 100644 --- a/kartei/tv/hosts/mu.nix +++ b/kartei/tv/hosts/mu.nix @@ -1,5 +1,4 @@ { - ci = true; nets = { retiolum = { ip4.addr = "10.243.20.1"; diff --git a/kartei/tv/hosts/nomic.nix b/kartei/tv/hosts/nomic.nix index 7c46dc40a..ebb0edcf5 100644 --- a/kartei/tv/hosts/nomic.nix +++ b/kartei/tv/hosts/nomic.nix @@ -1,5 +1,4 @@ { - ci = true; nets = { retiolum = { ip4.addr = "10.243.0.110"; diff --git a/kartei/tv/hosts/querel.nix b/kartei/tv/hosts/querel.nix index 6b9b9881b..805eeab94 100644 --- a/kartei/tv/hosts/querel.nix +++ b/kartei/tv/hosts/querel.nix @@ -1,5 +1,4 @@ { - ci = true; nets = { retiolum = { ip4.addr = "10.243.22.22"; diff --git a/kartei/tv/hosts/ru.nix b/kartei/tv/hosts/ru.nix index 334df5d07..d1a2be276 100644 --- a/kartei/tv/hosts/ru.nix +++ b/kartei/tv/hosts/ru.nix @@ -1,5 +1,4 @@ { - ci = true; nets = { retiolum = { ip4.addr = "10.243.13.42"; diff --git a/kartei/tv/hosts/xu.nix b/kartei/tv/hosts/xu.nix index e943915e4..7361092b7 100644 --- a/kartei/tv/hosts/xu.nix +++ b/kartei/tv/hosts/xu.nix @@ -2,7 +2,6 @@ binary-cache = { pubkey = "xu-1:pYRENvaxZqGeImwLA9qHmRwHV4jfKaYx4u1VcZ31x0s="; }; - ci = true; nets = { retiolum = { ip4.addr = "10.243.13.38"; diff --git a/kartei/tv/hosts/zu.nix b/kartei/tv/hosts/zu.nix index 91270d57e..c40de32a1 100644 --- a/kartei/tv/hosts/zu.nix +++ b/kartei/tv/hosts/zu.nix @@ -1,5 +1,4 @@ { - ci = true; nets = { retiolum = { ip4.addr = "10.243.13.40"; diff --git a/tv/1systems/alnus/config.nix b/tv/1systems/alnus/config.nix deleted file mode 100644 index 90501d56d..000000000 --- a/tv/1systems/alnus/config.nix +++ /dev/null @@ -1,87 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - imports = [ - - - - - ]; - - boot = { - initrd = { - availableKernelModules = [ "ahci" ]; - luks.devices.luksroot.device = "/dev/sda2"; - }; - }; - - environment.systemPackages = [ - pkgs.firefox - pkgs.networkmanagerapplet - (pkgs.pidgin.override { - plugins = [ pkgs.pidgin-otr ]; - }) - ]; - - fileSystems = { - "/boot" = { - device = "/dev/sda1"; - }; - "/" = { - device = "/dev/mapper/main-root"; - fsType = "ext4"; - options = [ "defaults" "noatime" ]; - }; - "/home" = { - device = "/dev/mapper/main-home"; - fsType = "ext4"; - options = [ "defaults" "noatime" ]; - }; - }; - - hardware = { - opengl.driSupport32Bit = true; - pulseaudio.enable = true; - }; - - i18n.defaultLocale = "de_DE.UTF-8"; - - krebs.build = { - host = config.krebs.hosts.alnus; - user = mkForce config.krebs.users.dv; - }; - - networking.networkmanager.enable = true; - - services.earlyoom.enable = true; - services.earlyoom.freeMemThreshold = 5; - systemd.services.earlyoom.environment.EARLYOOM_ARGS = toString [ - "--prefer '^(Web Content|Privileged Cont)$'" # firefox tabs - ]; - - services.xserver = { - enable = true; - layout = "de"; - xkbOptions = "eurosign:e"; - - libinput.enable = false; - synaptics = { - enable = true; - twoFingerScroll = true; - }; - }; - services.xserver.desktopManager.plasma5.enable = true; - services.xserver.displayManager.autoLogin.enable = true; - services.xserver.displayManager.autoLogin.user = "dv"; - - system.stateVersion = "22.05"; - - users.users.dv = { - inherit (config.krebs.users.dv) home uid; - isNormalUser = true; - extraGroups = [ - "audio" - "video" - "networkmanager" - ]; - }; -} diff --git a/tv/1systems/alnus/lib b/tv/1systems/alnus/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/1systems/alnus/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/1systems/au/config.nix b/tv/1systems/au/config.nix deleted file mode 100644 index 2521059b4..000000000 --- a/tv/1systems/au/config.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, ... }: { - imports = [ - ./disks.nix - - - - - - ]; - - krebs.build.host = config.krebs.hosts.au; - - networking.wireless.enable = true; - networking.useDHCP = false; - networking.interfaces.enp0s25.useDHCP = true; - networking.interfaces.wlp3s0.useDHCP = true; - networking.interfaces.wwp0s29u1u4i6.useDHCP = true; - - system.stateVersion = "20.03"; - - tv.hw.screens.primary.width = 1920; - tv.hw.screens.primary.height = 1080; -} diff --git a/tv/1systems/au/disks.nix b/tv/1systems/au/disks.nix deleted file mode 100644 index 434de1740..000000000 --- a/tv/1systems/au/disks.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - boot.initrd.luks.devices.main.device = "/dev/sda2"; - fileSystems."/" = { - device = "/dev/main/root"; - options = ["defaults" "noatime" "commit=60"]; - }; - fileSystems."/boot" = { - device = "/dev/sda1"; - options = ["defaults" "noatime"]; - }; - fileSystems."/bku" = { - device = "/dev/main/bku"; - options = ["defaults" "noatime"]; - }; - fileSystems."/home" = { - device = "/dev/main/home"; - options = ["defaults" "noatime" "commit=60"]; - }; -} diff --git a/tv/1systems/au/lib b/tv/1systems/au/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/1systems/au/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/1systems/bu/config.nix b/tv/1systems/bu/config.nix deleted file mode 100644 index a3959cd84..000000000 --- a/tv/1systems/bu/config.nix +++ /dev/null @@ -1,35 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - imports = [ - ./disks.nix - - - - - - - - ]; - - krebs.build.host = config.krebs.hosts.bu; - - networking.wireless.enable = true; - networking.useDHCP = false; - networking.interfaces.enp0s25.useDHCP = true; - networking.interfaces.wlp3s0.useDHCP = true; - networking.interfaces.wwp0s29u1u4i6.useDHCP = true; - networking.wireless.interfaces = [ - "wlp3s0" - ]; - - programs.gnupg.agent.enable = true; - programs.gnupg.agent.pinentryFlavor = "gtk2"; - - services.earlyoom.enable = true; - services.earlyoom.freeMemThreshold = 5; - systemd.services.earlyoom.environment.EARLYOOM_ARGS = toString [ - "--prefer '(^|/)chromium$'" - ]; - - system.stateVersion = "21.11"; -} diff --git a/tv/1systems/bu/disks.nix b/tv/1systems/bu/disks.nix deleted file mode 100644 index deabefa7b..000000000 --- a/tv/1systems/bu/disks.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - boot.initrd.luks.devices.buda2.device = "/dev/sda2"; - fileSystems."/" = { - device = "buda2/root"; - fsType = "zfs"; - }; - fileSystems."/bku" = { - device = "buda2/bku"; - fsType = "zfs"; - }; - fileSystems."/home" = { - device = "buda2/home"; - fsType = "zfs"; - }; - fileSystems."/boot" = { - device = "/dev/sda1"; - fsType = "vfat"; - }; -} diff --git a/tv/1systems/bu/lib b/tv/1systems/bu/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/1systems/bu/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/1systems/lib b/tv/1systems/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/1systems/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix deleted file mode 100644 index 00cdf84c1..000000000 --- a/tv/1systems/mu/config.nix +++ /dev/null @@ -1,127 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - imports = [ - - - - - - ]; - - krebs.build.host = config.krebs.hosts.mu; - krebs.build.user = mkForce config.krebs.users.vv; - - tv.x0vncserver.enable = true; - - boot.initrd.luks.devices.muca.device = "/dev/sda2"; - boot.initrd.availableKernelModules = [ "ahci" ]; - boot.kernelModules = [ "fbcon" "kvm-intel" ]; - boot.kernelParams = [ "fsck.repair=yes" ]; - boot.extraModulePackages = [ ]; - - fileSystems = { - "/" = { - device = "/dev/mapper/muvga-root"; - fsType = "ext4"; - options = [ "defaults" "discard" ]; - }; - "/home" = { - device = "/dev/mapper/muvga-home"; - fsType = "ext4"; - options = [ "defaults" "discard" ]; - }; - "/boot" = { - device = "/dev/sda1"; - fsType = "vfat"; - }; - }; - - nixpkgs.config.allowUnfree = true; - hardware.opengl.driSupport32Bit = true; - - hardware.pulseaudio.enable = true; - - hardware.enableRedistributableFirmware = true; - - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.systemd-boot.enable = true; - - networking.networkmanager.enable = true; - - # XXX reload to work around occasional "Failed to load firmware chunk!" - # TODO only do this if firmware is actually broken(?) - system.activationScripts.reload-iwlwifi = /* sh */ '' - ${pkgs.kmod}/bin/modprobe -vr iwlwifi - ${pkgs.kmod}/bin/modprobe -v iwlwifi - ''; - - environment.systemPackages = [ - pkgs.chromium - pkgs.firefox - pkgs.gimp - pkgs.iptables - pkgs.libreoffice - pkgs.plasma-pa - (pkgs.pidgin.override { - plugins = [ pkgs.pidgin-otr ]; - }) - pkgs.skypeforlinux - pkgs.slock - pkgs.tinc_pre - pkgs.vim - pkgs.xsane - - #pkgs.foomatic_filters - #pkgs.gutenprint - #pkgs.cups_pdf_filter - #pkgs.ghostscript - ]; - - - i18n.defaultLocale = "de_DE.UTF-8"; - - programs.ssh.startAgent = false; - - krebs.setuid = { - slock = { - filename = "${pkgs.slock}/bin/slock"; - mode = "4111"; - }; - }; - - security.pam.loginLimits = [ - # for jack - { domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; } - { domain = "@audio"; item = "rtprio"; type = "-"; value = "99"; } - ]; - - fonts.fonts = [ - pkgs.xorg.fontschumachermisc - ]; - - services.xserver.enable = true; - services.xserver.layout = "de"; - services.xserver.xkbOptions = "eurosign:e"; - - # TODO this is host specific - services.xserver.libinput.enable = false; - services.xserver.synaptics = { - enable = true; - twoFingerScroll = true; - }; - - services.xserver.desktopManager.plasma5.enable = true; - - services.xserver.displayManager.autoLogin.enable = true; - services.xserver.displayManager.autoLogin.user = "vv"; - - users.users.vv = { - inherit (config.krebs.users.vv) home uid; - isNormalUser = true; - extraGroups = [ - "audio" - "video" - "networkmanager" - ]; - }; -} diff --git a/tv/1systems/mu/lib b/tv/1systems/mu/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/1systems/mu/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/1systems/nomic/config.nix b/tv/1systems/nomic/config.nix deleted file mode 100644 index 5bc25fd36..000000000 --- a/tv/1systems/nomic/config.nix +++ /dev/null @@ -1,62 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - krebs.build.host = config.krebs.hosts.nomic; - - imports = [ - - - - - - - - - - ]; - - boot.initrd.luks.devices.luks1.device = "/dev/sda2"; - - # Don't use UEFI because current disk was partitioned/formatted for AO753. - # TODO remove following bool.loader section after repartitioning/reformatting - boot.loader = { - grub = { - device = "/dev/sda"; - splashImage = null; - }; - systemd-boot.enable = mkForce false; - }; - - fileSystems."/" = - { device = "/dev/mapper/nomic1-root"; - fsType = "btrfs"; - }; - - fileSystems."/boot" = - { device = "/dev/sda1"; - fsType = "ext4"; - }; - - fileSystems."/home" = - { device = "/dev/mapper/nomic1-home"; - fsType = "btrfs"; - }; - - environment.systemPackages = with pkgs; [ - (writeDashBin "play" '' - set -euf - mpv() { exec ${mpv}/bin/mpv "$@"; } - case $1 in - deepmix) mpv http://deepmix.ru/deepmix128.pls;; - groovesalad) mpv http://somafm.com/play/groovesalad;; - ntslive) mpv http://listen2.ntslive.co.uk/listen.pls;; - *) - echo "$0: bad argument: $*" >&2 - exit 23 - esac - '') - gnupg - tmux - ]; - - networking.wireless.enable = true; -} diff --git a/tv/1systems/nomic/lib b/tv/1systems/nomic/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/1systems/nomic/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/1systems/querel/config.nix b/tv/1systems/querel/config.nix deleted file mode 100644 index 7ba7d1620..000000000 --- a/tv/1systems/querel/config.nix +++ /dev/null @@ -1,86 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - imports = [ - - - ]; - - krebs.build.host = config.krebs.hosts.querel; - krebs.build.user = mkForce config.krebs.users.itak; - - boot.initrd.availableKernelModules = [ "ahci" ]; - boot.initrd.luks.devices.querel-luks1 = { - allowDiscards = true; - device = "/dev/sda2"; - }; - boot.kernelModules = [ "kvm-intel" ]; - boot.loader = { - efi.canTouchEfiVariables = true; - systemd-boot.enable = true; - }; - - environment.systemPackages = [ - pkgs.firefox - pkgs.gimp - pkgs.kate - pkgs.libreoffice - (pkgs.pidgin.override { - plugins = [ pkgs.pidgin-otr ]; - }) - pkgs.sxiv - pkgs.texlive.combined.scheme-full - pkgs.vim - pkgs.xsane - pkgs.zathura - ]; - - fileSystems = { - "/" = { - device = "/dev/mapper/querel-root"; - fsType = "ext4"; - options = [ "defaults" "discard" ]; - }; - "/home" = { - device = "/dev/mapper/querel-home"; - fsType = "ext4"; - options = [ "defaults" "discard" ]; - }; - "/boot" = { - device = "/dev/sda1"; - }; - }; - - hardware.enableRedistributableFirmware = true; - hardware.pulseaudio.enable = true; - - i18n.defaultLocale = "de_DE.UTF-8"; - - networking.networkmanager.enable = true; - - programs.ssh.startAgent = false; - - services.xserver.enable = true; - services.xserver.layout = "de"; - services.xserver.xkbOptions = "eurosign:e"; - - services.xserver.libinput.enable = false; - services.xserver.synaptics = { - enable = true; - twoFingerScroll = true; - }; - - services.xserver.desktopManager.plasma5.enable = true; - - services.xserver.displayManager.autoLogin.enable = true; - services.xserver.displayManager.autoLogin.user = "itak"; - - users.users.itak = { - inherit (config.krebs.users.itak) home uid; - isNormalUser = true; - extraGroups = [ - "audio" - "video" - "networkmanager" - ]; - }; -} diff --git a/tv/1systems/querel/lib b/tv/1systems/querel/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/1systems/querel/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/1systems/ru/config.nix b/tv/1systems/ru/config.nix deleted file mode 100644 index 0fc62167e..000000000 --- a/tv/1systems/ru/config.nix +++ /dev/null @@ -1,37 +0,0 @@ -with import ./lib; -{ config, ... }: { - imports = [ - ../.. - ../../2configs/hw/winmax2.nix - ../../2configs/retiolum.nix - ../../2configs/wiregrill.nix - ]; - - boot.initrd.luks.devices.main.device = "/dev/nvme0n1p2"; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.systemd-boot.enable = true; - - fileSystems."/" = { - device = "/dev/mapper/ruvg0-root"; - fsType = "btrfs"; - options = ["defaults" "noatime" "compress=zstd"]; - }; - fileSystems."/boot" = { - device = "/dev/nvme0n1p1"; - fsType = "vfat"; - }; - fileSystems."/home" = { - device = "/dev/mapper/ruvg0-home"; - fsType = "btrfs"; - options = ["defaults" "noatime" "compress=zstd"]; - }; - fileSystems."/bku" = { - device = "/dev/mapper/ruvg0-bku"; - fsType = "btrfs"; - options = ["defaults" "noatime" "compress=zstd"]; - }; - - krebs.build.host = config.krebs.hosts.ru; - - system.stateVersion = "22.11"; -} diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix deleted file mode 100644 index 83e17e1bd..000000000 --- a/tv/1systems/xu/config.nix +++ /dev/null @@ -1,154 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - krebs.build.host = config.krebs.hosts.xu; - - imports = [ - - ../../2configs/autotether.nix - - - - - - - - - - - - - - - - { - environment.systemPackages = with pkgs; [ - - - # root - cryptsetup - - # tv - bc - bind # dig - brain - cac-api - dic - file - gnupg1compat - haskellPackages.hledger - jq - mkpasswd - netcat - netcup - nmap - p7zip - (pkgs.pass.withExtensions (ext: [ - ext.pass-otp - ])) - q - qrencode - texlive.combined.scheme-full - tmux - - #ack - #apache-httpd - #ascii - #emacs - #es - #esniper - #gcc - #gptfdisk - #graphviz - #haskellPackages.cabal2nix - #haskellPackages.ghc - #haskellPackages.shake - #hdparm - #i7z - #iftop - #imagemagick - #inotifyTools - #iodine - #iotop - #lshw - #lsof - #minicom - #mtools - #ncmpc - #nethogs - #nix-prefetch-scripts #cvs bug - #openssl - #openswan - #parted - #perl - #powertop - #ppp - #proot - #pythonPackages.arandr - #pythonPackages.youtube-dl - #racket - #rxvt_unicode-with-plugins - #scrot - #sec - #silver-searcher - #sloccount - #smartmontools - #socat - #sshpass - #strongswan - #sysdig - #sysstat - #tcpdump - #tlsdate - #unetbootin - #utillinuxCurses - #xdotool - #xkill - #xl2tpd - #xsel - - unison - ]; - } - ]; - - boot.initrd.luks.devices.xuca.device = "/dev/sda2"; - - fileSystems = { - "/" = { - device = "/dev/mapper/xuvga-root"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/bku" = { - device = "/dev/mapper/xuvga-bku"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/home" = { - device = "/dev/mapper/xuvga-home"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/boot" = { - device = "/dev/sda1"; - }; - }; - - environment.systemPackages = with pkgs; [ - ethtool - tinc_pre - iptables - #jack2 - - gptfdisk - ]; - - networking.wireless.enable = true; - - #services.bitlbee.enable = true; - #services.tor.client.enable = true; - #services.tor.enable = true; - - # The NixOS release to be compatible with for stateful data such as databases. - system.stateVersion = "15.09"; -} diff --git a/tv/1systems/xu/lib b/tv/1systems/xu/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/1systems/xu/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix deleted file mode 100644 index 169fa6bd6..000000000 --- a/tv/1systems/zu/config.nix +++ /dev/null @@ -1,51 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - krebs.build.host = config.krebs.hosts.zu; - - imports = [ - - - - - - - - - - - ]; - - boot.initrd.luks.devices.zuca.device = "/dev/sda2"; - - fileSystems = { - "/" = { - device = "/dev/mapper/zuvga-root"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/bku" = { - device = "/dev/mapper/zuvga-bku"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/home" = { - device = "/dev/mapper/zuvga-home"; - fsType = "btrfs"; - options = ["defaults" "noatime" "ssd" "compress=lzo"]; - }; - "/boot" = { - device = "/dev/sda1"; - }; - }; - - networking.wireless.enable = true; - - services.printing.enable = true; - - #services.bitlbee.enable = true; - #services.tor.client.enable = true; - #services.tor.enable = true; - - # The NixOS release to be compatible with for stateful data such as databases. - system.stateVersion = "15.09"; -} diff --git a/tv/2configs/autotether.nix b/tv/2configs/autotether.nix deleted file mode 100644 index 43b5575c8..000000000 --- a/tv/2configs/autotether.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, pkgs, ... }: let - cfg.serial = "17e064850405"; -in { - systemd.services.usb_tether.serviceConfig = { - SyslogIdentifier = "usb_tether"; - ExecStartPre = "${pkgs.android-tools}/bin/adb -s ${cfg.serial} wait-for-device"; - ExecStart = "${pkgs.android-tools}/bin/adb -s ${cfg.serial} shell svc usb setFunctions rndis"; - }; - services.udev.extraRules = /* sh */ '' - ACTION=="add", SUBSYSTEM=="net", KERNEL=="usb*", NAME="android" - - ACTION=="add", SUBSYSTEM=="usb", ATTR{serial}=="${cfg.serial}", \ - TAG+="systemd", ENV{SYSTEMD_WANTS}="usb_tether.service" - ''; - systemd.network.networks.android = { - matchConfig.Name = "android"; - DHCP = "yes"; - }; -} diff --git a/tv/2configs/backup.nix b/tv/2configs/backup.nix deleted file mode 100644 index 56c04c4e3..000000000 --- a/tv/2configs/backup.nix +++ /dev/null @@ -1,109 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - krebs.backup.plans = { - } // mapAttrs (_: recursiveUpdate { - snapshots = { - daily = { format = "%Y-%m-%d"; retain = 7; }; - weekly = { format = "%YW%W"; retain = 4; }; - monthly = { format = "%Y-%m"; retain = 12; }; - yearly = { format = "%Y"; }; - }; - }) { - bu-home-xu = { - method = "push"; - src = { host = config.krebs.hosts.bu; path = "/home"; }; - dst = { host = config.krebs.hosts.xu; path = "/bku/bu-home"; }; - startAt = "05:20"; - }; - bu-home-zu = { - method = "push"; - src = { host = config.krebs.hosts.bu; path = "/home"; }; - dst = { host = config.krebs.hosts.zu; path = "/bku/bu-home"; }; - startAt = "05:25"; - }; - nomic-home-xu = { - method = "push"; - src = { host = config.krebs.hosts.nomic; path = "/home"; }; - dst = { host = config.krebs.hosts.xu; path = "/bku/nomic-home"; }; - startAt = "05:00"; - }; - nomic-home-zu = { - method = "push"; - src = { host = config.krebs.hosts.nomic; path = "/home"; }; - dst = { host = config.krebs.hosts.zu; path = "/bku/nomic-home"; }; - startAt = "04:20"; - }; - nomic-pull-querel-home = { - method = "pull"; - src = { host = config.krebs.hosts.querel; path = "/home"; }; - dst = { host = config.krebs.hosts.nomic; path = "/fs/ponyhof/bku/querel-home"; }; - startAt = "22:00"; - }; - xu-home-bu = { - method = "push"; - src = { host = config.krebs.hosts.xu; path = "/home"; }; - dst = { host = config.krebs.hosts.bu; path = "/bku/xu-home"; }; - startAt = "04:50"; - }; - xu-home-nomic = { - method = "push"; - src = { host = config.krebs.hosts.xu; path = "/home"; }; - dst = { host = config.krebs.hosts.nomic; path = "/fs/cis3hG/bku/xu-home"; }; - startAt = "05:20"; - }; - xu-home-zu = { - method = "push"; - src = { host = config.krebs.hosts.xu; path = "/home"; }; - dst = { host = config.krebs.hosts.zu; path = "/bku/xu-home"; }; - startAt = "06:20"; - }; - xu-pull-ni-ejabberd = { - method = "pull"; - src = { host = config.krebs.hosts.ni; path = "/var/lib/ejabberd"; }; - dst = { host = config.krebs.hosts.xu; path = "/bku/ni-ejabberd"; }; - startAt = "07:00"; - }; - xu-pull-ni-home = { - method = "pull"; - src = { host = config.krebs.hosts.ni; path = "/home"; }; - dst = { host = config.krebs.hosts.xu; path = "/bku/ni-home"; }; - startAt = "07:00"; - }; - zu-home-xu = { - method = "push"; - src = { host = config.krebs.hosts.zu; path = "/home"; }; - dst = { host = config.krebs.hosts.xu; path = "/bku/zu-home"; }; - startAt = "05:00"; - }; - zu-pull-ni-ejabberd = { - method = "pull"; - src = { host = config.krebs.hosts.ni; path = "/var/lib/ejabberd"; }; - dst = { host = config.krebs.hosts.zu; path = "/bku/ni-ejabberd"; }; - startAt = "06:00"; - }; - zu-pull-ni-home = { - method = "pull"; - src = { host = config.krebs.hosts.ni; path = "/home"; }; - dst = { host = config.krebs.hosts.zu; path = "/bku/ni-home"; }; - startAt = "06:30"; - }; - } // mapAttrs (_: recursiveUpdate { - snapshots = { - minutely = { format = "%Y-%m-%dT%H:%M"; retain = 3; }; - hourly = { format = "%Y-%m-%dT%H"; retain = 3; }; - daily = { format = "%Y-%m-%d"; retain = 3; }; - }; - startAt = null; - }) { - xu-test-push-xu = { - method = "push"; - src = { host = config.krebs.hosts.xu; path = "/tmp/xu-bku-test-data"; }; - dst = { host = config.krebs.hosts.xu; path = "/bku/xu-test-push"; }; - }; - xu-test-pull-xu = { - method = "pull"; - src = { host = config.krebs.hosts.xu; path = "/tmp/xu-bku-test-data"; }; - dst = { host = config.krebs.hosts.xu; path = "/bku/xu-test-pull"; }; - }; - }; -} diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix deleted file mode 100644 index 57801d964..000000000 --- a/tv/2configs/bash/default.nix +++ /dev/null @@ -1,67 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - programs.bash = { - interactiveShellInit = /* sh */ '' - HISTCONTROL='erasedups:ignorespace' - HISTSIZE=900001 - HISTFILESIZE=$HISTSIZE - HISTTIMEFORMAT= - - shopt -s checkhash - shopt -s histappend histreedit histverify - shopt -s no_empty_cmd_completion - complete -d cd - - case $UID in - ${shell.escape (toString config.krebs.users.tv.uid)}) - if test ''${SHLVL-1} = 1 && test -n "''${DISPLAY-}"; then - _CURRENT_DESKTOP_NAME=''${_CURRENT_DESKTOP_NAME-$( - ${pkgs.xorg.xprop}/bin/xprop -notype -root \ - 32i _NET_CURRENT_DESKTOP \ - 8s _NET_DESKTOP_NAMES \ - | - ${pkgs.gnused}/bin/sed -r 's/.* = //;s/"//g;s/, /\a/g' | - { - read -r _NET_CURRENT_DESKTOP - IFS=$'\a' read -ra _NET_DESKTOP_NAMES - echo "''${_NET_DESKTOP_NAMES[$_NET_CURRENT_DESKTOP]}" - } - )} - case $_CURRENT_DESKTOP_NAME in - stockholm) - cd ~/stockholm - ;; - esac - fi - - export NIX_PATH="stockholm=$HOME/stockholm:$NIX_PATH" - ;; - esac - - ${pkgs.bash-fzf-history.bind} - - if test -n "''${BASH_EXTRA_INIT-}"; then - . "$BASH_EXTRA_INIT" - fi - ''; - promptInit = /* sh */ '' - case $UID in - 0) - PS1='\[\e[1;31m\]\w\[\e[0m\] ' - ;; - ${toString config.krebs.build.user.uid}) - PS1='\[\e[1;32m\]\w\[\e[0m\] ' - ;; - *) - PS1='\[\e[1;35m\]\u \[\e[1;32m\]\w\[\e[0m\] ' - ;; - esac - if test -n "$SSH_CLIENT"; then - PS1='\[\e[35m\]\h'" $PS1" - fi - if test -n "$SSH_AGENT_PID"; then - PS1="ssh-agent[$SSH_AGENT_PID] $PS1" - fi - ''; - }; -} diff --git a/tv/2configs/bash/lib b/tv/2configs/bash/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/2configs/bash/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/2configs/binary-cache/default.nix b/tv/2configs/binary-cache/default.nix deleted file mode 100644 index 5b4e75107..000000000 --- a/tv/2configs/binary-cache/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, lib, pkgs, ... }: with import ./lib; -{ - environment.etc."binary-cache.pubkey".text = - config.krebs.build.host.binary-cache.pubkey; - - nixpkgs.overlays = [ - (self: super: { - nix-serve = self.haskellPackages.nix-serve-ng; - }) - ]; - - services.nix-serve = { - enable = true; - secretKeyFile = "${config.krebs.secret.directory}/nix-serve.key"; - }; - - services.nginx = { - enable = true; - virtualHosts.nix-serve = { - serverAliases = [ - "cache.${config.krebs.build.host.name}.hkw" - "cache.${config.krebs.build.host.name}.r" - ]; - locations."/".extraConfig = '' - proxy_pass http://localhost:${toString config.services.nix-serve.port}; - ''; - }; - }; -} diff --git a/tv/2configs/binary-cache/lib b/tv/2configs/binary-cache/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/2configs/binary-cache/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/2configs/br.nix b/tv/2configs/br.nix deleted file mode 100644 index 47d657c46..000000000 --- a/tv/2configs/br.nix +++ /dev/null @@ -1,49 +0,0 @@ -with import ./lib; -{ config, modulesPath, pkgs, ... }: { - - imports = [ - (modulesPath + "/services/hardware/sane_extra_backends/brscan4.nix") - ]; - - krebs.nixpkgs.allowUnfreePredicate = pkg: any (eq (packageName pkg)) [ - "brother-udev-rule-type1" - "brscan4" - "brscan4-etc-files" - "mfcl2700dnlpr" - ]; - - hardware.sane = { - enable = true; - brscan4 = { - enable = true; - netDevices = { - bra = { - model = "MFCL2700DN"; - ip = "10.23.1.214"; - }; - }; - }; - }; - - services.saned.enable = true; - - # usage: scanimage -d "$(find-scanner bra)" --batch --format=tiff --resolution 150 -x 211 -y 298 - environment.systemPackages = [ - (pkgs.writeDashBin "find-scanner" '' - set -efu - name=$1 - ${pkgs.sane-backends}/bin/scanimage -f '%m %d - ' \ - | ${pkgs.gawk}/bin/awk -v dev="*$name" '$1 == dev { print $2; exit }' \ - | ${pkgs.gnugrep}/bin/grep . - '') - ]; - - services.printing = { - enable = true; - drivers = [ - pkgs.mfcl2700dncupswrapper - ]; - }; - -} diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix deleted file mode 100644 index 91aad54cf..000000000 --- a/tv/2configs/default.nix +++ /dev/null @@ -1,137 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - boot.tmpOnTmpfs = true; - - krebs.enable = true; - - krebs.build.user = config.krebs.users.tv; - - networking.hostId = mkDefault (hashToLength 8 config.networking.hostName); - networking.hostName = config.krebs.build.host.name; - - imports = [ - ./backup.nix - ./bash - ./htop.nix - ./nets/hkw.nix - ./networkd.nix - ./nginx - ./nix.nix - ./pki - ./ssh.nix - ./sshd.nix - ./vim.nix - ./xdg.nix - { - users = { - defaultUserShell = "/run/current-system/sw/bin/bash"; - mutableUsers = false; - users = { - root = { - openssh.authorizedKeys.keys = [ - config.krebs.users.tv.pubkey - ]; - }; - tv = { - inherit (config.krebs.users.tv) home uid; - isNormalUser = true; - extraGroups = [ "tv" ]; - }; - }; - }; - } - { - i18n.defaultLocale = mkDefault "C.UTF-8"; - security.sudo.extraConfig = '' - Defaults env_keep+="SSH_CLIENT _CURRENT_DESKTOP_NAME" - Defaults mailto="${config.krebs.users.tv.mail}" - Defaults !lecture - ''; - time.timeZone = "Europe/Berlin"; - } - - { - nixpkgs.config.allowUnfree = false; - } - { - environment.homeBinInPath = true; - - environment.profileRelativeEnvVars.PATH = mkForce [ "/bin" ]; - - environment.systemPackages = with pkgs; [ - rxvt_unicode.terminfo - ]; - - environment.shellAliases = mkForce { - gp = "${pkgs.pari}/bin/gp -q"; - df = "df -h"; - du = "du -h"; - - # TODO alias cannot contain #\' - # "ps?" = "ps ax | head -n 1;ps ax | fgrep -v ' grep --color=auto ' | grep"; - - ls = "ls -h --color=auto --group-directories-first"; - dmesg = "dmesg -L --reltime"; - view = "vim -R"; - }; - - environment.variables = { - NIX_PATH = mkForce (concatStringsSep ":" [ - "secrets=/var/src/stockholm/null" - "/var/src" - ]); - }; - } - - { - services.cron.enable = false; - services.ntp.enable = false; - services.timesyncd.enable = true; - } - - { - boot.kernel.sysctl = { - # Enable IPv6 Privacy Extensions - # - # XXX use mkForce here because since NixOS 21.11 there's a collision in - # net.ipv6.conf.default.use_tempaddr, and boot.kernel.sysctl incapable - # of merging. - # - # XXX net.ipv6.conf.all.use_tempaddr is set because it was mentioned in - # https://tldp.org/HOWTO/Linux+IPv6-HOWTO/ch06s05.html - # TODO check if that is really necessary, otherwise we can rely solely - # on networking.tempAddresses in the future (when nothing is <21.11) - "net.ipv6.conf.all.use_tempaddr" = mkForce 2; - "net.ipv6.conf.default.use_tempaddr" = mkForce 2; - }; - } - - { - tv.iptables.enable = true; - tv.iptables.accept-echo-request = "internet"; - } - - { - services.journald.extraConfig = '' - SystemMaxUse=1G - RuntimeMaxUse=128M - ''; - } - - { - environment.systemPackages = [ - pkgs.field - pkgs.get - pkgs.git - pkgs.git-crypt - pkgs.git-preview - pkgs.hashPassword - pkgs.htop - pkgs.kpaste - pkgs.nix-prefetch-scripts - pkgs.ovh-zone - pkgs.push - ]; - } - ]; -} diff --git a/tv/2configs/elm-packages-proxy.nix b/tv/2configs/elm-packages-proxy.nix deleted file mode 100644 index caea18802..000000000 --- a/tv/2configs/elm-packages-proxy.nix +++ /dev/null @@ -1,359 +0,0 @@ -{ config, lib, pkgs, ... }: let - - cfg.nameserver = "1.1.1.1"; - cfg.packageDir = "/var/lib/elm-packages"; - cfg.port = 7782; - - # TODO secret files - cfg.htpasswd = "/var/lib/certs/package.elm-lang.org/htpasswd"; - cfg.sslCertificate = "/var/lib/certs/package.elm-lang.org/fullchain.pem"; - cfg.sslCertificateKey = "/var/lib/certs/package.elm-lang.org/key.pem"; - - semverRegex = - "(?0|[1-9]\\d*)\\.(?0|[1-9]\\d*)\\.(?0|[1-9]\\d*)(?:-(?(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+(?[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?"; - -in { - services.nginx.virtualHosts."package.elm-lang.org" = { - addSSL = true; - - sslCertificate = cfg.sslCertificate; - sslCertificateKey = cfg.sslCertificateKey; - - locations."/all-packages".extraConfig = '' - proxy_pass http://127.0.0.1:${toString config.krebs.htgen.elm-packages-proxy.port}; - proxy_pass_header Server; - ''; - - locations."/all-packages/since/".extraConfig = '' - proxy_pass http://127.0.0.1:${toString config.krebs.htgen.elm-packages-proxy.port}; - proxy_pass_header Server; - ''; - - locations."~ ^/packages/(?[A-Za-z0-9-]+)/(?[A-Za-z0-9-]+)/(?${semverRegex})\$".extraConfig = '' - auth_basic "Restricted Area"; - auth_basic_user_file ${cfg.htpasswd}; - - proxy_set_header X-User $remote_user; - proxy_set_header X-Author $author; - proxy_set_header X-Package $pname; - proxy_set_header X-Version $version; - proxy_pass_header Server; - - proxy_pass http://127.0.0.1:${toString config.krebs.htgen.elm-packages-proxy.port}; - ''; - - locations."~ ^/packages/(?[A-Za-z0-9-]+)/(?[A-Za-z0-9-]+)/(?${semverRegex})/(?:zipball|elm.json|endpoint.json)\$".extraConfig = '' - set $zipball "${cfg.packageDir}/$author/$pname/$version/zipball"; - proxy_set_header X-Author $author; - proxy_set_header X-Package $pname; - proxy_set_header X-Version $version; - proxy_set_header X-Zipball $zipball; - proxy_pass_header Server; - resolver ${cfg.nameserver}; - - if (-f $zipball) { - set $new_uri http://127.0.0.1:${toString config.krebs.htgen.elm-packages-proxy.port}; - } - if (!-f $zipball) { - set $new_uri https://package.elm-lang.org$request_uri; - } - - proxy_pass $new_uri; - ''; - - locations."/search.json".extraConfig = '' - proxy_pass http://127.0.0.1:${toString config.krebs.htgen.elm-packages-proxy.port}; - proxy_pass_header Server; - ''; - }; - - krebs.htgen.elm-packages-proxy = { - port = cfg.port; - script = /* sh */ ''. ${pkgs.writeDash "elm-packages-proxy.sh" '' - PATH=${lib.makeBinPath [ - pkgs.attr - pkgs.coreutils - pkgs.curl - pkgs.findutils - pkgs.gnugrep - pkgs.jq - pkgs.p7zip - ]} - export PATH - file_response() {( - status_code=$1 - status_reason=$2 - file=$3 - content_type=$4 - - content_length=$(wc -c "$file" | cut -d\ -f1) - - printf "HTTP/1.1 $status_code $status_reason\r\n" - printf 'Connection: close\r\n' - printf 'Content-Length: %d\r\n' "$content_length" - printf 'Content-Type: %s\r\n' "$content_type" - printf 'Server: %s\r\n' "$Server" - printf '\r\n' - cat "$file" - )} - string_response() {( - status_code=$1 - status_reason=$2 - response_body=$3 - content_type=$4 - - printf "HTTP/1.1 $status_code $status_reason\r\n" - printf 'Connection: close\r\n' - printf 'Content-Length: %d\r\n' "$(expr ''${#response_body} + 1)" - printf 'Content-Type: %s\r\n' "$content_type" - printf 'Server: %s\r\n' "$Server" - printf '\r\n' - printf '%s\n' "$response_body" - )} - - case "$Method $Request_URI" in - 'GET /packages/'*) - - author=$req_x_author - pname=$req_x_package - version=$req_x_version - - zipball=${cfg.packageDir}/$author/$pname/$version/zipball - elmjson=$HOME/cache/$author%2F$pname%2F$version%2Felm.json - endpointjson=$HOME/cache/$author%2F$pname%2F$version%2Fendpoint.json - mkdir -p "$HOME/cache" - - case $(basename $Request_URI) in - zipball) - file_response 200 OK "$zipball" application/zip - exit - ;; - elm.json) - if ! test -f "$elmjson"; then - 7z x -so "$zipball" \*/elm.json > "$elmjson" - fi - file_response 200 OK "$elmjson" 'application/json; charset=UTF-8' - exit - ;; - endpoint.json) - if ! test -f "$endpointjson"; then - hash=$(sha1sum "$zipball" | cut -d\ -f1) - url=https://package.elm-lang.org/packages/$author/$pname/$version/zipball - jq -n \ - --arg hash "$hash" \ - --arg url "$url" \ - '{ $hash, $url }' \ - > "$endpointjson" - fi - file_response 200 OK "$endpointjson" 'application/json; charset=UTF-8' - exit - ;; - esac - ;; - 'POST /packages/'*) - - author=$req_x_author - pname=$req_x_package - user=$req_x_user - version=$req_x_version - - action=uploading - force=''${req_x_force-false} - zipball=${cfg.packageDir}/$author/$pname/$version/zipball - elmjson=$HOME/cache/$author%2F$pname%2F$version%2Felm.json - endpointjson=$HOME/cache/$author%2F$pname%2F$version%2Fendpoint.json - - if test -e "$zipball"; then - if test "$force" = true; then - zipball_owner=$(attr -q -g X-User "$zipball" || :) - if test "$zipball_owner" = "$req_x_user"; then - action=replacing - rm -f "$elmjson" - rm -f "$endpointjson" - else - string_response 403 Forbidden \ - "package already exists: $author/$pname@$version" \ - text/plain - exit - fi - else - string_response 409 Conflict \ - "package already exists: $author/$pname@$version" \ - text/plain - exit - fi - fi - - echo "user $user is $action package $author/$pname@$version" >&2 - # TODO check package - mkdir -p "$(dirname "$zipball")" - head -c $req_content_length > "$zipball" - - attr -q -s X-User -V "$user" "$zipball" || : - - string_response 200 OK \ - "package created: $author/$pname@$version" \ - text/plain - - exit - ;; - 'DELETE /packages/'*) - - author=$req_x_author - pname=$req_x_package - user=$req_x_user - version=$req_x_version - - zipball=${cfg.packageDir}/$author/$pname/$version/zipball - elmjson=$HOME/cache/$author%2F$pname%2F$version%2Felm.json - endpointjson=$HOME/cache/$author%2F$pname%2F$version%2Fendpoint.json - - if test -e "$zipball"; then - zipball_owner=$(attr -q -g X-User "$zipball" || :) - if test "$zipball_owner" = "$req_x_user"; then - echo "user $user is deleting package $author/$pname@$version" >&2 - rm -f "$elmjson" - rm -f "$endpointjson" - rm "$zipball" - string_response 200 OK \ - "package deleted: $author/$pname@$version" \ - text/plain - exit - else - string_response 403 Forbidden \ - "package already exists: $author/$pname@$version" \ - text/plain - exit - fi - fi - ;; - 'GET /all-packages'|'POST /all-packages') - - response=$(mktemp -t htgen.$$.elm-packages-proxy.all-packages.XXXXXXXX) - trap "rm $response >&2" EXIT - - { - # upstream packages - curl -fsS https://package.elm-lang.org"$Request_URI" - - # private packages - (cd ${cfg.packageDir}; find -mindepth 3 -maxdepth 3) | - jq -Rs ' - split("\n") | - map( - select(.!="") | - match("^\\./(?[^/]+)/(?[^/]+)/(?[^/]+)$").captures | - map({key:.name,value:.string}) | - from_entries - ) | - reduce .[] as $item ({}; - ($item|"\(.author)/\(.pname)") as $name | - . + { "\($name)": ((.[$name] // []) + [$item.version]) } - ) - ' - } | - jq -cs add > $response - - file_response 200 OK "$response" 'application/json; charset=UTF-8' - exit - ;; - 'GET /all-packages/since/'*|'POST /all-packages/since/'*) - - response=$(mktemp -t htgen.$$.elm-packages-proxy.all-packages.XXXXXXXX) - trap "rm $response >&2" EXIT - - { - # upstream packages - curl -fsS https://package.elm-lang.org"$Request_URI" - - # private packages - (cd ${cfg.packageDir}; find -mindepth 3 -maxdepth 3) | - jq -Rs ' - split("\n") | - map( - select(.!="") | - sub("^\\./(?[^/]+)/(?[^/]+)/(?[^/]+)$";"\(.author)/\(.pname)@\(.version)") - ) | - sort_by(split("@") | [.[0]]+(.[1]|split(".")|map(tonumber))) | - reverse - ' - } | - jq -cs add > $response - - file_response 200 OK "$response" 'application/json; charset=UTF-8' - exit - ;; - 'GET /search.json') - - searchjson=$HOME/cache/search.json - mkdir -p "$HOME/cache" - - # update cached search.json - ( - last_modified=$( - if test -f "$searchjson"; then - date -Rr "$searchjson" - else - date -R -d @0 - fi - ) - tempsearchjson=$(mktemp "$searchjson.XXXXXXXX") - trap 'rm "$tempsearchjson" >&2' EXIT - curl -fsS --compressed https://package.elm-lang.org/search.json \ - -H "If-Modified-Since: $last_modified" \ - -o "$tempsearchjson" - if test -s "$tempsearchjson"; then - mv "$tempsearchjson" "$searchjson" - trap - EXIT - fi - ) - - response=$(mktemp -t htgen.$$.elm-packages-proxy.search.XXXXXXXX) - trap 'rm "$response" >&2' EXIT - - { - printf '{"upstream":'; cat "$searchjson" - printf ',"private":'; (cd ${cfg.packageDir}; find -mindepth 3 -maxdepth 3) | - jq -Rs ' - split("\n") | - map( - select(.!="") | - match("^\\./(?[^/]+)/(?[^/]+)/(?[^/]+)$").captures | - map({key:.name,value:.string}) | - from_entries - ) | - map({ - key: "\(.author)/\(.pname)", - value: .version, - }) | - from_entries - ' - printf '}' - } | - jq -c ' - reduce .upstream[] as $upstreamItem ({ private, output: [] }; - .private[$upstreamItem.name] as $privateItem | - if $privateItem then - .output += [$upstreamItem * { version: $privateItem.version }] | - .private |= del(.[$upstreamItem.name]) - else - .output += [$upstreamItem] - end - ) | - - .output + (.private | to_entries | sort_by(.key) | map({ - name: .key, - version: .value, - summary: "dummy summary", - license: "dummy license", - })) - ' \ - > $response - - file_response 200 OK "$response" 'application/json; charset=UTF-8' - exit - ;; - esac - ''}''; - }; -} diff --git a/tv/2configs/exim-retiolum.nix b/tv/2configs/exim-retiolum.nix deleted file mode 100644 index fefc6dd24..000000000 --- a/tv/2configs/exim-retiolum.nix +++ /dev/null @@ -1,9 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - environment.systemPackages = [ - pkgs.eximlog - ]; - krebs.exim-retiolum.enable = true; - krebs.exim-retiolum.rspamd.enable = config.krebs.build.host.name == "nomic"; - tv.iptables.input-retiolum-accept-tcp = singleton "smtp"; -} diff --git a/tv/2configs/exim-smarthost.nix b/tv/2configs/exim-smarthost.nix deleted file mode 100644 index 6750d9a85..000000000 --- a/tv/2configs/exim-smarthost.nix +++ /dev/null @@ -1,46 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - environment.systemPackages = [ - pkgs.eximlog - ]; - krebs.exim-smarthost = { - enable = true; - dkim = [ - { domain = "viljetic.de"; } - ]; - sender_domains = [ - "krebsco.de" - "shackspace.de" - "viljetic.de" - ]; - relay_from_hosts = concatMap (host: host.nets.retiolum.addrs) [ - config.krebs.hosts.nomic - config.krebs.hosts.xu - ]; - internet-aliases = with config.krebs.users; [ - { from = "bku-eppler@viljetic.de"; to = tv.mail; } - { from = "postmaster@viljetic.de"; to = tv.mail; } # RFC 822 - { from = "mirko@viljetic.de"; to = mv-ni.mail; } - { from = "tomislav@viljetic.de"; to = tv.mail; } - { from = "tv@viljetic.de"; to = tv.mail; } - { from = "tv@shackspace.de"; to = tv.mail; } - ]; - system-aliases = [ - { from = "mailer-daemon"; to = "postmaster"; } - { from = "postmaster"; to = "root"; } - { from = "nobody"; to = "root"; } - { from = "hostmaster"; to = "root"; } - { from = "usenet"; to = "root"; } - { from = "news"; to = "root"; } - { from = "webmaster"; to = "root"; } - { from = "www"; to = "root"; } - { from = "ftp"; to = "root"; } - { from = "abuse"; to = "root"; } - { from = "noc"; to = "root"; } - { from = "security"; to = "root"; } - { from = "root"; to = "tv"; } - { from = "mirko"; to = "mv"; } - ]; - }; - tv.iptables.input-internet-accept-tcp = singleton "smtp"; -} diff --git a/tv/2configs/fs/CAC-CentOS-7-64bit.nix b/tv/2configs/fs/CAC-CentOS-7-64bit.nix deleted file mode 100644 index c9eb97f44..000000000 --- a/tv/2configs/fs/CAC-CentOS-7-64bit.nix +++ /dev/null @@ -1,20 +0,0 @@ -_: - -{ - boot.loader.grub = { - device = "/dev/sda"; - }; - fileSystems = { - "/" = { - device = "/dev/centos/root"; - fsType = "xfs"; - }; - "/boot" = { - device = "/dev/sda1"; - fsType = "xfs"; - }; - }; - swapDevices = [ - { device = "/dev/centos/swap"; } - ]; -} diff --git a/tv/2configs/gitconfig.nix b/tv/2configs/gitconfig.nix deleted file mode 100644 index fb9b78e6a..000000000 --- a/tv/2configs/gitconfig.nix +++ /dev/null @@ -1,16 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - environment.etc.gitconfig.text = '' - [alias] - patch = !${pkgs.git}/bin/git --no-pager diff --no-color - [diff-so-fancy] - markEmptyLines = false - stripLeadingSymbols = false - [pager] - diff = ${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy \ - | ${pkgs.less}/bin/less -FRX - [user] - email = tv@krebsco.de - name = tv - ''; -} diff --git a/tv/2configs/gitrepos.nix b/tv/2configs/gitrepos.nix deleted file mode 100644 index 102d264b6..000000000 --- a/tv/2configs/gitrepos.nix +++ /dev/null @@ -1,233 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let { - - body = { - - nixpkgs.config.packageOverrides = super: { - cgit = pkgs.symlinkJoin { - name = "${super.cgit.name}-tv"; - paths = [ - (pkgs.runCommand "${super.cgit.name}-tv-overrides" { - } /* sh */ '' - mkdir -p $out/lib/cgit/filters - cd $out/lib/cgit/filters - cp \ - ${super.cgit}/lib/cgit/filters/syntax-highlighting.py \ - ${super.cgit}/lib/cgit/filters/.syntax-highlighting.py-wrapped \ - . - sed -i "s:${super.cgit}:$out:" syntax-highlighting.py - sed -i ' - s:^\(formatter =\).*:\1 HtmlFormatter(style="algol_nu"): - ' .syntax-highlighting.py-wrapped - '') - super.cgit - ]; - }; - }; - - krebs.git = { - enable = true; - cgit = { - settings = { - about-filter = pkgs.exec "krebs.cgit.about-filter" rec { - filename = "${pkgs.python3Packages.markdown2}/bin/markdown2"; - argv = [ - filename - "--extras=fenced-code-blocks" - ]; - envp = {}; - }; - readme = [ - ":README.md" - ]; - root-desc = "mostly krebs"; - root-title = "repositories at ${config.krebs.build.host.name}"; - source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py"; - }; - }; - repos = repos; - rules = rules; - }; - }; - - cgit-clear-cache = pkgs.cgit-clear-cache.override { - inherit (config.krebs.git.cgit.settings) cache-root; - }; - - repos = - public-repos // - optionalAttrs config.krebs.build.host.secure restricted-repos; - - rules = concatMap make-rules (attrValues repos); - - public-repos = mapAttrs make-public-repo ({ - } // mapAttrs (_: recursiveUpdate { cgit.section = "1. miscellaneous"; }) { - couchfs = { - cgit.desc = "filesystem (in userspace) on top of CouchDB"; - }; - crx = { - cgit.desc = "utilities for working with Chrome extensions"; - }; - dic = { - cgit.desc = "dict.leo.org command line interface"; - }; - disko = { - cgit.desc = "declarative partitioning and formatting tool"; - }; - fswm = { - cgit.desc = "simple full screen window manager"; - }; - htgen = { - cgit.desc = "toy HTTP server"; - }; - ircaids = { - cgit.desc = "Assortment of aids for working with Internet relay chat"; - }; - krops = { - cgit.desc = "deployment tools"; - }; - mailaids = { - cgit.desc = "Assortment of aids for working with electronic mail"; - }; - much = {}; - netcup = { - cgit.desc = "netcup command line interface"; - }; - nix-writers = { - cgit.desc = "collection of package builders"; - }; - nixpkgs = { - cgit.desc = "Nix Packages collection"; - }; - pager = { - }; - populate = { - cgit.desc = "source code installer"; - }; - q = {}; - reaktor2 = {}; - stockholm = { - cgit.desc = "NixOS configuration"; - }; - TabFS = { - cgit.desc = "mount browser tabs & co. as a filesystem"; - }; - texnix = { - cgit.desc = "TeX live environment generator"; - }; - with-ssh = {}; - } // mapAttrs (_: recursiveUpdate { cgit.section = "2. Host configurations"; }) { - ni = { - }; - } // mapAttrs (_: recursiveUpdate { cgit.section = "3. Haskell libraries"; }) { - X11-aeson = {}; - blessings = {}; - hack = {}; - hc = {}; - mime = {}; - quipper = {}; - scanner = {}; - wai-middleware-time = {}; - web-routes-wai-custom = {}; - xintmap = {}; - xmonad-aeson = {}; - xmonad-web = {}; - } // mapAttrs (_: recursiveUpdate { cgit.section = "4. museum"; }) { - cac-api = { - cgit.desc = "CloudAtCost API command line interface"; - }; - cgserver = {}; - crude-mail-setup = {}; - dot-xmonad = {}; - flameshot-once = { - cgit.desc = "flameshot runner that automatically starts/stops the daemon"; - }; - hirc = {}; - hstool = { - cgit.desc = "Haskell Development Environment ^_^"; - }; - kirk = { - cgit.desc = "IRC tools"; - }; - make-snapshot = {}; - nixos-infest = {}; - painload = {}; - push = {}; - Reaktor = {}; - regfish = {}; - with-tmpdir = {}; - get = {}; - load-env = {}; - loldns = { - cgit.desc = "toy DNS server"; - }; - soundcloud = { - cgit.desc = "SoundCloud command line interface"; - }; - xmonad-stockholm = {}; - }); - - restricted-repos = mapAttrs make-restricted-repo ( - { - brain = { - collaborators = with config.krebs.users; [ lass makefu ]; - hooks = { - post-receive = /* sh */ '' - (${irc-announce { cgit_endpoint = null; }}) - ${cgit-clear-cache}/bin/cgit-clear-cache - ''; - }; - }; - } - ); - - irc-announce = args: pkgs.git-hooks.irc-announce (recursiveUpdate { - channel = "#xxx"; - # TODO make nick = config.krebs.build.host.name the default - nick = config.krebs.build.host.name; - server = "irc.r"; - verbose = { - exclude = [ - "refs/heads/head" - ]; - }; - } args); - - make-public-repo = name: { cgit ? {}, ... }: { - inherit cgit name; - public = true; - hooks = { - post-receive = /* sh */ '' - (${optionalString (config.krebs.build.host.name == "ni") - (irc-announce {})}) - ${cgit-clear-cache}/bin/cgit-clear-cache - ''; - }; - }; - - make-restricted-repo = name: { collaborators ? [], hooks ? {}, ... }: { - inherit collaborators name; - public = false; - hooks = hooks // { - post-receive = /* sh */ '' - (${hooks.post-receive or ":"}) - ${cgit-clear-cache}/bin/cgit-clear-cache - ''; - }; - }; - - make-rules = - with git // config.krebs.users; - repo: - singleton { - user = [ tv tv-xu ]; - repo = [ repo ]; - perm = push "refs/*" [ non-fast-forward create delete merge ]; - } ++ - optional (repo.collaborators or [] != []) { - user = repo.collaborators; - repo = [ repo ]; - perm = fetch; - }; - -} diff --git a/tv/2configs/htop.nix b/tv/2configs/htop.nix deleted file mode 100644 index 09372980f..000000000 --- a/tv/2configs/htop.nix +++ /dev/null @@ -1,40 +0,0 @@ -with import ./lib; -{ pkgs, ... }: { - nixpkgs.config.packageOverrides = super: { - htop = pkgs.symlinkJoin { - name = "htop"; - paths = [ - (pkgs.writeDashBin "htop" '' - export HTOPRC=${pkgs.writeText "htoprc" '' - fields=0 48 17 18 38 39 40 2 46 47 49 1 - sort_key=46 - sort_direction=1 - hide_threads=0 - hide_kernel_threads=1 - hide_userland_threads=0 - shadow_other_users=1 - show_thread_names=1 - show_program_path=1 - highlight_base_name=1 - highlight_megabytes=1 - highlight_threads=1 - tree_view=1 - header_margin=0 - detailed_cpu_time=0 - cpu_count_from_zero=0 - update_process_names=0 - account_guest_in_cpu_meter=1 - color_scheme=0 - delay=15 - left_meters=LeftCPUs2 RightCPUs2 Memory Swap - left_meter_modes=1 1 1 1 - right_meters=Uptime Tasks LoadAverage Battery - right_meter_modes=2 2 2 2 - ''} - exec ${super.htop}/bin/htop "$@" - '') - super.htop - ]; - }; - }; -} diff --git a/tv/2configs/hw/AO753.nix b/tv/2configs/hw/AO753.nix deleted file mode 100644 index f2268a9b2..000000000 --- a/tv/2configs/hw/AO753.nix +++ /dev/null @@ -1,48 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - imports = [ - ../smartd.nix - - { - nix.settings.cores = 2; - nix.settings.max-jobs = 2; - } - (if lib.versionAtLeast (lib.versions.majorMinor lib.version) "21.11" then { - nix.daemonCPUSchedPolicy = "batch"; - nix.daemonIOSchedPriority = 1; - } else { - nix.daemonIONiceLevel = 1; - nix.daemonNiceLevel = 1; - }) - ]; - - boot.loader.grub = { - device = "/dev/sda"; - splashImage = null; - }; - - boot.initrd.availableKernelModules = [ - "ahci" - ]; - - boot.kernelModules = [ - "kvm-intel" - "wl" - ]; - - boot.extraModulePackages = [ - config.boot.kernelPackages.broadcom_sta - ]; - - services.logind.extraConfig = '' - HandleHibernateKey=ignore - HandleLidSwitch=ignore - HandlePowerKey=ignore - HandleSuspendKey=ignore - ''; - - krebs.nixpkgs.allowUnfreePredicate = pkg: packageName pkg == "broadcom-sta"; - - tv.hw.screens.primary.width = 1366; - tv.hw.screens.primary.height = 768; -} diff --git a/tv/2configs/hw/lib b/tv/2configs/hw/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/2configs/hw/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/2configs/hw/winmax2.nix b/tv/2configs/hw/winmax2.nix deleted file mode 100644 index 7b284668d..000000000 --- a/tv/2configs/hw/winmax2.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ pkgs, ... }: { - - imports = [ - ../smartd.nix - ]; - - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" ]; - boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelModules = [ - "amd-pstate" - "kvm-amd" - ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelParams = [ - "amd_pstate=passive" - ]; - - hardware.bluetooth.enable = true; - - hardware.cpu.amd.updateMicrocode = true; - hardware.enableRedistributableFirmware = true; - - hardware.opengl.enable = true; - hardware.opengl.extraPackages = [ - pkgs.amdvlk - pkgs.rocm-opencl-icd - pkgs.rocm-opencl-runtime - ]; - - networking.wireless.enable = true; - networking.wireless.interfaces = [ - "wlp1s0" - ]; - networking.interfaces.wlp1s0.useDHCP = true; - - nixpkgs.hostPlatform = "x86_64-linux"; - - services.illum.enable = true; - - services.logind.extraConfig = /* ini */ '' - HandlePowerKey=ignore - ''; - - tv.lidControl.enable = true; - - tv.hw.screens.primary.width = 2560; - tv.hw.screens.primary.height = 1600; -} diff --git a/tv/2configs/hw/x220.nix b/tv/2configs/hw/x220.nix deleted file mode 100644 index ee3c7dc04..000000000 --- a/tv/2configs/hw/x220.nix +++ /dev/null @@ -1,89 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - imports = [ - ../smartd.nix - { - boot.extraModulePackages = [ - config.boot.kernelPackages.acpi_call - ]; - - boot.kernelModules = [ - "acpi_call" - ]; - - environment.systemPackages = [ - pkgs.tpacpi-bat - ]; - } - - # fix jumpy touchpad - # https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X220#X220_Touchpad_cursor_jump/imprecise - { - services.udev.extraHwdb = /* sh */ '' - touchpad:i8042:* - LIBINPUT_MODEL_LENOVO_X220_TOUCHPAD_FW81=1 - ''; - } - - { - nix.settings.cores = 2; - nix.settings.max-jobs = 2; - } - (if lib.versionAtLeast (lib.versions.majorMinor lib.version) "21.11" then { - nix.daemonCPUSchedPolicy = "batch"; - nix.daemonIOSchedPriority = 1; - } else { - nix.daemonIONiceLevel = 1; - nix.daemonNiceLevel = 1; - }) - ]; - - boot.extraModulePackages = [ - config.boot.kernelPackages.tp_smapi - ]; - - boot.kernelModules = [ "tp_smapi" ]; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # Required for Centrino. - hardware.enableRedistributableFirmware = true; - - hardware.opengl.extraPackages = [ pkgs.vaapiIntel pkgs.vaapiVdpau ]; - - hardware.trackpoint = { - enable = true; - sensitivity = 220; - speed = 0; - emulateWheel = true; - }; - - # Conflicts with TLP, but gets enabled by DEs. - services.power-profiles-daemon.enable = false; - - services.tlp.enable = true; - services.tlp.settings = { - START_CHARGE_THRESH_BAT0 = 80; - }; - - - services.logind.extraConfig = '' - HandleHibernateKey=ignore - HandleLidSwitch=ignore - HandlePowerKey=ignore - HandleSuspendKey=ignore - ''; - - # because extraConfig is not extra enough: - services.logind.lidSwitch = "ignore"; - services.logind.lidSwitchDocked = "ignore"; - services.logind.lidSwitchExternalPower = "ignore"; - - services.xserver = { - videoDriver = "intel"; - }; - - tv.hw.screens.primary.width = lib.mkDefault 1366; - tv.hw.screens.primary.height = lib.mkDefault 768; -} diff --git a/tv/2configs/imgur.nix b/tv/2configs/imgur.nix deleted file mode 100644 index e22122761..000000000 --- a/tv/2configs/imgur.nix +++ /dev/null @@ -1,22 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - services.nginx.virtualHosts."ni.r" = { - locations."/image" = { - extraConfig = /* nginx */ '' - client_max_body_size 20M; - - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - proxy_pass http://127.0.0.1:${toString config.krebs.htgen.imgur.port}; - proxy_pass_header Server; - ''; - }; - }; - - krebs.htgen.imgur = { - port = 7771; - scriptFile = "${pkgs.htgen-imgur}/bin/htgen-imgur"; - }; -} diff --git a/tv/2configs/initrd/sshd.nix b/tv/2configs/initrd/sshd.nix deleted file mode 100644 index d7264f073..000000000 --- a/tv/2configs/initrd/sshd.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, ... }: { - boot.initrd.availableKernelModules = [ - "e1000e" - ]; - boot.initrd.network.enable = true; - boot.initrd.network.ssh = { - enable = true; - port = 11423; - authorizedKeys = [ - config.krebs.users.tv.pubkey - ]; - ignoreEmptyHostKeys = true; - }; - boot.initrd.secrets = { - "/etc/ssh/ssh_host_rsa_key" = "${config.krebs.secret.directory}/initrd/ssh_host_rsa_key"; - }; -} diff --git a/tv/2configs/lib b/tv/2configs/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/2configs/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/2configs/mail-client.nix b/tv/2configs/mail-client.nix deleted file mode 100644 index fc8fc81f2..000000000 --- a/tv/2configs/mail-client.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: { - environment.systemPackages = [ - pkgs.haskellPackages.much - pkgs.msmtp - pkgs.notmuch - pkgs.qprint - pkgs.w3m - ]; -} diff --git a/tv/2configs/man.nix b/tv/2configs/man.nix deleted file mode 100644 index c723138f1..000000000 --- a/tv/2configs/man.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - #environment.etc."man.conf".source = pkgs.runCommand "man.conf" {} '' - # ${pkgs.gnused}/bin/sed <${pkgs.man}/lib/man.conf >$out ' - # s:^NROFF\t.*:& -Wbreak: - # ' - #''; - environment.systemPackages = [ - pkgs.man-pages - pkgs.posix_man_pages - pkgs.xorg.xorgdocs - ]; -} diff --git a/tv/2configs/nets/hkw.nix b/tv/2configs/nets/hkw.nix deleted file mode 100644 index 51a8a7366..000000000 --- a/tv/2configs/nets/hkw.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ - krebs = { - dns.providers.hkw = "hosts"; - hosts = { - au = { - nets.hkw = { - ip4 = { - addr = "10.23.1.39"; - prefix = "10.23.1.0/24"; - }; - aliases = [ - "au.hkw" - ]; - ssh.port = 11423; - }; - }; - nomic = { - nets.hkw = { - ip4 = { - addr = "10.23.1.110"; - prefix = "10.23.1.0/24"; - }; - aliases = [ - "nomic.hkw" - ]; - ssh.port = 11423; - }; - }; - ok = { - external = true; - nets.hkw = { - ip4 = { - addr = "10.23.1.1"; - prefix = "10.23.1.0/24"; - }; - aliases = [ - "ok.hkw" - ]; - }; - }; - xu = { - nets.hkw = { - ip4 = { - addr = "10.23.1.38"; - prefix = "10.23.1.0/24"; - }; - aliases = [ - "xu.hkw" - "cache.xu.hkw" - ]; - ssh.port = 11423; - }; - }; - zu = { - nets.hkw = { - ip4 = { - addr = "10.23.1.40"; - prefix = "10.23.1.0/24"; - }; - aliases = [ - "zu.hkw" - ]; - ssh.port = 11423; - }; - }; - }; - }; -} diff --git a/tv/2configs/networkd.nix b/tv/2configs/networkd.nix deleted file mode 100644 index da0d9ce43..000000000 --- a/tv/2configs/networkd.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - # often hangs - systemd.services.systemd-networkd-wait-online.enable = false; -} diff --git a/tv/2configs/nginx/default.nix b/tv/2configs/nginx/default.nix deleted file mode 100644 index 6844df99b..000000000 --- a/tv/2configs/nginx/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -with import ./lib; -{ config, ... }: { - services.nginx = { - enableReload = true; - - recommendedGzipSettings = true; - recommendedOptimisation = true; - recommendedTlsSettings = true; - - virtualHosts.${toJSON ""} = { - default = true; - extraConfig = '' - error_page 400 =444 /; - return 444; - ''; - rejectSSL = true; - }; - }; - tv.iptables = { - input-retiolum-accept-tcp = singleton "http"; - }; -} diff --git a/tv/2configs/nginx/lib b/tv/2configs/nginx/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/2configs/nginx/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/2configs/nginx/public_html.nix b/tv/2configs/nginx/public_html.nix deleted file mode 100644 index c2403cd8d..000000000 --- a/tv/2configs/nginx/public_html.nix +++ /dev/null @@ -1,18 +0,0 @@ -with import ./lib; -{ config, ... }: { - services.nginx = { - enable = true; - virtualHosts.default = { - serverAliases = [ - "localhost" - "${config.krebs.build.host.name}" - "${config.krebs.build.host.name}.hkw" - "${config.krebs.build.host.name}.r" - ]; - locations."~ ^/~([a-z]+)(?:/(.*))?\$" = { - alias = "/srv/$1/public_html/$2"; - }; - }; - }; - tv.iptables.input-internet-accept-tcp = singleton "http"; -} diff --git a/tv/2configs/nix.nix b/tv/2configs/nix.nix deleted file mode 100644 index fa96d459f..000000000 --- a/tv/2configs/nix.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: { - nix.settings.auto-optimise-store = true; - - # TODO check if both are required: - nix.settings.extra-sandbox-paths = [ - "/etc/protocols" - pkgs.iana-etc.outPath - ]; -} diff --git a/tv/2configs/pki/certs/tv.crt b/tv/2configs/pki/certs/tv.crt deleted file mode 100644 index ccb2623fb..000000000 --- a/tv/2configs/pki/certs/tv.crt +++ /dev/null @@ -1,31 +0,0 @@ -tv Root CA ------BEGIN CERTIFICATE----- -MIIFGzCCAwOgAwIBAgIUbLFkDA1OgKbej/FQiJZ4gpGPg/4wDQYJKoZIhvcNAQEL -BQAwFTETMBEGA1UEAwwKdHYgUm9vdCBDQTAeFw0xOTA0MjEwNzI1MTdaFw0yOTA0 -MTgwNzI1MTdaMBUxEzARBgNVBAMMCnR2IFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEB -AQUAA4ICDwAwggIKAoICAQDEVpZo1PLayK2AULwNtRY/2RIs/h+Uz1k/I7AY5o7H -HTD6pxNH3DZS82Y89nAHDVEnotK26TW6N1O2fBHUxH2GXVD+MaA/D9ngbNTJa7DW -2EThezOyesAbXk7dkoHh4Bouj5L7Ronka5+IREFmb3mHmcXLuR/sot9Pwr9A7Lwm -55Avv+VwMFnqVMXiCYQsDL7Mxf7Vm79+kXShpfDhNmHhyZc/xPjVk7lttSEp0LCq -hhJjte3xDGbk7OThTSxoqP+K4Ek7NGatCcm4AUZlDl1kLN2QKudYqj0VRQpfE+4Q -jMAAtttc/10MV0e08pRK0FvJsDsi70YZrHnDP6hIBrRNjC8iB/8rz2pjnYzgriUt -HHEDr26234VB5Zqhsi8pmXA16FVkoKlucADXXKEcR/3VreTvZLdSsP3OrDdSCwhi -H2W/7tshDPp+I9Q9fGNixry7PODbud1h/wLsq3Geg/U6VkDdl7uDNMB/O7LvlFaC -7jkHv/xFLqV1Xx9+yFMdJTKLf9jnIIjeINfV4VcJZDrtgGpnC6cYD5DNLA4j7Mny -EnBV9IRhmKiZLvUZP62dPhqIfSSPNxXV2+rT5ZfaXCuVe79R5npgJzF7/qslvnZ6 -0mjZfQdJiXY+/oT9zPUxTroFx7Qtda15aIVwXR+1cMRY/Hg/uBQyp7yWsvwhPYwH -awIDAQABo2MwYTAdBgNVHQ4EFgQUWYjGpR7J/UqggxQV87hBQ8ZT0qkwHwYDVR0j -BBgwFoAUWYjGpR7J/UqggxQV87hBQ8ZT0qkwDwYDVR0TAQH/BAUwAwEB/zAOBgNV -HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggIBAA++eAA7KLEd4n05n8w95sJ7 -cxqQSkVxV3ASnEUQRwVGo3CqEKcNufbCTG7KKGQFUi2Xd3/SWgnEiSZZWo06azbV -vlquG+9ilwnrnqfjlbUEjLMHDzukrEeIiRuFY7gZv6S2o4WkW/M9IPkP34+PRjip -AJ8kFcy7wLPaeH7OagslAVUcf68lMm+8W4U1g0HZaY2zXFgdRrIO1dXKlJ22Wh4X -fcblHjkASAGi+BK+xRJ9G7s3sie2wPyk+WKKv0Z+WheKf+L+TPBg2sJ+d25gW+gG -XNJSQOzCqSfHrCtcW1xkGgifog28/ymN03ggn8oMBUebOp+ayLkbPQDaj6te3y1v -YE0cfkzQ0T6sSzPzoOrwBEuSX8cLWTpzO2Zgqbf36UtHjgxi58vY46p7MjAInxAf -j+k67rF7qWH38drg4nfGjNgiEdeJw9dtDFdmso+ZiWipUyGF4VYh+Q6JnXDMF0+A -wXcYWa7ckXvVOLVpHJfrLDYTXznGnk2u4ToVNEk1j/klMRn96lxfFg04iv8fz8m6 -/Y8g0G1uIT5Mq9l68oZUoEkUHZabPNhYOiYtg4t5v/T3AIV8nm2A5jZYj0am26xT -iqF/tqL3alWXs9OHP7FNdrVWtwO8vcspYcd4mOHdAC/dmhq+77BowR5Lldx9T+mR -QT8jW9PXL0IH0wKMBXxf ------END CERTIFICATE----- diff --git a/tv/2configs/pki/default.nix b/tv/2configs/pki/default.nix deleted file mode 100644 index 415755b16..000000000 --- a/tv/2configs/pki/default.nix +++ /dev/null @@ -1,68 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - - certFile = config.environment.etc."ssl/certs/ca-certificates.crt".source; - -in { - - environment.etc."pki/nssdb".source = - pkgs.runCommand "system-wide-nssdb" { - inherit certFile; - buildInputs = [ - pkgs.jq - pkgs.nssTools - ]; - parseInfoScript = /* jq */ '' - ${toJSON certFile} as $certFile | - - split("\t-----END CERTIFICATE-----\n")[] | - select(test("\t-----BEGIN CERTIFICATE-----\n")) | - . + "\t-----END CERTIFICATE-----\n" | - - sub("^([0-9]+\t\n)*";"") | - - (match("^([0-9]+)\t").captures[0].string | tonumber) as $lineNumber | - - gsub("(?m)^[0-9]+\t";"") | - - match("^([^\n]+)\n(.*)";"m").captures | map(.string) | - - # Line numbers are added to the names to ensure uniqueness. - "\(.[0]) (\($certFile):\($lineNumber))" as $name | - .[1] as $cert | - - { $name, $cert } - ''; - passAsFile = [ - "parseInfoScript" - ]; - } /* sh */ '' - mkdir nssdb - - nl -ba -w1 "$certFile" | - jq -ceRs -f "$parseInfoScriptPath" > certinfo.ndjson - - exec < certinfo.ndjson - while read -r certinfo; do - name=$(printf %s "$certinfo" | jq -er .name) - cert=$(printf %s "$certinfo" | jq -er .cert) - - printf %s "$cert" | certutil -A -d nssdb -n "$name" -t C,C,C - done - - mv nssdb "$out" - ''; - - environment.variables = flip genAttrs (_: toString certFile) [ - "CURL_CA_BUNDLE" - "GIT_SSL_CAINFO" - "SSL_CERT_FILE" - ]; - - security.pki.certificateFiles = - mapAttrsToList - (name: const (./certs + "/${name}")) - (filterAttrs (const (eq "regular")) - (readDir ./certs)); - -} diff --git a/tv/2configs/pki/lib b/tv/2configs/pki/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/2configs/pki/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/2configs/ppp.nix b/tv/2configs/ppp.nix deleted file mode 100644 index b3ae4da89..000000000 --- a/tv/2configs/ppp.nix +++ /dev/null @@ -1,86 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - cfg = { - pin = "@${config.krebs.secret.directory}/o2.pin"; - ttys.ppp = "/dev/ttyACM0"; - ttys.com = "/dev/ttyACM1"; - }; -in { - assertions = [ - { - assertion = - config.networking.resolvconf.enable || - config.networking.useNetworkd; - message = "ppp configuration needs resolvconf or networkd"; - } - ]; - environment.etc."ppp/ip-up".source = pkgs.writeDash "ppp.ip-up" '' - ${pkgs.openresolv}/bin/resolvconf -a "$IFNAME" < /etc/ppp/resolv.conf - ''; - environment.etc."ppp/ip-down".source = pkgs.writeDash "ppp.ip-down" '' - ${pkgs.openresolv}/bin/resolvconf -fd "$IFNAME" - ''; - environment.etc."ppp/peers/o2".text = /* sh */ '' - ${cfg.ttys.ppp} - 921600 - crtscts - defaultroute - holdoff 10 - lock - maxfail 0 - noauth - nodetach - noipdefault - passive - persist - usepeerdns - connect "${pkgs.ppp}/bin/chat ''${DEBUG+-v} -Ss -f ${pkgs.writeText "o2.chat" /* sh */ '' - ABORT "BUSY" - ABORT "NO CARRIER" - REPORT CONNECT - "*EMRDY: 1" - ATZ OK - AT+CFUN=1 OK - ${cfg.pin} TIMEOUT 2 ERROR-AT-OK - AT+CGDCONT=1,\042IP\042,\042internet\042 OK - ATDT*99***1# CONNECT - ''}" - ''; - users.users.root.packages = [ - (pkgs.writeDashBin "connect" '' - # usage: - # connect wlan - # connect wwan [PEERNAME] - set -efu - rfkill_wlan=/sys/class/rfkill/rfkill2 - rfkill_wwan=/sys/class/rfkill/rfkill1 - case $1 in - wlan) - ${pkgs.procps}/bin/pkill pppd || : - echo 0 > "$rfkill_wwan"/state - echo 1 > "$rfkill_wlan"/state - ;; - wwan) - name=''${2-o2} - echo 0 > "$rfkill_wlan"/state - echo 1 > "$rfkill_wwan"/state - ${pkgs.ppp}/bin/pppd call "$name" updetach - ;; - *) - echo "$0: error: bad arguments: $*" >&2 - exit 1 - esac - '') - (pkgs.writeDashBin "modem-send" '' - # usage: modem-send ATCOMMAND - set -efu - tty=${lib.shell.escape cfg.ttys.com} - exec <"$tty" - printf '%s\r\n' "$1" >"$tty" - ${pkgs.gnused}/bin/sed -E ' - /^OK\r?$/q - /^ERROR\r?$/q - ' - '') - ]; -} diff --git a/tv/2configs/pulse.nix b/tv/2configs/pulse.nix deleted file mode 100644 index 7a07e8154..000000000 --- a/tv/2configs/pulse.nix +++ /dev/null @@ -1,120 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - pkg = pkgs.pulseaudio; - runDir = "/run/pulse"; - - pkgs_i686 = pkgs.pkgsi686Linux; - - support32Bit = - pkgs.stdenv.isx86_64 && - pkgs_i686.alsaLib != null && - pkgs_i686.libpulseaudio != null; - - alsaConf = pkgs.writeText "asound.conf" '' - ctl_type.pulse { - libs.native = ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so; - ${optionalString support32Bit - "libs.32Bit = ${pkgs_i686.alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so;"} - } - pcm_type.pulse { - libs.native = ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so; - ${optionalString support32Bit - "libs.32Bit = ${pkgs_i686.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so;"} - } - ctl.!default { - type pulse - } - pcm.!default { - type pulse - } - ''; - - clientConf = pkgs.writeText "client.conf" '' - autospawn=no - default-server = unix:${runDir}/socket - ''; - - configFile = pkgs.writeText "default.pa" '' - .include ${pkg}/etc/pulse/default.pa - load-module ${toString [ - "module-native-protocol-unix" - "auth-anonymous=1" - "socket=${runDir}/socket" - ]} - ${lib.optionalString (config.krebs.build.host.name == "au") '' - load-module ${toString [ - "module-native-protocol-tcp" - "auth-ip-acl=127.0.0.1;10.23.1.0/24" - ]} - ''} - ${lib.optionalString (config.krebs.build.host.name != "au") '' - load-module ${toString [ - "module-tunnel-sink-new" - "server=au.hkw" - "sink_name=au" - "channels=2" - "rate=44100" - ]} - ''} - ''; -in - -{ - environment = { - etc = { - "asound.conf".source = alsaConf; - # XXX mkForce is not strong enough (and neither is mkOverride) to create - # /etc/pulse/client.conf, see pulseaudio-hack below for a solution. - #"pulse/client.conf" = mkForce { source = clientConf; }; - #"pulse/client.conf".source = mkForce clientConf; - "pulse/default.pa".source = configFile; - }; - systemPackages = [ - pkg - ] ++ optionals config.services.xserver.enable [ - pkgs.pavucontrol - ]; - }; - - hardware.pulseaudio = { - inherit support32Bit; - }; - - # Allow PulseAudio to get realtime priority using rtkit. - security.rtkit.enable = true; - - system.activationScripts.pulseaudio-hack = '' - ln -fns ${clientConf} /etc/pulse/client.conf - ''; - - systemd.services.pulse = { - wantedBy = [ "sound.target" ]; - before = [ "sound.target" ]; - environment = { - PULSE_RUNTIME_PATH = "${runDir}/home"; - }; - serviceConfig = { - ExecStart = "${pkg}/bin/pulseaudio --exit-idle-time=-1"; - ExecStartPre = pkgs.writeDash "pulse-start" '' - install -o pulse -g pulse -m 0750 -d ${runDir} - install -o pulse -g pulse -m 0700 -d ${runDir}/home - ''; - PermissionsStartOnly = "true"; - User = "pulse"; - }; - }; - - # TODO assert that pulse is the only user with "audio" in group/extraGroups - # otherwise the audio device can be hijacked while the pulse service restarts - # (e.g. when mpv is running) and then the service will fail. - users = { - groups.pulse.gid = config.users.users.pulse.uid; - users.pulse = { - uid = genid_uint31 "pulse"; - group = "pulse"; - extraGroups = [ "audio" ]; - home = "${runDir}/home"; - isSystemUser = true; - }; - }; -} diff --git a/tv/2configs/repo-sync/lib b/tv/2configs/repo-sync/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/2configs/repo-sync/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/2configs/repo-sync/wiki.nix b/tv/2configs/repo-sync/wiki.nix deleted file mode 100644 index 515e731c4..000000000 --- a/tv/2configs/repo-sync/wiki.nix +++ /dev/null @@ -1,40 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - krebs.repo-sync.enable = true; - krebs.repo-sync.repos.wiki.branches.hotdog = { - origin.url = "http://cgit.hotdog.r/wiki"; - mirror.url = "git@${config.krebs.build.host.name}.r:wiki"; - }; - krebs.git.repos.wiki = { - public = true; - name = "wiki"; - cgit.desc = toString [ - "mirror of" - config.krebs.repo-sync.repos.wiki.branches.hotdog.origin.url - ]; - cgit.section = "7. mirrors"; - hooks.post-receive = /* sh */ '' - ${pkgs.git-hooks.irc-announce { - channel = "#xxx"; - nick = config.krebs.build.host.name; - server = "irc.r"; - }} - ${pkgs.cgit-clear-cache.override { - inherit (config.krebs.git.cgit.settings) cache-root; - }}/bin/cgit-clear-cache - ''; - }; - krebs.git.rules = lib.singleton { - user = lib.singleton config.krebs.users.repo-sync; - repo = lib.singleton config.krebs.git.repos.wiki; - perm = lib.git.push "refs/*" [ - lib.git.create - lib.git.delete - lib.git.merge - lib.git.non-fast-forward - ]; - }; - krebs.users.${config.krebs.repo-sync.user.name}.pubkey = { - ni = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINK9U0Ob9/O0kxg3trhZY/vDnbqfN+R5cASGiClRr4IM"; - }.${config.krebs.build.host.name}; -} diff --git a/tv/2configs/retiolum.nix b/tv/2configs/retiolum.nix deleted file mode 100644 index 1b176e0b9..000000000 --- a/tv/2configs/retiolum.nix +++ /dev/null @@ -1,27 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - krebs.tinc.retiolum = { - enable = true; - connectTo = filter (ne config.krebs.build.host.name) [ - "ni" - "prism" - "eve" - ]; - extraConfig = '' - LocalDiscovery = yes - ''; - tincPackage = pkgs.tinc_pre; - tincUp = lib.mkIf config.systemd.network.enable ""; - }; - systemd.network.networks.retiolum = { - matchConfig.Name = "retiolum"; - address = let - inherit (config.krebs.build.host.nets.retiolum) ip4 ip6; - in [ - "${ip4.addr}/${toString ip4.prefixLength}" - "${ip6.addr}/${toString ip6.prefixLength}" - ]; - }; - tv.iptables.input-internet-accept-tcp = singleton "tinc"; - tv.iptables.input-internet-accept-udp = singleton "tinc"; -} diff --git a/tv/2configs/smartd.nix b/tv/2configs/smartd.nix deleted file mode 100644 index 9c4d8b2d8..000000000 --- a/tv/2configs/smartd.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, pkgs, ... }: - -{ - services.smartd = { - enable = true; - devices = [ - { - device = "DEVICESCAN"; - options = toString [ - "-a" - "-m ${config.krebs.users.tv.mail}" - "-s (O/../.././09|S/../.././04|L/../../6/05)" - ]; - } - ]; - }; -} diff --git a/tv/2configs/ssh.nix b/tv/2configs/ssh.nix deleted file mode 100644 index ad828813d..000000000 --- a/tv/2configs/ssh.nix +++ /dev/null @@ -1,22 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - # Override NixOS's "Allow DSA keys for now." - environment.etc."ssh/ssh_config".text = mkForce '' - AddressFamily ${if config.networking.enableIPv6 then "any" else "inet"} - - ${optionalString config.programs.ssh.setXAuthLocation '' - XAuthLocation ${pkgs.xorg.xauth}/bin/xauth - ''} - - ForwardX11 ${if config.programs.ssh.forwardX11 then "yes" else "no"} - - ${config.programs.ssh.extraConfig} - ''; - - programs.ssh = { - extraConfig = '' - UseRoaming no - ''; - startAgent = false; - }; -} diff --git a/tv/2configs/sshd.nix b/tv/2configs/sshd.nix deleted file mode 100644 index 59c95ccba..000000000 --- a/tv/2configs/sshd.nix +++ /dev/null @@ -1,27 +0,0 @@ -with import ./lib; -{ config, ... }: let - cfg.host = config.krebs.build.host; - nets = - optional (cfg.host.nets?retiolum) cfg.host.nets.retiolum ++ - optional (cfg.host.nets?wiregrill) cfg.host.nets.wiregrill; -in { - services.openssh = { - enable = true; - }; - tv.iptables.input-internet-accept-tcp = singleton "ssh"; - tv.iptables.extra.nat.OUTPUT = [ - "-o lo -p tcp --dport 11423 -j REDIRECT --to-ports 22" - ]; - tv.iptables.extra4.nat.PREROUTING = - map - (net: "-d ${net.ip4.addr} -p tcp --dport 22 -j ACCEPT") - (filter (net: net.ip4 != null) nets); - tv.iptables.extra6.nat.PREROUTING = - map - (net: "-d ${net.ip6.addr} -p tcp --dport 22 -j ACCEPT") - (filter (net: net.ip6 != null) nets); - tv.iptables.extra.nat.PREROUTING = [ - "-p tcp --dport 22 -j REDIRECT --to-ports 0" - "-p tcp --dport 11423 -j REDIRECT --to-ports 22" - ]; -} diff --git a/tv/2configs/urlwatch.nix b/tv/2configs/urlwatch.nix deleted file mode 100644 index f5260ee05..000000000 --- a/tv/2configs/urlwatch.nix +++ /dev/null @@ -1,117 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - exec = filename: args: url: { - inherit url; - filter = singleton { - system = - concatMapStringsSep " " shell.escape ([filename] ++ toList args); - }; - }; - json = json' ["."]; - json' = exec "${pkgs.jq}/bin/jq"; - urigrep' = exec (pkgs.writeDash "urigrep" '' - ${pkgs.urix}/bin/urix | ${pkgs.gnugrep}/bin/grep -E "$1" - ''); - xml = xml' ["--format" "-"]; - xml' = exec "${pkgs.libxml2}/bin/xmllint"; -in { - krebs.urlwatch = { - enable = true; - mailto = config.krebs.users.tv.mail; - onCalendar = "*-*-* 05:00:00"; - urls = [ - ## nixpkgs maintenance - - # 2014-07-29 when one of the following urls change - # then we have to update the package - - http://www.exim.org/ - - # ref src/nixpkgs/pkgs/tools/networking/urlwatch/default.nix - { - url = https://thp.io/2008/urlwatch/; - # workaround: ('Received response with content-encoding: gzip, but - # failed to decode it.', error('Error -3 while decompressing data: - # incorrect header check',)) - ignore_cached = true; - } - - # 2015-02-18 - # ref ~/src/nixpkgs/pkgs/tools/text/qprint/default.nix - http://www.fourmilab.ch/webtools/qprint/ - - # 2014-09-24 ref https://github.com/4z3/xintmap - http://www.mathstat.dal.ca/~selinger/quipper/ - - ## 2014-10-17 - ## TODO update ~/src/login/default.nix - #http://hackage.haskell.org/package/bcrypt - #http://hackage.haskell.org/package/cron - #http://hackage.haskell.org/package/hyphenation - #http://hackage.haskell.org/package/iso8601-time - #http://hackage.haskell.org/package/ixset-typed - #http://hackage.haskell.org/package/system-command - #http://hackage.haskell.org/package/transformers - #http://hackage.haskell.org/package/web-routes-wai - #http://hackage.haskell.org/package/web-page - - # ref , services.openssh.knownHosts.github* - (json https://api.github.com/meta) - - # ref - (json https://api.github.com/repos/arthepsy/ssh-audit/tags) - - # 2014-12-20 ref src/nixpkgs/pkgs/tools/networking/tlsdate/default.nix - (json https://api.github.com/repos/ioerror/tlsdate/tags) - - # ref src/nixpkgs/pkgs/tools/admin/sec/default.nix - (json https://api.github.com/repos/simple-evcorr/sec/tags) - - # - # is derived from `configFile` in: - https://raw.githubusercontent.com/NixOS/nixpkgs/master/nixos/modules/services/x11/xserver.nix - - https://www.rabbitmq.com/changelog.html - - (urigrep' ["software-resources"] https://semiconductor.samsung.com/consumer-storage/support/tools/) - ]; - hooksFile = toFile "hooks.py" '' - import subprocess - import urlwatch - - class SystemFilter(urlwatch.filters.FilterBase): - """Filter for piping data through an external process""" - - __kind__ = 'system' - - __supported_subfilters__ = { - 'command': 'shell command line to tranform data', - } - - __default_subfilter__ = 'command' - - def filter(self, data, subfilter=None): - if 'command' not in subfilter: - raise ValueError('{} filter needs a command'.format(self.__kind__)) - - proc = subprocess.Popen( - subfilter['command'], - shell=True, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - - (stdout, stderr) = proc.communicate(data.encode()) - - if proc.returncode != 0: - raise RuntimeError( - "system filter returned non-zero exit status %d; stderr:\n" - % proc.returncode - + stderr.decode() - ) - - return stdout.decode() - ''; - }; -} diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix deleted file mode 100644 index 8aee31082..000000000 --- a/tv/2configs/vim.nix +++ /dev/null @@ -1,183 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let { - body = { - environment.systemPackages = [ - vim-wrapper - ]; - - environment.etc.vimrc.source = vimrc; - - environment.variables.EDITOR = mkForce "vim"; - environment.variables.VIMINIT = ":so /etc/vimrc"; - }; - - base-plugins = [ - pkgs.tv.vimPlugins.file-line - pkgs.tv.vimPlugins.hack - pkgs.vimPlugins.undotree - (pkgs.tv.vim.makePlugin (pkgs.write "vim-tv-base" { - "/ftplugin/haskell.vim".text = '' - if exists("g:vim_tv_ftplugin_haskell_loaded") - finish - endif - let g:vim_tv_ftplugin_haskell_loaded = 1 - - setlocal iskeyword+=' - ''; - })) - ]; - - extra-plugins = [ - pkgs.tv.vimPlugins.elixir - pkgs.tv.vimPlugins.fzf - pkgs.tv.vimPlugins.jq - pkgs.tv.vimPlugins.nix - pkgs.tv.vimPlugins.showsyntax - pkgs.tv.vimPlugins.tv - pkgs.tv.vimPlugins.vim - pkgs.vimPlugins.fzfWrapper - pkgs.vimPlugins.vim-nftables - ]; - - dirs = { - backupdir = "$HOME/.cache/vim/backup"; - swapdir = "$HOME/.cache/vim/swap"; - undodir = "$HOME/.cache/vim/undo"; - }; - files = { - viminfo = "$HOME/.cache/vim/info"; - }; - - need-dirs = let - dirOf = s: let out = concatStringsSep "/" (init (splitString "/" s)); - in assert out != ""; out; - alldirs = attrValues dirs ++ map dirOf (attrValues files); - in unique (sort lessThan alldirs); - - vim-wrapper = pkgs.symlinkJoin { - name = "vim"; - paths = [ - (pkgs.writeDashBin "vim" '' - set -efu - export FZF_DEFAULT_COMMAND='${pkgs.ripgrep}/bin/rg --files' - export PATH=$PATH:${makeBinPath [ - pkgs.fzf - pkgs.ripgrep - ]} - (umask 0077; exec ${pkgs.coreutils}/bin/mkdir -p ${toString need-dirs}) - exec ${pkgs.vim}/bin/vim "$@" - '') - pkgs.vim - ]; - }; - - vimrc = pkgs.writeText "vimrc" /* vim */ '' - vim9script - - set nocompatible - - set autoindent - set backspace=indent,eol,start - set backup - set backupdir=${dirs.backupdir}/ - set directory=${dirs.swapdir}// - set hlsearch - set incsearch - set mouse=a - set noruler - set pastetoggle= - set runtimepath=${pkgs.tv.vim.makeRuntimePath base-plugins},$VIMRUNTIME - set shortmess+=I - set showcmd - set showmatch - set timeoutlen=0 - set ttimeoutlen=0 - set ttymouse=sgr - set undodir=${dirs.undodir} - set undofile - set undolevels=1000000 - set undoreload=1000000 - set viminfo='20,<1000,s100,h,n${files.viminfo} - set visualbell - set wildignore+=*.o,*.class,*.hi,*.dyn_hi,*.dyn_o - set wildmenu - set wildmode=longest,full - - set runtimepath^=${pkgs.tv.vim.makeRuntimePath extra-plugins} - syntax on - - set et ts=2 sts=2 sw=2 - - filetype plugin indent on - - set t_Co=256 - colorscheme hack - - au Syntax * syn match Garbage containedin=ALL /\s\+$/ - \ | syn match TabStop containedin=ALL /\t\+/ - \ | syn keyword Todo containedin=ALL TODO - - au BufRead,BufNewFile *.nix set ft=nix - - au BufRead,BufNewFile /dev/shm/* set nobackup nowritebackup noswapfile - - cnoremap - - noremap :q - - nnoremap [5^ :tabp - nnoremap [6^ :tabn - nnoremap [5@ :tabm -1 - nnoremap [6@ :tabm +1 - - nnoremap :tabp - nnoremap :tabn - imap - imap - - nnoremap :tabm -1 - nnoremap :tabm +1 - imap - imap - - noremap :ShowSyntax - - # - noremap Oa | noremap! Oa - noremap Ob | noremap! Ob - noremap Oc | noremap! Oc - noremap Od | noremap! Od - # <[C]S-{Up,Down,Right,Left}> - noremap [a | noremap! [a - noremap [b | noremap! [b - noremap [c | noremap! [c - noremap [d | noremap! [d - vnoremap u - - # fzf - nnoremap q :Buffers - nnoremap f :Files - nnoremap w :Rg - - # edit alternate buffer - # For some reason neither putting 6 nor ^ works here... - nnoremap a  - - if $TOUCHSCREEN == "1" - nnoremap - nnoremap - nnoremap 3 - nnoremap 3 - nnoremap 3 - nnoremap 3 - nnoremap - nnoremap - endif - - # remember last position - autocmd BufReadPost * - \ if line("'\"") > 0 && line("'\"") <= line("$") | - \ exe "normal! g`\"" | - \ endif - ''; -} diff --git a/tv/2configs/weechat-server.nix b/tv/2configs/weechat-server.nix deleted file mode 100644 index 41f157c35..000000000 --- a/tv/2configs/weechat-server.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, pkgs, ... }: { - users.users.tv.packages = [ - (pkgs.writers.writeDashBin "weechat-client" '' - set -efu - exec ${pkgs.tmux}/bin/tmux attach -t weechat - '') - ]; - systemd.services.weechat = { - wantedBy = [ "multi-user.target" ]; - environment = { - TERM = "rxvt-unicode-256color"; - }; - serviceConfig = { - ExecStart = "${pkgs.tmux}/bin/tmux new -d -s weechat ${pkgs.weechat}/bin/weechat"; - OOMScoreAdjust = -1000; - Restart = "always"; - RestartSec = "100ms"; - Type = "forking"; - StartLimitBurst = 0; - User = "tv"; - WorkingDirectory = "/home/tv"; - }; - }; -} diff --git a/tv/2configs/wiregrill.nix b/tv/2configs/wiregrill.nix deleted file mode 100644 index cace01a6b..000000000 --- a/tv/2configs/wiregrill.nix +++ /dev/null @@ -1,37 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - cfg = { - enable = cfg.net != null; - net = config.krebs.build.host.nets.wiregrill or null; - }; - toCidrNotation = ip: "${ip.addr}/${toString ip.prefixLength}"; -in - mkIf cfg.enable { - networking.wireguard.interfaces.wiregrill = { - ips = - optional (cfg.net.ip4 != null) cfg.net.ip4.addr ++ - optional (cfg.net.ip6 != null) cfg.net.ip6.addr; - listenPort = 51820; - privateKeyFile = "${config.krebs.secret.directory}/wiregrill.key"; - allowedIPsAsRoutes = true; - peers = mapAttrsToList - (_: host: { - allowedIPs = host.nets.wiregrill.wireguard.subnets; - endpoint = - mkIf (host.nets.wiregrill.via != null) (host.nets.wiregrill.via.ip4.addr + ":${toString host.nets.wiregrill.wireguard.port}"); - persistentKeepalive = mkIf (host.nets.wiregrill.via != null) 61; - publicKey = - replaceStrings ["\n"] [""] host.nets.wiregrill.wireguard.pubkey; - }) - (filterAttrs (_: h: hasAttr "wiregrill" h.nets) config.krebs.hosts); - }; - systemd.network.networks.wiregrill = { - matchConfig.Name = "wiregrill"; - address = - optional (cfg.net.ip4 != null) (toCidrNotation cfg.net.ip4) ++ - optional (cfg.net.ip6 != null) (toCidrNotation cfg.net.ip6); - }; - tv.iptables.extra.filter.INPUT = [ - "-p udp --dport ${toString cfg.net.wireguard.port} -j ACCEPT" - ]; - } diff --git a/tv/2configs/xdg.nix b/tv/2configs/xdg.nix deleted file mode 100644 index b7c14af5a..000000000 --- a/tv/2configs/xdg.nix +++ /dev/null @@ -1,11 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - environment.variables.XDG_RUNTIME_DIR = "/run/xdg/$LOGNAME"; - - systemd.tmpfiles.rules = let - forUsers = flip map users; - isUser = { name, group, ... }: - name == "root" || hasSuffix "users" group; - users = filter isUser (mapAttrsToList (_: id) config.users.users); - in forUsers (u: "d /run/xdg/${u.name} 0700 ${u.name} ${u.group} -"); -} diff --git a/tv/2configs/xserver/Xmodmap.nix b/tv/2configs/xserver/Xmodmap.nix deleted file mode 100644 index 8e555e927..000000000 --- a/tv/2configs/xserver/Xmodmap.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, pkgs, ... }: - -with import ./lib; - -pkgs.writeText "Xmodmap" '' - !keycode 66 = Caps_Lock - !remove Lock = Caps_Lock - clear Lock - - ! caps lock - keycode 66 = Mode_switch - - keycode 13 = 4 dollar EuroSign cent - keycode 30 = u U udiaeresis Udiaeresis - keycode 32 = o O odiaeresis Odiaeresis - keycode 38 = a A adiaeresis Adiaeresis - keycode 39 = s S ssharp - - keycode 33 = p P Greek_pi Greek_PI - keycode 40 = d D Greek_delta Greek_DELTA - keycode 46 = l L Greek_lambda Greek_LAMBDA - - keycode 54 = c C cacute Cacute - - ! BULLET OPERATOR - keycode 17 = 8 asterisk U2219 - keycode 27 = r R r U211D -'' diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix deleted file mode 100644 index 9b9d86f58..000000000 --- a/tv/2configs/xserver/default.nix +++ /dev/null @@ -1,167 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }@args: let - cfg = { - cacheDir = cfg.dataDir; - configDir = "/var/empty"; - dataDir = "/run/xdg/${cfg.user.name}/xmonad"; - user = config.krebs.build.user; - xmonad.pkg = pkgs.haskellPackages.xmonad-tv.overrideAttrs (_: { - au = { - XMONAD_BUILD_SCREEN_WIDTH = 1920; - XMONAD_BUILD_TERM_FONT_WIDTH = 10; - XMONAD_BUILD_TERM_FONT = "xft:Input Mono:size=12:style=Regular"; - XMONAD_BUILD_TERM_PADDING = 2; - }; - }.${config.krebs.build.host.name} or { - XMONAD_BUILD_SCREEN_WIDTH = 1366; - XMONAD_BUILD_TERM_FONT_WIDTH = 6; - XMONAD_BUILD_TERM_FONT = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"; - XMONAD_BUILD_TERM_PADDING = 2; - }); - }; -in { - - imports = [ - ./sxiv.nix - ./urxvt.nix - ]; - - environment.systemPackages = [ - pkgs.ff - pkgs.font-size - pkgs.gitAndTools.qgit - pkgs.mpv - pkgs.xdotool - pkgs.xsel - pkgs.zathura - ]; - - fonts.fonts = [ - pkgs.xorg.fontschumachermisc - ]; - - services.xserver = { - - # Don't install feh into systemPackages - # refs - desktopManager.session = mkForce []; - - displayManager.lightdm.enable = mkForce false; - displayManager.job.execCmd = mkForce "derp"; - - enable = true; - display = mkForce 11; - tty = mkForce 11; - }; - - systemd.services.display-manager.enable = false; - - systemd.services.xmonad = let - xmonad = "${cfg.xmonad.pkg}/bin/xmonad"; - xmonad-start = pkgs.writeDash "xmonad-start" '' - ${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CACHE_DIR" - ${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CONFIG_DIR" - ${pkgs.coreutils}/bin/mkdir -p "$XMONAD_DATA_DIR" - - f=$HOME/.dbus/session-bus/$(${pkgs.coreutils}/bin/cat /etc/machine-id)-${ - toString config.services.xserver.display - } - if test -e "$f" && - . "$f" && - ${pkgs.coreutils}/bin/kill -0 "$DBUS_SESSION_BUS_PID" - then - export DBUS_SESSION_BUS_ADDRESS - else - eval "$(${pkgs.dbus.lib}/bin/dbus-launch --sh-syntax)" - fi - - exec ${xmonad} - ''; - xmonad-ready = pkgs.writeDash "xmonad-ready" '' - ${pkgs.systemd}/bin/systemd-notify --ready - { - ${pkgs.xorg.xhost}/bin/xhost +SI:localuser:${cfg.user.name} - ${pkgs.xorg.xhost}/bin/xhost -LOCAL: - } & - ${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} & - ${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' & - wait - ''; - in { - wantedBy = [ "graphical.target" ]; - requires = [ "xserver.service" ]; - environment = { - DISPLAY = ":${toString config.services.xserver.display}"; - FZMENU_FZF_DEFAULT_OPTS = toString [ - "--color=dark,border:126,bg+:090" - "--inline-info" - ]; - XMONAD_CACHE_DIR = cfg.cacheDir; - XMONAD_CONFIG_DIR = cfg.configDir; - XMONAD_DATA_DIR = cfg.dataDir; - XMONAD_STARTUP_HOOK = xmonad-ready; - XMONAD_WORKSPACES0_FILE = pkgs.writeJSON "xmonad-workspaces0.json" [ - "Dashboard" # we start here - "23" - "cr" - "ff" - "hack" - "im" - "mail" - "stockholm" - "za" "zh" "zj" "zs" - ]; - }; - path = [ - config.tv.slock.package - pkgs.flameshot-once-tv - pkgs.pulseaudio.out - pkgs.rxvt_unicode - pkgs.xcalib - "/run/wrappers" # for su - ]; - serviceConfig = { - ExecStart = "@${xmonad-start} xmonad-${currentSystem}"; - ExecStop = "@${xmonad} xmonad-${currentSystem} --shutdown"; - SyslogIdentifier = "xmonad"; - User = cfg.user.name; - WorkingDirectory = cfg.user.home; - - NotifyAccess = "all"; - Type = "notify"; - }; - }; - - systemd.services.xserver = { - after = [ - "acpid.service" - "local-fs.target" - "systemd-udev-settle.service" - ]; - wants = [ - "systemd-udev-settle.service" - ]; - restartIfChanged = false; - environment = { - LD_LIBRARY_PATH = concatStringsSep ":" ([ "/run/opengl-driver/lib" ] - ++ concatLists (catAttrs "libPath" config.services.xserver.drivers)); - }; - serviceConfig = { - SyslogIdentifier = "xserver"; - ExecStart = toString [ - "${pkgs.xorg.xorgserver}/bin/X" - ":${toString config.services.xserver.display}" - "vt${toString config.services.xserver.tty}" - "-config ${import ./xserver.conf.nix args}" - "-logfile /dev/null -logverbose 0 -verbose 3" - "-nolisten tcp" - "-xkbdir ${config.services.xserver.xkbDir}" - ]; - }; - }; - - tv.slock = { - enable = true; - user = cfg.user; - }; -} diff --git a/tv/2configs/xserver/lib b/tv/2configs/xserver/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/2configs/xserver/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/2configs/xserver/sxiv.nix b/tv/2configs/xserver/sxiv.nix deleted file mode 100644 index eb862f887..000000000 --- a/tv/2configs/xserver/sxiv.nix +++ /dev/null @@ -1,12 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - cfg.user = config.krebs.build.user; -in { - tv.Xresources = { - "Sxiv.foreground" = "#232323"; - "Sxiv.background" = "#424242"; - }; - users.users.${cfg.user.name}.packages = [ - pkgs.sxiv - ]; -} diff --git a/tv/2configs/xserver/urxvt.nix b/tv/2configs/xserver/urxvt.nix deleted file mode 100644 index 3502c6356..000000000 --- a/tv/2configs/xserver/urxvt.nix +++ /dev/null @@ -1,73 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - cfg.user = config.krebs.build.user; -in { - systemd.services.urxvtd = { - wantedBy = [ "graphical.target" ]; - restartIfChanged = false; - serviceConfig = { - SyslogIdentifier = "urxvtd"; - ExecStart = "${pkgs.rxvt_unicode}/bin/urxvtd"; - Restart = "always"; - RestartSec = "2s"; - StartLimitBurst = 0; - User = cfg.user.name; - }; - }; - tv.Xresources = { - "URxvt*cutchars" = ''"\\`\"'&()*,;<=>?@[]^{|}‘’"''; - "URxvt*eightBitInput" = "false"; - "URxvt*font" = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"; - "URxvt*boldFont" = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"; - "URxvt*scrollBar" = "false"; - "URxvt*background" = "#050505"; - "URxvt*foreground" = "#d0d7d0"; - "URxvt*cursorColor" = "#f042b0"; - "URxvt*cursorColor2" = "#f0b000"; - "URxvt*cursorBlink" = "off"; - "URxvt*jumpScroll" = "true"; - "URxvt*allowSendEvents" = "false"; - "URxvt*charClass" = "33:48,37-38:48,45-47:48,61:48,63-64:48"; - "URxvt*cutNewline" = "False"; - "URxvt*cutToBeginningOfLine" = "False"; - - "URxvt*color0" = "#232342"; - "URxvt*color3" = "#c07000"; - "URxvt*color4" = "#4040c0"; - "URxvt*color7" = "#c0c0c0"; - "URxvt*color8" = "#707070"; - "URxvt*color9" = "#ff6060"; - "URxvt*color10" = "#70ff70"; - "URxvt*color11" = "#ffff70"; - "URxvt*color12" = "#7070ff"; - "URxvt*color13" = "#ff50ff"; - "URxvt*color14" = "#70ffff"; - "URxvt*color15" = "#ffffff"; - - "URxvt*iso14755" = "False"; - - "URxvt*urgentOnBell" = "True"; - "URxvt*visualBell" = "True"; - - # ref https://github.com/muennich/urxvt-perls - "URxvt*perl-ext" = "default,url-select"; - "URxvt*keysym.M-u" = "perl:url-select:select_next"; - "URxvt*url-select.launcher" = - "/etc/profiles/per-user/${cfg.user.name}/bin/ff -new-tab"; - "URxvt*url-select.underline" = "true"; - "URxvt*colorUL" = "#4682B4"; - "URxvt.perl-lib" = "${pkgs.urxvt_perls}/lib/urxvt/perl"; - "URxvt*saveLines" = "10000"; - "URxvt*modifier" = "mod1"; - - "root-urxvt*background" = "#230000"; - "root-urxvt*foreground" = "#e0c0c0"; - "root-urxvt*BorderColor" = "#400000"; - "root-urxvt*color0" = "#800000"; - - "fzmenu-urxvt*background" = "rgb:42/23/42"; - "fzmenu-urxvt*externalBorder" = "1"; - "fzmenu-urxvt*geometry" = "70x9"; - "fzmenu-urxvt*internalBorder" = "1"; - }; -} diff --git a/tv/2configs/xserver/xkiller.nix b/tv/2configs/xserver/xkiller.nix deleted file mode 100644 index 2f9763093..000000000 --- a/tv/2configs/xserver/xkiller.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: { - - services.acpid.enable = true; - services.acpid.handlers.xkiller = { - action = /* sh */ '' - event=($1) - if test "''${event[2]}" = 00000080; then - ${pkgs.systemd}/bin/systemd-cat -t xkiller ${pkgs.xkiller} - fi - ''; - event = "button/prog1"; - }; - -} diff --git a/tv/2configs/xserver/xserver.conf.nix b/tv/2configs/xserver/xserver.conf.nix deleted file mode 100644 index 3fdfebf1b..000000000 --- a/tv/2configs/xserver/xserver.conf.nix +++ /dev/null @@ -1,39 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: - -let - cfg = config.services.xserver; -in - -pkgs.stdenv.mkDerivation { - name = "xserver.conf"; - - fontPath = optionalString (cfg.fontPath != null) - ''FontPath "${toString cfg.fontPath}"''; - - inherit (cfg) config; - - buildCommand = - '' - echo 'Section "Files"' >> $out - echo $fontPath >> $out - - for i in ${toString config.fonts.fonts}; do - if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then - for j in $(find $i -name fonts.dir); do - echo " FontPath \"$(dirname $j)\"" >> $out - done - fi - done - - for i in $(find ${toString cfg.modules} -type d); do - if test $(echo $i/*.so* | wc -w) -ne 0; then - echo " ModulePath \"$i\"" >> $out - fi - done - - echo 'EndSection' >> $out - - echo "$config" >> $out - ''; -} diff --git a/tv/2configs/xsessions/default.nix b/tv/2configs/xsessions/default.nix deleted file mode 100644 index 384c9c5e5..000000000 --- a/tv/2configs/xsessions/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./urxvtd.nix - ]; -} diff --git a/tv/2configs/xsessions/urxvtd.nix b/tv/2configs/xsessions/urxvtd.nix deleted file mode 100644 index de16a634b..000000000 --- a/tv/2configs/xsessions/urxvtd.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, ... }: { - systemd.user.sockets.urxvtd = { - wantedBy = [ "sockets.target" ]; - socketConfig.ListenStream = "%t/urxvtd"; - }; - systemd.user.services.urxvtd = { - restartIfChanged = false; - environment = { - RXVT_SOCKET = "%t/urxvtd"; - }; - serviceConfig = { - ExecStart = "${pkgs.rxvt_unicode}/bin/urxvtd"; - }; - }; -} diff --git a/tv/3modules/Xresources.nix b/tv/3modules/Xresources.nix deleted file mode 100644 index 266531de9..000000000 --- a/tv/3modules/Xresources.nix +++ /dev/null @@ -1,38 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - cfg = { - enable = config.services.xserver.enable && config.tv.Xresources != {}; - user = config.krebs.build.user; - }; -in { - options.tv.Xresources = mkOption { - default = {}; - type = types.attrsOf types.str; - }; - config = { - nixpkgs.overlays = singleton (self: super: { - tv = super.tv or {} // { - Xresources = - self.writeText "Xresources" - (concatStrings (mapAttrsToList (name: value: /* xdefaults */ '' - ${name}: ${value} - '') config.tv.Xresources)); - }; - }); - systemd.services.${if cfg.enable then "Xresources" else null} = { - wantedBy = [ "graphical.target" ]; - after = [ "xmonad.service" ]; - environment = { - DISPLAY = ":${toString config.services.xserver.display}"; - }; - serviceConfig = { - ExecStart = "${pkgs.xorg.xrdb}/bin/xrdb ${pkgs.tv.Xresources}"; - RemainAfterExit = true; - SyslogIdentifier = "Xresources"; - Type = "oneshot"; - User = cfg.user.name; - WorkingDirectory = cfg.user.home; - }; - }; - }; -} diff --git a/tv/3modules/charybdis/config.nix b/tv/3modules/charybdis/config.nix deleted file mode 100644 index 4669345eb..000000000 --- a/tv/3modules/charybdis/config.nix +++ /dev/null @@ -1,519 +0,0 @@ -{ config, ... }: with import ./lib; let - cfg = config.tv.charybdis; -in toFile "charybdis.conf" '' - /* doc/example.conf - brief example configuration file - * - * Copyright (C) 2000-2002 Hybrid Development Team - * Copyright (C) 2002-2005 ircd-ratbox development team - * Copyright (C) 2005-2006 charybdis development team - * - * $Id: example.conf 3582 2007-11-17 21:55:48Z jilles $ - * - * See reference.conf for more information. - */ - - /* Extensions */ - #loadmodule "extensions/chm_operonly_compat.so"; - #loadmodule "extensions/chm_quietunreg_compat.so"; - #loadmodule "extensions/chm_sslonly_compat.so"; - #loadmodule "extensions/createauthonly.so"; - #loadmodule "extensions/extb_account.so"; - #loadmodule "extensions/extb_canjoin.so"; - #loadmodule "extensions/extb_channel.so"; - #loadmodule "extensions/extb_extgecos.so"; - #loadmodule "extensions/extb_oper.so"; - #loadmodule "extensions/extb_realname.so"; - #loadmodule "extensions/extb_server.so"; - #loadmodule "extensions/extb_ssl.so"; - #loadmodule "extensions/hurt.so"; - #loadmodule "extensions/m_findforwards.so"; - #loadmodule "extensions/m_identify.so"; - #loadmodule "extensions/no_oper_invis.so"; - #loadmodule "extensions/sno_farconnect.so"; - #loadmodule "extensions/sno_globalkline.so"; - #loadmodule "extensions/sno_globaloper.so"; - #loadmodule "extensions/sno_whois.so"; - loadmodule "extensions/override.so"; - - /* - * IP cloaking extensions: use ip_cloaking_4.0 - * if you're linking 3.2 and later, otherwise use - * ip_cloaking.so, for compatibility with older 3.x - * releases. - */ - - #loadmodule "extensions/ip_cloaking_4.0.so"; - #loadmodule "extensions/ip_cloaking.so"; - - serverinfo { - name = ${toJSON (head config.krebs.build.host.nets.retiolum.aliases)}; - sid = "4z3"; - description = "miep!"; - network_name = "irc.r"; - #network_desc = "Retiolum IRC Network"; - hub = yes; - - /* On multi-homed hosts you may need the following. These define - * the addresses we connect from to other servers. */ - /* for IPv4 */ - vhost = ${toJSON config.krebs.build.host.nets.retiolum.ip4.addr}; - /* for IPv6 */ - vhost6 = ${toJSON config.krebs.build.host.nets.retiolum.ip6.addr}; - - /* ssl_private_key: our ssl private key */ - ssl_private_key = "/tmp/credentials/ssl_private_key"; - - /* ssl_cert: certificate for our ssl server */ - ssl_cert = ${toJSON cfg.ssl_cert}; - - /* ssl_dh_params: DH parameters, generate with openssl dhparam -out dh.pem 1024 */ - ssl_dh_params = "/tmp/credentials/ssl_dh_params"; - - /* ssld_count: number of ssld processes you want to start, if you - * have a really busy server, using N-1 where N is the number of - * cpu/cpu cores you have might be useful. A number greater than one - * can also be useful in case of bugs in ssld and because ssld needs - * two file descriptors per SSL connection. - */ - ssld_count = 1; - - /* default max clients: the default maximum number of clients - * allowed to connect. This can be changed once ircd has started by - * issuing: - * /quote set maxclients - */ - default_max_clients = 1024; - - /* nicklen: enforced nickname length (for this server only; must not - * be longer than the maximum length set while building). - */ - nicklen = 30; - }; - - admin { - name = "tv"; - description = "peer"; - }; - - log { - fname_userlog = "/dev/stderr"; - fname_fuserlog = "/dev/stderr"; - fname_operlog = "/dev/stderr"; - fname_foperlog = "/dev/stderr"; - fname_serverlog = "/dev/stderr"; - fname_klinelog = "/dev/stderr"; - fname_killlog = "/dev/stderr"; - fname_operspylog = "/dev/stderr"; - fname_ioerrorlog = "/dev/stderr"; - }; - - /* class {} blocks MUST be specified before anything that uses them. That - * means they must be defined before auth {} and before connect {}. - */ - - class "krebs" { - ping_time = 2 minutes; - number_per_ident = 10; - number_per_ip = 2048; - number_per_ip_global = 4096; - cidr_ipv4_bitlen = 24; - cidr_ipv6_bitlen = 64; - number_per_cidr = 65536; - max_number = 3000; - sendq = 1 megabyte; - }; - - class "users" { - ping_time = 2 minutes; - number_per_ident = 10; - number_per_ip = 1024; - number_per_ip_global = 4096; - cidr_ipv4_bitlen = 24; - cidr_ipv6_bitlen = 64; - number_per_cidr = 65536; - max_number = 3000; - sendq = 400 kbytes; - }; - - class "opers" { - ping_time = 5 minutes; - number_per_ip = 10; - max_number = 1000; - sendq = 1 megabyte; - }; - - class "server" { - ping_time = 5 minutes; - connectfreq = 5 minutes; - max_number = 1; - sendq = 4 megabytes; - }; - - listen { - /* defer_accept: wait for clients to send IRC handshake data before - * accepting them. if you intend to use software which depends on the - * server replying first, such as BOPM, you should disable this feature. - * otherwise, you probably want to leave it on. - */ - defer_accept = yes; - - /* If you want to listen on a specific IP only, specify host. - * host definitions apply only to the following port line. - */ - #host = ${toJSON config.krebs.build.host.nets.retiolum.ip4.addr}; - port = ${toString cfg.port}; - sslport = ${toString cfg.sslport}; - }; - - /* auth {}: allow users to connect to the ircd (OLD I:) - * auth {} blocks MUST be specified in order of precedence. The first one - * that matches a user will be used. So place spoofs first, then specials, - * then general access, then restricted. - */ - auth { - /* user: the user@host allowed to connect. Multiple IPv4/IPv6 user - * lines are permitted per auth block. This is matched against the - * hostname and IP address (using :: shortening for IPv6 and - * prepending a 0 if it starts with a colon) and can also use CIDR - * masks. - */ - user = "*@10.243.0.0/16"; - user = "*@42::/16"; - - /* password: an optional password that is required to use this block. - * By default this is not encrypted, specify the flag "encrypted" in - * flags = ...; below if it is. - */ - #password = "letmein"; - - /* spoof: fake the users user@host to be be this. You may either - * specify a host or a user@host to spoof to. This is free-form, - * just do everyone a favour and dont abuse it. (OLD I: = flag) - */ - #spoof = "I.still.hate.packets"; - - /* Possible flags in auth: - * - * encrypted | password is encrypted with mkpasswd - * spoof_notice | give a notice when spoofing hosts - * exceed_limit (old > flag) | allow user to exceed class user limits - * kline_exempt (old ^ flag) | exempt this user from k/g/xlines&dnsbls - * dnsbl_exempt | exempt this user from dnsbls - * spambot_exempt | exempt this user from spambot checks - * shide_exempt | exempt this user from serverhiding - * jupe_exempt | exempt this user from generating - * warnings joining juped channels - * resv_exempt | exempt this user from resvs - * flood_exempt | exempt this user from flood limits - * USE WITH CAUTION. - * no_tilde (old - flag) | don't prefix ~ to username if no ident - * need_ident (old + flag) | require ident for user in this class - * need_ssl | require SSL/TLS for user in this class - * need_sasl | require SASL id for user in this class - */ - flags = kline_exempt, exceed_limit, flood_exempt; - - /* class: the class the user is placed in */ - class = "krebs"; - }; - - auth { - user = "*@*"; - class = "users"; - }; - - /* privset {} blocks MUST be specified before anything that uses them. That - * means they must be defined before operator {}. - */ - privset "local_op" { - privs = oper:local_kill, oper:operwall; - }; - - privset "server_bot" { - extends = "local_op"; - privs = oper:kline, oper:remoteban, snomask:nick_changes; - }; - - privset "global_op" { - extends = "local_op"; - privs = oper:global_kill, oper:routing, oper:kline, oper:unkline, oper:xline, - oper:resv, oper:mass_notice, oper:remoteban; - }; - - privset "admin" { - extends = "global_op"; - privs = oper:admin, oper:die, oper:rehash, oper:spy, oper:override; - }; - - privset "aids" { - privs = oper:override, oper:rehash; - }; - - operator "aids" { - user = "*@10.243.*"; - privset = "aids"; - flags = ~encrypted; - password = "balls"; - }; - - operator "god" { - /* name: the name of the oper must go above */ - - /* user: the user@host required for this operator. CIDR *is* - * supported now. auth{} spoofs work here, other spoofs do not. - * multiple user="" lines are supported. - */ - user = "*god@127.0.0.1"; - - /* password: the password required to oper. Unless ~encrypted is - * contained in flags = ...; this will need to be encrypted using - * mkpasswd, MD5 is supported - */ - password = "5"; - - /* rsa key: the public key for this oper when using Challenge. - * A password should not be defined when this is used, see - * doc/challenge.txt for more information. - */ - #rsa_public_key_file = "/usr/local/ircd/etc/oper.pub"; - - /* umodes: the specific umodes this oper gets when they oper. - * If this is specified an oper will not be given oper_umodes - * These are described above oper_only_umodes in general {}; - */ - #umodes = locops, servnotice, operwall, wallop; - - /* fingerprint: if specified, the oper's client certificate - * fingerprint will be checked against the specified fingerprint - * below. - */ - #fingerprint = "c77106576abf7f9f90cca0f63874a60f2e40a64b"; - - /* snomask: specific server notice mask on oper up. - * If this is specified an oper will not be given oper_snomask. - */ - snomask = "+Zbfkrsuy"; - - /* flags: misc options for the operator. You may prefix an option - * with ~ to disable it, e.g. ~encrypted. - * - * Default flags are encrypted. - * - * Available options: - * - * encrypted: the password above is encrypted [DEFAULT] - * need_ssl: must be using SSL/TLS to oper up - */ - flags = encrypted; - - /* privset: privileges set to grant */ - privset = "admin"; - }; - - service { - name = "services.int"; - }; - - cluster { - name = "*"; - flags = kline, tkline, unkline, xline, txline, unxline, resv, tresv, unresv; - }; - - shared { - oper = "*@*", "*"; - flags = all, rehash; - }; - - /* exempt {}: IPs that are exempt from Dlines and rejectcache. (OLD d:) */ - exempt { - ip = "127.0.0.1"; - }; - - channel { - use_invex = yes; - use_except = yes; - use_forward = yes; - use_knock = yes; - knock_delay = 5 minutes; - knock_delay_channel = 1 minute; - max_chans_per_user = 15; - max_bans = 100; - max_bans_large = 500; - default_split_user_count = 0; - default_split_server_count = 0; - no_create_on_split = no; - no_join_on_split = no; - burst_topicwho = yes; - kick_on_split_riding = no; - only_ascii_channels = no; - resv_forcepart = yes; - channel_target_change = yes; - disable_local_channels = no; - }; - - serverhide { - flatten_links = yes; - links_delay = 5 minutes; - hidden = no; - disable_hidden = no; - }; - - /* These are the blacklist settings. - * You can have multiple combinations of host and rejection reasons. - * They are used in pairs of one host/rejection reason. - * - * These settings should be adequate for most networks, and are (presently) - * required for use on StaticBox. - * - * Word to the wise: Do not use blacklists like SPEWS for blocking IRC - * connections. - * - * As of charybdis 2.2, you can do some keyword substitution on the rejection - * reason. The available keyword substitutions are: - * - * ''${ip} - the user's IP - * ''${host} - the user's canonical hostname - * ''${dnsbl-host} - the dnsbl hostname the lookup was done against - * ''${nick} - the user's nickname - * ''${network-name} - the name of the network - * - * As of charybdis 3.4, a type parameter is supported, which specifies the - * address families the blacklist supports. IPv4 and IPv6 are supported. - * IPv4 is currently the default as few blacklists support IPv6 operation - * as of this writing. - * - * Note: AHBL (the providers of the below *.ahbl.org BLs) request that they be - * contacted, via email, at admins@2mbit.com before using these BLs. - * See for more information. - */ - blacklist { - host = "rbl.efnetrbl.org"; - type = ipv4; - reject_reason = "''${nick}, your IP (''${ip}) is listed in EFnet's RBL. For assistance, see http://efnetrbl.org/?i=''${ip}"; - - # host = "ircbl.ahbl.org"; - # type = ipv4; - # reject_reason = "''${nick}, your IP (''${ip}) is listed in ''${dnsbl-host} for having an open proxy. In order to protect ''${network-name} from abuse, we are not allowing connections with open proxies to connect."; - # - # host = "tor.ahbl.org"; - # type = ipv4; - # reject_reason = "''${nick}, your IP (''${ip}) is listed as a TOR exit node. In order to protect ''${network-name} from tor-based abuse, we are not allowing TOR exit nodes to connect to our network."; - # - /* Example of a blacklist that supports both IPv4 and IPv6 */ - # host = "foobl.blacklist.invalid"; - # type = ipv4, ipv6; - # reject_reason = "''${nick}, your IP (''${ip}) is listed in ''${dnsbl-host} for some reason. In order to protect ''${network-name} from abuse, we are not allowing connections listed in ''${dnsbl-host} to connect"; - }; - - alias "NickServ" { - target = "NickServ"; - }; - - alias "ChanServ" { - target = "ChanServ"; - }; - - alias "OperServ" { - target = "OperServ"; - }; - - alias "MemoServ" { - target = "MemoServ"; - }; - - alias "NS" { - target = "NickServ"; - }; - - alias "CS" { - target = "ChanServ"; - }; - - alias "OS" { - target = "OperServ"; - }; - - alias "MS" { - target = "MemoServ"; - }; - - general { - hide_error_messages = opers; - hide_spoof_ips = yes; - - /* - * default_umodes: umodes to enable on connect. - * If you have enabled the new ip_cloaking_4.0 module, and you want - * to make use of it, add +x to this option, i.e.: - * default_umodes = "+ix"; - * - * If you have enabled the old ip_cloaking module, and you want - * to make use of it, add +h to this option, i.e.: - * default_umodes = "+ih"; - */ - default_umodes = "+i"; - - default_operstring = "is an IRC Operator"; - default_adminstring = "is a Server Administrator"; - servicestring = "is a Network Service"; - disable_fake_channels = no; - tkline_expire_notices = no; - default_floodcount = 1000; - failed_oper_notice = yes; - dots_in_ident=2; - min_nonwildcard = 4; - min_nonwildcard_simple = 3; - max_accept = 100; - max_monitor = 100; - anti_nick_flood = yes; - max_nick_time = 20 seconds; - max_nick_changes = 5; - anti_spam_exit_message_time = 5 minutes; - ts_warn_delta = 30 seconds; - ts_max_delta = 5 minutes; - client_exit = yes; - collision_fnc = yes; - resv_fnc = yes; - global_snotices = yes; - dline_with_reason = yes; - kline_delay = 0 seconds; - kline_with_reason = yes; - kline_reason = "K-Lined"; - identify_service = "NickServ@services.int"; - identify_command = "IDENTIFY"; - non_redundant_klines = yes; - warn_no_nline = yes; - use_propagated_bans = yes; - stats_e_disabled = no; - stats_c_oper_only=no; - stats_h_oper_only=no; - client_flood_max_lines = 16000; - client_flood_burst_rate = 32000; - client_flood_burst_max = 32000; - client_flood_message_num = 32000; - client_flood_message_time = 32000; - use_whois_actually = no; - oper_only_umodes = operwall, locops, servnotice; - oper_umodes = locops, servnotice, operwall, wallop; - oper_snomask = "+s"; - burst_away = yes; - nick_delay = 0 seconds; # 15 minutes if you want to enable this - reject_ban_time = 1 minute; - reject_after_count = 3; - reject_duration = 5 minutes; - throttle_duration = 1; - throttle_count = 1000; - max_ratelimit_tokens = 30; - away_interval = 30; - disable_auth = yes; - }; - - modules { - path = "modules"; - path = "modules/autoload"; - }; - - exempt { - ip = "10.243.0.0/16"; - }; -'' diff --git a/tv/3modules/charybdis/default.nix b/tv/3modules/charybdis/default.nix deleted file mode 100644 index 1fdcea572..000000000 --- a/tv/3modules/charybdis/default.nix +++ /dev/null @@ -1,81 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }@args: let - cfg = config.tv.charybdis; -in { - options.tv.charybdis = { - enable = mkEnableOption "tv.charybdis"; - motd = mkOption { - type = types.str; - default = "/join #retiolum"; - }; - port = mkOption { - type = types.int; - default = 6667; - }; - ssl_cert = mkOption { - type = types.path; - }; - ssl_dh_params = mkOption { - type = types.absolute-pathname; - default = "${config.krebs.secret.directory}/charybdis.dh.pem"; - }; - ssl_private_key = mkOption { - type = types.absolute-pathname; - default = "${config.krebs.secret.directory}/charybdis.key.pem"; - }; - sslport = mkOption { - type = types.int; - default = 6697; - }; - user = mkOption { - type = types.user; - default = { - name = "charybdis"; - home = "/var/lib/charybdis"; - }; - }; - }; - config = lib.mkIf cfg.enable { - - environment.etc."charybdis-ircd.motd".text = cfg.motd; - - krebs.systemd.services.charybdis = {}; - - systemd.services.charybdis = { - wantedBy = [ "multi-user.target" ]; - after = [ "network-online.target" ]; - environment = { - BANDB_DBPATH = "${cfg.user.home}/ban.db"; - }; - serviceConfig = { - SyslogIdentifier = "charybdis"; - User = cfg.user.name; - PrivateTmp = true; - Restart = "always"; - ExecStartPre = [ - "${pkgs.coreutils}/bin/ln -s /etc/charybdis-ircd.motd /tmp/ircd.motd" - "${pkgs.coreutils}/bin/ln -s \${CREDENTIALS_DIRECTORY} /tmp/credentials" - ]; - ExecStart = toString [ - "${pkgs.charybdis}/bin/charybdis" - "-configfile ${import ./config.nix args}" - "-foreground" - "-logfile /dev/stderr" - ]; - LoadCredential = [ - "ssl_dh_params:${cfg.ssl_dh_params}" - "ssl_private_key:${cfg.ssl_private_key}" - ]; - }; - }; - - users.users.${cfg.user.name} = { - inherit (cfg.user) home name uid; - createHome = true; - group = cfg.user.name; - isSystemUser = true; - }; - - users.groups.${cfg.user.name} = {}; - }; -} diff --git a/tv/3modules/charybdis/lib b/tv/3modules/charybdis/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/3modules/charybdis/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/3modules/default.nix b/tv/3modules/default.nix deleted file mode 100644 index 1a0971ec6..000000000 --- a/tv/3modules/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -with import ./lib; -{ - imports = - map - (name: ./. + "/${name}") - (attrNames - (filterAttrs isNixDirEntry (readDir ./.))); -} diff --git a/tv/3modules/dnsmasq.nix b/tv/3modules/dnsmasq.nix deleted file mode 100644 index e1dfdea34..000000000 --- a/tv/3modules/dnsmasq.nix +++ /dev/null @@ -1,58 +0,0 @@ -with import ./lib; -{ config, ... }: let - cfg = config.tv.dnsmasq; -in { - - options.tv.dnsmasq = { - enable = mkEnableOption "tv.dnsmasq"; - dhcp-range = mkOption { - type = types.str; - }; - interface = mkOption { - type = types.str; - }; - address = mkOption { - type = types.str; - }; - prefixLength = mkOption { - type = types.addCheck types.int (x: x >= 0 && x <= 32); - }; - }; - - config = mkIf cfg.enable (mkMerge [ - { - networking.dhcpcd.denyInterfaces = [ cfg.interface ]; - services.dnsmasq.resolveLocalQueries = false; - networking.interfaces.${cfg.interface} = { - ipv4.addresses = singleton { - address = cfg.address; - prefixLength = cfg.prefixLength; - }; - }; - services.dnsmasq.enable = true; - services.dnsmasq.extraConfig = '' - bind-interfaces - dhcp-range=${cfg.dhcp-range} - listen-address=${cfg.address} - ''; - tv.iptables.extra.filter.INPUT = [ - "-i ${cfg.interface} -p tcp -m tcp --dport bootps -j ACCEPT" - "-i ${cfg.interface} -p udp -m udp --dport bootps -j ACCEPT" - "-i ${cfg.interface} -p tcp -m tcp --dport domain -j ACCEPT" - "-i ${cfg.interface} -p udp -m udp --dport domain -j ACCEPT" - ]; - } - { - # enable forwarding - boot.kernel.sysctl."net.ipv4.ip_forward" = true; - tv.iptables.extra.filter.FORWARD = [ - "-m state --state RELATED,ESTABLISHED -j ACCEPT" - "-i ${cfg.interface} -j ACCEPT" - ]; - tv.iptables.extra.nat.POSTROUTING = [ - "-j MASQUERADE" - ]; - } - ]); - -} diff --git a/tv/3modules/ejabberd/default.nix b/tv/3modules/ejabberd/default.nix deleted file mode 100644 index 61fd8fdf1..000000000 --- a/tv/3modules/ejabberd/default.nix +++ /dev/null @@ -1,275 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - cfg = config.tv.ejabberd; - - gen-dhparam = pkgs.writeDash "gen-dhparam" '' - set -efu - path=$1 - bits=2048 - # TODO regenerate dhfile after some time? - if ! test -e "$path"; then - ${pkgs.openssl}/bin/openssl dhparam "$bits" > "$path" - fi - ''; - - settingsFormat = pkgs.formats.json {}; - -in { - options.tv.ejabberd = { - enable = mkEnableOption "tv.ejabberd"; - certfiles = mkOption { - type = types.listOf types.absolute-pathname; - default = [ - "${config.krebs.secret.directory}/ejabberd.pem" - ]; - }; - configFile = mkOption { - type = types.either types.package types.absolute-pathname; - default = settingsFormat.generate "ejabberd.yaml" cfg.settings; - }; - ciphers = mkOption { - type = types.listOf types.str; - default = [ - "ECDHE-ECDSA-AES256-GCM-SHA384" - "ECDHE-RSA-AES256-GCM-SHA384" - "ECDHE-ECDSA-CHACHA20-POLY1305" - "ECDHE-RSA-CHACHA20-POLY1305" - "ECDHE-ECDSA-AES128-GCM-SHA256" - "ECDHE-RSA-AES128-GCM-SHA256" - "ECDHE-ECDSA-AES256-SHA384" - "ECDHE-RSA-AES256-SHA384" - "ECDHE-ECDSA-AES128-SHA256" - "ECDHE-RSA-AES128-SHA256" - ]; - }; - credentials.certfiles = mkOption { - internal = true; - readOnly = true; - default = - imap - (i: const "/tmp/credentials/certfile${toJSON i}") - cfg.certfiles; - }; - hosts = mkOption { - type = with types; listOf str; - }; - pkgs.ejabberd = mkOption { - type = types.package; - default = pkgs.symlinkJoin { - name = "ejabberd-wrapper"; - paths = [ - (pkgs.writeDashBin "ejabberdctl" '' - exec ${pkgs.ejabberd}/bin/ejabberdctl \ - --config /etc/ejabberd/ejabberd.yaml \ - --ctl-config /etc/ejabberd/ejabberdctl.cfg \ - --logs ${cfg.stateDir} \ - --spool ${cfg.stateDir} \ - "$@" - '') - pkgs.ejabberd - ]; - }; - }; - protocol_options = mkOption { - type = types.listOf types.str; - default = [ - "no_sslv2" - "no_sslv3" - "no_tlsv1" - "no_tlsv1_10" - ]; - }; - registration_watchers = mkOption { - type = types.listOf types.str; - default = [ - config.krebs.users.tv.mail - ]; - }; - settings = mkOption { - type = settingsFormat.type; - default = {}; - }; - stateDir = mkOption { - type = - types.addCheck - types.absolute-pathname - (path: - hasPrefix "/var/lib/" path && - types.filename.check (removePrefix "/var/lib/" path) - ); - default = "/var/lib/ejabberd"; - }; - }; - config = lib.mkIf cfg.enable { - - environment.etc."ejabberd/ejabberd.yaml".source = cfg.configFile; - environment.etc."ejabberd/ejabberdctl.cfg".source = - builtins.toFile "ejabberdctl.cfg" /* sh */ '' - ERL_OPTIONS='-setcookie ${cfg.stateDir}/.erlang.cookie' - ''; - - environment.systemPackages = [ - (pkgs.symlinkJoin { - name = "ejabberd-sudo-wrapper"; - paths = [ - (pkgs.writeDashBin "ejabberdctl" '' - exec ${pkgs.systemd}/bin/systemd-run \ - --unit=ejabberdctl \ - --property=StateDirectory=ejabberd \ - --property=User=ejabberd \ - --collect \ - --pipe \ - --quiet \ - ${cfg.pkgs.ejabberd}/bin/ejabberdctl "$@" - '') - cfg.pkgs.ejabberd - ]; - }) - ]; - - krebs.systemd.services.ejabberd.restartIfCredentialsChange = true; - - systemd.services.ejabberd = { - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - reloadTriggers = [ - config.environment.etc."ejabberd/ejabberd.yaml".source - config.environment.etc."ejabberd/ejabberdctl.cfg".source - ]; - serviceConfig = { - ExecStartPre = [ - "${pkgs.coreutils}/bin/ln -s \${CREDENTIALS_DIRECTORY} /tmp/credentials" - "${gen-dhparam} ${cfg.stateDir}/dhfile" - ]; - ExecStart = "${cfg.pkgs.ejabberd}/bin/ejabberdctl foreground"; - ExecStop = [ - "${cfg.pkgs.ejabberd}/bin/ejabberdctl stop" - "${cfg.pkgs.ejabberd}/bin/ejabberdctl stopped" - ]; - ExecReload = "${cfg.pkgs.ejabberd}/bin/ejabberdctl reload_config"; - LoadCredential = - zipListsWith - (dst: src: "${baseNameOf dst}:${src}") - cfg.credentials.certfiles - cfg.certfiles; - LimitNOFILE = 65536; - PrivateDevices = true; - PrivateTmp = true; - SyslogIdentifier = "ejabberd"; - StateDirectory = "ejabberd"; - User = "ejabberd"; - DynamicUser = true; - TimeoutSec = 60; - RestartSec = 5; - Restart = "on-failure"; - Type = "notify"; - NotifyAccess = "all"; - WatchdogSec = 30; - }; - }; - - # preset config values - tv.ejabberd.settings = { - access_rules = { - announce = mkDefault [{ allow = "admin"; }]; - local = mkDefault [{ allow = "local"; }]; - configure = mkDefault [{ allow = "admin"; }]; - register = mkDefault ["allow"]; - s2s = mkDefault ["allow"]; - trusted_network = mkDefault [{ allow = "loopback"; }]; - }; - - acl = { - local.user_regexp = mkDefault ""; - loopback.ip = mkDefault [ - "127.0.0.0/8" - "::1/128" - "::FFFF:127.0.0.1/128" - ]; - }; - - certfiles = mkDefault cfg.credentials.certfiles; - - hosts = mkDefault cfg.hosts; - - language = mkDefault "en"; - - listen = mkDefault [ - { - port = 5222; - ip = "::"; - module = "ejabberd_c2s"; - shaper = "c2s_shaper"; - ciphers = concatStringsSep ":" cfg.ciphers; - protocol_options = cfg.protocol_options; - starttls = true; - starttls_required = true; - tls = false; - tls_compression = false; - max_stanza_size = 65536; - } - { - port = 5269; - ip = "::"; - module = "ejabberd_s2s_in"; - shaper = "s2s_shaper"; - dhfile = "${cfg.stateDir}/dhfile"; - max_stanza_size = 131072; - } - ]; - - loglevel = mkDefault "4"; - - modules = { - mod_adhoc = mkDefault {}; - mod_admin_extra = mkDefault {}; - mod_announce.access = mkDefault "announce"; - mod_caps = mkDefault {}; - mod_carboncopy = mkDefault {}; - mod_client_state = mkDefault {}; - mod_configure = mkDefault {}; - mod_disco = mkDefault {}; - mod_echo = mkDefault {}; - mod_bosh = mkDefault {}; - mod_last = mkDefault {}; - mod_offline.access_max_user_messages = mkDefault "max_user_offline_messages"; - mod_ping = mkDefault {}; - mod_privacy = mkDefault {}; - mod_private = mkDefault {}; - mod_register = { - access_from = mkDefault "deny"; - access = mkDefault "register"; - ip_access = mkDefault "trusted_network"; - registration_watchers = mkDefault cfg.registration_watchers; - }; - mod_roster = mkDefault {}; - mod_shared_roster = mkDefault {}; - mod_stats = mkDefault {}; - mod_time = mkDefault {}; - mod_vcard.search = mkDefault false; - mod_version = mkDefault {}; - mod_http_api = mkDefault {}; - }; - - s2s_access = mkDefault "s2s"; - s2s_ciphers = concatStringsSep ":" cfg.ciphers; - s2s_dhfile = mkDefault "${cfg.stateDir}/dhfile"; - s2s_protocol_options = mkDefault cfg.protocol_options; - s2s_tls_compression = mkDefault false; - s2s_use_starttls = mkDefault "required"; - - shaper_rules = { - max_user_offline_messages = mkDefault [ - { "5000" = "admin"; } - 100 - ]; - max_user_sessions = mkDefault 10; - c2s_shaper = mkDefault [ - { "none" = "admin"; } - "normal" - ]; - s2s_shaper = mkDefault "fast"; - }; - }; - }; -} diff --git a/tv/3modules/ejabberd/lib b/tv/3modules/ejabberd/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/3modules/ejabberd/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/3modules/focus.nix b/tv/3modules/focus.nix deleted file mode 100644 index c16d44243..000000000 --- a/tv/3modules/focus.nix +++ /dev/null @@ -1,4 +0,0 @@ -with import ./lib; -{ - options.tv.focus.enable = mkEnableOption "tv.focus"; -} diff --git a/tv/3modules/hosts.nix b/tv/3modules/hosts.nix deleted file mode 100644 index 2d382e266..000000000 --- a/tv/3modules/hosts.nix +++ /dev/null @@ -1,9 +0,0 @@ -with import ./lib; -{ config, ... }: { - options.tv.hosts = mkOption { - type = types.attrsOf types.host; - default = - filterAttrs (_: host: host.owner.name == "tv") - config.krebs.hosts; - }; -} diff --git a/tv/3modules/hw.nix b/tv/3modules/hw.nix deleted file mode 100644 index db1a77c85..000000000 --- a/tv/3modules/hw.nix +++ /dev/null @@ -1,16 +0,0 @@ -with import ./lib; -let - local.types.screen = lib.types.submodule { - options.width = lib.mkOption { - type = lib.types.uint; - }; - options.height = lib.mkOption { - type = lib.types.uint; - }; - }; -in { - options.tv.hw.screens = lib.mkOption { - type = lib.types.attrsOf local.types.screen; - default = {}; - }; -} diff --git a/tv/3modules/im.nix b/tv/3modules/im.nix deleted file mode 100644 index 76a61b191..000000000 --- a/tv/3modules/im.nix +++ /dev/null @@ -1,110 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - im = config.tv.im; -in { - options = { - tv.im.client.enable = lib.mkEnableOption "tv.im.client" // { - default = config.krebs.build.host.name == im.client.host.name; - }; - tv.im.client.term = lib.mkOption { - default = "rxvt-unicode-256color"; - type = lib.types.filename; - }; - tv.im.client.useIPv6 = lib.mkEnableOption "tv.im.client.useIPv6" // { - default = true; - }; - tv.im.client.host = lib.mkOption { - default = config.krebs.hosts.xu; - type = lib.types.host; - }; - tv.im.client.user = lib.mkOption { - default = config.krebs.users.tv; - type = lib.types.user; - }; - - tv.im.server.enable = lib.mkEnableOption "tv.im.server" // { - default = config.krebs.build.host.name == im.server.host.name; - }; - tv.im.server.host = lib.mkOption { - default = config.krebs.hosts.nomic; - type = lib.types.host; - }; - tv.im.server.mosh.enable = lib.mkEnableOption "tv.im.server.mosh" // { - default = true; - }; - tv.im.server.weechat.relay.enable = - lib.mkEnableOption "tv.im.server.weechat.relay"; - tv.im.server.user = lib.mkOption { - default = config.krebs.users.tv; - type = lib.types.user; - }; - }; - imports = [ - (lib.mkIf im.client.enable { - users.users.${im.client.user.name}.packages = [ - (pkgs.writeDashBin "im" '' - ${if im.server.mosh.enable then /* sh */ '' - exec ${pkgs.mosh}/bin/mosh \ - ${lib.optionalString im.client.useIPv6 "-6"} \ - ${im.server.user.name}@${lib.head im.server.host.nets.retiolum.aliases} \ - env TERM=${im.client.term} im - '' else /* sh */ '' - exec ${pkgs.openssh}/bin/ssh \ - ${lib.optionalString im.client.useIPv6 "-6"} \ - ${im.server.user.name}@${lib.head im.server.host.nets.retiolum.aliases} \ - -t \ - im - ''} - '') - ]; - }) - (lib.mkIf im.server.enable { - services.bitlbee = { - enable = true; - plugins = [ - pkgs.bitlbee-facebook - ]; - }; - users.users.${im.server.user.name}.packages = [ - pkgs.mosh - (pkgs.writeDashBin "im" '' - export PATH=${lib.makeSearchPath "bin" [ - pkgs.tmux - pkgs.gnugrep - pkgs.weechat-tv - ]} - if tmux list-sessions -F\#S | grep -q '^im''$'; then - exec tmux attach -t im - else - exec tmux new -s im weechat - fi - '') - ]; - }) - (lib.mkIf im.server.mosh.enable { - krebs.setuid.utempter = { - filename = "${pkgs.libutempter}/lib/utempter/utempter"; - owner = "nobody"; - group = "utmp"; - mode = "2111"; - }; - tv.iptables.extra4.filter.Retiolum = [ - "-s ${im.client.host.nets.retiolum.ip4.addr} -p udp --dport 60000:61000 -j ACCEPT" - ]; - tv.iptables.extra6.filter.Retiolum = [ - "-s ${im.client.host.nets.retiolum.ip6.addr} -p udp --dport 60000:61000 -j ACCEPT" - ]; - }) - (lib.mkIf im.server.weechat.relay.enable { - krebs.iana-etc.services = { - "9001".tcp.name = "weechat-ssl"; - }; - tv.iptables.extra4.filter.Retiolum = [ - "-s ${im.client.host.nets.retiolum.ip4.addr} -p tcp -m tcp --dport 9001 -j ACCEPT" - ]; - tv.iptables.extra6.filter.Retiolum = [ - "-s ${im.client.host.nets.retiolum.ip6.addr} -p tcp -m tcp --dport 9001 -j ACCEPT" - ]; - }) - ]; -} diff --git a/tv/3modules/iptables.nix b/tv/3modules/iptables.nix deleted file mode 100644 index 5b36c5acb..000000000 --- a/tv/3modules/iptables.nix +++ /dev/null @@ -1,208 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let { - cfg = config.tv.iptables; - - body = { - options.tv.iptables = api; - config = lib.mkIf cfg.enable imp; - }; - - extraTypes = { - rules = types.submodule { - options = { - nat.OUTPUT = mkOption { - type = with types; listOf str; - default = []; - }; - nat.PREROUTING = mkOption { - type = with types; listOf str; - default = []; - }; - nat.POSTROUTING = mkOption { - type = with types; listOf str; - default = []; - }; - filter.FORWARD = mkOption { - type = with types; listOf str; - default = []; - }; - filter.INPUT = mkOption { - type = with types; listOf str; - default = []; - }; - filter.Retiolum = mkOption { - type = with types; listOf str; - default = []; - }; - filter.Wiregrill = mkOption { - type = with types; listOf str; - default = []; - }; - }; - }; - }; - - api = { - enable = mkEnableOption "tv.iptables"; - - accept-echo-request = mkOption { - type = with types; nullOr (enum ["internet" "retiolum"]); - default = "retiolum"; - }; - - input-internet-accept-tcp = mkOption { - type = with types; listOf (either int str); - default = []; - }; - - input-internet-accept-udp = mkOption { - type = with types; listOf (either int str); - default = []; - }; - - input-retiolum-accept-tcp = mkOption { - type = with types; listOf (either int str); - default = []; - }; - - input-retiolum-accept-udp = mkOption { - type = with types; listOf (either int str); - default = []; - }; - - input-wiregrill-accept-tcp = mkOption { - type = with types; listOf (either int str); - default = []; - }; - - input-wiregrill-accept-udp = mkOption { - type = with types; listOf (either int str); - default = []; - }; - - extra = mkOption { - default = {}; - type = extraTypes.rules; - }; - - extra4 = mkOption { - default = {}; - type = extraTypes.rules; - }; - - extra6 = mkOption { - default = {}; - type = extraTypes.rules; - }; - }; - - imp = { - networking.firewall.enable = false; - - systemd.services.tv-iptables = { - wantedBy = [ "sysinit.target" ]; - wants = [ "network-pre.target" ]; - before = [ "network-pre.target" ]; - after = [ "systemd-modules-load.service" ]; - - path = with pkgs; [ - iptables - ]; - - restartIfChanged = true; - - serviceConfig = { - Type = "simple"; - RemainAfterExit = true; - Restart = "always"; - SyslogIdentifier = "tv-iptables_start"; - ExecStart = pkgs.writeDash "tv-iptables_start" '' - set -euf - iptables-restore < ${rules 4} - ip6tables-restore < ${rules 6} - ''; - }; - - unitConfig.DefaultDependencies = false; - }; - }; - - formatTable = table: - (concatStringsSep "\n" - (mapAttrsToList - (chain: concatMapStringsSep "\n" (rule: "-A ${chain} ${rule}")) - table)); - - rules = iptables-version: let - accept-echo-request = { - ip4tables = "-p icmp -m icmp --icmp-type echo-request -j ACCEPT"; - ip6tables = "-p ipv6-icmp -m icmp6 --icmpv6-type echo-request -j ACCEPT"; - }."ip${toString iptables-version}tables"; - accept-tcp = port: "-p tcp -m tcp --dport ${port} -j ACCEPT"; - accept-udp = port: "-p udp -m udp --dport ${port} -j ACCEPT"; - in - pkgs.writeText "tv-iptables-rules${toString iptables-version}" '' - *nat - :PREROUTING ACCEPT [0:0] - :INPUT ACCEPT [0:0] - :OUTPUT ACCEPT [0:0] - :POSTROUTING ACCEPT [0:0] - ${formatTable cfg."extra${toString iptables-version}".nat} - ${formatTable cfg.extra.nat} - COMMIT - *filter - :INPUT DROP [0:0] - :FORWARD DROP [0:0] - :OUTPUT ACCEPT [0:0] - :Retiolum - [0:0] - :Wiregrill - [0:0] - ${concatMapStringsSep "\n" (rule: "-A INPUT ${rule}") ([] - ++ [ - "-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT" - "-i lo -j ACCEPT" - ] - ++ optional (cfg.accept-echo-request == "internet") accept-echo-request - ++ map accept-tcp (unique (map toString cfg.input-internet-accept-tcp)) - ++ map accept-udp (unique (map toString cfg.input-internet-accept-udp)) - ++ ["-i retiolum -j Retiolum"] - ++ ["-i wiregrill -j Wiregrill"] - )} - ${formatTable cfg.extra.filter} - ${formatTable cfg."extra${toString iptables-version}".filter} - ${concatMapStringsSep "\n" (rule: "-A Retiolum ${rule}") ([] - ++ optional (cfg.accept-echo-request == "retiolum") accept-echo-request - ++ map accept-tcp (unique (map toString cfg.input-retiolum-accept-tcp)) - ++ map accept-udp (unique (map toString cfg.input-retiolum-accept-udp)) - ++ { - ip4tables = [ - "-p tcp -j REJECT --reject-with tcp-reset" - "-p udp -j REJECT --reject-with icmp-port-unreachable" - "-j REJECT --reject-with icmp-proto-unreachable" - ]; - ip6tables = [ - "-p tcp -j REJECT --reject-with tcp-reset" - "-p udp -j REJECT --reject-with icmp6-port-unreachable" - "-j REJECT" - ]; - }."ip${toString iptables-version}tables" - )} - ${concatMapStringsSep "\n" (rule: "-A Wiregrill ${rule}") ([] - ++ optional (cfg.accept-echo-request == "wiregrill") accept-echo-request - ++ map accept-tcp (unique (map toString cfg.input-wiregrill-accept-tcp)) - ++ map accept-udp (unique (map toString cfg.input-wiregrill-accept-udp)) - ++ { - ip4tables = [ - "-p tcp -j REJECT --reject-with tcp-reset" - "-p udp -j REJECT --reject-with icmp-port-unreachable" - "-j REJECT --reject-with icmp-proto-unreachable" - ]; - ip6tables = [ - "-p tcp -j REJECT --reject-with tcp-reset" - "-p udp -j REJECT --reject-with icmp6-port-unreachable" - "-j REJECT" - ]; - }."ip${toString iptables-version}tables" - )} - COMMIT - ''; -} diff --git a/tv/3modules/lib b/tv/3modules/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/3modules/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/3modules/lidControl.nix b/tv/3modules/lidControl.nix deleted file mode 100644 index 6a48da18d..000000000 --- a/tv/3modules/lidControl.nix +++ /dev/null @@ -1,45 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - options = { - tv.lidControl.enable = mkEnableOption "tv.lidControl"; - }; - config = let - cfg = config.tv.lidControl; - in mkIf cfg.enable { - services.acpid.enable = true; - services.acpid.lidEventCommands = /* sh */ '' - set -- $1 - - # usage: vt_is_xserver NUMBER - vt_is_xserver() { - ${pkgs.iproute}/bin/ss -lp src unix:/tmp/.X11-unix/X* | - ${pkgs.gnused}/bin/sed -n 's|.*/tmp/.X11-unix/X\([0-9]\+\)\>.*|\1|p' | - ${pkgs.gnugrep}/bin/grep -Fqx "$1" - } - - console=$(${pkgs.kbd}/bin/fgconsole) - - if vt_is_xserver "$console"; then - # usage: run_on_display COMMAND [ARG...] - run_on_display() { - owner=$(${pkgs.coreutils}/bin/stat -c %u /tmp/.X11-unix/X$console) - ${pkgs.systemd}/bin/systemd-run -GPq \ - -E DISPLAY=:$console \ - --uid=$owner \ - "$@" - } - case $3 in - open) - run_on_display ${pkgs.xorg.xset}/bin/xset dpms force on - ;; - close) - run_on_display ${pkgs.xorg.xset}/bin/xset dpms force off - ;; - esac - fi - ''; - services.logind.lidSwitch = "ignore"; - services.logind.lidSwitchDocked = "ignore"; - services.logind.lidSwitchExternalPower = "ignore"; - }; -} diff --git a/tv/3modules/org.freedesktop.machine1.host-shell.nix b/tv/3modules/org.freedesktop.machine1.host-shell.nix deleted file mode 100644 index 7d31edf9d..000000000 --- a/tv/3modules/org.freedesktop.machine1.host-shell.nix +++ /dev/null @@ -1,29 +0,0 @@ -with import ./lib; -{ config, ... }: { - options.org.freedesktop.machine1.host-shell.access = lib.mkOption { - default = {}; - type = - lib.types.addCheck - (lib.types.attrsOf (lib.types.attrsOf lib.types.bool)) - (x: - lib.all - lib.types.username.check - (lib.concatLists - (lib.mapAttrsToList - (name: value: [name] ++ lib.attrNames value) - x))); - }; - config.security.polkit.extraConfig = let - cfg = config.org.freedesktop.machine1.host-shell; - enable = cfg.access != {}; - in lib.optionalString enable /* js */ '' - polkit.addRule(function () { - var access = ${lib.toJSON cfg.access}; - return function(action, subject) { - if (action.id === "org.freedesktop.machine1.host-shell" - && (access[subject.user]||{})[action.lookup("user")]) - return polkit.Result.YES; - } - }()); - ''; -} diff --git a/tv/3modules/slock.nix b/tv/3modules/slock.nix deleted file mode 100644 index a08303215..000000000 --- a/tv/3modules/slock.nix +++ /dev/null @@ -1,78 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - cfg = config.tv.slock; -in { - options.tv.slock = { - enable = mkEnableOption "tv.slock"; - package = mkOption { - default = pkgs.writeDashBin "slock" '' - set -efu - display=''${DISPLAY#:} - service=slock-$LOGNAME@$display.service - exec ${pkgs.systemd}/bin/systemctl start "$service" - ''; - type = types.package; - }; - user = mkOption { - type = types.user; - }; - }; - config = mkIf cfg.enable { - security.polkit.extraConfig = /* js */ '' - polkit.addRule(function(action, subject) { - if (action.id === "org.freedesktop.systemd1.manage-units" && - subject.user === ${toJSON cfg.user.name} && - /^slock-${cfg.user.name}@[0-9]+\.service$/.test(action.lookup("unit")) ) { - return polkit.Result.YES; - } - }); - ''; - systemd.services."slock-${cfg.user.name}@" = { - conflicts = [ - "picom@%i.target" - ]; - environment = { - DISPLAY = ":%I"; - LD_PRELOAD = pkgs.runCommandCC "slock-${cfg.user.name}.so" { - passAsFile = ["text"]; - text = /* c */ '' - #include - #include - - static struct spwd entry = { - .sp_namp = "", - .sp_pwdp = - ${toC config.users.users.${cfg.user.name}.hashedPassword}, - .sp_lstchg = 0, - .sp_min = 0, - .sp_max = 0, - .sp_warn = 0, - .sp_inact = 0, - .sp_expire = 0, - .sp_flag = 0, - }; - - extern struct spwd *getspnam(const char *name) { return &entry; } - extern int setgroups(size_t size, const gid_t *list) { return 0; } - extern int setgid(gid_t gid) { return 0; } - extern int setuid(uid_t uid) { return 0; } - ''; - } /* sh */ '' - gcc -Wall -shared -o $out -xc "$textPath" - ''; - }; - restartIfChanged = false; - serviceConfig = { - ExecStart = "${pkgs.slock}/bin/slock"; - ExecStopPost = - "+${pkgs.systemd}/bin/systemctl start xsession@%i.target"; - OOMScoreAdjust = -1000; - Restart = "on-failure"; - RestartSec = "100ms"; - StartLimitBurst = 0; - SyslogIdentifier = "slock"; - User = cfg.user.name; - }; - }; - }; -} diff --git a/tv/3modules/systemd.nix b/tv/3modules/systemd.nix deleted file mode 100644 index db8a51994..000000000 --- a/tv/3modules/systemd.nix +++ /dev/null @@ -1,47 +0,0 @@ -with import ./lib; -{ config, ... }: let - normalUsers = filterAttrs (_: getAttr "isNormalUser") config.users.users; -in { - options = { - tv.systemd.services = mkOption { - type = types.attrsOf (types.submodule (self: { - options = { - operators = mkOption { - type = with types; listOf (enum (attrNames normalUsers)); - default = []; - }; - }; - })); - default = {}; - }; - }; - config = { - security.polkit.extraConfig = let - access = - mapAttrs' - (name: cfg: - nameValuePair "${name}.service" - (genAttrs cfg.operators (const true)) - ) - config.tv.systemd.services; - in optionalString (access != {}) /* js */ '' - polkit.addRule(function () { - const access = ${lib.toJSON access}; - return function (action, subject) { - if (action.id === "org.freedesktop.systemd1.manage-units") { - const unit = action.lookup("unit"); - if ( - (access[unit]||{})[subject.user] || - ( - unit.includes("@") && - (access[unit.replace(/@[^.]+/, "@")]||{})[subject.user] - ) - ) { - return polkit.Result.YES; - } - } - } - }()); - ''; - }; -} diff --git a/tv/3modules/unbound.nix b/tv/3modules/unbound.nix deleted file mode 100644 index 6a5102753..000000000 --- a/tv/3modules/unbound.nix +++ /dev/null @@ -1,84 +0,0 @@ -{ config, lib, pkgs, ... }: { - options.tv.unbound = { - enable = lib.mkEnableOption "tv.unbound"; - DoH.enable = lib.mkEnableOption "tv.unbound.DoH"; - DoT.enable = lib.mkEnableOption "tv.unbound.DoT"; - host = lib.mkOption { - type = lib.types.str; - }; - useACMEHost = lib.mkOption { - type = lib.types.str; - }; - }; - imports = let - cfg = config.tv.unbound; - in [ - (lib.mkIf cfg.enable { - services.unbound = { - enable = true; - settings.server = { - access-control = [ - "::/0 allow" - "0.0.0.0/0 allow" - ]; - interface = [ - "127.0.0.1@53" - "retiolum@53" - "wiregrill@53" - ]; - prefetch = true; - prefetch-key = true; - }; - }; - # Since we use this for local dns resolving, we don't want to stop/start - # but just restart, so we quickly get it back. - systemd.services.unbound.stopIfChanged = false; - - tv.iptables.input-retiolum-accept-udp = [ "domain" ]; - tv.iptables.input-wiregrill-accept-udp = [ "domain" ]; - }) - (lib.mkIf cfg.DoH.enable (let - http-port = 8053; - http-endpoint = "/query"; - in { - services.unbound.package = pkgs.unbound-with-systemd.override { - withDoH = true; - }; - services.unbound.settings.server.interface = [ - "127.0.0.1@${toString http-port}" - ]; - services.unbound.settings.server = { - https-port = http-port; - http-endpoint = http-endpoint; - http-notls-downstream = true; - }; - services.nginx.virtualHosts.${cfg.host} = { - useACMEHost = cfg.useACMEHost; - forceSSL = true; - http2 = true; - locations."/".return = ''404 "Not Found\n"''; - locations.${http-endpoint}.extraConfig = '' - grpc_pass grpc://127.0.0.1:${toString http-port}; - ''; - }; - - tv.iptables.input-internet-accept-tcp = [ "https" ]; - })) - (lib.mkIf cfg.DoT.enable { - services.unbound.settings.server = { - interface = [ - "::@853" - "0.0.0.0@853" - ]; - tls-service-key = "/run/credentials/unbound.service/tls-service-key"; - tls-service-pem = "/run/credentials/unbound.service/tls-service-pem"; - }; - krebs.systemd.services.unbound.restartIfCredentialsChange = true; - systemd.services.unbound.serviceConfig.LoadCredential = [ - "tls-service-key:/var/lib/acme/${cfg.useACMEHost}/key.pem" - "tls-service-pem:/var/lib/acme/${cfg.useACMEHost}/fullchain.pem" - ]; - tv.iptables.input-internet-accept-tcp = [ "domain-s" ]; - }) - ]; -} diff --git a/tv/3modules/wwan.nix b/tv/3modules/wwan.nix deleted file mode 100644 index 0cdfbf36c..000000000 --- a/tv/3modules/wwan.nix +++ /dev/null @@ -1,182 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - options = { - tv.wwan.enable = mkEnableOption "tv.wwan"; - tv.wwan.apn = mkOption { - type = with types; filename; - }; - tv.wwan.device = mkOption { - type = with types; pathname; - default = "/dev/cdc-wdm0"; - }; - tv.wwan.interface = mkOption { - type = with types; nullOr filename; - default = null; - }; - tv.wwan.operators = mkOption { - type = with types; listOf username; - default = []; - }; - tv.wwan.secrets = mkOption { - type = with types; pathname; - default = "${config.krebs.secret.directory}/wwan.json"; - # format: {"pin1":number} - }; - }; - config = let - cfg = config.tv.wwan; - in mkIf cfg.enable { - nixpkgs.overlays = singleton (self: super: { - uqmi-wrapper = pkgs.symlinkJoin { - name = "uqmi-wrapper"; - paths = [ - (pkgs.writeDashBin "uqmi" '' - exec ${pkgs.uqmi}/bin/uqmi --device=${cfg.device} "$@" - '') - (pkgs.writeTextDir "share/bash-completion/completions/uqmi" /* sh */'' - _uqmi_complete() { - case ''${#COMP_WORDS[@]} in - 2) - COMPREPLY=($(compgen -W "$( - ${pkgs.uqmi}/bin/uqmi --help 2>&1 | - ${pkgs.coreutils}/bin/tr , \\n | - ${pkgs.gnused}/bin/sed -nr 's/^ *(-[a-z-]+).*/\1/p' - )" -- "''${COMP_WORDS[1]}")) - ;; - esac - } - complete -F _uqmi_complete uqmi - '') - pkgs.uqmi - ]; - }; - }); - systemd.services.wwan = { - environment = { - SECRETS = "%d/secrets"; - }; - path = [ - pkgs.busybox - pkgs.coreutils - pkgs.iproute2 - pkgs.jq - pkgs.uqmi-wrapper - (pkgs.writeDashBin "get-interface" ( - if cfg.interface != null then /* sh */ '' - echo ${cfg.interface} - '' else /* sh */ '' - exec ${pkgs.libqmi}/bin/qmicli -d ${cfg.device} -p --get-wwan-iface - '' - )) - ]; - serviceConfig = { - LoadCredential = [ - "secrets:${cfg.secrets}" - ]; - Type = "oneshot"; - RemainAfterExit = true; - SyslogIdentifier = "wwan"; - ExecStart = pkgs.writeDash "tv.wwan.start.sh" '' - set -efu - - interface=$(get-interface) - - pin1_status=$( - uqmi --uim-get-sim-state | - jq -r '"\(.pin1_status)/\(.pin1_verify_tries)"' - ) - case $pin1_status in - verified/*) - : - ;; - not_verified/3) - pin1=$(jq .pin1 "$SECRETS") - echo "verifying PIN1" >&2 - if ! uqmi --uim-verify-pin1 "$pin1"; then - echo "error: failed to verify PIN1" >&2 - exit 1 - fi - ;; - not_verified/*) - echo "error: not trying to verify PIN1: not enough tries left" >&2 - echo \ - "please check your configuration in ${cfg.secrets}" \ - " and verify if manually using:" \ - " ${pkgs.uqmi}/bin/uqmi -d $device --uim-veriy-pin1 XXXX" \ - >&2 - exit 1 - esac - - raw_ip_path=/sys/class/net/$interface/qmi/raw_ip - raw_ip=$(cat "$raw_ip_path") - if [ "$raw_ip" != Y ]; then - echo "enabling raw-ip" >&2 - if ! echo Y > "$raw_ip_path"; then - echo "error: failed to enable raw-ip" >&2 - exit 1 - fi - fi - - operating_mode=$(uqmi --get-device-operating-mode | tr -d \") - case $operating_mode in - online) - : - ;; - persistent_low_power|low_power) - echo "settings device operating mode to online" >&2 - uqmi --set-device-operating-mode online - operating_mode=$(uqmi --get-device-operating-mode | tr -d \") - if test "$operating_mode" != online; then - echo "error: failed to set device operating mode to online" >&2 - exit 1 - fi - ;; - *) - echo "error: don't know how to change device operating mode to online: $operating_mode" >&2 - exit 1 - esac - - ip link set dev "$interface" up - - data_status=$(uqmi --get-data-status | tr -d \") - case $data_status in - connected) - : - ;; - disconnected) - echo "starting network (APN=${cfg.apn})" >&2 - sleep 1 - uqmi \ - --start-network \ - --autoconnect \ - --apn ${cfg.apn} \ - --ip-family ipv4 - sleep 1 - ;; - *) - echo "error: unsupported data status: $data_status" >&2 - exit 1 - esac - - udhcpc -q -f -n -i "$interface" - ''; - Restart = "on-failure"; - ExecStop = pkgs.writeDash "tv.wwan.stop.sh" '' - set -efu - - interface=$(get-interface) - - ip addr flush "$interface" - ip link set dev "$interface" down - uqmi --stop-network 0xFFFFFFFF --autoconnect - uqmi --sync - uqmi --set-device-operating-mode persistent_low_power - ''; - }; - }; - users.users.root.packages = [ - pkgs.uqmi-wrapper - ]; - tv.systemd.services.wwan.operators = cfg.operators; - }; -} diff --git a/tv/3modules/x0vncserver.nix b/tv/3modules/x0vncserver.nix deleted file mode 100644 index c8e23d06e..000000000 --- a/tv/3modules/x0vncserver.nix +++ /dev/null @@ -1,45 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: let - cfg = config.tv.x0vncserver; -in { - options.tv.x0vncserver = { - display = mkOption { - default = ":${toString config.services.xserver.display}"; - type = types.str; - }; - enable = mkEnableOption "tv.x0vncserver"; - pwfile = mkOption { - default = "${config.krebs.secret.directory}/vncpasswd"; - description = '' - Use vncpasswd to edit pwfile. - See: nix-shell -p tigervnc --run 'man vncpasswd' - ''; - type = types.absolute-pathname; - }; - rfbport = mkOption { - default = 5900; - type = types.int; - }; - user = mkOption { - default = config.krebs.build.user; - type = types.user; - }; - }; - config = mkIf cfg.enable { - krebs.systemd.services.x0vncserver.restartIfCredentialsChange = true; - systemd.services.x0vncserver = { - after = [ "graphical.target" ]; - requires = [ "graphical.target" ]; - serviceConfig = { - ExecStart = "${pkgs.tigervnc}/bin/x0vncserver ${toString [ - "-display ${cfg.display}" - "-passwordfile \${CREDENTIALS_DIRECTORY}/pwfile" - "-rfbport ${toString cfg.rfbport}" - ]}"; - LoadCredential = "ssh_key:${cfg.pwfile}"; - User = cfg.user.name; - }; - }; - tv.iptables.input-retiolum-accept-tcp = singleton (toString cfg.rfbport); - }; -} diff --git a/tv/5pkgs/compat/default.nix b/tv/5pkgs/compat/default.nix deleted file mode 100644 index 0d1e61b3b..000000000 --- a/tv/5pkgs/compat/default.nix +++ /dev/null @@ -1 +0,0 @@ -self: super: {} diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix deleted file mode 100644 index 245d0542b..000000000 --- a/tv/5pkgs/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -with import ./lib; -let - pushBack = x: xs: - if elem x xs then - remove x xs ++ [ x ] - else - xs; -in - -self: super: - -# Import files and subdirectories like they are overlays. -fix - (foldl' (flip extends) (_: super) - (map - (name: import (./. + "/${name}")) - (pushBack "override" - (attrNames - (filterAttrs isNixDirEntry (readDir ./.)))))) diff --git a/tv/5pkgs/haskell/default.nix b/tv/5pkgs/haskell/default.nix deleted file mode 100644 index 193a2630d..000000000 --- a/tv/5pkgs/haskell/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -with import ./lib; -let - overrides = self: super: - mapNixDir (path: self.callPackage path {}) [ - - ./. - ] // { - xmonad-tv = self.callPackage ./xmonad-tv { - pager = self.desktop-pager; - }; - }; -in - self: super: { - haskell = super.haskell // { - packages = mapAttrs (name: value: - if hasAttr "override" value - then value.override (old: { - overrides = - composeExtensions (old.overrides or (_: _: { })) overrides; - }) - else value - ) super.haskell.packages; - }; - haskellPackages = super.haskellPackages.override (old: { - overrides = - composeExtensions (old.overrides or (_: _: { })) overrides; - }); - } diff --git a/tv/5pkgs/haskell/lib b/tv/5pkgs/haskell/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/5pkgs/haskell/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/5pkgs/haskell/th-env/default.nix b/tv/5pkgs/haskell/th-env/default.nix deleted file mode 100644 index 158fb165a..000000000 --- a/tv/5pkgs/haskell/th-env/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ mkDerivation, base, lib, template-haskell, text }: -mkDerivation { - pname = "th-env"; - version = "1.0.0"; - src = ./.; - libraryHaskellDepends = [ base template-haskell text ]; - homepage = "https://stackoverflow.com/q/57635686"; - license = "unknown"; - hydraPlatforms = lib.platforms.none; -} diff --git a/tv/5pkgs/haskell/th-env/src/THEnv.hs b/tv/5pkgs/haskell/th-env/src/THEnv.hs deleted file mode 100644 index b04f2ce0b..000000000 --- a/tv/5pkgs/haskell/th-env/src/THEnv.hs +++ /dev/null @@ -1,49 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} -module THEnv - ( - -- * Compile-time configuration - lookupCompileEnv - , lookupCompileEnvExp - , getCompileEnv - , getCompileEnvExp - , fileAsString - ) where - -import Control.Monad -import qualified Data.Text as T -import qualified Data.Text.IO as T -import Language.Haskell.TH -import Language.Haskell.TH.Syntax (Lift(..)) -import System.Environment (getEnvironment) - --- Functions that work with compile-time configuration - --- | Looks up a compile-time environment variable. -lookupCompileEnv :: String -> Q (Maybe String) -lookupCompileEnv key = lookup key `liftM` runIO getEnvironment - --- | Looks up a compile-time environment variable. The result is a TH --- expression of type @Maybe String@. -lookupCompileEnvExp :: String -> Q Exp -lookupCompileEnvExp = (`sigE` [t| Maybe String |]) . lift <=< lookupCompileEnv - -- We need to explicly type the result so that things like `print Nothing` - -- work. - --- | Looks up an compile-time environment variable and fail, if it's not --- present. -getCompileEnv :: String -> Q String -getCompileEnv key = - lookupCompileEnv key >>= - maybe (fail $ "Environment variable " ++ key ++ " not defined") return - --- | Looks up an compile-time environment variable and fail, if it's not --- present. The result is a TH expression of type @String@. -getCompileEnvExp :: String -> Q Exp -getCompileEnvExp = lift <=< getCompileEnv - --- | Loads the content of a file as a string constant expression. --- The given path is relative to the source directory. -fileAsString :: FilePath -> Q Exp -fileAsString = do - -- addDependentFile path -- works only with template-haskell >= 2.7 - stringE . T.unpack . T.strip <=< runIO . T.readFile diff --git a/tv/5pkgs/haskell/th-env/th-env.cabal b/tv/5pkgs/haskell/th-env/th-env.cabal deleted file mode 100644 index b9a2cff39..000000000 --- a/tv/5pkgs/haskell/th-env/th-env.cabal +++ /dev/null @@ -1,20 +0,0 @@ -name: th-env -version: 1.0.0 --- license: https://creativecommons.org/licenses/by-sa/4.0/ -license: OtherLicense -author: https://stackoverflow.com/users/9348482 -homepage: https://stackoverflow.com/q/57635686 -maintainer: tv -build-type: Simple -cabal-version: >=1.10 - -library - hs-source-dirs: src - build-depends: - base, - template-haskell, - text - exposed-modules: - THEnv - default-language: Haskell2010 - ghc-options: -O2 -Wall diff --git a/tv/5pkgs/haskell/xmonad-tv/default.nix b/tv/5pkgs/haskell/xmonad-tv/default.nix deleted file mode 100644 index f42f97c2a..000000000 --- a/tv/5pkgs/haskell/xmonad-tv/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ mkDerivation, aeson, base, bytestring, containers, directory -, extra, filepath, lib, pager, unix, X11, xmonad, xmonad-contrib -}: -mkDerivation { - pname = "xmonad-tv"; - version = "1.0.0"; - src = ./src; - isLibrary = false; - isExecutable = true; - executableHaskellDepends = [ - aeson base bytestring containers directory extra filepath pager - unix X11 xmonad xmonad-contrib - ]; - license = lib.licenses.mit; - mainProgram = "xmonad"; -} diff --git a/tv/5pkgs/haskell/xmonad-tv/shell.nix b/tv/5pkgs/haskell/xmonad-tv/shell.nix deleted file mode 100644 index 6ca00bc05..000000000 --- a/tv/5pkgs/haskell/xmonad-tv/shell.nix +++ /dev/null @@ -1,83 +0,0 @@ -{ compiler ? "default" }: let - - stockholm = import ; - - inherit (stockholm.systems.${lib.krops.getHostName}) config pkgs; - inherit (stockholm) lib; - - haskellPackages = - if compiler == "default" - then pkgs.haskellPackages - else pkgs.haskell.packages.${compiler}; - - xmonadDrv = haskellPackages.callPackage (import ./.) {}; - -in - - lib.overrideDerivation xmonadDrv.env (oldAttrs: { - shellHook = '' - pkg_name=${lib.shell.escape (lib.baseNameOf (toString ./.))} - - WORKDIR=${toString ./src} - CACHEDIR=$HOME/tmp/$pkg_name - HISTFILE=$CACHEDIR/bash_history - - mkdir -p "$CACHEDIR" - - config_XMONAD_CACHE_DIR=${lib.shell.escape - config.systemd.services.xmonad.environment.XMONAD_CACHE_DIR - } - - xmonad=$CACHEDIR/xmonad-${lib.currentSystem} - - xmonad_build() {( - set -efu - cd "$WORKDIR" - options=$( - ${pkgs.cabal-read}/bin/ghc-options "$WORKDIR/$pkg_name.cabal" xmonad - ) - ghc $options \ - -odir "$CACHEDIR" \ - -hidir "$CACHEDIR" \ - -o "$xmonad" \ - main.hs - )} - - xmonad_restart() {( - set -efu - cd "$WORKDIR" - if systemctl --quiet is-active xmonad; then - sudo systemctl stop xmonad - cp -b "$config_XMONAD_CACHE_DIR"/xmonad.state "$CACHEDIR"/ - echo "xmonad.state: $(cat "$CACHEDIR"/xmonad.state)" - else - "$xmonad" --shutdown || : - fi - "$xmonad" & - echo xmonad pid: $! >&2 - )} - - xmonad_yield() {( - set -efu - if ! systemctl --quiet is-active xmonad; then - "$xmonad" --shutdown - cp -b "$CACHEDIR"/xmonad.state "$config_XMONAD_CACHE_DIR"/ - sudo systemctl start xmonad - else - echo "xmonad.service is already running" >&2 - exit -1 - fi - )} - - export PATH=${config.systemd.services.xmonad.path}:$PATH - export SHELL=/run/current-system/sw/bin/bash - - export XMONAD_CACHE_DIR="$CACHEDIR" - export XMONAD_DATA_DIR="$CACHEDIR" - export XMONAD_CONFIG_DIR=/var/empty - - unset XMONAD_STARTUP_HOOK - - cd "$WORKDIR" - ''; - }) diff --git a/tv/5pkgs/haskell/xmonad-tv/src/Shutdown.hs b/tv/5pkgs/haskell/xmonad-tv/src/Shutdown.hs deleted file mode 100644 index d4a4d93cf..000000000 --- a/tv/5pkgs/haskell/xmonad-tv/src/Shutdown.hs +++ /dev/null @@ -1,113 +0,0 @@ -{-# LANGUAGE LambdaCase #-} - -module Shutdown - ( newShutdownEventHandler - , shutdown - ) - where - -import Control.Applicative ((<|>), empty) -import Control.Concurrent (threadDelay) -import Control.Monad (forever, guard, when) -import Data.Monoid (All(All)) -import System.Directory (XdgDirectory(XdgData), createDirectoryIfMissing, doesFileExist, getAppUserDataDirectory, getXdgDirectory) -import System.Exit (exitSuccess) -import System.Environment (lookupEnv) -import System.FilePath (()) -import System.IO.Error (isDoesNotExistError, tryIOError) -import System.IO (hPutStrLn, stderr) -import System.Posix.Process (getProcessID) -import System.Posix.Signals (nullSignal, signalProcess) -import System.Posix.Types (ProcessID) -import XMonad hiding (getXMonadDataDir) - - --- XXX this is for compatibility with both xmonad<0.17 and xmonad>=0.17 -getXMonadDataDir :: IO String -getXMonadDataDir = xmEnvDir <|> xmDir <|> xdgDir - where - -- | Check for xmonad's environment variables first - xmEnvDir :: IO String - xmEnvDir = - maybe empty pure =<< lookupEnv "XMONAD_DATA_DIR" - - -- | Check whether the config file or a build script is in the - -- @~\/.xmonad@ directory - xmDir :: IO String - xmDir = do - d <- getAppUserDataDirectory "xmonad" - conf <- doesFileExist $ d "xmonad.hs" - build <- doesFileExist $ d "build" - pid <- doesFileExist $ d "xmonad.pid" - - -- Place *everything* in ~/.xmonad if yes - guard $ conf || build || pid - pure d - - -- | Use XDG directories as a fallback - xdgDir :: IO String - xdgDir = do - d <- getXdgDirectory XdgData "xmonad" - d <$ createDirectoryIfMissing True d - - -newShutdownEventHandler :: IO (Event -> X All) -newShutdownEventHandler = do - writeProcessIDToFile - return handleShutdownEvent - -handleShutdownEvent :: Event -> X All -handleShutdownEvent = \case - ClientMessageEvent { ev_message_type = mt } -> do - isShutdownEvent <- (mt ==) <$> getAtom "XMONAD_SHUTDOWN" - when isShutdownEvent $ do - broadcastMessage ReleaseResources - writeStateToFile - io exitSuccess >> return () - return (All (not isShutdownEvent)) - _ -> - return (All True) - -sendShutdownEvent :: IO () -sendShutdownEvent = do - dpy <- openDisplay "" - rw <- rootWindow dpy $ defaultScreen dpy - a <- internAtom dpy "XMONAD_SHUTDOWN" False - allocaXEvent $ \e -> do - setEventType e clientMessage - setClientMessageEvent e rw a 32 0 currentTime - sendEvent dpy rw False structureNotifyMask e - sync dpy False - -shutdown :: IO () -shutdown = do - pid <- readProcessIDFromFile - sendShutdownEvent - hPutStrLn stderr ("waiting for: " <> show pid) - result <- tryIOError (waitProcess pid) - if isSuccess result - then hPutStrLn stderr ("result: " <> show result <> " [AKA success^_^]") - else hPutStrLn stderr ("result: " <> show result) - where - isSuccess = either isDoesNotExistError (const False) - -waitProcess :: ProcessID -> IO () -waitProcess pid = forever (signalProcess nullSignal pid >> threadDelay 10000) - --- --- PID file stuff --- - -getProcessIDFileName :: IO FilePath -getProcessIDFileName = ( "xmonad.pid") <$> getXMonadDataDir - -writeProcessIDToFile :: IO () -writeProcessIDToFile = do - pidFileName <- getProcessIDFileName - pid <- getProcessID - writeFile pidFileName (show pid) - -readProcessIDFromFile :: IO ProcessID -readProcessIDFromFile = do - pidFileName <- getProcessIDFileName - read <$> readFile pidFileName diff --git a/tv/5pkgs/haskell/xmonad-tv/src/XMonad/Extra.hs b/tv/5pkgs/haskell/xmonad-tv/src/XMonad/Extra.hs deleted file mode 100644 index 74222712d..000000000 --- a/tv/5pkgs/haskell/xmonad-tv/src/XMonad/Extra.hs +++ /dev/null @@ -1,14 +0,0 @@ -module XMonad.Extra where - -import XMonad -import qualified Data.Map as Map -import qualified XMonad.StackSet as W - - -isFloating :: Window -> WindowSet -> Bool -isFloating w = - Map.member w . W.floating - -isFloatingX :: Window -> X Bool -isFloatingX w = - isFloating w <$> gets windowset diff --git a/tv/5pkgs/haskell/xmonad-tv/src/XMonad/Hooks/EwmhDesktops/Extra.hs b/tv/5pkgs/haskell/xmonad-tv/src/XMonad/Hooks/EwmhDesktops/Extra.hs deleted file mode 100644 index bf8431446..000000000 --- a/tv/5pkgs/haskell/xmonad-tv/src/XMonad/Hooks/EwmhDesktops/Extra.hs +++ /dev/null @@ -1,117 +0,0 @@ -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE MultiWayIf #-} -{-# LANGUAGE NamedFieldPuns #-} - -module XMonad.Hooks.EwmhDesktops.Extra where - -import Control.Monad (when) -import Data.Maybe (fromMaybe) -import Data.Monoid (All) -import Data.Tuple.Extra (both) -import Graphics.X11.EWMH (getDesktopNames, setDesktopNames) -import Graphics.X11.EWMH.Atom (_NET_DESKTOP_NAMES) -import Graphics.X11.Xlib.Display.Extra (withDefaultDisplay) -import XMonad hiding (workspaces) -import XMonad.Actions.DynamicWorkspaces (addHiddenWorkspace, removeEmptyWorkspaceByTag) -import XMonad.StackSet (mapWorkspace, tag, workspaces) -import XMonad.Util.WorkspaceCompare (getSortByIndex) -import qualified Data.Map.Strict as Map -import qualified Data.Set as Set -import qualified XMonad - - -ewmhExtra :: XConfig a -> IO (XConfig a) -ewmhExtra c = do - -- XMonad.Hooks.EwmhDesktops.setDesktopViewport uses _NET_DESKTOP_VIEWPORT - -- only if it exists. This seems to be a harmless issue, but by creating - -- the atom here, we suppress the error message: - -- - -- xmonad: X11 error: BadAtom (invalid Atom parameter), - -- request code=18, error code=5 - -- - _ <- - withDefaultDisplay $ \dpy -> internAtom dpy "_NET_DESKTOP_VIEWPORT" False - - initialWorkspaces <- - Data.Maybe.fromMaybe (XMonad.workspaces def) - <$> withDefaultDisplay getDesktopNames - - return - c { handleEventHook = ewmhDesktopsExtraEventHook <> handleEventHook c - , rootMask = rootMask c .|. propertyChangeMask - , XMonad.workspaces = initialWorkspaces - } - -ewmhDesktopsExtraEventHook :: Event -> X All -ewmhDesktopsExtraEventHook = \case - PropertyEvent{ev_window, ev_atom} -> do - r <- asks theRoot - when (ev_window == r && ev_atom == _NET_DESKTOP_NAMES) $ - withDisplay $ \dpy -> do - sort <- getSortByIndex - - oldNames <- gets $ map tag . sort . workspaces . windowset - newNames <- fromMaybe oldNames <$> io (getDesktopNames dpy) - - let - (renamesFrom, renamesTo) = both Set.fromList $ unzip renames - - renames = go oldNames newNames where - go old@(headOld : tailOld) new@(headNew : tailNew) = do - let - deleteOld = Set.member headOld deleteNameSet - createNew = Set.member headNew createNameSet - - if - | headOld == headNew -> - -- assert (not deleteOld && not createNew) - go tailOld tailNew - - | deleteOld && createNew -> - (headOld, headNew) : - go tailOld tailNew - - | deleteOld -> - go tailOld new - - | createNew -> - go old tailNew - - | otherwise -> - -- assert (headOld == headNew) - go tailOld tailNew - - go _ _ = [] - - oldNameSet = Set.fromList oldNames - newNameSet = Set.fromList newNames - deleteNameSet = Set.difference oldNameSet newNameSet - createNameSet = Set.difference newNameSet oldNameSet - - deleteNames = Set.toAscList $ - Set.difference deleteNameSet renamesFrom - createNames = Set.toAscList $ - Set.difference createNameSet renamesTo - - mapM_ addHiddenWorkspace createNames - mapM_ removeEmptyWorkspaceByTag deleteNames - when (not (null renames)) $ do - let - renameMap = Map.fromList renames - rename w = - case Map.lookup (tag w) renameMap of - Just newName -> w { tag = newName } - Nothing -> w - - modifyWindowSet $ mapWorkspace rename - - names <- gets $ map tag . sort . workspaces . windowset - - when (names /= newNames) $ do - trace $ "setDesktopNames " <> show names - io (setDesktopNames names dpy) - - mempty - - _ -> - mempty diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs deleted file mode 100644 index 7256963a5..000000000 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ /dev/null @@ -1,227 +0,0 @@ -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE PatternSynonyms #-} - -module Main (main) where - -import System.Exit (exitFailure) -import XMonad.Hooks.EwmhDesktops (ewmh) -import XMonad.Hooks.EwmhDesktops.Extra (ewmhExtra) -import XMonad.Hooks.RefocusLast (refocusLastLayoutHook, toggleFocus) - -import Control.Monad.Extra (whenJustM) -import qualified Data.Aeson -import qualified Data.ByteString.Char8 -import qualified Data.List -import qualified Data.Maybe -import Graphics.X11.ExtraTypes.XF86 -import XMonad -import XMonad.Extra (isFloatingX) -import System.IO (hPutStrLn, stderr) -import System.Environment (getArgs, getEnv, getEnvironment, lookupEnv) -import System.Posix.Process (executeFile) -import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace - , removeEmptyWorkspace) -import XMonad.Actions.CycleWS (toggleWS) -import XMonad.Layout.Gaps (Direction2D(U,R,D,L), gaps) -import XMonad.Layout.NoBorders ( smartBorders ) -import XMonad.Layout.ResizableTile (ResizableTall(ResizableTall)) -import XMonad.Layout.ResizableTile (MirrorResize(MirrorExpand,MirrorShrink)) -import XMonad.Layout.StateFull (pattern StateFull) -import qualified XMonad.Prompt -import qualified XMonad.StackSet as W -import Data.Map (Map) -import qualified Data.Map as Map -import XMonad.Hooks.UrgencyHook - ( BorderUrgencyHook(BorderUrgencyHook,urgencyBorderColor) - , RemindWhen(Dont) - , SuppressWhen(Never) - , UrgencyConfig(UrgencyConfig,remindWhen,suppressWhen) - , withUrgencyHookC - ) -import XMonad.Hooks.ManageHelpers (doCenterFloat,doRectFloat) -import Data.Ratio -import XMonad.Hooks.Place (placeHook, smart) -import XMonad.Actions.PerWorkspaceKeys (chooseAction) - -import Shutdown (shutdown, newShutdownEventHandler) - - -main :: IO () -main = getArgs >>= \case - [] -> mainNoArgs - ["--shutdown"] -> shutdown - args -> hPutStrLn stderr ("bad arguments: " <> show args) >> exitFailure - - -(=??) :: Query a -> (a -> Bool) -> Query Bool -(=??) x p = fmap p x - -readEnv :: Data.Aeson.FromJSON b => String -> IO b -readEnv name = - readEnv' (error $ "could not get environment variable: " <> name) name - -readEnv' :: Data.Aeson.FromJSON b => b -> String -> IO b -readEnv' defaultValue name = - Data.Maybe.fromMaybe defaultValue - . Data.Aeson.decodeStrict' - . Data.ByteString.Char8.pack - . Data.Maybe.fromMaybe mempty - <$> lookupEnv name - -mainNoArgs :: IO () -mainNoArgs = do - myScreenGaps <- readEnv' [] "XMONAD_SCREEN_GAPS" :: IO [Int] - myScreenWidth <- readEnv "XMONAD_SCREEN_WIDTH" :: IO Dimension - myTermFont <- getEnv "XMONAD_TERM_FONT" - myTermFontWidth <- readEnv "XMONAD_TERM_FONT_WIDTH" :: IO Dimension - myTermPadding <- readEnv "XMONAD_TERM_PADDING" :: IO Dimension - handleShutdownEvent <- newShutdownEventHandler - config <- - ewmhExtra - $ ewmh - $ withUrgencyHookC - BorderUrgencyHook - { urgencyBorderColor = "#ff0000" - } - UrgencyConfig - { remindWhen = Dont - , suppressWhen = Never - } - $ def - { terminal = {-pkg:alacritty-tv-}"alacritty" - , modMask = mod4Mask - , keys = myKeys myTermFont - , layoutHook = - refocusLastLayoutHook $ - gaps (zip [U,R,D,L] myScreenGaps) $ - smartBorders $ - ResizableTall - 1 - (fromIntegral (10 * myTermFontWidth) / fromIntegral myScreenWidth) - (fromIntegral (80 * myTermFontWidth + 2 * (myTermPadding + borderWidth def)) / fromIntegral myScreenWidth) - [] - ||| - StateFull - , manageHook = - composeAll - [ appName =? "fzmenu-urxvt" --> doCenterFloat - , appName =?? Data.List.isPrefixOf "pinentry" --> doCenterFloat - , appName =?? Data.List.isInfixOf "Float" --> doCenterFloat - , title =? "Upload to Imgur" --> - doRectFloat (W.RationalRect 0 0 (1 % 8) (1 % 8)) - , placeHook (smart (1,0)) - ] - , startupHook = - whenJustM (io (lookupEnv "XMONAD_STARTUP_HOOK")) - (\path -> forkFile path [] Nothing) - , normalBorderColor = "#1c1c1c" - , focusedBorderColor = "#f000b0" - , handleEventHook = handleShutdownEvent - } - directories <- getDirectories - launch config directories - - -forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X () -forkFile path args env = - xfork (executeFile path True args env) >> return () - - -spawnRootTerm :: X () -spawnRootTerm = - forkFile - {-pkg:alacritty-tv-}"alacritty" - ["--profile=root", "-e", "/run/wrappers/bin/su", "-"] - Nothing - - -myKeys :: String -> XConfig Layout -> Map (KeyMask, KeySym) (X ()) -myKeys font conf = Map.fromList $ - [ ((_4 , xK_Escape ), forkFile {-pkg-}"slock" [] Nothing) - , ((_4S , xK_c ), kill) - - , ((_4 , xK_o ), forkFile {-pkg:fzmenu-}"otpmenu" [] Nothing) - , ((_4 , xK_p ), forkFile {-pkg:fzmenu-}"passmenu" [] Nothing) - - , ((_4 , xK_x ), forkFile {-pkg:alacritty-tv-}"alacritty" ["--singleton"] Nothing) - , ((_4C , xK_x ), spawnRootTerm) - - , ((_C , xK_Menu ), toggleWS) - - , ((_4 , xK_space ), withFocused $ \w -> ifM (isFloatingX w) xdeny $ sendMessage NextLayout) - , ((_4M , xK_space ), withFocused $ \w -> ifM (isFloatingX w) xdeny $ resetLayout) - - , ((_4 , xK_l ), toggleFocus) - - , ((_4 , xK_m ), windows W.focusMaster) - , ((_4 , xK_j ), windows W.focusDown) - , ((_4 , xK_k ), windows W.focusUp) - - , ((_4S , xK_m ), windows W.swapMaster) - , ((_4S , xK_j ), windows W.swapDown) - , ((_4S , xK_k ), windows W.swapUp) - - , ((_4M , xK_h ), sendMessage Shrink) - , ((_4M , xK_l ), sendMessage Expand) - - , ((_4M , xK_j ), sendMessage MirrorShrink) - , ((_4M , xK_k ), sendMessage MirrorExpand) - - , ((_4 , xK_t ), withFocused $ windows . W.sink) - - , ((_4 , xK_comma ), sendMessage $ IncMasterN 1) - , ((_4 , xK_period ), sendMessage $ IncMasterN (-1)) - - , ((_4 , xK_a ), addWorkspacePrompt promptXPConfig) - , ((_4 , xK_r ), renameWorkspace promptXPConfig) - , ((_4 , xK_Delete ), removeEmptyWorkspace) - - , ((_4 , xK_Return ), toggleWS) - - , ((0, xF86XK_AudioLowerVolume), audioLowerVolume) - , ((0, xF86XK_AudioRaiseVolume), audioRaiseVolume) - , ((0, xF86XK_AudioMute), audioMute) - , ((0, xF86XK_AudioMicMute), audioMicMute) - , ((_4, xF86XK_AudioMute), pavucontrol []) - - , ((_4, xK_Prior), forkFile {-pkg-}"xcalib" ["-invert", "-alter"] Nothing) - - , ((0, xK_Print), forkFile {-pkg:flameshot-once-tv-}"flameshot-once" [] Nothing) - - , ((_C, xF86XK_Forward), forkFile {-pkg:xdpytools-}"xdpychvt" ["next"] Nothing) - , ((_C, xF86XK_Back), forkFile {-pkg:xdpytools-}"xdpychvt" ["prev"] Nothing) - ] - where - _4 = mod4Mask - _C = controlMask - _S = shiftMask - _M = mod1Mask - _4C = _4 .|. _C - _4S = _4 .|. _S - _4M = _4 .|. _M - _4CM = _4 .|. _C .|. _M - _4SM = _4 .|. _S .|. _M - - amixer args = forkFile {-pkg:alsaUtils-}"amixer" args Nothing - pavucontrol args = forkFile {-pkg-}"pavucontrol" args Nothing - - audioLowerVolume = amixer ["-q", "sset", "Master", "5%-"] - audioRaiseVolume = amixer ["-q", "sset", "Master", "5%+"] - audioMute = amixer ["-q", "sset", "Master", "toggle"] - audioMicMute = amixer ["-q", "sset", "Capture", "toggle"] - - resetLayout = setLayout $ XMonad.layoutHook conf - - promptXPConfig = - def { XMonad.Prompt.font = font } - - xdeny = - forkFile - {-pkg-}"xterm" - [ "-fn", font - , "-geometry", "300x100" - , "-name", "AlertFloat" - , "-bg", "#E4002B" - , "-e", "sleep", "0.05" - ] - Nothing diff --git a/tv/5pkgs/haskell/xmonad-tv/src/xmonad-tv.cabal b/tv/5pkgs/haskell/xmonad-tv/src/xmonad-tv.cabal deleted file mode 100644 index f211627bf..000000000 --- a/tv/5pkgs/haskell/xmonad-tv/src/xmonad-tv.cabal +++ /dev/null @@ -1,29 +0,0 @@ -name: xmonad-tv -version: 1.0.0 -license: MIT -author: tv -maintainer: tv -build-type: Simple -cabal-version: >=1.10 - -executable xmonad - main-is: main.hs - build-depends: - base - , X11 - , aeson - , bytestring - , containers - , directory - , extra - , filepath - , pager - , unix - , xmonad - , xmonad-contrib - other-modules: - Shutdown - XMonad.Extra - XMonad.Hooks.EwmhDesktops.Extra - default-language: Haskell2010 - ghc-options: -O2 -Wall diff --git a/tv/5pkgs/lib b/tv/5pkgs/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/5pkgs/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/5pkgs/override/alacritty.nix b/tv/5pkgs/override/alacritty.nix deleted file mode 100644 index f864fff63..000000000 --- a/tv/5pkgs/override/alacritty.nix +++ /dev/null @@ -1,16 +0,0 @@ -self: super: - -super.alacritty.overrideAttrs (old: - if self.lib.versions.majorMinor old.version == "0.12" then - { - version = "${old.version}-tv"; - src = self.fetchFromGitHub { - owner = "4z3"; - repo = "alacritty"; - rev = "touchscreen-support-0.12"; - hash = "sha256-yDG7IeQUmJhKMJebhMDzHLb3UHGLcO1FVZnmGe5Xr9w="; - }; - } - else - builtins.trace "not overriding alacritty because unsupported version" {} -) diff --git a/tv/5pkgs/override/anbox.nix b/tv/5pkgs/override/anbox.nix deleted file mode 100644 index 394061733..000000000 --- a/tv/5pkgs/override/anbox.nix +++ /dev/null @@ -1,72 +0,0 @@ -self: super: - -# https://github.com/NixOS/nixpkgs/pull/125600 -super.anbox.overrideAttrs (old: - assert old.version == "unstable-2020-11-29"; - rec { - version = "unstable-2021-05-26"; - - src = self.fetchFromGitHub { - owner = old.pname; - repo = old.pname; - rev = "ad377ff25354d68b76e2b8da24a404850f8514c6"; - sha256 = "1bj07ixwbkli4ycjh41mnqdbsjz9haiwg2nhf9anbi29z1d0819w"; - fetchSubmodules = true; - }; - - postPatch = old.patchPhase; - - # patchPhase() from - # TODO patchPhase = default.patchPhase; or something - patchPhase = '' - runHook prePatch - - for i in ''${patches:-}; do - header "applying patch $i" 3 - local uncompress=cat - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac - # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.) - # shellcheck disable=SC2086 - $uncompress < "$i" 2>&1 | patch ''${patchFlags:--p1} - done - - runHook postPatch - ''; - - patches = [ - # Fixes compatibility with lxc 4 - (self.fetchpatch { - url = "https://git.alpinelinux.org/aports/plain/community/anbox/lxc4.patch?id=64243590a16aee8d4e72061886fc1b15256492c3"; - sha256 = "1da5xyzyjza1g2q9nbxb4p3njj2sf3q71vkpvmmdphia5qnb0gk5"; - }) - # Wait 10× more time when starting - # Not *strictly* needed, but helps a lot on slower hardware - (self.fetchpatch { - url = "https://git.alpinelinux.org/aports/plain/community/anbox/give-more-time-to-start.patch?id=058b56d4b332ef3379551b343bf31e0f2004321a"; - sha256 = "0iiz3c7fgfgl0dvx8sf5hv7a961xqnihwpz6j8r0ib9v8piwxh9a"; - }) - # Ensures generated desktop files work on store path change - (self.fetchpatch { - url = "https://raw.githubusercontent.com/NixOS/nixpkgs/fdf7b4be1a659ed8b96586c2fc8ff90850e25feb/pkgs/os-specific/linux/anbox/0001-NixOS-Use-anbox-from-PATH-in-desktop-files.patch"; - sha256 = "173z84g1r8h367a2dgk6945is6vxg4j1hs2hkfd3m3bbpwfw9221"; - }) - # Provide window icons - (self.fetchpatch { - url = "https://github.com/samueldr/anbox/commit/2387f4fcffc0e19e52e58fb6f8264fbe87aafe4d.patch"; - sha256 = "12lmr0kxw1n68g3abh1ak5awmpczfh75c26f53jc8qpvdvv1ywha"; - }) - ]; -}) diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix deleted file mode 100644 index 87b7ce929..000000000 --- a/tv/5pkgs/override/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -with import ./lib; -self: super: - -mapNixDir (path: import path self super) ./. diff --git a/tv/5pkgs/override/fzf/complete1.patch b/tv/5pkgs/override/fzf/complete1.patch deleted file mode 100644 index 3e3f2c4d5..000000000 --- a/tv/5pkgs/override/fzf/complete1.patch +++ /dev/null @@ -1,77 +0,0 @@ -commit 57cbd76c068121b685399fdb4649e7ba537983d6 -Author: tv -Date: Mon Dec 5 15:24:30 2022 +0100 - - Add --complete-1 option - -diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 -index 79e7291..3b8a753 100644 ---- a/man/man1/fzf.1 -+++ b/man/man1/fzf.1 -@@ -685,6 +685,9 @@ interactive finder and automatically select the only match - If there is no match for the initial query (\fB--query\fR), do not start - interactive finder and exit immediately - .TP -+.B "--complete-1" -+Exit interactive finder when there's exactly one match -+.TP - .BI "-f, --filter=" "STR" - Filter mode. Do not start interactive finder. When used with \fB--no-sort\fR, - fzf becomes a fuzzy-version of grep. -diff --git a/src/core.go b/src/core.go -index 2ddddc3..09afff2 100644 ---- a/src/core.go -+++ b/src/core.go -@@ -337,8 +337,14 @@ func Run(opts *Options, version string, revision string) { - } - determine(val.final) - } -+ } else { -+ if opts.Complete1 && val.Length() == 1 { -+ opts.Printer(val.Get(0).item.AsString(opts.Ansi)) -+ terminal.reqBox.Set(reqClose, nil) -+ } else { -+ terminal.UpdateList(val, clearSelection()) -+ } - } -- terminal.UpdateList(val, clearSelection()) - } - } - } -diff --git a/src/options.go b/src/options.go -index 5400311..1e38fe4 100644 ---- a/src/options.go -+++ b/src/options.go -@@ -108,6 +108,7 @@ const usage = `usage: fzf [options] - -1, --select-1 Automatically select the only match - -0, --exit-0 Exit immediately when there's no match - -f, --filter=STR Filter mode. Do not start interactive finder. -+ --complete-1 Exit interactive finder when there's exactly one match - --print-query Print query as the first line - --expect=KEYS Comma-separated list of keys to complete fzf - --read0 Read input delimited by ASCII NUL characters -@@ -274,6 +275,7 @@ type Options struct { - Query string - Select1 bool - Exit0 bool -+ Complete1 bool - Filter *string - ToggleSort bool - Expect map[tui.Event]string -@@ -342,6 +344,7 @@ func defaultOptions() *Options { - Query: "", - Select1: false, - Exit0: false, -+ Complete1: false, - Filter: nil, - ToggleSort: false, - Expect: make(map[tui.Event]string), -@@ -1546,6 +1549,8 @@ func parseOptions(opts *Options, allArgs []string) { - opts.Exit0 = true - case "+0", "--no-exit-0": - opts.Exit0 = false -+ case "--complete-1": -+ opts.Complete1 = true - case "--read0": - opts.ReadZero = true - case "--no-read0": diff --git a/tv/5pkgs/override/fzf/default.nix b/tv/5pkgs/override/fzf/default.nix deleted file mode 100644 index 2254d455a..000000000 --- a/tv/5pkgs/override/fzf/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -self: super: - -super.fzf.overrideAttrs (old: { - patches = old.patches or [] ++ [ - ./complete1.patch - ]; -}) diff --git a/tv/5pkgs/override/gitAndTools.nix b/tv/5pkgs/override/gitAndTools.nix deleted file mode 100644 index a460773b8..000000000 --- a/tv/5pkgs/override/gitAndTools.nix +++ /dev/null @@ -1,5 +0,0 @@ -self: super: - -super.gitAndTools // { - inherit (self) diff-so-fancy; -} diff --git a/tv/5pkgs/override/input-fonts.nix b/tv/5pkgs/override/input-fonts.nix deleted file mode 100644 index 6ee7afac1..000000000 --- a/tv/5pkgs/override/input-fonts.nix +++ /dev/null @@ -1,13 +0,0 @@ -self: super: - -super.input-fonts.overrideAttrs (old: rec { - src = self.fetchzip { - url = "http://xu.r/~tv/mirrors/input-fonts/Input-Font-2.zip"; - sha256 = "1q58x92nm7dk9ylp09pvgj74nxkywvqny3xmfighnsl30dv42fcr"; - stripRoot = false; - }; - sourceRoot = null; - outputHash = null; - outputHashAlgo = null; - outputHashMode = null; -}) diff --git a/tv/5pkgs/override/iosevka-tv-1.nix b/tv/5pkgs/override/iosevka-tv-1.nix deleted file mode 100644 index 880160b3e..000000000 --- a/tv/5pkgs/override/iosevka-tv-1.nix +++ /dev/null @@ -1,20 +0,0 @@ -self: super: - -let - srcpkg = super.iosevka-tv-1; - binpkg = self.fetchzip { - inherit (srcpkg) pname version; - stripRoot = false; - hash = "sha256-QIuTS70vUQSvDDXjY4uI6SCcu1XT4HjvzpthvrNX4h0="; - urls = [ - "https://c.krebsco.de/${srcpkg.name}.tar.gz" - "https://ni.krebsco.de/~tv/mirrors/iosevka/${srcpkg.name}.tar.gz" - ]; - }; -in - -if srcpkg.version == binpkg.version then - binpkg - -else - srcpkg diff --git a/tv/5pkgs/override/iosevka-tv-2.nix b/tv/5pkgs/override/iosevka-tv-2.nix deleted file mode 100644 index 2eecf3cff..000000000 --- a/tv/5pkgs/override/iosevka-tv-2.nix +++ /dev/null @@ -1,20 +0,0 @@ -self: super: - -let - srcpkg = super.iosevka-tv-2; - binpkg = self.fetchzip { - inherit (srcpkg) pname version; - stripRoot = false; - hash = "sha256-PuIrW1ftYD5PW4du6gq1XpUM3v0potwmj+vAxJImF/A="; - urls = [ - "https://c.krebsco.de/${srcpkg.name}.tar.gz" - "https://ni.krebsco.de/~tv/mirrors/iosevka/${srcpkg.name}.tar.gz" - ]; - }; -in - -if srcpkg.version == binpkg.version then - binpkg - -else - srcpkg diff --git a/tv/5pkgs/override/jc.nix b/tv/5pkgs/override/jc.nix deleted file mode 100644 index 346dd3eee..000000000 --- a/tv/5pkgs/override/jc.nix +++ /dev/null @@ -1,21 +0,0 @@ -self: super: - -let - version = "1.21.0"; -in - -# Prevent downgrades. -assert self.lib.versionAtLeast version super.jc.version; - -self.python3.pkgs.toPythonApplication - (self.python3.pkgs.jc.overrideAttrs - (oldAttrs: { - name = "jc-${version}"; - version = version; - src = self.fetchFromGitHub { - owner = "kellyjonbrazil"; - repo = "jc"; - rev = "v${version}"; - sha256 = "sha256-kS42WokR7ZIqIPi8LbX4tmtjn37tckea2ELbuqzTm2o"; - }; - })) diff --git a/tv/5pkgs/override/lib b/tv/5pkgs/override/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/5pkgs/override/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/5pkgs/override/uqmi.nix b/tv/5pkgs/override/uqmi.nix deleted file mode 100644 index 1eaecbd67..000000000 --- a/tv/5pkgs/override/uqmi.nix +++ /dev/null @@ -1,10 +0,0 @@ -self: super: - -super.uqmi.overrideAttrs (old: { - version = "unstable-2022-05-04"; - src = self.fetchgit { - url = "https://git.openwrt.org/project/uqmi.git"; - rev = "56cb2d4056fef132ccf78dfb6f3074ae5d109992"; - hash = "sha256-PwnR24PbNKfLrsBlU5JTOHDzs/9Wgcuwfnu3dJuuZcM="; - }; -}) diff --git a/tv/5pkgs/rpi/433Utils/RPi_utils.codesend.codestring.patch b/tv/5pkgs/rpi/433Utils/RPi_utils.codesend.codestring.patch deleted file mode 100644 index 447e42f1d..000000000 --- a/tv/5pkgs/rpi/433Utils/RPi_utils.codesend.codestring.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/RPi_utils/codesend.cpp -+++ b/RPi_utils/codesend.cpp -@@ -40,18 +40,18 @@ int main(int argc, char *argv[]) { - } - - // Change protocol and pulse length accroding to parameters -- int code = atoi(argv[1]); -+ const char *code = argv[1]; - if (argc >= 3) protocol = atoi(argv[2]); - if (argc >= 4) pulseLength = atoi(argv[3]); - - if (wiringPiSetup () == -1) return 1; -- printf("sending code[%i]\n", code); -+ printf("sending code[%s]\n", code); - RCSwitch mySwitch = RCSwitch(); - if (protocol != 0) mySwitch.setProtocol(protocol); - if (pulseLength != 0) mySwitch.setPulseLength(pulseLength); - mySwitch.enableTransmit(PIN); - -- mySwitch.send(code, 24); -+ mySwitch.send(code); - - return 0; - diff --git a/tv/5pkgs/rpi/433Utils/default.nix b/tv/5pkgs/rpi/433Utils/default.nix deleted file mode 100644 index 136e3dbca..000000000 --- a/tv/5pkgs/rpi/433Utils/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ fetchFromGitHub, lib, stdenv -, wiringPi ? WiringPi.wiringPi -, wiringPiDev ? WiringPi.wiringPiDev -, WiringPi ? rpiPackages.WiringPi -, rpiPackages -}: - -stdenv.mkDerivation { - pname = "433Utils-RPi_utils"; - version = "2018-06-07"; - - src = fetchFromGitHub (lib.importJSON ./src.json); - - patches = [ - ./rc-switch.protocols.patch - ./RPi_utils.codesend.codestring.patch - ]; - - buildPhase = '' - runHook postBuild - - make -C RPi_utils - - runHook preBuild - ''; - - buildInputs = [ - wiringPi - wiringPiDev - ]; - - installPhase = '' - runHook preInstall - - mkdir -p $out/bin - for name in send codesend RFSniffer; do - cp RPi_utils/$name $out/bin/ - done - - runHook postInstall - ''; -} diff --git a/tv/5pkgs/rpi/433Utils/rc-switch.protocols.patch b/tv/5pkgs/rpi/433Utils/rc-switch.protocols.patch deleted file mode 100644 index 41304ef8e..000000000 --- a/tv/5pkgs/rpi/433Utils/rc-switch.protocols.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/rc-switch/RCSwitch.cpp -+++ b/rc-switch/RCSwitch.cpp -@@ -78,6 +78,7 @@ static const RCSwitch::Protocol PROGMEM proto[] = { - { 100, { 30, 71 }, { 4, 11 }, { 9, 6 } }, // protocol 3 - { 380, { 1, 6 }, { 1, 3 }, { 3, 1 } }, // protocol 4 - { 500, { 6, 14 }, { 1, 2 }, { 2, 1 } }, // protocol 5 -+ { 136, { 1, 31 }, { 1, 3 }, { 3, 1 } }, // protocol 6 - }; - - enum { diff --git a/tv/5pkgs/rpi/433Utils/src.json b/tv/5pkgs/rpi/433Utils/src.json deleted file mode 100644 index 3cf232788..000000000 --- a/tv/5pkgs/rpi/433Utils/src.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "owner": "ninjablocks", - "repo": "433Utils", - "rev": "31c0ea4e158287595a6f6116b6151e72691e1839", - "sha256": "04r2qlkdsz46qgpnbizrfccz1i0qlkb1iqz0jzyq4fzvksqp9dg1", - "fetchSubmodules": true -} \ No newline at end of file diff --git a/tv/5pkgs/rpi/WiringPi/default.nix b/tv/5pkgs/rpi/WiringPi/default.nix deleted file mode 100644 index 40fcaeae4..000000000 --- a/tv/5pkgs/rpi/WiringPi/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ fetchFromGitHub, lib, runCommand, stdenv }: - -let - generic = name: extraAttrs: - stdenv.mkDerivation ({ - pname = "WiringPi-${name}"; - version = "2020-09-14"; - - src = fetchFromGitHub (lib.importJSON ./src.json); - - buildPhase = '' - runHook postBuild - - make -C ${name} all - - runHook preBuild - ''; - - installPhase = '' - runHook preInstall - - export DESTDIR=$out - export PREFIX= - export LDCONFIG=true - - make -C ${name} install - - runHook postInstall - ''; - } // extraAttrs); - - fakeutils = runCommand "fakeutils-1.0" {} /* sh */ '' - mkdir -p $out/bin - for name in chown chmod; do - touch $out/bin/$name - chmod +x $out/bin/$name - done - ''; -in - -rec { - wiringPi = generic "wiringPi" {}; - wiringPiDev = generic "devLib" { - buildInputs = [ - wiringPi - ]; - }; - gpio = generic "gpio" { - preInstall = '' - # fakeutils cannot be buildInputs because they have to override existing - # executables and therefore need to be prepended to the search path. - PATH=${fakeutils}/bin:$PATH - - mkdir -p $out/bin - ''; - buildInputs = [ - wiringPi - wiringPiDev - ]; - }; -} diff --git a/tv/5pkgs/rpi/WiringPi/src.json b/tv/5pkgs/rpi/WiringPi/src.json deleted file mode 100644 index edf4e8272..000000000 --- a/tv/5pkgs/rpi/WiringPi/src.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "owner": "WiringPi", - "repo": "WiringPi", - "rev": "5c6bab7d4279e8c0cc890984eaa1a69ff3af1c99", - "sha256": "1jlx7lb3ybwv06b2dpmsr718d0xj85awl1dgdqc607k50kk25mjb" -} diff --git a/tv/5pkgs/rpi/default.nix b/tv/5pkgs/rpi/default.nix deleted file mode 100644 index e41d6373f..000000000 --- a/tv/5pkgs/rpi/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -with import ./lib; - -self: super: - -{ - rpiPackages = lib.mapNixDir (path: self.callPackage path {}) ./.; -} diff --git a/tv/5pkgs/rpi/lib b/tv/5pkgs/rpi/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/5pkgs/rpi/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix deleted file mode 100644 index ddf2ca8df..000000000 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ /dev/null @@ -1,152 +0,0 @@ -{ pkgs -, variant ? "x220" -}: - -let - lib = import ./lib; - font-size = arg: { - program = "${pkgs.font-size-alacritty}/bin/font-size-alacritty"; - args = [arg]; - }; - configs.default = lib.recursiveUpdate variants.${variant} { - bell.animation = "EaseOut"; - bell.duration = 50; - bell.color = "#ff00ff"; - colors.cursor.cursor = "#f042b0"; - colors.primary.background = "#202020"; - colors.primary.foreground = "#d0d7d0"; - colors.normal.black = "#000000"; - colors.normal.red = "#cd0000"; - colors.normal.green = "#00cd00"; - colors.normal.yellow = "#bc7004"; - colors.normal.blue = "#4343be"; - colors.normal.magenta = "#cb06cb"; - colors.normal.cyan = "#04c9c9"; - colors.normal.white = "#bebebe"; - colors.bright.black = "#727272"; - colors.bright.red = "#fb6262"; - colors.bright.green = "#72fb72"; - colors.bright.yellow = "#fbfb72"; - colors.bright.blue = "#7272fb"; - colors.bright.magenta = "#fb53fb"; - colors.bright.cyan = "#72fbfb"; - colors.bright.white = "#fbfbfb"; - draw_bold_text_with_bright_colors = true; - hints.enabled = [ - { - regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\s{-}\\^⟨⟩`]+"; - mouse.enabled = true; - post_processing = true; - action = "Select"; - } - ]; - scrolling.multiplier = 8; - }; - configs.root = lib.recursiveUpdate configs.default { - colors.primary.background = "#230000"; - colors.primary.foreground = "#e0c0c0"; - colors.normal.black = "#800000"; - }; - configs.fzmenu = lib.recursiveUpdate configs.default { - colors.primary.background = "#2A172A"; - window.dimensions.columns = 70; - window.dimensions.lines = 9; - }; - variants.hidpi = { - font.normal.family = "iosevka tv 2 Light"; - font.italic.family = "iosevka tv 2 Light"; - font.bold.family = "iosevka tv 2 Medium"; - font.bold_italic.family = "iosevka tv 2 Medium"; - font.size = 5; - key_bindings = [ - { key = "Up"; mods = "Control"; action = "IncreaseFontSize"; } - { key = "Down"; mods = "Control"; action = "DecreaseFontSize"; } - { key = "Down"; mods = "Shift|Control"; action = "ResetFontSize"; } - ]; - }; - variants.x220 = { - font.normal.family = "Clean"; - font.bold.family = "Clean"; - font.bold.style = "Regular"; - font.size = 10; - key_bindings = [ - { key = "Up"; mods = "Shift|Control"; command = font-size "=14"; } - { key = "Up"; mods = "Control"; command = font-size "+1"; } - { key = "Down"; mods = "Control"; command = font-size "-1"; } - { key = "Down"; mods = "Shift|Control"; command = font-size "=0"; } - ]; - }; - writeProfile = name: config: let - config-file = - assert lib.types.filename.check name; - pkgs.writeJSON "alacritty-tv-${name}.json" config; - in pkgs.writeText "alacritty-tv-${name}.profile" /* sh */ '' - # Use home so Alacritty can find the configuration without arguments. - # HOME will be reset once in Alacritty. - HOME=$XDG_RUNTIME_DIR/Alacritty-${name} - export HOME - - # Tell Alacritty via XDG_RUNTIME_DIR where to create sockets. - # XDG_RUNTIME_DIR needs to be reset manually. - export ALACRITTY_XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" - export BASH_EXTRA_INIT=${pkgs.writeDash "alacritty-tv.cleanup.sh" '' - XDG_RUNTIME_DIR=$ALACRITTY_XDG_RUNTIME_DIR - unset ALACRITTY_XDG_RUNTIME_DIR - unset BASH_EXTRA_INIT - ''} - export XDG_RUNTIME_DIR="$HOME" - - # Install stored configuration if it has changed. - # This allows for both declarative updates and runtime modifications. - # rust-xdg requires XDG_RUNTIME_DIR to be secure: - # https://docs.rs/xdg/2.4.1/src/xdg/lib.rs.html#311 - ${pkgs.coreutils}/bin/mkdir -m 0700 -p "$HOME" - ref=$(! test -e "$HOME"/ref || ${pkgs.coreutils}/bin/cat "$HOME"/ref) - if test "$ref" != ${config-file}; then - echo ${config-file} > "$HOME"/ref - ${pkgs.coreutils}/bin/install -m 644 ${config-file} "$HOME"/.alacritty.yml - fi - ''; -in - -pkgs.symlinkJoin { - name = "alacritty-tv"; - paths = [ - (pkgs.writeDashBin "alacritty" '' - # usage: - # alacritty [--profile=PROFILE] [--singleton] [ARGS...] - # where - # PROFILE one of ${lib.toJSON (lib.attrNames configs)} - - set -efu - - case ''${1-} in - ${lib.concatMapStringsSep "\n" (name: /* sh */ '' - --${lib.shell.escape name}|--profile=${lib.shell.escape name}) - shift - profile=${writeProfile name configs.${name}} - ;; - '') (lib.attrNames configs)} - *) - profile=${writeProfile "default" configs.default} - ;; - esac - - - case ''${1-} in - --singleton) - shift - if ! ${pkgs.alacritty}/bin/alacritty msg create-window "$@"; then - . "$profile" - ${pkgs.alacritty}/bin/alacritty "$@" & - fi - ;; - *) - . "$profile" - exec ${pkgs.alacritty}/bin/alacritty "$@" - ;; - esac - '') - pkgs.alacritty - ]; -} diff --git a/tv/5pkgs/simple/bash-fzf-history.nix b/tv/5pkgs/simple/bash-fzf-history.nix deleted file mode 100644 index 1166ec7fd..000000000 --- a/tv/5pkgs/simple/bash-fzf-history.nix +++ /dev/null @@ -1,102 +0,0 @@ -with import ./lib; -{ pkgs - -, edit-key ? "ctrl-e" -, exec-key ? "enter" -, edit-mark ? "${mark-prefix}${edit-key}" -, exec-mark ? "${mark-prefix}${exec-key}" -, edit-command ? "\"\"" -, exec-command ? "accept-line" -, mark-prefix ? " #FZFKEY:" -, finish-keyseq ? "\\C-x\\C-p" -, rebind-keyseq ? "\\C-x\\C-o" - -, start-keyseq ? "\\C-f" -, load-keyseq ? start-keyseq -}: let - script = pkgs.writeBash "bash-fzf-history.sh" '' - if ! command -v fzf >/dev/null; then - # Alternatively rewrite ${pkgs.fzf}/share/fzf/* to use absolute paths. - fzf() { - ${pkgs.fzf}/bin/fzf "$@" - } - fi - - . ${pkgs.fzf}/share/fzf/key-bindings.bash - . ${pkgs.fzf}/share/fzf/completion.bash - - FZF_DEFAULT_OPTS='${toString [ - /* sh */ "--height=40%" - /* sh */ "--inline-info" - /* sh */ "--min-height=4" - /* sh */ "--reverse" - ]}' - - __fzf_history__() ( - IFS=$'\n' - result=( $( - # To add "unknown timestamps" to each line of the history: - # sed -i '/^#[0-9]/{n;b};s/^/#1\n/' "$HISTFILE" - HISTTIMEFORMAT=$'\e[38;5;244m%Y-%m-%dT%H:%M:%S\e[m ' history | - ${pkgs.gnused}/bin/sed ' - s/\(\x1b\[[0-9;]*\)244m1970-[0-9T:-]*/\1237m????-??-??T??:??:??/ - ' | - FZF_DEFAULT_OPTS="${toString [ - /* sh */ "--ansi" - /* sh */ "--tac" - /* sh */ "--sync" - /* sh */ "-n2..,.." - /* sh */ "--tiebreak=index" - /* sh */ "--bind=ctrl-r:toggle-sort" - /* sh */ "--expect=${edit-key},${exec-key}" - /* sh */ "$FZF_DEFAULT_OPTS" - /* sh */ "+m" - ]}" \ - ${pkgs.fzf}/bin/fzf | - ${pkgs.gnused}/bin/sed ' - /^ *[0-9]/{ - s/^ *// - s/ \+/\n/;# index - s/ \+/\n/;# date - } - ' - ) ) - if test -n "$result"; then - key=''${result[0]} - index=''${result[1]} - date=''${result[2]} - command=''${result[3]} - - echo "$command${mark-prefix}$key" - else - # Ensure no empty new line gets produced when fzf was aborted. - echo '${edit-mark}' - fi - ) - - __fzf_rebind_finish_keyseq__() { - local suffix= - case $READLINE_LINE in - *'${edit-mark}') - suffix='${edit-mark}' - bind '"${finish-keyseq}": ${edit-command}' - ;; - *'${exec-mark}') - suffix='${exec-mark}' - bind '"${finish-keyseq}": ${exec-command}' - ;; - esac - READLINE_LINE=${"\${READLINE_LINE:0:-\${#suffix}}"} - } - bind -x '"${rebind-keyseq}": __fzf_rebind_finish_keyseq__' - - bind '"\C-r": reverse-search-history' - bind '"${start-keyseq}": " \C-e\C-u\C-y\ey\C-u`__fzf_history__`\e\C-e\er\e^${rebind-keyseq}${finish-keyseq}"' - - echo '# fzf key bindings loaded:' >&2 - bind -s | ${pkgs.gnugrep}/bin/grep __fzf_ >&2 - ''; -in - script.overrideAttrs (old: rec { - bind = /* sh */ ''bind -x '"${load-keyseq}": . ${script}' ''; - }) diff --git a/tv/5pkgs/simple/cr.nix b/tv/5pkgs/simple/cr.nix deleted file mode 100644 index 048d77953..000000000 --- a/tv/5pkgs/simple/cr.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs }: - -pkgs.writeDashBin "cr" '' - set -efu - if test -n "''${XDG_RUNTIME_DIR-}"; then - cache_dir=$XDG_RUNTIME_DIR/chromium-disk-cache - else - cache_dir=/tmp/chromium-disk-cache_$LOGNAME - fi - export LC_TIME=de_DE.utf8 - exec ${pkgs.chromium}/bin/chromium \ - --ssl-version-min=tls1 \ - --disk-cache-dir="$cache_dir" \ - --disk-cache-size=50000000 \ - "$@" -'' diff --git a/tv/5pkgs/simple/default.nix b/tv/5pkgs/simple/default.nix deleted file mode 100644 index 82a19a9b1..000000000 --- a/tv/5pkgs/simple/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -with import ./lib; - -self: super: - -let - # This callPackage will try to detect obsolete overrides. - callPackage = path: args: let - override = self.callPackage path args; - upstream = optionalAttrs (override ? "name") - (super.${(parseDrvName override.name).name} or {}); - in if upstream ? "name" && - override ? "name" && - compareVersions upstream.name override.name != -1 - then trace "Upstream `${upstream.name}' gets overridden by `${override.name}'." override - else override; -in - - mapNixDir (path: callPackage path {}) ./. diff --git a/tv/5pkgs/simple/diff-so-fancy.nix b/tv/5pkgs/simple/diff-so-fancy.nix deleted file mode 100644 index d57e6e75c..000000000 --- a/tv/5pkgs/simple/diff-so-fancy.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ fetchFromGitHub, lib, stdenv -, coreutils, git, makeWrapper, ncurses, perl -}: - -stdenv.mkDerivation rec { - name = "diff-so-fancy-${version}"; - version = "ed8cf17"; - - src = fetchFromGitHub { - owner = "so-fancy"; - repo = "diff-so-fancy"; - rev = "ed8cf1763d38bdd79ceb55a73b9ce7e30f1e184d"; - sha256 = "176qn0w2rn6mr5ymvkblyiznqq7yyibfsnnjfivcyhz69w6yr9r9"; - }; - - # Perl is needed here for patchShebangs - nativeBuildInputs = [ perl makeWrapper ]; - - buildPhase = null; - - installPhase = '' - mkdir -p $out/bin $out/lib/diff-so-fancy - - # diff-so-fancy executable searches for it's library relative to - # itself, so we are copying executable to lib, and only symlink it - # from bin/ - cp diff-so-fancy $out/lib/diff-so-fancy - cp -r lib $out/lib/diff-so-fancy - ln -s $out/lib/diff-so-fancy/diff-so-fancy $out/bin - - # ncurses is needed for `tput` - wrapProgram $out/lib/diff-so-fancy/diff-so-fancy \ - --prefix PATH : "${git}/share/git/contrib/diff-highlight" \ - --prefix PATH : "${git}/bin" \ - --prefix PATH : "${coreutils}/bin" \ - --prefix PATH : "${ncurses.out}/bin" - ''; - - meta = with lib; { - homepage = https://github.com/so-fancy/diff-so-fancy; - description = "Good-looking diffs filter for git"; - license = licenses.mit; - platforms = platforms.all; - longDescription = '' - diff-so-fancy builds on the good-lookin' output of git contrib's - diff-highlight to upgrade your diffs' appearances. - ''; - maintainers = with maintainers; [ fpletz ]; - }; -} diff --git a/tv/5pkgs/simple/disko.nix b/tv/5pkgs/simple/disko.nix deleted file mode 100644 index de8f1df22..000000000 --- a/tv/5pkgs/simple/disko.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ fetchgit }: - -let - src = fetchgit { - url = https://cgit.krebsco.de/disko; - rev = "16cd458af06d3caf687eb7d80ca3df26b71fe28c"; - sha256 = "16cd458af06d3caf687eb7d80ca3df26b71fe28c"; - }; -in - -{ - lib = import "${src}/lib"; -} diff --git a/tv/5pkgs/simple/editor-input.nix b/tv/5pkgs/simple/editor-input.nix deleted file mode 100644 index 931179af6..000000000 --- a/tv/5pkgs/simple/editor-input.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs }: -pkgs.writeDashBin "editor-input" '' - exec \ - ${pkgs.utillinux}/bin/setsid -f \ - ${pkgs.with-tmpdir}/bin/with-tmpdir -t editor-input.XXXXXXXX \ - ${pkgs.writeDash "editor-input.sh" '' - f=$TMPDIR/input - ${pkgs.rxvt_unicode}/bin/urxvt -name editor-input-urxvt -e \ - ${pkgs.vim}/bin/vim --cmd ':set noeol binary' -c startinsert "$f" - if test -e "$f"; then - ${pkgs.xsel}/bin/xsel -ip < "$f" - ${pkgs.xsel}/bin/xsel -ib < "$f" - ${pkgs.xdotool}/bin/xdotool key --clearmodifiers shift+Insert - ${pkgs.xsel}/bin/xsel -dp - ${pkgs.xsel}/bin/xsel -db - fi - ''} -'' diff --git a/tv/5pkgs/simple/ff.nix b/tv/5pkgs/simple/ff.nix deleted file mode 100644 index b6022c6ca..000000000 --- a/tv/5pkgs/simple/ff.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs }: - -pkgs.writeDashBin "ff" '' - case $TOUCHSCREEN in 1) - export MOZ_USE_XINPUT2=1 - esac - exec ${pkgs.firefox}/bin/firefox "$@" -'' diff --git a/tv/5pkgs/simple/field.nix b/tv/5pkgs/simple/field.nix deleted file mode 100644 index 71362398d..000000000 --- a/tv/5pkgs/simple/field.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ gawk, writeDashBin }: - -writeDashBin "field" '' - set -u - exec ${gawk}/bin/awk -v n="$1" '{print$n}' -'' diff --git a/tv/5pkgs/simple/flameshot-once-tv.nix b/tv/5pkgs/simple/flameshot-once-tv.nix deleted file mode 100644 index e3a9f9a4f..000000000 --- a/tv/5pkgs/simple/flameshot-once-tv.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ pkgs }: - -pkgs.flameshot-once.override { - name = "flameshot-once-tv"; - config.imgur.enable = true; - config.imgur.createUrl = "http://ni.r/image"; - config.imgur.deleteUrl = "http://ni.r/image/delete/%1"; - config.imgur.xdg-open.browser = "/etc/profiles/per-user/tv/bin/cr"; - config.settings.General = { - autoCloseIdleDaemon = true; - buttons = [ - "TYPE_ARROW" - "TYPE_CIRCLE" - "TYPE_CIRCLECOUNT" - "TYPE_COPY" - "TYPE_DRAWER" - "TYPE_IMAGEUPLOADER" - "TYPE_MARKER" - "TYPE_MOVESELECTION" - "TYPE_PENCIL" - "TYPE_PIXELATE" - "TYPE_RECTANGLE" - "TYPE_SAVE" - "TYPE_SELECTION" - "TYPE_TEXT" - ]; - checkForUpdates = false; - contrastOpacity = 220; - copyPathAfterSave = true; - disabledTrayIcon = true; - drawColor = "#E4002B"; - drawThickness = 8; - filenamePattern = "%FT%T%z_flameshot"; - fontFamily = "iosevka tv 2"; - savePath = "/tmp"; - savePathFixed = true; - showDesktopNotification = false; - showHelp = false; - showSidePanelButton = false; - showStartupLaunchMessage = false; - squareMagnifier = true; - uploadWithoutConfirmation = true; - }; - config.settings.Shortcuts = { - TYPE_COPY = "Return"; - TYPE_TOGGLE_PANEL = "`"; - }; -} diff --git a/tv/5pkgs/simple/font-size-alacritty.nix b/tv/5pkgs/simple/font-size-alacritty.nix deleted file mode 100644 index d37f0f055..000000000 --- a/tv/5pkgs/simple/font-size-alacritty.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ pkgs }: - -pkgs.writeDashBin "font-size-alacritty" '' - # usage: font-size-alacritty (+N|-N|=N) - # Increase by, decrease by, or set font size to the value N. - - set -efu - - min_size=5 - - op=''${1%%[0-9]*} - op=''${op:-=} - - value=''${1#[=+-]} - - window_id=$(${pkgs.xdotool}/bin/xdotool getactivewindow) - - current_size=$( - ${pkgs.xorg.xprop}/bin/xprop -notype -id $window_id FONT_SIZE | - ${pkgs.gnused}/bin/sed -rn 's/.* = ([0-9]+)$/\1/p' - ) - - # usage: set_font_size WINDOW_ID FONT_SIZE - set_font_size() { - ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$2 - ${pkgs.xorg.xprop}/bin/xprop -id $1 -f FONT_SIZE 32c -set FONT_SIZE $2 - } - - # usage: reset_font_size WINDOW_ID - reset_font_size() { - ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$min_size - ${pkgs.xorg.xprop}/bin/xprop -id $1 -remove FONT_SIZE - } - - # usage: make_next_size - make_next_size() { - case $op in - -) next_size=$(expr $current_size - $value) ;; - =) next_size=$value ;; - +) - next_size=$(expr $current_size + $value) - test $next_size -ge $min_size || next_size=$min_size - ;; - esac - } - - if test -z "$current_size"; then - current_size=0 - make_next_size - if test $next_size -ge $min_size; then - ${pkgs.alacritty}/bin/alacritty msg config -w $window_id \ - font.normal.family='Input Mono' \ - font.normal.style=Condensed \ - font.bold.family='Input Mono' \ - font.bold.style=Bold - set_font_size $window_id $next_size - fi - else - make_next_size - if test $next_size -ge $min_size; then - set_font_size $window_id $next_size - else - ${pkgs.alacritty}/bin/alacritty msg config -w $window_id -r - reset_font_size $window_id - fi - fi -'' diff --git a/tv/5pkgs/simple/fzmenu/bin/otpmenu b/tv/5pkgs/simple/fzmenu/bin/otpmenu deleted file mode 100755 index 273a408e6..000000000 --- a/tv/5pkgs/simple/fzmenu/bin/otpmenu +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/sh -set -efu - -#PATH= - -case ${FZMENU_PHASE-0} in - 0) - export FZMENU_PHASE=1 - exec setsid -f terminal dash "$0" - ;; - 1) - if result=$( - PASSWORD_STORE_DIR=${PASSWORD_STORE_DIR-$HOME/.password-store} - FZF_DEFAULT_OPTS=${FZMENU_FZF_DEFAULT_OPTS-} - if test -n "$FZF_DEFAULT_OPTS"; then - export FZF_DEFAULT_OPTS - fi - find -L "$PASSWORD_STORE_DIR" -type f -name 'otp.gpg' | - awk -F / -v PASSWORD_STORE_DIR="$PASSWORD_STORE_DIR" ' - { n = length(PASSWORD_STORE_DIR "/") } - $NF == "otp.gpg" { - print substr($0, 1 + n, length($0)-length("/otp.gpg")-n) - } - ' | - exec fzf \ - --history=/dev/null \ - --no-sort \ - --prompt='OTP: ' \ - ) - then - export FZMENU_PHASE=2 - export FZMENU_RESULT="$result" - setsid -f "$0" - fi - ;; - 2) - pass=$(pass otp code "$FZMENU_RESULT/otp") - printf %s "$pass" | - xdotool type -f - - ;; - *) - echo "$0: error: bad phase: $FZMENU_PHASE" >&2 - exit -1 -esac diff --git a/tv/5pkgs/simple/fzmenu/bin/passmenu b/tv/5pkgs/simple/fzmenu/bin/passmenu deleted file mode 100755 index 76153f53e..000000000 --- a/tv/5pkgs/simple/fzmenu/bin/passmenu +++ /dev/null @@ -1,45 +0,0 @@ -#! /bin/sh -set -efu - -#PATH= - -case ${FZMENU_PHASE-0} in - 0) - export FZMENU_PHASE=1 - exec setsid -f terminal dash "$0" - ;; - 1) - if result=$( - PASSWORD_STORE_DIR=${PASSWORD_STORE_DIR-$HOME/.password-store} - FZF_DEFAULT_OPTS=${FZMENU_FZF_DEFAULT_OPTS-} - if test -n "$FZF_DEFAULT_OPTS"; then - export FZF_DEFAULT_OPTS - fi - find -L "$PASSWORD_STORE_DIR" -type f -name '*.gpg' | - awk -F / -v PASSWORD_STORE_DIR="$PASSWORD_STORE_DIR" ' - { n = length(PASSWORD_STORE_DIR "/") } - $NF == "otp.gpg" { next } - /.*\.gpg$/ { - print substr($0, 1 + n, length($0)-length(".gpg")-n) - } - ' | - exec fzf \ - --history=/dev/null \ - --no-sort \ - --prompt='pass: ' \ - ) - then - export FZMENU_PHASE=2 - export FZMENU_RESULT="$result" - setsid -f "$0" - fi - ;; - 2) - pass=$(pass show "$FZMENU_RESULT") - printf %s "$pass" | - xdotool type -f - - ;; - *) - echo "$0: error: bad phase: $FZMENU_PHASE" >&2 - exit -1 -esac diff --git a/tv/5pkgs/simple/fzmenu/default.nix b/tv/5pkgs/simple/fzmenu/default.nix deleted file mode 100644 index 1a285ee99..000000000 --- a/tv/5pkgs/simple/fzmenu/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ lib, pkgs, stdenv }: - -let - terminal = pkgs.writeDashBin "terminal" '' - # usage: terminal COMMAND [ARGS...] - exec ${pkgs.alacritty-tv}/bin/alacritty \ - --profile=fzmenu \ - --class AlacrittyFzmenuFloat \ - -e "$@" - ''; -in - -pkgs.runCommand "fzmenu" { -} /* sh */ '' - mkdir $out - - cp -r ${./bin} $out/bin - - substituteInPlace $out/bin/otpmenu \ - --replace '#! /bin/sh' '#! ${pkgs.dash}/bin/dash' \ - --replace '#PATH=' PATH=${lib.makeBinPath [ - pkgs.coreutils - pkgs.dash - pkgs.findutils - pkgs.fzf - pkgs.gawk - (pkgs.pass.withExtensions (ext: [ - ext.pass-otp - ])) - pkgs.utillinux - pkgs.xdotool - terminal - ]} - - substituteInPlace $out/bin/passmenu \ - --replace '#! /bin/sh' '#! ${pkgs.dash}/bin/dash' \ - --replace '#PATH=' PATH=${lib.makeBinPath [ - pkgs.coreutils - pkgs.dash - pkgs.findutils - pkgs.fzf - pkgs.gawk - (pkgs.pass.withExtensions (ext: [ - ext.pass-otp - ])) - pkgs.utillinux - pkgs.xdotool - terminal - ]} -'' diff --git a/tv/5pkgs/simple/hc.nix b/tv/5pkgs/simple/hc.nix deleted file mode 100644 index 086445ec0..000000000 --- a/tv/5pkgs/simple/hc.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ fetchgit, lib, makeWrapper, stdenv -, coreutils, findutils, gawk, gnugrep, qrencode, texlive, utillinux, zbar -}: - -stdenv.mkDerivation rec { - name = "hc-${meta.version}"; - - src = fetchgit { - url = "https://cgit.krebsco.de/hc"; - rev = "refs/tags/v${meta.version}"; - sha256 = "09349gja22p0j3xs082kp0fnaaada14bafszn4r3q7rg1id2slfb"; - }; - - nativeBuildInputs = [ makeWrapper ]; - - buildPhase = null; - - installPhase = '' - mkdir -p $out/bin - - cp $src/bin/hc $out/bin/hc - - wrapProgram $out/bin/hc \ - --prefix PATH : ${lib.makeBinPath [ - coreutils - findutils - gawk - gnugrep - qrencode - texlive.combined.scheme-full - utillinux - zbar - ]} - ''; - - meta = { - version = "1.0.0"; - }; -} diff --git a/tv/5pkgs/simple/iosevka-tv-1.nix b/tv/5pkgs/simple/iosevka-tv-1.nix deleted file mode 100644 index 0f8b4d4b2..000000000 --- a/tv/5pkgs/simple/iosevka-tv-1.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs }: - -pkgs.iosevka.override { - # https://typeof.net/Iosevka/customizer - privateBuildPlan = { - family = "iosevka tv 1"; - spacing = "term"; - serifs = "sans"; - export-glyph-names = true; - no-ligation = true; - no-cv-ss = false; - - widths.normal.shape = 600; - widths.normal.menu = 5; - widths.normal.css = "normal"; - }; - set = "tv-1"; -} diff --git a/tv/5pkgs/simple/iosevka-tv-2.nix b/tv/5pkgs/simple/iosevka-tv-2.nix deleted file mode 100644 index 888ba6a0c..000000000 --- a/tv/5pkgs/simple/iosevka-tv-2.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs }: - -pkgs.iosevka.override { - # https://typeof.net/Iosevka/customizer - privateBuildPlan = { - family = "iosevka tv 2"; - spacing = "term"; - serifs = "sans"; - export-glyph-names = true; - no-ligation = true; - no-cv-ss = false; - - variants.inherits = "ss10"; - - widths.normal.shape = 600; - widths.normal.menu = 5; - widths.normal.css = "normal"; - }; - set = "tv-2"; -} diff --git a/tv/5pkgs/simple/lib b/tv/5pkgs/simple/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/5pkgs/simple/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/5pkgs/simple/libinput-tv.nix b/tv/5pkgs/simple/libinput-tv.nix deleted file mode 100644 index 6f08689bb..000000000 --- a/tv/5pkgs/simple/libinput-tv.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs }: - -pkgs.libinput.overrideAttrs (old: { - patches = old.patches or [] ++ [ - (pkgs.fetchurl { - name = "libinput-winmax2.patch"; - url = "https://github.com/4z3/libinput/commit/2d0ff41.patch"; - sha256 = "0ipsxzjf98g9w2m163gp49zl14wbxs84s0psdnvk7wfiivgcnm1f"; - }) - ]; -}) diff --git a/tv/5pkgs/simple/mpvterm/default.nix b/tv/5pkgs/simple/mpvterm/default.nix deleted file mode 100644 index 66ad08a78..000000000 --- a/tv/5pkgs/simple/mpvterm/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs }: - -pkgs.mpv-unwrapped.overrideAttrs (old: rec { - pname = "mpvterm"; - patches = old.patches or [] ++ [ - ./mpvterm.patch - ]; -}) diff --git a/tv/5pkgs/simple/mpvterm/mpvterm.patch b/tv/5pkgs/simple/mpvterm/mpvterm.patch deleted file mode 100644 index 12636880d..000000000 --- a/tv/5pkgs/simple/mpvterm/mpvterm.patch +++ /dev/null @@ -1,146 +0,0 @@ -commit 5ded4dac370ce5d8d727c5d3891448f942edbfdf -Author: tv -Date: Sat Feb 27 22:54:55 2021 +0100 - - x11: add input forwarding support - -diff --git a/video/out/x11_common.c b/video/out/x11_common.c -index ac551fae8e..2e95451d7f 100644 ---- a/video/out/x11_common.c -+++ b/video/out/x11_common.c -@@ -25,6 +25,10 @@ - #include - #include - -+#include -+#include -+#include -+ - #include - #include - #include -@@ -1097,6 +1101,73 @@ static void release_all_keys(struct vo *vo) - x11->win_drag_button1_down = false; - } - -+ -+#define FORWARD_START 1 -+#define FORWARD_READY 2 -+#define FORWARD_ERROR 3 -+static int forward_state = FORWARD_START; -+static int forward_fd, forward_len; -+static struct sockaddr_un forward_un; -+static char forward_buf[BUFSIZ]; -+ -+static void forward_start(void) { -+ const char *socket_path = getenv("FORWARD_SOCKET"); -+ if (socket_path == NULL) { -+ fprintf(stderr, "forward_start: environment variable FORWARD_SOCKET not set\n"); -+ forward_state = FORWARD_ERROR; -+ return; -+ } -+ -+ if ((forward_fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) { -+ perror("socket"); -+ } else { -+ memset(&forward_un, 0, sizeof(forward_un)); -+ forward_un.sun_family = AF_UNIX; -+ strcpy(forward_un.sun_path, socket_path); -+ forward_len = offsetof(struct sockaddr_un, sun_path) + strlen(socket_path); -+ forward_state = FORWARD_READY; -+ } -+} -+static void forward_send(const char *fmt, ...) { -+ if (forward_state != FORWARD_READY) return; -+ -+ va_list argp; -+ va_start(argp, fmt); -+ int n1 = vsnprintf(forward_buf, BUFSIZ, fmt, argp); -+ if (n1 < BUFSIZ + 1) { -+ forward_buf[n1++] = '\n'; -+ forward_buf[n1] = '\0'; -+ int n2 = sendto(forward_fd, forward_buf, n1, 0, (struct sockaddr *)&forward_un, forward_len); -+ if (n2 < 0) { -+ perror("sendto"); -+ } -+ } -+} -+static const char *forward_keyname(KeySym keySym) { -+ const char *name; -+ if (keySym == NoSymbol) { -+ name = "NoSymbol"; -+ } else if (!(name = XKeysymToString(keySym))) { -+ name = "NoName"; -+ } -+ return name; -+} -+static void forward_keydown(KeySym keySym) { -+ forward_send("xdotool keydown %s", forward_keyname(keySym)); -+} -+static void forward_keyup(KeySym keySym) { -+ forward_send("xdotool keyup %s", forward_keyname(keySym)); -+} -+static void forward_mousedown(int button) { -+ forward_send("xdotool mousedown %d", button); -+} -+static void forward_mouseup(int button) { -+ forward_send("xdotool mouseup %d", button); -+} -+static void forward_mousemove(int x, int y) { -+ forward_send("xdotool mousemove %d %d", x, y); -+} -+ - void vo_x11_check_events(struct vo *vo) - { - struct vo_x11_state *x11 = vo->x11; -@@ -1105,6 +1176,10 @@ void vo_x11_check_events(struct vo *vo) - - xscreensaver_heartbeat(vo->x11); - -+ if (forward_state == FORWARD_START) { -+ forward_start(); -+ } -+ - while (XPending(display)) { - XNextEvent(display, &Event); - MP_TRACE(x11, "XEvent: %d\n", Event.type); -@@ -1146,6 +1221,7 @@ void vo_x11_check_events(struct vo *vo) - if (mpkey) - mp_input_put_key(x11->input_ctx, mpkey | modifiers); - } -+ forward_keydown(XLookupKeysym(&Event.xkey, 0)); - break; - } - case FocusIn: -@@ -1161,6 +1237,7 @@ void vo_x11_check_events(struct vo *vo) - break; - case KeyRelease: - release_all_keys(vo); -+ forward_keyup(XLookupKeysym(&Event.xkey, 0)); - break; - case MotionNotify: - if (x11->win_drag_button1_down && !x11->fs && -@@ -1182,6 +1259,7 @@ void vo_x11_check_events(struct vo *vo) - Event.xmotion.y); - } - x11->win_drag_button1_down = false; -+ forward_mousemove(Event.xmotion.x, Event.xmotion.y); - break; - case LeaveNotify: - if (Event.xcrossing.mode != NotifyNormal) -@@ -1204,6 +1282,7 @@ void vo_x11_check_events(struct vo *vo) - get_mods(Event.xbutton.state) | MP_KEY_STATE_DOWN); - long msg[4] = {XEMBED_REQUEST_FOCUS}; - vo_x11_xembed_send_message(x11, msg); -+ forward_mousedown(Event.xbutton.button); - break; - case ButtonRelease: - if (Event.xbutton.button - 1 >= MP_KEY_MOUSE_BTN_COUNT) -@@ -1213,6 +1292,7 @@ void vo_x11_check_events(struct vo *vo) - mp_input_put_key(x11->input_ctx, - (MP_MBTN_BASE + Event.xbutton.button - 1) | - get_mods(Event.xbutton.state) | MP_KEY_STATE_UP); -+ forward_mouseup(Event.xbutton.button); - break; - case MapNotify: - x11->window_hidden = false; diff --git a/tv/5pkgs/simple/pinentry-urxvt/default.nix b/tv/5pkgs/simple/pinentry-urxvt/default.nix deleted file mode 100644 index ad8039ff2..000000000 --- a/tv/5pkgs/simple/pinentry-urxvt/default.nix +++ /dev/null @@ -1,124 +0,0 @@ -with import ./lib; -{ pkgs, ... }@args: - -let - # config cannot be declared in the input attribute set because that would - # cause callPackage to inject the wrong config. Instead, get it from ... - # via args. - config = args.config or {}; - - cfg = eval.config; - - eval = lib.evalModules { - modules = lib.singleton { - _file = toString ./default.nix; - imports = lib.singleton config; - options = { - appName = lib.mkOption { - default = "pinentry-urxvt"; - type = lib.types.str; - }; - display = lib.mkOption { - default = null; - type = lib.types.nullOr lib.types.str; - }; - xwud.className = lib.mkOption { - default = "PinentryUrxvtXwudFloat"; - type = lib.types.str; - }; - }; - }; - }; - - -in - - # pinentry-urxvt - A mechanism for PIN entry utilizing rxvt-unicode - # - # This spawns a PIN entry terminal on top of a tinted screenshot of the - # current display's root window. The display for spawning the terminal can - # be predefined, in which case both the current and the predefined display - # will show the screenshot. - # - # The purpose of the screenshot, aside from looking nice, is to prevent entry - # of the PIN into the wrong window, e.g. by accidentally moving the cursor - # while typing. If necessary, the screenshot can be closed by sending 'q', - # 'Q', or ctrl-c while its focused. - # - pkgs.write "pinentry-urxvt" { - "/bin/pinentry".link = pkgs.writeDash "pinentry-urxvt-wrapper" '' - set -efu - - trap cleanup EXIT - - cleanup() { - ${pkgs.utillinux}/bin/kill -- $(${pkgs.coreutils}/bin/cat "$displayers") - rm "$displayers" - rm "$screenshot" - } - - displayers=$(${pkgs.coreutils}/bin/mktemp -t pinentry-urxvt.$$.displayers.XXXXXXXX) - screenshot=$(${pkgs.coreutils}/bin/mktemp -t pinentry-urxvt.$$.screenshot.XXXXXXXX) - - ${pkgs.xorg.xwd}/bin/xwd -root | - ${pkgs.imagemagick}/bin/convert xwd:- -fill \#424242 -colorize 80% xwd:"$screenshot" - - display_screenshot() { - ${pkgs.exec "pinentry-urxvt.display_screenshot" { - filename = "${pkgs.xorg.xwud}/bin/xwud"; - argv = [ - cfg.xwud.className - "-noclick" - ]; - }} < "$screenshot" & - wait_for_screenshot $! && echo $! >>"$displayers" - } - - # Wait for the xwud window by trying to intercept the call to munmap(). - # If it cannot be intercepted within 0.1s, assume that attaching strace - # wasn't fast enough or xwud doesn't call munmap() anymore. In either - # case fall back to search the window by class name, assuming there can - # be only one per display. - wait_for_screenshot() { - if ! \ - ${pkgs.coreutils}/bin/timeout 0.1 \ - ${pkgs.strace}/bin/strace -p "$1" -e munmap 2>&1 | - read -r _ - then - until ${pkgs.xdotool}/bin/xdotool search \ - --classname ${lib.shell.escape cfg.xwud.className} - do - ${pkgs.coreutils}/bin/sleep 0.1 - done - fi - } - - display_screenshot - - ${lib.optionalString (cfg.display != null) /* sh */ '' - if test "$DISPLAY" != ${lib.shell.escape cfg.display}; then - export DISPLAY=${lib.shell.escape cfg.display} - display_screenshot - fi - ''} - - exec 3<&0 4>&1 5>&2 - ${pkgs.rxvt_unicode}/bin/urxvt \ - -name ${lib.shell.escape cfg.appName} \ - -e ${pkgs.writeDash "pinentry-urxvt-tty" '' - set -efu - exec 2>&5 - TTY=$(${pkgs.coreutils}/bin/tty) - while read -r line <&3; do - case $line in - 'OPTION ttyname='*) - echo "OPTION ttyname=$TTY" - ;; - *) - echo "$line" - esac - done | ${pkgs.pinentry.tty}/bin/pinentry-tty "$@" >&4 - ''} \ - "$@" - ''; - } diff --git a/tv/5pkgs/simple/pinentry-urxvt/lib b/tv/5pkgs/simple/pinentry-urxvt/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/5pkgs/simple/pinentry-urxvt/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/5pkgs/simple/q/default.nix b/tv/5pkgs/simple/q/default.nix deleted file mode 100644 index 1aea80b26..000000000 --- a/tv/5pkgs/simple/q/default.nix +++ /dev/null @@ -1,171 +0,0 @@ -with import ./lib; -{ pkgs }: -let - q-cal = let - - # Maximum width of cal's output. - calwidth = 23; - - # Number of space characters between two calendars. - hspace = 2; - - # Return number of columns required to print n calenders side by side. - need_width = n: assert n >= 1; n * calwidth + (n - 1) * hspace; - - in /* sh */ '' - cols=$(${pkgs.ncurses}/bin/tput cols) - if test $cols -ge ${toString (need_width 3)}; then - ${pkgs.utillinux}/bin/cal --color=always -mw3 - elif test $cols -ge ${toString (need_width 2)}; then - ${pkgs.utillinux}/bin/cal --color=always -mw -n 2 - elif test $cols -ge ${toString (need_width 1)}; then - ${pkgs.utillinux}/bin/cal --color=always -mw1 - else - : - fi | - ${pkgs.gnused}/bin/sed -r ' - # dim week numbers - s/((^| )[ 1-5][0-9])(( ..| \[7m..\[27m){7})/\1\3/g - # dim month and day names - s/^ *[A-Z].*/&/ - # highlight current date - s/\[7m// - s/\[27m// - ' - ''; - - q-isodate = TZ: color: /* sh */ '' - TZ=${shell.escape TZ} \ - ${pkgs.coreutils}/bin/date \ - '+%Y-%m-%dT[;'${shell.escape color}'m%H:%M:%S%:z' - ''; - - q-deudate = q-isodate "Europe/Berlin" "38;5;085"; - - # Singapore's red is #ED2E38 - q-sgtdate = q-isodate "Asia/Singapore" "38;2;237;46;56"; - - q-thadate = q-isodate "Asia/Bangkok" "38;5;226"; - - q-utcdate = q-isodate "UTC" "38;5;065"; - - q-gitdir = /* sh */ '' - if test -d .git; then - #git status --porcelain - branch=$( - ${pkgs.git}/bin/git branch \ - | ${pkgs.gnused}/bin/sed -rn 's/^\* (.*)/\1/p' - ) - echo "± $LOGNAME@''${HOSTNAME-$(${pkgs.nettools}/bin/hostname)}:$PWD .git $branch" - fi - ''; - - q-intel_backlight = /* sh */ '' - cd /sys/class/backlight/intel_backlight - &1 | - ${pkgs.gnused}/bin/sed -rn ' - s/.*time=([0-9.]+).*/online ni=\1/p - s/.*Network is unreachable.*/offline/p - s/.*100% packet loss.*/offline/p - ' - ) - echo "$dev''${inet:+ $inet}''${ssid:+ $ssid} $latency" - } & - done - wait - ''; - - q-thermal_zone = /* sh */ '' - for i in /sys/class/thermal/thermal_zone*; do - type=$(${pkgs.coreutils}/bin/cat $i/type) - temp=$(${pkgs.coreutils}/bin/cat $i/temp) - printf '%s %s°C\n' $type $(echo $temp / 1000 | ${pkgs.bc}/bin/bc) - done - ''; - - q-todo = /* sh */ '' - TODO_file=$PWD/TODO - if test -e "$TODO_file"; then - ${pkgs.jq}/bin/jq -Rrs <"$TODO_file" -f ${pkgs.writeJq "q-todo.jq" '' - split("\n") | map( - (match("^([0-9]+-\\d{2}-\\d{2})\\s+(.*)$").captures | map(.string)) - as $captures | - ($captures[0] | strptime("%Y-%m-%d") | mktime) as $date | - $captures[1] as $text | - - select(now >= $date) | - - ($text | test("\\[URGENT]"; "i")) as $urgent | - (if $urgent then "38;5;196" else "38;5;208" end) as $sgr | - if $urgent then sub("\\s*\\[URGENT]\\s*"; " "; "i") else . end | - - "\u001b[\($sgr)m\(.)\u001b[m" - ) | - if length == 0 then "nothing to remind" else .[] end - ''} - else - echo "$TODO_file: no such file or directory" - fi - ''; - -in -# bash needed for <(...) -pkgs.writeBashBin "q" '' - set -eu - export PATH=/var/empty - ${q-cal} - ${q-utcdate} - ${q-deudate} - ${q-sgtdate} - (${q-gitdir}) & - (${q-intel_backlight}) & - ${pkgs.q-power_supply}/bin/q-power_supply & - (${q-virtualization}) & - (${q-net}) & - (${q-thermal_zone}) & - wait - if test "$PWD" != "$HOME" && test -e "$HOME/TODO"; then - TODO_home_entries=$(cd; (${q-todo}) | ${pkgs.coreutils}/bin/wc -l) - if test "$TODO_home_entries" = 1; then - TODO_format='There is %d entry in ~/TODO' - else - TODO_format='There are %d entries in ~/TODO' - fi - printf "\x1b[38;5;238m$TODO_format\x1b[m\n" "$TODO_home_entries" - fi - (${q-todo}) || : -'' diff --git a/tv/5pkgs/simple/q/lib b/tv/5pkgs/simple/q/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/5pkgs/simple/q/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/5pkgs/simple/rox-filer.nix b/tv/5pkgs/simple/rox-filer.nix deleted file mode 100644 index b380bdff9..000000000 --- a/tv/5pkgs/simple/rox-filer.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ fetchFromGitLab, lib, stdenv -, autoconf, pkgconfig, libxml2, libSM, shared-mime-info -, libxslt, docbook_xml_dtd_412, docbook_xsl -, gtk ? gtk2, gtk2 -}: - -stdenv.mkDerivation { - pname = "rox-filer"; - version = "2.11-tv"; - - src = fetchFromGitLab { - owner = "seirios"; - repo = "rox-filer"; - rev = "3c3ad5d85a1ab548574bf450f730886b60092587"; - sha256 = "0h743zpx1v9rrsaxn0q3nwpq8wkjf6icgzrg8jpqldsphw3ygkhr"; - }; - - nativeBuildInputs = [ - autoconf - docbook_xsl - libxslt - pkgconfig - ]; - - buildInputs = [ libxml2 gtk shared-mime-info libSM ]; - - # go to the source directory after unpacking the sources - setSourceRoot = "export sourceRoot=source/ROX-Filer"; - - # patch the main.c to disable the lookup of the APP_DIR environment variable, - # which is used to lookup the location for certain images when rox-filer - # starts; rather override the location with an absolute path to the directory - # where images are stored to prevent having to use a wrapper, which sets the - # APP_DIR environment variable prior to starting rox-filer - preConfigure = '' - (cd src && autoconf) - sed -i -e "s:g_strdup(getenv(\"APP_DIR\")):\"$out\":" src/main.c - mkdir build - cd build - ''; - - preBuild = '' - for f in \ - ../src/Docs/Manual.xml \ - ../src/Docs/Manual-fr.xml \ - ../src/Docs/Manual-it.xml ; - do - substituteInPlace "$f" \ - --replace \ - /usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd \ - ${docbook_xml_dtd_412}/xml/dtd/docbook/docbookx.dtd - done - make -C ../src/Docs MAN=.. || exit 1 - ''; - - configureScript = "../src/configure"; - - installPhase = '' - mkdir -p "$out" - cd .. - cp -av Help Messages Options.xml ROX images style.css .DirIcon "$out" - - mkdir -p "$out/share/man/man1" - cp -av src/rox.1 "$out/share/man/man1" - - # the main executable - mkdir "$out/bin/" - cp -v ROX-Filer "$out/bin/rox" - - # mime types - mkdir -p "$out/ROX/MIME" - cd "$out/ROX/MIME" - ln -sv text-x-{diff,patch}.png - ln -sv application-x-font-{afm,type1}.png - ln -sv application-xml{,-dtd}.png - ln -sv application-xml{,-external-parsed-entity}.png - ln -sv application-{,rdf+}xml.png - ln -sv application-x{ml,-xbel}.png - ln -sv application-{x-shell,java}script.png - ln -sv application-x-{bzip,xz}-compressed-tar.png - ln -sv application-x-{bzip,lzma}-compressed-tar.png - ln -sv application-x-{bzip-compressed-tar,lzo}.png - ln -sv application-x-{bzip,xz}.png - ln -sv application-x-{gzip,lzma}.png - ln -sv application-{msword,rtf}.png - ''; - - meta = with lib; { - description = "Fast, lightweight, gtk2 file manager"; - homepage = "http://rox.sourceforge.net/desktop"; - license = with licenses; [ gpl2 lgpl2 ]; - platforms = platforms.linux; - maintainers = [ maintainers.eleanor ]; - }; -} diff --git a/tv/5pkgs/simple/rxvt-unicode-256color-terminfo/default.nix b/tv/5pkgs/simple/rxvt-unicode-256color-terminfo/default.nix deleted file mode 100644 index d2f6f46b2..000000000 --- a/tv/5pkgs/simple/rxvt-unicode-256color-terminfo/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -# This package is mainly intended for cross-built systems for which we cannot -# or don't want to build pkgs.rxvt_unicode for some reason. -# -# ${./rxvt-unicode-256color.terminfo} was copied from a previously built -# /run/current-system/sw/share/terminfo/r/rxvt-unicode-256color -{ runCommand }: - -runCommand "rxvt-unicode-256color-terminfo" {} /* sh */ '' - mkdir -p $out/nix-support - mkdir -p $out/share/terminfo/r - - ln -s ${./rxvt-unicode-256color.terminfo} \ - $out/share/terminfo/r/rxvt-unicode-256color - - echo "$out" >> $out/nix-support/propagated-user-env-packages -'' diff --git a/tv/5pkgs/simple/rxvt-unicode-256color-terminfo/rxvt-unicode-256color.terminfo b/tv/5pkgs/simple/rxvt-unicode-256color-terminfo/rxvt-unicode-256color.terminfo deleted file mode 100644 index 3f43d0d567f4bc450e2354e00fde5760e82074a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2239 zcmb_cO=w(I6h8O8j8#iPDWZ0WPPMl`X_L&m?`LLwCex&C8e;lGV{vGj(j+rUCY`^` zy!_9k(nSUBq6mTtcA*H_R4AfoapB*>McoL3t8U%-gCKMv&vVXuW0NLDD!$=-_dDM` z=idA7Id67|OV1v=E!mds8ut ziE&UZwl@=dC11*x=VL>QH7{4(2SUI<#stvEAAx|A@Gv}uiof9j;a}WLzZ)3AEC3B! z;0f3P&%thJL&b(Z=!ZcVLVg;?5GP<7JXnA_@=I_T-hivfeE%KBYw!WA!gcr*Zo*fn zd=EdsPjDOAukbtk$uS*53Ey|n=t<((h1SDCGi^0T|v7l z-V*O}obO)~?~4yZ9;~zxSH%r+Q+y+Ci66yn@w50%+zB%@?ICTe=KGIn+Yx>Ls5YRT z)-u`|ZAAMBl^fc}to#0F+85fF+PB(w?B7D%rc=h_`jb4iGLq7Kp3$F2ZO;b1IluXM z0OJka;Vc*NpngOjVDC8M5HsJ;gd?qSRv*)+^pfuBOZuz&W&Mi&=9<~fclmGX+Yh+z zd-|$=UH?S?9P_^B+}$m&x2)g$mwSAg{bLhteb&EwcfvLPYS|hIqMwemMs`MIWD9JA z=&;PoiXpSEtSFhSqF_!U^hbx)0FE!A(HKS@y-S0Hes~n6ezdf*3;4MqF;s!wDRd5@ z^#r1;Y*J359fRnIa<@QqZyY_lh+q(;jkuMfAd4VD5`#sIkD0-oUUZ7VPz`emC|LxG z;}s{Q?WtWas(5EN2I1LoyWyP`1WYQ@>!F;WL(v+p=~}MsI&R8!9M_1);{*nRmBP2- zwGU$MAY4Q=R}knJ$#V#XL9Svn6mf$C42!wVm|#pYrU+G>kY&y}jGjXh$A|aU4bd)? z_|@s+m>g>oIsq$mGA2V!GT0=vEKkvjOkQphs!JZtBCrw0aSSf!fi5PAX<>h4A)26$ z;3KAG#gU$CNLM0NNUeYxvSP|Q`ia1|klF!FAWcfQNEs>VVS~sVmRhxKJn*i=|SzT&c{=RI9a`=grQ}&CSm*EG#ZAEiEtC z>y5_BN_$U7@BTvv4#$s7_2sFr&!D9f)OhJc0dSyVouD`2%9^{7aYd8F41xrKBFLgS zL~H`ONX0#%I74ww6_;0W4=C;dGgz7HZ*sgD^bCD=c%}GNW=|n?N(k7biWVj_Q?8Z5 zk7C4fxu$M)a_j}V<7LOTO}io6X8T`f2UsD@?Vf%aGZv^{@0RR91 diff --git a/tv/5pkgs/simple/stardict/default.nix b/tv/5pkgs/simple/stardict/default.nix deleted file mode 100644 index 2135cc056..000000000 --- a/tv/5pkgs/simple/stardict/default.nix +++ /dev/null @@ -1,235 +0,0 @@ -{ lib, pkgs }: -let - classicsDictionaries = { - Pape = pkgs.fetchzip { - url = "http://tovotu.de/data/stardict/pape_gr-de.zip"; - sha256 = "1kmbdjqinrcxkc6jdyyrq5rl2wzhnrychyynnh91yhrjwjxlh44k"; - }; - Woodhouse = pkgs.fetchzip { - url = "https://c.krebsco.de/Woodhouse.zip"; - sha256 = "1dvnc2679yb048q2f3hr2h34acvhan0n3iir6h9ajlrdzz48mlkq"; - stripRoot = false; - }; - LSJ = pkgs.fetchzip { - url = "https://github.com/nikita-moor/latin-dictionary/releases/download/2020-02-14/LiddellScott1940-stardict.zip"; - sha256 = "13rprgd9jvnhxk9735c91xr6ywr0j5jiwkjnpm3qpvy93isyjbys"; - }; - GreekMorphology = pkgs.fetchzip { - url = "https://github.com/latin-dict/Morphologia-Graeca/releases/download/v0.5/morphology-mobile-goldendict.oxia.zip"; - sha256 = "0m75cppjjjmvv18cs7yh9f4p7ckqzxfznnndgkiw3yrfd50k8p96"; - }; - Frisk = pkgs.fetchzip { - url = "https://github.com/latin-dict/Frisk1960/releases/download/v1.1/Frisk1960-stardict.zip"; - sha256 = "1rk5a3n3fpfdcmg4bc5945m88s6ldxql8cjn4jqs33rgklh7n046"; - }; - Georges-De-Lat = pkgs.fetchzip { - url = "http://tovotu.de/data/stardict/georges_de-lat.zip"; - sha256 = "1gx4vv64bi9lxw2zgd861j469jvw4f2hhfwy1gglb12id8r7rdrl"; - }; - Georges-Lat-De = pkgs.fetchzip { # TODO find out why this does not work with sdcv - url = "http://tovotu.de/data/stardict/georges_lat-de.zip"; - sha256 = "0cc5xipn60anxvq8z2mw53d4gi1k92wbrj9m4ws3g9rh87fmkvgz"; - }; - LewisShort = pkgs.fetchzip { - url = "https://github.com/latin-dict/LewisShort1879/releases/download/v1.3/LewisShort1879-stardict.zip"; - sha256 = "1y3ans47iv8bzzb1paimdqvcid8ms04ikjbqy3iw077i2js3qbjk"; - }; - DoederleinSynonymes = pkgs.fetchzip { - url = "https://github.com/latin-dict/Doederlein1874/releases/download/v1.1/Doederlein1875-stardict.zip"; - sha256 = "0mhik7gjxl8ncr9g5z2l4pfk60k1c5n0gc1w0cnp2x1v6lqvb57h"; - }; - }; - - englishGermanDictionaries = { - Etymonline = pkgs.fetchzip { - url = "http://tovotu.de/data/stardict/etymonline.zip"; - sha256 = "1bjja3n3layfd08xa1r0a6375dxh5zi6hlv7chkhgnx800cx7hxn"; - }; - Roget = builtins.fetchTarball { - url = "http://download.huzheng.org/bigdict/stardict-Roget_s_II_The_New_Thesaurus_3th_Ed-2.4.2.tar.bz2"; - sha256 = "1szyny9497bpyyccf9l5kr3bnw0wvl4cnsd0n1zscxpyzlsrqqbz"; - }; - JargonFile = builtins.fetchTarball { - url = "http://download.huzheng.org/dict.org/stardict-dictd-jargon-2.4.2.tar.bz2"; - sha256 = "096phar9qpmm0fnaqv5nz8x9lpxwnfj78g4vjfcfyd7kqp7iqla4"; - }; - Oxford-Collocations = builtins.fetchTarball { - url = "http://download.huzheng.org/bigdict/stardict-Oxford_Collocations_Dictionary_2nd_Ed-2.4.2.tar.bz2"; - sha256 = "1zkfs0zxkcn21z2lhcabrs77v4ma9hpv7qm119hpyi1d8ajcw07q"; - }; - Langenscheidt-Deu-En = builtins.fetchTarball { - url = "http://download.huzheng.org/babylon/german/stardict-Handw_rterbuch_Deutsch_Englisc-2.4.2.tar.bz2"; - sha256 = "12q9i5azq7ylyrpb6jqbaf1rxalc3kzcwjvbinvb0yabdxb80y30"; - }; - Langenscheidt-En-Deu = builtins.fetchTarball { - url = "http://download.huzheng.org/babylon/german/stardict-Handw_rterbuch_Englisch_Deutsc-2.4.2.tar.bz2"; - sha256 = "087b05h155j5ldshfgx91pz81h6ijq2zaqjirg7ma8ig3l96zb59"; - }; - Duden_Das_Fremdworterbuch = builtins.fetchTarball { - url = "http://download.huzheng.org/babylon/german/stardict-Duden_Das_Fremdworterbuch-2.4.2.tar.bz2"; - sha256 = "1zrcay54ccl031s6dvjwsah5slhanmjab87d81rxlcy8fx0xd8wq"; - }; - Duden_De_De = builtins.fetchTarball { - url = "http://download.huzheng.org/babylon/german/stardict-Duden_De_De-2.4.2.tar.bz2"; - sha256 = "1fhay04w5aaj83axfmla2ql34nb60gb05dgv0k94ig7p8x4yxxlf"; - }; - ConciseOED = builtins.fetchTarball { - url = "http://download.huzheng.org/bigdict/stardict-Concise_Oxford_English_Dictionary-2.4.2.tar.bz2"; - sha256 = "19kpcxbhqzpmhi94mp48nalgmsh6s7rsx1gb4kwkhirp2pbjcyl7"; - }; - # Duden_Rechtschreibung = builtins.fetchTarball { - # url = "http://download.huzheng.org/babylon/german/stardict-Duden_Rechtschreibung-2.4.2.tar.bz2"; - # sha256 = "0xiprb45s88w62rn8rlbjrsagbiliay9hszsiy20glwabf6zsfji"; - # }; - Duden_Synonym = builtins.fetchTarball { - url = "http://download.huzheng.org/babylon/german/stardict-Duden_Synonym-2.4.2.tar.bz2"; - sha256 = "0cx086zvb86bmz7i8vnsch4cj4fb0cp165g4hig4982zakj6f2jd"; - }; - # Duden = builtins.fetchTarball { - # url = "http://download.huzheng.org/de/stardict-duden-2.4.2.tar.bz2"; - # sha256 = "049i4ynfqqxykv1nlkyks94mvn14s22qdax5gg7hx1ks5y4xw64j"; - # }; - # FreeOnlineDictionaryOfComputing = builtins.fetchTarball { - # url = "http://download.huzheng.org/dict.org/stardict-dictd_www.dict.org_foldoc-2.4.2.tar.bz2"; - # sha256 = "1lw2i8dzxpx929cpgvv0x366dnh4drr10wzqmrhcd0kvwglqawgm"; - # }; - }; - - sanskritDictionaries = { - BoehtlingkRoth = pkgs.fetchzip { - url = "https://c.krebsco.de/Bohtlingk-and-Roth-Grosses-Petersburger-Worterbuch.zip"; - sha256 = "13414a8rgd7hd5ffar6nl68nk3ys60wjkgb7m11hp0ahaasmf6ly"; - stripRoot = false; - }; - MonierWilliams = pkgs.fetchzip { - url = "https://c.krebsco.de/mw-cologne.zip"; - sha256 = "0p99ybxwxmmd94hf035hvm2hhnfy84av7qq79xf28bh2rbx6s9ng"; - stripRoot = false; - }; - MonierWilliamsEnglish = pkgs.fetchzip { - url = "https://c.krebsco.de/mw-english-sanskrit.zip"; - sha256 = "09a61hhii4b1m2fkrlh4rm2xnlgwrllh84iypbc6wyj00w9jkl3x"; - stripRoot = false; - }; - }; - - swahiliDictionaries = { - vickio = pkgs.fetchzip { - url = "http://swahili.vickio.net/files/Swahili-English.zip"; - sha256 = "0m6wkwc83fcim43ijn17lcsda4clkra587gxaz6m59qd0yfwzakw"; - stripRoot = false; - }; - }; - - makeStardictDataDir = dicts: pkgs.linkFarm "dictionaries" (lib.mapAttrsToList (name: path: { inherit name path; }) dicts); - - sdcvPager = pkgs.writeDash "sdcvPager" '' - export PATH=${lib.makeBinPath [pkgs.gnused pkgs.ncurses]} - sed " - s! style=\"color: #...\"!!g; - s!\([^<>]*\)!\1!g; - s!]*>!!g; - s!!!g; - s!\([^<>]*\)!\1 !g; - s!\([^<>]*\)!$(tput sitm)\2$(tput sgr0)!g; - s!\([^<>]*\)!\1!g; - s!\([^<>]*\)!$(tput sitm)\1$(tput sgr0)!g; - s!\([^<>]*\)!$(tput sitm)\1$(tput sgr0)!g; - s!]*>\([^<>]*\)!$(tput sitm)\1$(tput sgr0)!g; - s!\([^<>]*\)!$(tput sitm)\1$(tput sgr0) !g; - s!\([^<>]*\)!$(tput sitm)\1$(tput sgr0) !g; - s!\([^<>]*\)!$(tput setaf 3)\1$(tput sgr0)!g; - s!\([^<>]*\)!$(tput bold)\1$(tput sgr0)\t!g; - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!$(tput sitm)!g - s!]*>!$(tput sgr0)!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!]*>!!g - s!!!g - s!]*>!$(tput setaf 245)!g - s!]*>!$(tput sgr0)!g - s/
/$(tput bold)/g; - s:
:$(tput sgr0):g; - s/
/\n/g; - s:
::g; - s/<[bB]>/$(tput bold)/g; - s::$(tput sgr0):g; - s:<[bB][rR]\s*/\?>:\n:g; - s:<[iI]>:$(tput sitm):g; - s::$(tput sgr0):g; - s:<[uU]>:$(tput smul):g; - s::$(tput sgr0):g; - s:]*>::g; - s:::g; - s!\([^<>]*\)!$(tput bold)\1$(tput sgr0)!g; - s!\([^<>]*\)!\2!g - s#
\(.*\)
#\\1#g; - s:\([^<>]*\):$(tput setaf 3)\\1$(tput sgr0):g; - s:\([^<>]*\):$(tput setaf 4)\\1$(tput sgr0):g; - s:\([^<>]*\):$(tput setaf 1)\\1$(tput sgr0):g; - s:\([^<>]*\):$(tput setaf 5)\\1$(tput sgr0):g; - s:\([^<>]*\):$(tput bold)\1$(tput sgr0):g - s:\([^<>]*\):$(tput setaf 3)\1$(tput sgr0):g - s:':':g - s:<:<:g - s:>:>:g - s:\([^<>]*\):$(tput setaf 2)\\1$(tput sgr0):g; - s:\([^<>]*\):$(tput setaf 2)\\1$(tput sgr0):g; - s:\([^<>]*\):$(tput setaf 4)\\1$(tput sgr0):g; - s:\([^<>]*\):$(tput bold)\\1$(tput sgr0):g; - s:]*>:ː:g; - s:]*>::g; - s!!!g - s!]*>!!g - s!!!g - s!]*>!!g - s!]*>!!g - s!\([^<>]*\)!$(tput setaf 245)\1$(tput sgr0)!g - s!]*>!!g - s! +! !g; - s!
!\n\n&!g - s!]*>!!g - s!]*>!!g - s!!!g # unbalanced in Frisk - s!^\s*[0-9])!$(tput setaf 5)&$(tput sgr0)!g - s#^\(-->.*\)\$#$(tput bold)\1$(tput sgr0)# - " - ''; - - mkDictBin = name: dicts: - pkgs.writers.writeDashBin name '' - set -efu - export SDCV_PAGER=${toString sdcvPager} - exec ${pkgs.sdcv}/bin/sdcv --data-dir ${makeStardictDataDir dicts} "$@" - ''; -in - -pkgs.symlinkJoin { - name = "stardict"; - paths = [ - (mkDictBin "sd-classics" classicsDictionaries) - (mkDictBin "sd-sanskrit" sanskritDictionaries) - (mkDictBin "sd-swahili" swahiliDictionaries) - (mkDictBin "sd" englishGermanDictionaries) - ]; -} diff --git a/tv/5pkgs/simple/viljetic-pages/default.nix b/tv/5pkgs/simple/viljetic-pages/default.nix deleted file mode 100644 index ee07c9277..000000000 --- a/tv/5pkgs/simple/viljetic-pages/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, stdenv, ... }: - -stdenv.mkDerivation { - name = "viljetic-pages-0"; - phases = [ - "installPhase" - ]; - buildInputs = with pkgs; [ - imagemagick - ]; - installPhase = '' - mkdir -p $out - cp ${./index.html} $out/index.html - convert ${./logo.xpm} $out/favicon.ico - convert ${./logo.xpm} $out/favicon2.png - ''; -} diff --git a/tv/5pkgs/simple/viljetic-pages/index.html b/tv/5pkgs/simple/viljetic-pages/index.html deleted file mode 100644 index c268cb9a3..000000000 --- a/tv/5pkgs/simple/viljetic-pages/index.html +++ /dev/null @@ -1,11 +0,0 @@ - -blank page - -This page intentionally left blank. - diff --git a/tv/5pkgs/simple/viljetic-pages/logo.xpm b/tv/5pkgs/simple/viljetic-pages/logo.xpm deleted file mode 100644 index bb263dad9..000000000 --- a/tv/5pkgs/simple/viljetic-pages/logo.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static char *meh[] = { -/* columns rows colors chars-per-pixel */ -"16 16 2 1 ", -" c black", -". c None", -/* pixels */ -"................", -". ...... .", -". .. ...... .. .", -". .. ...... .. .", -". ...... .", -"................", -". . . .", -". .. . .. . .", -". .. . .. . .", -". . . .", -"................", -"...... . .", -"...... . .", -"...... . .", -"...... . .", -"................" -}; diff --git a/tv/5pkgs/simple/weechat-tv.nix b/tv/5pkgs/simple/weechat-tv.nix deleted file mode 100644 index 17d286366..000000000 --- a/tv/5pkgs/simple/weechat-tv.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ lib, pkgs }: - -pkgs.wrapWeechat pkgs.weechat-unwrapped { - configure = { availablePlugins, ... }: { - scripts = [ - pkgs.weechatScripts.weechat-matrix - ]; - }; -} diff --git a/tv/5pkgs/simple/xdpytools/default.nix b/tv/5pkgs/simple/xdpytools/default.nix deleted file mode 100644 index 7d1ee071e..000000000 --- a/tv/5pkgs/simple/xdpytools/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ lib, pkgs }: - -let - install = name: { path }: /* sh */ '' - ( - mkdir -p $out/bin - touch $out/bin/${name} - chmod +x $out/bin/${name} - exec >$out/bin/${name} - - echo '#! ${pkgs.dash}/bin/dash' - echo export PATH=${lib.makeBinPath path} - sed 1d ${./src + "/${name}"} - ) - ''; -in - -pkgs.runCommand "xdpytools" {} - (toString - (lib.mapAttrsToList install { - xdpychvt.path = [ - "$out" - "/run/wrappers/'$LOGNAME'" - "/run/wrappers" - ]; - xdpysel.path = [ - "$out" - pkgs.findutils - pkgs.jq - ]; - })) diff --git a/tv/5pkgs/simple/xdpytools/src/xdpychvt b/tv/5pkgs/simple/xdpytools/src/xdpychvt deleted file mode 100755 index 84c1907b9..000000000 --- a/tv/5pkgs/simple/xdpytools/src/xdpychvt +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh -# usage: xdpychvt {prev,next} -# Changes to the VT based on the selected X display. -# -# This allows switching between X servers when display names and VT numbers -# correlate. A more sophisticated tool would try to determine the correct VT -# by e.g. looking at /proc, but this might not possible when e.g. using -# security.hideProcessInformation. -# - -chvt "$(xdpysel "$1")" diff --git a/tv/5pkgs/simple/xdpytools/src/xdpysel b/tv/5pkgs/simple/xdpytools/src/xdpysel deleted file mode 100755 index e08015576..000000000 --- a/tv/5pkgs/simple/xdpytools/src/xdpysel +++ /dev/null @@ -1,49 +0,0 @@ -#! /bin/sh -# usage: xdpysel {prev,next} -# Print the number of the selected X display. - -find /tmp/.X11-unix -mindepth 1 -maxdepth 1 | -jq -Rrs --arg command "$1" ' - ( - split("\n") | - map( - select(.!="") | - match("^.*/X([0-9]+)$").captures[0].string | - tonumber - ) - ) - as $all_displays | - - ( - env.DISPLAY | - match("^:([0-9]+)(?:[.][0-9]+)?$").captures[0].string | - tonumber - ) - as $current_display | - - ($all_displays | length) as $all_displays_count | - - ($all_displays|index($current_display)) - as $current_index | - - (($current_index + 1) % $all_displays_count) - as $next_index | - - (($all_displays_count + $current_index - 1) % $all_displays_count) - as $prev_index | - - $all_displays[$prev_index] as $prev_display | - $all_displays[$next_index] as $next_display | - - { - prev: $prev_display, - next: $next_display, - }[$command] - as $result | - - if $result | type == "number" then - $result - else - "xdpysel: bad argument: \($command)\n" | halt_error(-1) - end -' diff --git a/tv/5pkgs/simple/xkiller.nix b/tv/5pkgs/simple/xkiller.nix deleted file mode 100644 index 8d8f01690..000000000 --- a/tv/5pkgs/simple/xkiller.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs }: -pkgs.writeDash "xkiller" '' - set -efu - exec >&2 - ${pkgs.iproute}/bin/ss -lp src unix:/tmp/.X11-unix/X* | - ${pkgs.gnused}/bin/sed -n ' - s|.*/tmp/.X11-unix/X\([0-9]\+\)\>.*("X[^"]*",pid=\([0-9]\+\)\>.*|\1 \2|p - ' | - while read -r display pid; do - { - exit_code=$( - DISPLAY=:$display ${pkgs.coreutils}/bin/timeout 1 \ - ${pkgs.xorg.xset}/bin/xset q >/dev/null 2>&1 && - echo 0 || echo $? - ) - if test $exit_code = 124; then - echo "X on display :$display is locked up; killing PID $pid..." - ${pkgs.coreutils}/bin/kill -SIGKILL "$pid" - else - echo "X on display :$display is healthy" - fi - } & - done - wait -'' diff --git a/tv/5pkgs/simple/xtoggledpms.nix b/tv/5pkgs/simple/xtoggledpms.nix deleted file mode 100644 index d164ad712..000000000 --- a/tv/5pkgs/simple/xtoggledpms.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs }: - -let - grep = "${pkgs.gnugrep}/bin/grep"; - xset = "${pkgs.xorg.xset}/bin/xset"; -in - -pkgs.writeDashBin "xtoggledpms" '' - # usage: xtoggledpms - set -efu - if ${xset} q | ${grep} -qF 'DPMS is Disabled'; then - ${xset} dpms force off - else - ${xset} s off -dpms - fi -'' diff --git a/tv/5pkgs/vim/default.nix b/tv/5pkgs/vim/default.nix deleted file mode 100644 index c143592ad..000000000 --- a/tv/5pkgs/vim/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -with import ./lib; - -self: super: { - tv = super.tv // { - vim = { - makePlugin = outPath: outPath // { inherit outPath; }; - makeRuntimePath = concatMapStringsSep "," (getAttr "outPath"); - }; - vimPlugins = mapNixDir (path: self.callPackage path {}) ./.; - }; -} diff --git a/tv/5pkgs/vim/elixir.nix b/tv/5pkgs/vim/elixir.nix deleted file mode 100644 index 2ffbbc82f..000000000 --- a/tv/5pkgs/vim/elixir.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs }: -pkgs.vimUtils.buildVimPlugin { - name = "vim-elixir-2018-08-17"; - src = pkgs.fetchgit { - url = https://github.com/elixir-editors/vim-elixir; - rev = "0a847f0faed5ba2d94bb3d51f355c50f37ba025b"; - sha256 = "1jl85wpgywhcvhgw02y8zpvqf0glr4i8522kxpvhsiacb1v1xh04"; - }; -} diff --git a/tv/5pkgs/vim/file-line.nix b/tv/5pkgs/vim/file-line.nix deleted file mode 100644 index 0509cc4a0..000000000 --- a/tv/5pkgs/vim/file-line.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs }: - -pkgs.vimUtils.buildVimPlugin { - name = "file-line-1.0"; - src = pkgs.fetchgit { - url = https://github.com/bogado/file-line; - rev = "refs/tags/1.0"; - sha256 = "0z47zq9rqh06ny0q8lpcdsraf3lyzn9xvb59nywnarf3nxrk6hx0"; - }; -} diff --git a/tv/5pkgs/vim/fzf.nix b/tv/5pkgs/vim/fzf.nix deleted file mode 100644 index e24bee5d4..000000000 --- a/tv/5pkgs/vim/fzf.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs }: - -# cannot use pkgs.vimPlugins.fzf-vim as it's missing :Rg -pkgs.vimUtils.buildVimPlugin { - name = "fzf-2023-01-16"; - src = pkgs.fetchgit { - url = https://github.com/junegunn/fzf.vim; - rev = "bdf48c282ad2174c25c059b3cdb7956427b07a99"; - hash = "sha256-eCCk+Q596Ljjdtjd0cYGqR77K3Me5gf+ts5icP22S3Y="; - }; -} diff --git a/tv/5pkgs/vim/hack.nix b/tv/5pkgs/vim/hack.nix deleted file mode 100644 index d378f355b..000000000 --- a/tv/5pkgs/vim/hack.nix +++ /dev/null @@ -1,49 +0,0 @@ -with import ./lib; -{ pkgs }: - -pkgs.tv.vim.makePlugin (pkgs.writeTextFile (let - name = "hack"; -in { - name = "vim-color-${name}-1.0.2"; - destination = "/colors/${name}.vim"; - text = /* vim */ '' - set background=dark - hi clear - if exists("syntax_on") - syntax clear - endif - - let colors_name = ${toJSON name} - - hi Normal ctermbg=235 - hi Comment ctermfg=242 - hi Constant ctermfg=255 - hi Identifier ctermfg=253 - hi Function ctermfg=253 - hi Statement ctermfg=253 - hi PreProc ctermfg=251 - hi Type ctermfg=251 - hi Delimiter ctermfg=251 - hi Special ctermfg=255 - - hi Garbage ctermbg=088 - hi TabStop ctermbg=016 - hi Todo ctermfg=174 ctermbg=NONE - - hi NixCode ctermfg=040 - hi NixData ctermfg=046 - hi NixQuote ctermfg=071 - - hi diffNewFile ctermfg=207 - hi diffFile ctermfg=207 - hi diffLine ctermfg=207 - hi diffSubname ctermfg=207 - hi diffAdded ctermfg=010 - hi diffRemoved ctermfg=009 - - hi Search cterm=NONE ctermbg=216 - - hi TabLine cterm=underline guifg=#424242 guibg=#232323 - hi TabLineFill cterm=underline guifg=#424242 guibg=#232323 - ''; -})) diff --git a/tv/5pkgs/vim/jq.nix b/tv/5pkgs/vim/jq.nix deleted file mode 100644 index 523f49f02..000000000 --- a/tv/5pkgs/vim/jq.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs }: - -pkgs.vimUtils.buildVimPlugin { - name = "vim-syntax-jq"; - src = pkgs.fetchgit { - url = https://github.com/vito-c/jq.vim; - rev = "99d55a300047946a82ecdd7617323a751199ad2d"; - sha256 = "09c94nah47wx0cr556w61h6pfznxld18pfblc3nv51ivbw7cjqyx"; - }; -} diff --git a/tv/5pkgs/vim/lib b/tv/5pkgs/vim/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/5pkgs/vim/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/5pkgs/vim/nix.nix b/tv/5pkgs/vim/nix.nix deleted file mode 100644 index 43caf46c2..000000000 --- a/tv/5pkgs/vim/nix.nix +++ /dev/null @@ -1,225 +0,0 @@ -with import ./lib; -{ pkgs }: - -pkgs.tv.vim.makePlugin (pkgs.write "vim-syntax-nix-nested" { - "/syntax/haskell.vim".text = '' - syn region String start=+\[[[:alnum:]]*|+ end=+|]+ - - hi link ConId Identifier - hi link VarId Identifier - hi link hsDelimiter Delimiter - ''; - "/syntax/nix.vim".text = '' - "" Quit when a (custom) syntax file was already loaded - "if exists("b:current_syntax") - " finish - "endif - - "setf nix - - " Ref - syn match NixID /[a-zA-Z\_][a-zA-Z0-9\_\'\-]*/ - syn match NixINT /\<[0-9]\+\>/ - syn match NixPATH /[a-zA-Z0-9\.\_\-\+]*\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ - syn match NixHPATH /\~\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ - syn match NixSPATH /<[a-zA-Z0-9\.\_\-\+]\+\(\/[a-zA-Z0-9\.\_\-\+]\+\)*>/ - syn match NixURI /[a-zA-Z][a-zA-Z0-9\+\-\.]*:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']\+/ - syn region NixSTRING - \ matchgroup=NixSTRING - \ start='"' - \ skip='\\"' - \ end='"' - syn region NixIND_STRING - \ matchgroup=NixIND_STRING - \ start="'''" - \ skip="'''\('\|[$]\|\\[nrt]\)" - \ end="'''" - - syn match NixOther /[-!+&<>|():/;=.,?\[\]*@]/ - - syn match NixCommentMatch /\(^\|\s\)#.*/ - syn region NixCommentRegion start="/\*" end="\*/" - - hi link NixCode Statement - hi link NixData Constant - hi link NixComment Comment - - hi link NixCommentMatch NixComment - hi link NixCommentRegion NixComment - hi link NixID NixCode - hi link NixINT NixData - hi link NixPATH NixData - hi link NixHPATH NixData - hi link NixSPATH NixData - hi link NixURI NixData - hi link NixSTRING NixData - hi link NixIND_STRING NixData - - hi link NixEnter NixCode - hi link NixOther NixCode - hi link NixQuote NixData - - syn cluster nix_has_dollar_curly contains=@nix_ind_strings,@nix_strings - syn cluster nix_ind_strings contains=NixIND_STRING - syn cluster nix_strings contains=NixSTRING - - ${concatStringsSep "\n" (let - alts = xs: ''\(${concatStringsSep ''\|'' xs}\)''; - capitalize = s: let - xs = stringToCharacters s; - in - toUpper (head xs) + concatStrings (tail xs); - comment = k: ''/\* ${k} \*/''; - def = k: ''${k}[ \t\r\n]*=''; - writer = k: ''write${k}[^ \t\r\n]*[ \t\r\n]*\("[^"]*"\|[a-z]\+\)''; - writerExt = k: writerName ''[^"]*\.${k}''; - writerName = k: - ''${alts [''toFile'' ''write[^ \t\r\n]*'']}*[ \t\r\n]*"${k}"''; - in mapAttrsToList (name: { - extraStart ? null, - lang ? name - }: - let - startAlts = filter isString [ - (comment name) - extraStart - ]; - sigil = ''${alts startAlts}[ \t\r\n]*''; - in /* vim */ '' - syn include @nix_${lang}_syntax syntax/${lang}.vim - if exists("b:current_syntax") - unlet b:current_syntax - endif - - syn match nix_${lang}_sigil - \ X${replaceStrings ["X"] ["\\X"] sigil}\ze\('''\|"\)X - \ nextgroup=nix_${lang}_region_IND_STRING,nix_${lang}_region_STRING - \ transparent - - syn region nix_${lang}_region_STRING - \ matchgroup=NixSTRING - \ start='"' - \ skip='\\"' - \ end='"' - \ contained - \ contains=@nix_${lang}_syntax - \ transparent - - syn region nix_${lang}_region_IND_STRING - \ matchgroup=NixIND_STRING - \ start="'''" - \ skip="'''\('\|[$]\|\\[nrt]\)" - \ end="'''" - \ contained - \ contains=@nix_${lang}_syntax - \ transparent - - syn cluster nix_ind_strings - \ add=nix_${lang}_region_IND_STRING - - syn cluster nix_strings - \ add=nix_${lang}_region_STRING - - " This is required because containedin isn't transitive. - syn cluster nix_has_dollar_curly - \ add=@nix_${lang}_syntax - '') { - c = {}; - cabal = {}; - diff = {}; - exim = {}; - haskell = {}; - jq.extraStart = alts [ - (writer "Jq") - (writerExt "jq") - ]; - javascript.extraStart = comment "js"; - lua = {}; - markdown.extraStart = writerExt "md"; - nftables = {}; - #nginx = {}; - python.extraStart = alts [ - (comment "py") - (writerExt "py") - ]; - sed.extraStart = writer "Sed"; - sh.extraStart = let - phases = [ - "unpack" - "patch" - "configure" - "build" - "check" - "install" - "fixup" - "installCheck" - "dist" - ]; - shells = [ - "ash" - "bash" - "dash" - ]; - in alts [ - (def "shellHook") - (def "${alts phases}Phase") - (def "${alts ["pre" "post"]}${alts (map capitalize phases)}") - (writer (alts (map capitalize shells))) - ]; - yaml = {}; - vim.extraStart = alts [ - (def ''"[^"]*\.vim"\.text'') - (writerExt "vim") - (writerName ''\([^"]*\.\)\?vimrc'') - ]; - xdefaults = {}; - xmodmap = {}; - })} - - " Clear syntax that interferes with nixINSIDE_DOLLAR_CURLY. - syn clear shVarAssign - - syn region nixINSIDE_DOLLAR_CURLY - \ matchgroup=NixEnter - \ start="[$]{" - \ end="}" - \ contains=TOP - \ containedin=@nix_has_dollar_curly - \ transparent - - syn region nix_inside_curly - \ matchgroup=NixEnter - \ start="{" - \ end="}" - \ contains=TOP - \ containedin=nixINSIDE_DOLLAR_CURLY,nix_inside_curly - \ transparent - - syn match NixQuote /'''\(''$\|\\.\)/he=s+2 - \ containedin=@nix_ind_strings - \ contained - - syn match NixQuote /'''\('\|\\.\)/he=s+1 - \ containedin=@nix_ind_strings - \ contained - - syn match NixQuote /\\./he=s+1 - \ containedin=@nix_strings - \ contained - - syn sync fromstart - - let b:current_syntax = "nix" - - set isk=@,48-57,_,192-255,-,' - ''; - "/syntax/sed.vim".text = '' - syn region sedBranch - \ matchgroup=sedFunction start="T" - \ matchgroup=sedSemicolon end=";\|$" - \ contains=sedWhitespace - ''; - "/syntax/xmodmap.vim".text = '' - syn match xmodmapComment /^\s*!.*/ - ''; -}) diff --git a/tv/5pkgs/vim/showsyntax.nix b/tv/5pkgs/vim/showsyntax.nix deleted file mode 100644 index c27dd0447..000000000 --- a/tv/5pkgs/vim/showsyntax.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs }: - -pkgs.tv.vim.makePlugin (pkgs.writeTextFile (let - name = "showsyntax"; -in { - name = "vim-plugin-${name}-1.0.0"; - destination = "/plugin/${name}.vim"; - text = /* vim */ '' - if exists('g:loaded_showsyntax') - finish - endif - let g:loaded_showsyntax = 0 - - fu! ShowSyntax() - let id = synID(line("."), col("."), 1) - let name = synIDattr(id, "name") - let transName = synIDattr(synIDtrans(id),"name") - if name != transName - let name .= " (" . transName . ")" - endif - echo "Syntax: " . name - endfu - - command! -n=0 -bar ShowSyntax :call ShowSyntax() - ''; -})) diff --git a/tv/5pkgs/vim/tv.nix b/tv/5pkgs/vim/tv.nix deleted file mode 100644 index 10816ce96..000000000 --- a/tv/5pkgs/vim/tv.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ pkgs }: - -pkgs.tv.vim.makePlugin (pkgs.write "vim-tv" { - # - # TODO - # - "/ftdetect/todo.vim".text = '' - au BufRead,BufNewFile TODO set ft=todo - ''; - "/ftplugin/todo.vim".text = '' - setlocal foldmethod=syntax - ''; - "/syntax/todo.vim".text = '' - syn match todoComment /#.*/ - - syn match todoDate /^[1-9]\S*/ - \ nextgroup=todoSummary - - syn region todoSummary - \ contained - \ contains=todoTag - \ start="." end="$\n" - \ nextgroup=todoBlock - - syn match todoTag /\[[A-Za-z]\+\]/hs=s+1,he=e-1 - \ contained - - syn region todoBlock - \ contained - \ contains=Comment - \ fold - \ start="^[^1-9]" end="^[1-9 ]"re=s-1,he=s-1,me=s-1 - - syn sync minlines=1000 - - hi link todoComment Comment - hi todoDate ctermfg=255 - hi todoSummary ctermfg=229 - hi todoBlock ctermfg=248 - hi todoTag ctermfg=217 - ''; -}) diff --git a/tv/5pkgs/vim/vim.nix b/tv/5pkgs/vim/vim.nix deleted file mode 100644 index c5693a243..000000000 --- a/tv/5pkgs/vim/vim.nix +++ /dev/null @@ -1,16 +0,0 @@ -with import ./lib; -{ pkgs }: - -pkgs.tv.vim.makePlugin (pkgs.writeTextFile (let - name = "vim"; -in { - name = "vim-syntax-${name}-1.0.0"; - destination = "/syntax/${name}.vim"; - text = /* vim */ '' - ${concatMapStringsSep "\n" (s: /* vim */ '' - syn keyword vimColor${s} ${s} - \ containedin=ALLBUT,vimComment,vimLineComment - hi vimColor${s} ctermfg=${s} - '') (map (i: lpad 3 "0" (toString i)) (range 0 255))} - ''; -})) diff --git a/tv/default.nix b/tv/default.nix deleted file mode 100644 index 10b09f2af..000000000 --- a/tv/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - - imports = [ - ../krebs - ./2configs - ./3modules - ]; - - nixpkgs = { - overlays = [ - (import ./5pkgs) - ]; - }; - -} diff --git a/tv/dummy_secrets/default.nix b/tv/dummy_secrets/default.nix deleted file mode 100644 index ab90db55c..000000000 --- a/tv/dummy_secrets/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, ... }: -{ - users.users.root = { - openssh.authorizedKeys.keys = [ - config.krebs.users.tv.pubkey - ]; - }; -} diff --git a/tv/dummy_secrets/o2.pin b/tv/dummy_secrets/o2.pin deleted file mode 100644 index 53a3137cd..000000000 --- a/tv/dummy_secrets/o2.pin +++ /dev/null @@ -1 +0,0 @@ -AT diff --git a/tv/dummy_secrets/repos.nix b/tv/dummy_secrets/repos.nix deleted file mode 100644 index eed712458..000000000 --- a/tv/dummy_secrets/repos.nix +++ /dev/null @@ -1 +0,0 @@ -_: {} diff --git a/tv/dummy_secrets/ssh.id_ed25519 b/tv/dummy_secrets/ssh.id_ed25519 deleted file mode 100644 index a7d2adab4..000000000 --- a/tv/dummy_secrets/ssh.id_ed25519 +++ /dev/null @@ -1,3 +0,0 @@ ------BEGIN OPENSSH PRIVATE KEY----- -dummy ------END OPENSSH PRIVATE KEY----- diff --git a/tv/dummy_secrets/ssh.id_rsa b/tv/dummy_secrets/ssh.id_rsa deleted file mode 100644 index dd7209c2e..000000000 --- a/tv/dummy_secrets/ssh.id_rsa +++ /dev/null @@ -1,3 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -dummy ------END RSA PRIVATE KEY----- diff --git a/tv/krops.nix b/tv/krops.nix deleted file mode 100644 index af0e8616a..000000000 --- a/tv/krops.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ name }: rec { - - inherit (import ../krebs/krops.nix { inherit name; }) - krebs-source - lib - pkgs - ; - - source = lib.evalSource [ - (krebs-source { test = true; }) - { - nixos-config.symlink = "stockholm/tv/1systems/${name}/config.nix"; - secrets.file = toString ./dummy_secrets; - } - ]; - - # usage: $(nix-build --no-out-link --argstr name HOSTNAME --argstr target PATH -A test) - test = { target }: pkgs.krops.writeTest "tv-krops-${name}-ci" { - force = true; - inherit source target; - }; - -} diff --git a/tv/lib b/tv/lib deleted file mode 120000 index dc598c56d..000000000 --- a/tv/lib +++ /dev/null @@ -1 +0,0 @@ -../lib \ No newline at end of file diff --git a/tv/tombstone b/tv/tombstone new file mode 100644 index 000000000..6300357d4 --- /dev/null +++ b/tv/tombstone @@ -0,0 +1 @@ +tv's configuration moved to https://cgit.ni.krebsco.de/hrm