From 2e5167de1560ad0d7b8e294c72e1913f694160c2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 7 Sep 2023 12:26:31 +0200 Subject: lass: migrate away --- lass/5pkgs/acronym/default.nix | 16 -- lass/5pkgs/autowifi | 1 - lass/5pkgs/bank/default.nix | 14 -- lass/5pkgs/default.nix | 24 --- lass/5pkgs/deploy/default.nix | 6 - lass/5pkgs/dl/default.nix | 29 ---- lass/5pkgs/dls/default.nix | 13 -- lass/5pkgs/drbd9/default.nix | 35 ---- lass/5pkgs/emot-menu/default.nix | 34 ---- lass/5pkgs/firefoxPlugins/noscript.nix | 28 --- lass/5pkgs/firefoxPlugins/ublock.nix | 31 ---- lass/5pkgs/firefoxPlugins/vimperator.nix | 19 -- lass/5pkgs/graphml2json/default.nix | 12 -- lass/5pkgs/htmlparser/default.nix | 15 -- lass/5pkgs/init/default.nix | 107 ------------ lass/5pkgs/init/run-vm.sh | 7 - lass/5pkgs/init/test.nix | 13 -- lass/5pkgs/init/test.sh | 11 -- lass/5pkgs/install-system/default.nix | 35 ---- lass/5pkgs/knav/default.nix | 26 --- lass/5pkgs/l-gen-secrets/default.nix | 82 --------- lass/5pkgs/logify/default.nix | 7 - lass/5pkgs/mk_sql_pair/default.nix | 19 -- lass/5pkgs/mpv-poll/default.nix | 40 ----- lass/5pkgs/nichtparasoup/default.nix | 15 -- lass/5pkgs/nichtparasoup/exception.patch | 13 -- lass/5pkgs/nix-index-update/default.nix | 9 - lass/5pkgs/nm-dmenu/default.nix | 10 -- lass/5pkgs/otpmenu/default.nix | 11 -- lass/5pkgs/pop/default.nix | 10 -- lass/5pkgs/q/default.nix | 286 ------------------------------- lass/5pkgs/review-mail-queue/default.nix | 39 ----- lass/5pkgs/rs/default.nix | 6 - lass/5pkgs/searx/default.nix | 69 -------- lass/5pkgs/sshify/default.nix | 39 ----- lass/5pkgs/sshvnc/default.nix | 11 -- lass/5pkgs/super-vnc/default.nix | 38 ---- lass/5pkgs/sxiv/default.nix | 27 --- lass/5pkgs/tdlib-purple/default.nix | 51 ------ lass/5pkgs/unimenu/default.nix | 101 ----------- lass/5pkgs/urban/default.nix | 21 --- lass/5pkgs/xephyrify/default.nix | 62 ------- lass/5pkgs/xml2json/default.nix | 17 -- lass/5pkgs/xonsh2/default.nix | 56 ------ lass/5pkgs/yt-next/default.nix | 13 -- 45 files changed, 1528 deletions(-) delete mode 100644 lass/5pkgs/acronym/default.nix delete mode 160000 lass/5pkgs/autowifi delete mode 100644 lass/5pkgs/bank/default.nix delete mode 100644 lass/5pkgs/default.nix delete mode 100644 lass/5pkgs/deploy/default.nix delete mode 100644 lass/5pkgs/dl/default.nix delete mode 100644 lass/5pkgs/dls/default.nix delete mode 100644 lass/5pkgs/drbd9/default.nix delete mode 100644 lass/5pkgs/emot-menu/default.nix delete mode 100644 lass/5pkgs/firefoxPlugins/noscript.nix delete mode 100644 lass/5pkgs/firefoxPlugins/ublock.nix delete mode 100644 lass/5pkgs/firefoxPlugins/vimperator.nix delete mode 100644 lass/5pkgs/graphml2json/default.nix delete mode 100644 lass/5pkgs/htmlparser/default.nix delete mode 100644 lass/5pkgs/init/default.nix delete mode 100755 lass/5pkgs/init/run-vm.sh delete mode 100644 lass/5pkgs/init/test.nix delete mode 100755 lass/5pkgs/init/test.sh delete mode 100644 lass/5pkgs/install-system/default.nix delete mode 100644 lass/5pkgs/knav/default.nix delete mode 100644 lass/5pkgs/l-gen-secrets/default.nix delete mode 100644 lass/5pkgs/logify/default.nix delete mode 100644 lass/5pkgs/mk_sql_pair/default.nix delete mode 100644 lass/5pkgs/mpv-poll/default.nix delete mode 100644 lass/5pkgs/nichtparasoup/default.nix delete mode 100644 lass/5pkgs/nichtparasoup/exception.patch delete mode 100644 lass/5pkgs/nix-index-update/default.nix delete mode 100644 lass/5pkgs/nm-dmenu/default.nix delete mode 100644 lass/5pkgs/otpmenu/default.nix delete mode 100644 lass/5pkgs/pop/default.nix delete mode 100644 lass/5pkgs/q/default.nix delete mode 100644 lass/5pkgs/review-mail-queue/default.nix delete mode 100644 lass/5pkgs/rs/default.nix delete mode 100644 lass/5pkgs/searx/default.nix delete mode 100644 lass/5pkgs/sshify/default.nix delete mode 100644 lass/5pkgs/sshvnc/default.nix delete mode 100644 lass/5pkgs/super-vnc/default.nix delete mode 100644 lass/5pkgs/sxiv/default.nix delete mode 100644 lass/5pkgs/tdlib-purple/default.nix delete mode 100644 lass/5pkgs/unimenu/default.nix delete mode 100644 lass/5pkgs/urban/default.nix delete mode 100644 lass/5pkgs/xephyrify/default.nix delete mode 100644 lass/5pkgs/xml2json/default.nix delete mode 100644 lass/5pkgs/xonsh2/default.nix delete mode 100644 lass/5pkgs/yt-next/default.nix (limited to 'lass/5pkgs') diff --git a/lass/5pkgs/acronym/default.nix b/lass/5pkgs/acronym/default.nix deleted file mode 100644 index 8380b220a..000000000 --- a/lass/5pkgs/acronym/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: - -pkgs.writeScriptBin "acronym" '' - - #! ${pkgs.bash}/bin/bash - - acro=$1 - - curl -L -s http://www.acronymfinder.com/$acro.html \ - | grep 'class="result-list__body__rank"' \ - | sed ' - s/.*title="\([^"]*\)".*/\1/ - s/^.* - // - s/'/'\'''/g - ' -'' diff --git a/lass/5pkgs/autowifi b/lass/5pkgs/autowifi deleted file mode 160000 index cf3ae8f6f..000000000 --- a/lass/5pkgs/autowifi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cf3ae8f6fe285eab67db4f36f9a3da3762c35317 diff --git a/lass/5pkgs/bank/default.nix b/lass/5pkgs/bank/default.nix deleted file mode 100644 index 9f3a44d79..000000000 --- a/lass/5pkgs/bank/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ writeDashBin, coreutils, pass, hledger, diffutils }: - -writeDashBin "bank" '' - tmp=$(mktemp) - ${pass}/bin/pass show hledger > $tmp - ${hledger}/bin/hledger --file=$tmp "$@" - ${pass}/bin/pass show hledger | if ${diffutils}/bin/diff $tmp -; then - exit 0 - else - ${coreutils}/bin/cat $tmp | ${pass}/bin/pass insert -m hledger - fi - ${coreutils}/bin/rm $tmp -'' - diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix deleted file mode 100644 index 6fa93e146..000000000 --- a/lass/5pkgs/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -self: super: let - lib = super.lib; - - # This callPackage will try to detect obsolete overrides. - callPackage = path: args: let - override = super.callPackage path args; - upstream = lib.optionalAttrs (override ? "name") - (super.${(builtins.parseDrvName override.name).name} or {}); - in if upstream ? "name" && - override ? "name" && - builtins.compareVersions upstream.name override.name != -1 - then - builtins.trace - "Upstream `${upstream.name}' gets overridden by `${override.name}'." - override - else override; - - subdirsOf = path: - lib.mapAttrs (name: _: path + "/${name}") - (lib.filterAttrs (_: x: x == "directory") (builtins.readDir path)); - -in lib.mapAttrs (_: lib.flip callPackage {}) - (lib.filterAttrs (_: dir: lib.pathExists (dir + "/default.nix")) - (subdirsOf ./.)) diff --git a/lass/5pkgs/deploy/default.nix b/lass/5pkgs/deploy/default.nix deleted file mode 100644 index a3fe4dca3..000000000 --- a/lass/5pkgs/deploy/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ writers }: -writers.writeDashBin "deploy" '' - set -xeu - export SYSTEM="$1" - $(nix-build $HOME/sync/stockholm/lass/krops.nix --no-out-link --argstr name "$SYSTEM" -A deploy) -'' diff --git a/lass/5pkgs/dl/default.nix b/lass/5pkgs/dl/default.nix deleted file mode 100644 index 69f2b8c45..000000000 --- a/lass/5pkgs/dl/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ pkgs }: -pkgs.writers.writeBashBin "dl" '' - set -efux - LINK_OR_SEARCH=$@ - if [[ $LINK_OR_SEARCH == magnet:?* ]] || [[ $LINK_OR_SEARCH =~ ^https?: ]]; then - LINK=$LINK_OR_SEARCH - else - SEARCH=$LINK_OR_SEARCH - fi - - if ! [ -z ''${SEARCH+x} ]; then - LINK=$(${pkgs.we-get}/bin/we-get -n 50 -t the_pirate_bay,1337x --json -s "$SEARCH" | - ${pkgs.jq}/bin/jq -r 'to_entries | - .[] | - "\(.key) [\(.value.seeds)]\t\(.value.link)" - ' | - ${pkgs.fzf}/bin/fzf -d '\t' --with-nth=1 | - ${pkgs.coreutils}/bin/cut -f 2 - ) - fi - - if [ -z ''${CATEGORY+x} ]; then - CATEGORY=$(echo -e 'movies\nseries' | ${pkgs.fzf}/bin/fzf) - fi - - ${pkgs.transmission}/bin/transmission-remote yellow.r \ - -w /var/download/finished/sorted/"$CATEGORY" \ - -a "$LINK" -'' diff --git a/lass/5pkgs/dls/default.nix b/lass/5pkgs/dls/default.nix deleted file mode 100644 index 36cdb620b..000000000 --- a/lass/5pkgs/dls/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs }: -pkgs.writers.writeDashBin "dls" '' - set -efux - SESSION_ID=$( - curl -Ss -d '{}' http://yellow.r:9091/transmission/rpc -v -o /dev/null 2>&1 | - grep -oP '(?<=X-Transmission-Session-Id: )\w+' - ) - ${pkgs.curl}/bin/curl -Ss \ - http://yellow.r:9091/transmission/rpc \ - -H "X-Transmission-Session-Id: $SESSION_ID" \ - -d '{"arguments":{"fields":["errorString","eta","isFinished","name","sizeWhenDone","status"]},"method":"torrent-get","tag":4}' | - jq . -'' diff --git a/lass/5pkgs/drbd9/default.nix b/lass/5pkgs/drbd9/default.nix deleted file mode 100644 index 34ef0f564..000000000 --- a/lass/5pkgs/drbd9/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ lib, stdenv, git, fetchzip, fetchFromGitHub, kernel }: let - - version = "9.1.7"; - -in stdenv.mkDerivation { - pname = "drbd"; - version = "${kernel.version}-${version}"; - - src = fetchzip { - url = "https://pkg.linbit.com//downloads/drbd/9/drbd-9.1.7.tar.gz"; - sha256 = "sha256-JsbtOrqhZkG7tFEc6tDmj3RlxZggl0HOKfCI8lYtQok="; - }; - # src = fetchFromGitHub { - # owner = "LINBIT"; - # repo = "drbd"; - # rev = "drbd-${version}"; - # sha256 = "sha256-8HAt+k0yi6XsZZ9mkVCQkv2pn65o3Zsa0KwTSBJh0yY="; - # leaveDotGit = true; - # }; - - nativeBuildInputs = [ git ] ++ kernel.moduleBuildDependencies; - - # hardeningDisable = [ "pic" ]; - - makeFlags = kernel.makeFlags ++ [ - "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - ]; - - installPhase = '' - install -D drbd/drbd.ko -t "$out/lib/modules/${kernel.modDirVersion}/updates/" - install -D drbd/drbd_transport_tcp.ko -t "$out/lib/modules/${kernel.modDirVersion}/updates/" - ''; - - enableParallelBuilding = true; -} diff --git a/lass/5pkgs/emot-menu/default.nix b/lass/5pkgs/emot-menu/default.nix deleted file mode 100644 index 3ce635dac..000000000 --- a/lass/5pkgs/emot-menu/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ coreutils, dmenu, gnused, writeDashBin, writeText, xdotool }: let - - emoticons = writeText "emoticons" '' -¯\(°_o)/¯ | dunno lol shrug dlol -¯\_(ツ)_/¯ | dunno lol shrug dlol -( ͡° ͜ʖ ͡°) | lenny -¯\_( ͡° ͜ʖ ͡°)_/¯ | lenny shrug dlol -( ゚д゚) | aaah sad noo -ヽ(^o^)丿 | hi yay hello -(^o^; | ups hehe -(^∇^) | yay -┗(`皿´)┛ | angry argh -ヾ(^_^) byebye!! | bye -<(^.^<) <(^.^)> (>^.^)> (7^.^)7 (>^.^<) | dance -(-.-)Zzz... | sleep -(∩╹□╹∩) | oh noes woot -™ | tm -ζ | zeta -(╯°□°)╯ ┻━┻ | table flip -(」゜ロ゜)」 | why woot -(_゜_゜_) | gloom I see you -༼ ༎ຶ ෴ ༎ຶ༽ | sad -(\/) (°,,,,°) (\/) | krebs - ''; - -in -writeDashBin "emoticons" '' - set -efu - - data=$(${coreutils}/bin/cat ${emoticons}) - emoticon=$(echo "$data" | ${dmenu}/bin/dmenu | ${gnused}/bin/sed 's/ | .*//') - ${xdotool}/bin/xdotool type --clearmodifiers -- "$emoticon" - exit 0 -'' diff --git a/lass/5pkgs/firefoxPlugins/noscript.nix b/lass/5pkgs/firefoxPlugins/noscript.nix deleted file mode 100644 index 67a00a1b2..000000000 --- a/lass/5pkgs/firefoxPlugins/noscript.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ fetchgit, stdenv, bash, zip }: - -stdenv.mkDerivation rec { - name = "noscript"; - id = "{73a6fe31-595d-460b-a920-fcc0f8843232}"; - - src = fetchgit { - url = "https://github.com/avian2/noscript"; - rev = "c900a079793868bb080ab1e23522d29dc121b4c6"; - sha256 = "1y06gh5a622yrsx0h7v92qnvdi97i54ln09zc1lvk8x430z5bdly"; - }; - - buildInputs = [ zip ]; - - patchPhase = '' - substituteInPlace "version.sh" \ - --replace "/bin/bash" "${bash}/bin/bash" - ''; - - buildPhase = '' - ./makexpi.sh - ''; - - installPhase = '' - mkdir -p $out/ - cp *.xpi $out/${id}.xpi - ''; -} diff --git a/lass/5pkgs/firefoxPlugins/ublock.nix b/lass/5pkgs/firefoxPlugins/ublock.nix deleted file mode 100644 index 29ef250e8..000000000 --- a/lass/5pkgs/firefoxPlugins/ublock.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ fetchgit, stdenv, bash, python, zip }: - -stdenv.mkDerivation rec { - name = "ublock"; - id = "{2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}"; - - src = fetchgit { - url = "https://github.com/chrisaljoudi/uBlock"; - rev = "a70a50052a7914cbf86d46a725812b98434d8c70"; - sha256 = "1qfzy79f8x01i33x0m95k833z1jgxjwb8wvlr6fj6id1kxfvzh77"; - }; - - buildInputs = [ - zip - python - ]; - - patchPhase = '' - substituteInPlace "tools/make-firefox.sh" \ - --replace "/bin/bash" "${bash}/bin/bash" - ''; - - buildPhase = '' - tools/make-firefox.sh all - ''; - - installPhase = '' - mkdir -p $out/ - cp dist/build/uBlock.firefox.xpi $out/${id}.xpi - ''; -} diff --git a/lass/5pkgs/firefoxPlugins/vimperator.nix b/lass/5pkgs/firefoxPlugins/vimperator.nix deleted file mode 100644 index dabef3d20..000000000 --- a/lass/5pkgs/firefoxPlugins/vimperator.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ fetchgit, stdenv, zip }: - -stdenv.mkDerivation rec { - name = "vimperator"; - id = "vimperator@mozdev.org"; - - src = fetchgit { - url = "https://github.com/vimperator/vimperator-labs.git"; - rev = "ba7d8e72516fdc22246748c8183d7bc90f6fb073"; - sha256 = "0drz67qm5hxxzw699rswlpjkg4p2lfipx119pk1nyixrqblcsvq2"; - }; - - buildInputs = [ zip ]; - - installPhase = '' - mkdir -p $out/ - cp downloads/vimperator*.xpi $out/${id}.xpi - ''; -} diff --git a/lass/5pkgs/graphml2json/default.nix b/lass/5pkgs/graphml2json/default.nix deleted file mode 100644 index 6f06ded3d..000000000 --- a/lass/5pkgs/graphml2json/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: -pkgs.writers.writePython3Bin "graphml2json" { libraries = [ pkgs.python3Packages.networkx ]; } '' - import networkx as nx - import json - import sys - - - G = nx.read_graphml(sys.argv[1]) - data = nx.readwrite.json_graph.node_link_data(G) - - print(json.dumps(data, indent=2)) -'' diff --git a/lass/5pkgs/htmlparser/default.nix b/lass/5pkgs/htmlparser/default.nix deleted file mode 100644 index 72bd3f437..000000000 --- a/lass/5pkgs/htmlparser/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ lib, buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "htmlparser"; - version = "v1.0.0"; - - src = fetchFromGitHub { - owner = "htmlparser"; - repo = "htmlparser"; - rev = "02f964ebd24c296dcfa56c357bb8dedde0f39757"; - sha256 = "1k19rdpjf5sdyjfl233y6bsfgkcnv799ivrh2vkw22almg4243ar"; - }; - - vendorSha256 = "0qkd587z4n372y4lqyzjqc1qlsi3525ah99vdm5dqq4jidcd5h7w"; -} diff --git a/lass/5pkgs/init/default.nix b/lass/5pkgs/init/default.nix deleted file mode 100644 index ee49951b1..000000000 --- a/lass/5pkgs/init/default.nix +++ /dev/null @@ -1,107 +0,0 @@ -{ pkgs, lib, vgname ? "vgname", luksmap ? "luksmap", ... }: - -with lib; - -pkgs.writeScriptBin "init" '' - #!/usr/bin/env nix-shell - #! nix-shell -i bash -p cryptsetup gptfdisk jq libxfs - set -xefuo pipefail - - disk=$1 - - if mount | grep -q "$disk"; then - echo "target device is already mounted, bailout" - exit 2 - fi - - bootdev="$disk"2 - luksdev="$disk"3 - luksmap=/dev/mapper/${luksmap} - - vgname=${vgname} - - - rootdev=/dev/mapper/${vgname}-root - homedev=/dev/mapper/${vgname}-home - - read -p "LUKS Password: " lukspw - - # - # partitioning - # - - # http://en.wikipedia.org/wiki/GUID_Partition_Table - # undo: - # dd if=/dev/zero bs=512 count=34 of=/dev/sda - # TODO zero last 34 blocks (lsblk -bno SIZE /dev/sda) - if ! test "$(blkid -o value -s PTTYPE "$disk")" = gpt; then - sgdisk -og "$disk" - sgdisk -n 1:2048:4095 -c 1:"BIOS Boot Partition" -t 1:ef02 "$disk" - sgdisk -n 2:4096:+1G -c 2:"EFI System Partition" -t 2:ef00 "$disk" - sgdisk -n 3:0:0 -c 3:"LUKS container" -t 3:8300 "$disk" - fi - - if ! test "$(blkid -o value -s PARTLABEL "$luksdev")" = "LUKS container"; then - echo zonk2 - exit 23 - fi - - if ! cryptsetup isLuks "$luksdev"; then - # aes xts-plain64 - echo -n "$lukspw" | cryptsetup luksFormat "$luksdev" - \ - -h sha512 \ - --iter-time 5000 - fi - - if ! test -e "$luksmap"; then - echo "$lukspw" | cryptsetup luksOpen "$luksdev" "$(basename "$luksmap")" - - fi - - if ! test "$(blkid -o value -s TYPE "$luksmap")" = LVM2_member; then - pvcreate "$luksmap" - fi - - if ! vgdisplay -s "$vgname"; then vgcreate "$vgname" "$luksmap"; fi - - lvchange -a y /dev/mapper/"$vgname" - - if ! test -e "$rootdev"; then lvcreate -L 3G -n root "$vgname"; fi - - # - # formatting - # - - if ! test "$(blkid -o value -s TYPE "$bootdev")" = vfat; then - mkfs.vfat "$bootdev" - fi - - if ! test "$(blkid -o value -s TYPE "$rootdev")" = xfs; then - mkfs.xfs "$rootdev" - fi - - if ! test "$(lsblk -n -o MOUNTPOINT "$rootdev")" = /mnt; then - mkdir -p /mnt - mount "$rootdev" /mnt - fi - if ! test "$(lsblk -n -o MOUNTPOINT "$bootdev")" = /mnt/boot; then - mkdir -m 0000 -p /mnt/boot - mount "$bootdev" /mnt/boot - fi - - # - # dependencies for stockholm - # - - # TODO: get sentinal file from target_path - mkdir -p /mnt/var/src - touch /mnt/var/src/.populate - - # - # print all the infos - # - - gdisk -l "$disk" - lsblk "$disk" - - echo READY. -'' diff --git a/lass/5pkgs/init/run-vm.sh b/lass/5pkgs/init/run-vm.sh deleted file mode 100755 index 13914ad5f..000000000 --- a/lass/5pkgs/init/run-vm.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env nix-shell -#! nix-shell -i bash -p nixos-generators - -set -efu - -WD=$(dirname "$0") -nixos-generate -I stockholm="$WD"/../../.. -c "$WD"/config.nix -f vm-nogui --run diff --git a/lass/5pkgs/init/test.nix b/lass/5pkgs/init/test.nix deleted file mode 100644 index e76e7e009..000000000 --- a/lass/5pkgs/init/test.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - virtualisation.emptyDiskImages = [ - 8000 - ]; - virtualisation.memorySize = 1500; - boot.tmpOnTmpfs = true; - - environment.systemPackages = [ - (pkgs.callPackage ./default.nix {}) - ]; - services.mingetty.autologinUser = lib.mkForce "root"; -} diff --git a/lass/5pkgs/init/test.sh b/lass/5pkgs/init/test.sh deleted file mode 100755 index 0ceaa73ca..000000000 --- a/lass/5pkgs/init/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env nix-shell -#! nix-shell -i bash -p nixos-generators - -set -xefu - -WD=$(realpath $(dirname "$0")) -TMPDIR=$(mktemp -d) -cd "$TMPDIR" -nixos-generate -c "$WD"/test.nix -f vm-nogui --run "$@" -cd - -rm -r "$TMPDIR" diff --git a/lass/5pkgs/install-system/default.nix b/lass/5pkgs/install-system/default.nix deleted file mode 100644 index 0e13265f6..000000000 --- a/lass/5pkgs/install-system/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ pkgs }: -pkgs.writers.writeDashBin "install-system" '' - set -efux - SYSTEM=$1 - TARGET=$2 - # format - if ! (sshn "$TARGET" -- mountpoint /mnt); then - if ! (sshn "$TARGET" -- type -p nix); then - nix run github:numtide/nixos-remote -- --stop-after-disko --store-paths "$(nix-build --no-out-link -I stockholm="$HOME"/sync/stockholm -I nixos-config="$HOME"/sync/stockholm/lass/1systems/"$SYSTEM"/physical.nix '' -A config.system.build.diskoNoDeps)" /dev/null "$TARGET" - else - disko=$(nix-build -I stockholm=$HOME/sync/stockholm -I secrets=$HOME/sync/stockholm/lass/2configs/tests/dummy-secrets -I nixos-config=$HOME/sync/stockholm/lass/1systems/$SYSTEM/physical.nix '' -A config.system.build.disko) - NIX_SSHOPTS='-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' nix-copy-closure --to "$TARGET" "$disko" - sshn -t "$TARGET" -- "$disko" - fi - fi - - # install dependencies - sshn "$TARGET" << SSH - if ! type -p git; then - nix-channel --update - nix-env -iA nixos.git - fi - SSH - - # populate - $(nix-build --no-out-link "$HOME"/sync/stockholm/lass/krops.nix -A populate --argstr name "$SYSTEM" --argstr target "$TARGET"/mnt/var/src --arg force true) - - # install - sshn "$TARGET" << SSH - NIXOS_CONFIG=/var/src/nixos-config nixos-install --no-root-password -I /mnt/var/src - nixos-enter -- nixos-rebuild -I /var/src switch --install-bootloader - umount -R /mnt - zpool export -fa - SSH -'' diff --git a/lass/5pkgs/knav/default.nix b/lass/5pkgs/knav/default.nix deleted file mode 100644 index 30d49a1b3..000000000 --- a/lass/5pkgs/knav/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, ... }: let - - keynavrc = pkgs.writeText "keynavrc" '' - clear - Escape quit - q record ~/.keynav_macros - shift+at playback - u history-back - a cut-left - s cut-down - w cut-up - d cut-right - shift+a move-left - shift+s move-down - shift+w move-up - shift+d move-right - t windowzoom - c cursorzoom 300 300 - e warp - 1 click 1 - 2 click 2 - 3 click 3 - ''; -in pkgs.writeScriptBin "knav" '' - ${pkgs.keynav}/bin/keynav "loadconfig ${keynavrc}, start" -'' diff --git a/lass/5pkgs/l-gen-secrets/default.nix b/lass/5pkgs/l-gen-secrets/default.nix deleted file mode 100644 index 27e59bb96..000000000 --- a/lass/5pkgs/l-gen-secrets/default.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ pkgs }: -pkgs.writers.writeDashBin "l-gen-secrets" '' - set -efu - HOSTNAME=$1 - TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d) - if [ "''${DRYRUN-n}" = "n" ]; then - trap 'rm -rf $TMPDIR' EXIT - else - echo "$TMPDIR" - set -x - fi - mkdir -p $TMPDIR/out - - PASSWORD=$(${pkgs.pwgen}/bin/pwgen 25 1) - HASHED_PASSWORD=$(echo $PASSWORD | ${pkgs.hashPassword}/bin/hashPassword -s) > /dev/null - - # ssh - ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f $TMPDIR/ssh.id_ed25519 -P "" -C "" >/dev/null - ${pkgs.coreutils}/bin/mv $TMPDIR/ssh.id_ed25519 $TMPDIR/out/ - - # tor - ${pkgs.coreutils}/bin/timeout 1 ${pkgs.tor}/bin/tor --HiddenServiceDir $TMPDIR/tor --HiddenServicePort 1 --SocksPort 0 >/dev/null || : - ${pkgs.coreutils}/bin/mv $TMPDIR/tor/hs_ed25519_secret_key $TMPDIR/out/ssh-tor.priv - - # tinc - ${pkgs.coreutils}/bin/mkdir -p $TMPDIR/tinc - ${pkgs.tinc_pre}/bin/tinc --config $TMPDIR/tinc generate-keys 4096 $TMPDIR/out/wiregrill.key - ${pkgs.coreutils}/bin/cat $TMPDIR/out/wiregrill.key | ${pkgs.wireguard-tools}/bin/wg pubkey > $TMPDIR/wiregrill.pub - - # system passwords - cat < $TMPDIR/out/hashedPasswords.nix - { - root = "$HASHED_PASSWORD"; - mainUser = "$HASHED_PASSWORD"; - } - EOF - - set +f - if [ "''${DRYRUN-n}" = "n" ]; then - cd $TMPDIR/out - for x in *; do - ${pkgs.coreutils}/bin/cat $x | ${pkgs.pass}/bin/pass insert -m hosts/$HOSTNAME/$x > /dev/null - done - echo $PASSWORD | ${pkgs.pass}/bin/pass insert -m admin/$HOSTNAME/pass > /dev/null - ${pkgs.coreutils}/bin/cat $TMPDIR/tor/hostname | ${pkgs.pass}/bin/pass insert -m admin/$HOSTNAME/torname > /dev/null - fi - set -f - - cat <> $hist - mpv $mpv_options $toPlay - } - - if ! [ -e $hist ]; then - touch $hist - fi - - while : - do - if [ -s $pl ]; then - toPlay=$(head -1 $pl) - sed -i '1d' $pl - if $(echo $toPlay | grep -Eq 'https?://(www.)?youtube.com/watch'); then - lastYT=$toPlay - fi - play_video $toPlay - else - if [ -n "$lastYT" ]; then - next=$(yt-next $lastYT) - lastYT=$next - play_video $next - fi - sleep 1 - fi - done -'' diff --git a/lass/5pkgs/nichtparasoup/default.nix b/lass/5pkgs/nichtparasoup/default.nix deleted file mode 100644 index fcff7ad54..000000000 --- a/lass/5pkgs/nichtparasoup/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ stdenv, pkgs, ... }: -let - py = pkgs.python3Packages.python.withPackages (p: [ - p.werkzeug - p.beautifulsoup4 - ]); - src = pkgs.fetchFromGitHub { - owner = "k4cg"; - repo = "nichtparasoup"; - rev = "c6dcd0d"; - sha256 = "10xy20bjdnd5bjv2hf6v5y5wi0mc9555awxkjqf57rk6ngc5w6ss"; - }; -in pkgs.writeDashBin "nichtparasoup" '' - ${py}/bin/python ${src}/nichtparasoup.py "$@" -'' diff --git a/lass/5pkgs/nichtparasoup/exception.patch b/lass/5pkgs/nichtparasoup/exception.patch deleted file mode 100644 index 34c177de0..000000000 --- a/lass/5pkgs/nichtparasoup/exception.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/nichtparasoup.py b/nichtparasoup.py -index 9da9a2b..833ca71 100755 ---- a/nichtparasoup.py -+++ b/nichtparasoup.py -@@ -211,7 +211,7 @@ def cache_fill_loop(): - try: - sources[crawler][site].crawl() - info = Crawler.info() -- except Exception, e: -+ except Exception as e: - logger.error("Error in crawler %s - %s: %s" % (crawler, site, e)) - break - diff --git a/lass/5pkgs/nix-index-update/default.nix b/lass/5pkgs/nix-index-update/default.nix deleted file mode 100644 index 40be8d1a3..000000000 --- a/lass/5pkgs/nix-index-update/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs }: -pkgs.writers.writeDashBin "nix-index-update" '' - set -efux - filename="index-$(uname -m)-$(uname | tr A-Z a-z)" - mkdir -p ~/.cache/nix-index && cd ~/.cache/nix-index - # -N will only download a new version if there is an update. - ${pkgs.wget}/bin/wget -q -N https://github.com/Mic92/nix-index-database/releases/latest/download/$filename - ln -f $filename files -'' diff --git a/lass/5pkgs/nm-dmenu/default.nix b/lass/5pkgs/nm-dmenu/default.nix deleted file mode 100644 index ff4ba1633..000000000 --- a/lass/5pkgs/nm-dmenu/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, lib, ... }: - -pkgs.writeDashBin "nm-dmenu" '' - export PATH=$PATH:${lib.makeBinPath [ - pkgs.dmenu - pkgs.networkmanagerapplet - pkgs.procps - ]} - exec ${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu "$@" -'' diff --git a/lass/5pkgs/otpmenu/default.nix b/lass/5pkgs/otpmenu/default.nix deleted file mode 100644 index fffe47005..000000000 --- a/lass/5pkgs/otpmenu/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs }: -pkgs.writers.writeDashBin "otpmenu" '' -set -efux -x=$(${pkgs.pass}/bin/pass git ls-files '*/otp.gpg' \ - | ${pkgs.gnused}/bin/sed 's:/otp\.gpg$::' \ - | ${pkgs.dmenu}/bin/dmenu -) - -otp=$(${(pkgs.pass.withExtensions (ext: [ ext.pass-otp ]))}/bin/pass otp code "$x/otp") -printf %s "$otp" | ${pkgs.wtype}/bin/wtype -s 1 - || printf %s "$otp" | ${pkgs.xdotool}/bin/xdotool type -f - -'' diff --git a/lass/5pkgs/pop/default.nix b/lass/5pkgs/pop/default.nix deleted file mode 100644 index cec22e3b1..000000000 --- a/lass/5pkgs/pop/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: - -pkgs.writeScriptBin "pop" '' - #! ${pkgs.bash}/bin/bash - - file=$1 - - head -1 $file - sed -i 1d $file -'' diff --git a/lass/5pkgs/q/default.nix b/lass/5pkgs/q/default.nix deleted file mode 100644 index 9b834f0c4..000000000 --- a/lass/5pkgs/q/default.nix +++ /dev/null @@ -1,286 +0,0 @@ -{ pkgs, ... }: -let - q-cal = let - # XXX 23 is the longest line of cal's output - pad = ''{ - ${pkgs.gnused}/bin/sed ' - # rtrim - s/ *$// - - # delete last empty line - ''${/^$/d} - ' \ - | ${pkgs.gawk}/bin/awk '{printf "%-23s\n", $0}' \ - | ${pkgs.gnused}/bin/sed ' - # colorize header - 1,2s/.*/&/ - - # colorize week number - s/^[ 1-9][0-9]/&/ - ' - }''; - in '' - ${pkgs.coreutils}/bin/paste \ - <(${pkgs.util-linux}/bin/cal -mw \ - $(${pkgs.coreutils}/bin/date +'%m %Y' -d 'last month') \ - | ${pad} - ) \ - <(${pkgs.util-linux}/bin/cal -mw \ - | ${pkgs.gnused}/bin/sed ' - # colorize day of month - s/\(^\| \)'"$(${pkgs.coreutils}/bin/date +%e)"'\>/&/ - ' \ - | ${pad} - ) \ - <(${pkgs.util-linux}/bin/cal -mw \ - $(${pkgs.coreutils}/bin/date +'%m %Y' -d 'next month') \ - | ${pad} - ) \ - | ${pkgs.gnused}/bin/sed 's/\t/ /g' - ''; - - q-isodate = '' - ${pkgs.coreutils}/bin/date \ - '+%Y-%m-%dT%H:%M:%S%:z' - ''; - - q-gitdir = '' - 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 = '' - cd /sys/class/backlight/intel_backlight - = .42) t_col = "1;32" - else if (r >= 23) t_col = "1;33" - else if (r >= 11) t_col = "1;31" - else t_col = "5;1;31" - return sgr(t_col) strdup("■", t1) sgr(";30") strdup("■", t2) sgr() - } - - function sgr(p) { - return "\x1b[" p "m" - } - - function strdup(s,n,t) { - t = sprintf("%"n"s","") - gsub(/ /,s,t) - return t - } - - END { - name = ENVIRON["POWER_SUPPLY_NAME"] - - charge_unit = "Ah" - charge_now = ENVIRON["POWER_SUPPLY_CHARGE_NOW"] / 10^6 - charge_full = ENVIRON["POWER_SUPPLY_CHARGE_FULL"] / 10^6 - - current_unit = "A" - current_now = ENVIRON["POWER_SUPPLY_CURRENT_NOW"] / 10^6 - - energy_unit = "Wh" - energy_now = ENVIRON["POWER_SUPPLY_ENERGY_NOW"] / 10^6 - energy_full = ENVIRON["POWER_SUPPLY_ENERGY_FULL"] / 10^6 - - power_unit = "W" - power_now = ENVIRON["POWER_SUPPLY_POWER_NOW"] / 10^6 - - voltage_unit = "V" - voltage_now = ENVIRON["POWER_SUPPLY_VOLTAGE_NOW"] / 10^6 - voltage_min_design = ENVIRON["POWER_SUPPLY_VOLTAGE_MIN_DESIGN"] / 10^6 - - #printf "charge_now: %s\n", charge_now - #printf "charge_full: %s\n", charge_full - #printf "current_now: %s\n", current_now - #printf "energy_now: %s\n", energy_now - #printf "energy_full: %s\n", energy_full - #printf "energy_full: %s\n", ENVIRON["POWER_SUPPLY_ENERGY_FULL"] - #printf "energy_full: %s\n", ENVIRON["POWER_SUPPLY_ENERGY_FULL"] / 10^6 - #printf "power_now: %s\n", power_now - #printf "voltage_now: %s\n", voltage_now - - if (current_now == 0 && voltage_now != 0) { - current_now = power_now / voltage_now - } - if (power_now == 0) { - power_now = current_now * voltage_now - } - if (charge_now == 0 && voltage_min_design != 0) { - charge_now = energy_now / voltage_min_design - } - if (energy_now == 0) { - energy_now = charge_now * voltage_min_design - } - if (charge_full == 0 && voltage_min_design != 0) { - charge_full = energy_full / voltage_min_design - } - if (energy_full == 0) { - energy_full = charge_full * voltage_min_design - } - - if (charge_now == 0 || charge_full == 0) { - die("unknown charge") - } - - charge_ratio = charge_now / charge_full - - out = out name - out = out sprintf(" %s", print_bar(10, charge_ratio)) - out = out sprintf(" %d%", charge_ratio * 100) - out = out sprintf(" %.2f%s", charge_now, charge_unit) - if (current_now != 0) { - out = out sprintf("/%.1f%s", current_now, current_unit) - } - out = out sprintf(" %d%s", energy_full, energy_unit) - if (power_now != 0) { - out = out sprintf("/%.1f%s", power_now, power_unit) - } - if (current_now != 0) { - out = out sprintf(" %s", print_hm(charge_now / current_now)) - } - - print out - } - ' - ''; - in '' - for uevent in /sys/class/power_supply/*/uevent; do - ${power_supply} "$uevent" || : - done - ''; - - q-virtualization = '' - echo "VT: $(${pkgs.systemd}/bin/systemd-detect-virt)" - ''; - - q-wireless = '' - for dev in $( - ${pkgs.iw}/bin/iw dev \ - | ${pkgs.gnused}/bin/sed -n 's/^\s*Interface\s\+\([0-9a-z]\+\)$/\1/p' - ); do - inet=$(${pkgs.iproute2}/bin/ip addr show $dev \ - | ${pkgs.gnused}/bin/sed -n ' - s/.*inet \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p - ') \ - || unset inet - ssid=$(${pkgs.iw}/bin/iw dev $dev link \ - | ${pkgs.gnused}/bin/sed -n ' - s/.*\tSSID: \(.*\)/\1/p - ') \ - || unset ssid - echo "$dev''${inet+ $inet}''${ssid+ $ssid}" - done - ''; - - q-online = '' - if ${pkgs.curl}/bin/curl -s google.com >/dev/null; then - echo 'online' - else - echo offline - fi - ''; - - q-thermal_zone = '' - 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 = '' - TODO_file=$HOME/TODO - if test -e "$TODO_file"; then - ${pkgs.coreutils}/bin/cat "$TODO_file" \ - | ${pkgs.gawk}/bin/gawk -v now=$(${pkgs.coreutils}/bin/date +%s) ' - BEGIN { print "remind=0" } - /^[0-9]/{ - x = $1 - gsub(".", "\\\\&", x) - rest = substr($0, index($0, " ")) - rest = $0 - sub(" *", "", rest) - gsub(".", "\\\\&", rest) - print "test $(${pkgs.coreutils}/bin/date +%s -d"x") -lt "now" && \ - echo \"\x1b[38;5;208m\""rest esc "\"\x1b[m\" && \ - (( remind++ ))" - } - END { print "test $remind = 0 && echo \"nothing to remind\"" } - ' \ - | { - # bash needed for (( ... )) - ${pkgs.bash}/bin/bash - } - else - echo "$TODO_file: no such file or directory" - fi - ''; - -in -# bash needed for <(...) -pkgs.writeBashBin "q" '' - set -eu - export PATH=/var/empty - (${q-todo}) || : - if [ "$PWD" != "$HOME" ]; then - (HOME=$PWD; ${q-todo}) || : - fi - echo - ${q-cal} - echo - ${q-isodate} - (${q-gitdir}) & - (${q-intel_backlight}) & - (${q-power_supply}) & - (${q-virtualization}) & - (${q-wireless}) & - (${q-online}) & - (${q-thermal_zone}) & - wait -'' diff --git a/lass/5pkgs/review-mail-queue/default.nix b/lass/5pkgs/review-mail-queue/default.nix deleted file mode 100644 index c8c66706c..000000000 --- a/lass/5pkgs/review-mail-queue/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ pkgs }: let - - review = pkgs.writers.writeBash "review-mail" '' - mail="$1" - ${pkgs.exim}/bin/exim -Mvc "$mail" | grep -E 'Subject:|To:' - ${pkgs.exim}/bin/exim -Mvl "$mail" - while :; do - read -p 'delete?' key - case "$key" in - v*) - ${pkgs.exim}/bin/exim -Mvc "$mail" - ;; - d*) - ${pkgs.exim}/bin/exim -Mrm "$mail" - break - ;; - r*) - ${pkgs.exim}/bin/exim -Mt "$mail" - break - ;; - n*) - break - ;; - esac - done - echo '-------------------' - echo '-------------------' - echo '-------------------' - echo '-------------------' - echo '-------------------' - ''; - -in pkgs.writers.writeBashBin "review-mail" '' - for mail in $(${pkgs.exim}/bin/exim -bp \ - | ${pkgs.gnugrep}/bin/grep frozen \ - | ${pkgs.gawk}/bin/awk '{print $3}'); do - ${review} "$mail" - done -'' diff --git a/lass/5pkgs/rs/default.nix b/lass/5pkgs/rs/default.nix deleted file mode 100644 index 6b27908fb..000000000 --- a/lass/5pkgs/rs/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: - -#TODO: get tab-completion working again -pkgs.writeBashBin "rs" '' - rsync -vaP --append-verify "$@" -'' diff --git a/lass/5pkgs/searx/default.nix b/lass/5pkgs/searx/default.nix deleted file mode 100644 index e5ce5788a..000000000 --- a/lass/5pkgs/searx/default.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ lib, nixosTests, python3, python3Packages, fetchFromGitHub, fetchpatch }: - -with python3Packages; - -toPythonModule (buildPythonApplication rec { - pname = "searx"; - version = "1.0.0"; - - # Can not use PyPI because certain test files are missing. - src = fetchFromGitHub { - owner = "searx"; - repo = "searx"; - rev = "v${version}"; - sha256 = "0ghkx8g8jnh8yd46p4mlbjn2zm12nx27v7qflr4c8xhlgi0px0mh"; - }; - - postPatch = '' - sed -i 's/==.*$//' requirements.txt - ''; - - preBuild = '' - export SEARX_DEBUG="true"; - ''; - - propagatedBuildInputs = [ - Babel - certifi - dateutil - flask - flaskbabel - gevent - grequests - jinja2 - langdetect - lxml - ndg-httpsclient - pyasn1 - pyasn1-modules - pygments - pysocks - pytz - pyyaml - requests - speaklater - werkzeug - ]; - - # tests try to connect to network - doCheck = false; - # checkInputs = [ - # Babel mock nose2 covCore pep8 plone-testing splinter - # unittest2 zope_testrunner selenium - # ]; - - postInstall = '' - # Create a symlink for easier access to static data - mkdir -p $out/share - ln -s ../${python3.sitePackages}/searx/static $out/share/ - ''; - - passthru.tests = { inherit (nixosTests) searx; }; - - meta = with lib; { - homepage = "https://github.com/searx/searx"; - description = "A privacy-respecting, hackable metasearch engine"; - license = licenses.agpl3Plus; - maintainers = with maintainers; [ matejc fpletz globin danielfullmer ]; - }; -}) diff --git a/lass/5pkgs/sshify/default.nix b/lass/5pkgs/sshify/default.nix deleted file mode 100644 index 445b9b4aa..000000000 --- a/lass/5pkgs/sshify/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ pkgs }: -# usage: sshify prism.r -- curl ifconfig.me -pkgs.writers.writeBashBin "sshify" '' - set -efu - - TMPDIR=$(mktemp -d) - - SSH_ARGS=() - - while [[ "$#" -gt 0 ]]; do - case $1 in - --) - shift - break - ;; - *) - SSH_ARGS+=($1) - ;; - esac - shift - done - - if [[ "$#" -le 0 ]]; then - echo no command specified - exit 1 - fi - - RANDOM_HIGH_PORT=$(shuf -i 20000-65000 -n 1) - - cat << EOF >$TMPDIR/proxychains.conf - [ProxyList] - socks4 127.0.0.1 $RANDOM_HIGH_PORT - EOF - - ssh -fNM -S "$TMPDIR/socket" -D "$RANDOM_HIGH_PORT" "''${SSH_ARGS[@]}" - trap "ssh -S $TMPDIR/socket -O exit bla 2>/dev/null; rm -rf $TMPDIR >&2" EXIT - - ${pkgs.proxychains-ng}/bin/proxychains4 -q -f "$TMPDIR/proxychains.conf" "$@" -'' diff --git a/lass/5pkgs/sshvnc/default.nix b/lass/5pkgs/sshvnc/default.nix deleted file mode 100644 index f66ed1b0d..000000000 --- a/lass/5pkgs/sshvnc/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs }: -pkgs.writers.writeBashBin "sshvnc" '' - set -xm - - RANDOM_HIGH_PORT=$(shuf -i 20000-65000 -n 1) - ssh "$@" -f -L $RANDOM_HIGH_PORT:localhost:$RANDOM_HIGH_PORT -- x11vnc -noxdamage -noxfixes -noxrecord -display :0 -localhost -rfbport $RANDOM_HIGH_PORT - - sleep 3 - - _JAVA_AWT_WM_NONREPARENTING=1 ${pkgs.turbovnc}/bin/vncviewer localhost:$RANDOM_HIGH_PORT -'' diff --git a/lass/5pkgs/super-vnc/default.nix b/lass/5pkgs/super-vnc/default.nix deleted file mode 100644 index ce0e3aaa7..000000000 --- a/lass/5pkgs/super-vnc/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ pkgs, lib }: let - - quoteChar = c: - if c == "\n" then "'\n'" - else c; - quote = x: if x == "" then "''" else lib.stringAsChars quoteChar x; - -in pkgs.writers.writeDashBin "super-vnc" '' - PATH=${lib.makeBinPath (with pkgs; [ - xorg.xrandr gnugrep coreutils xorg.xorgserver gnused openssh gawk tightvnc - ])} - remote=$1 - res_x=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1) - res_y=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2) - export modeline="$(gtf "$res_x" "$res_y" 60 | sed -n 's/.*Modeline "\([^" ]\+\)" \(.*\)/\1 \2/p')" - export name="$(echo "$modeline" | sed 's/\([^ ]\+\) .*/\1/')" - export vncline="''${res_x}x''${res_y}+0+0" - - if [ -z "$modeline" -o -z "$name" ]; then - echo "Error! modeline=$modeline name=$name" - exit 1 - fi - - echo $modeline - - # TODO user random highport - ssh "$remote" -L 5900:localhost:55900 bash <&2; exit 1 - else - # Consume stdin and put it in the temporal file - cat > "$tmpfile" - fi - fi - - for arg in "$@"; do - # if it's a pipe then drain it to $tmpfile - [ -p "$arg" ] && cat "$arg" > "$tmpfile" - done - - if [ -s "$tmpfile" ]; then - ${nsxiv}/bin/nsxiv -q "$@" "$tmpfile" # -q to silence warnings - else - ${nsxiv}/bin/nsxiv "$@" # fallback - fi -'' diff --git a/lass/5pkgs/tdlib-purple/default.nix b/lass/5pkgs/tdlib-purple/default.nix deleted file mode 100644 index d7937da58..000000000 --- a/lass/5pkgs/tdlib-purple/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ stdenv, pkgs, fetchFromGitHub, cmake, pidgin, libwebp, libtgvoip } : - -let - - tdlib = stdenv.mkDerivation rec { - version = "1.6.0"; - pname = "tdlib"; - - src = fetchFromGitHub { - owner = "tdlib"; - repo = "td"; - rev = "v${version}"; - sha256 = "0zlzpl6fgszg18kwycyyyrnkm255dvc6fkq0b0y32m5wvwwl36cv"; - }; - - buildInputs = with pkgs; [ gperf openssl readline zlib ]; - nativeBuildInputs = [ pkgs.cmake ]; - - }; - -in stdenv.mkDerivation rec { - pname = "tdlib-purple"; - version = "0.7.8"; - - src = fetchFromGitHub { - owner = "ars3niy"; - repo = pname; - rev = "v${version}"; - sha256 = "17g54mcxsidcx37l6m4p8i06ln1hvq3347dhdl9xkkn7pqpwvv1c"; - }; - - cmakeFlags = [ - "-Dtgvoip_INCLUDE_DIRS=${libtgvoip.dev}/include/tgvoip" - ]; - - nativeBuildInputs = [ cmake ]; - buildInputs = [ pidgin tdlib libwebp libtgvoip ]; - - installPhase = '' - mkdir -p $out/lib/purple-2/ - cp *.so $out/lib/purple-2/ - ''; - - meta = with stdenv.lib; { - homepage = "https://github.com/ars3niy/tdlib-purple"; - description = "New libpurple plugin for Telegram"; - license = licenses.gpl2; - maintainers = [ maintainers.lassulus ]; - platforms = platforms.linux; - }; -} diff --git a/lass/5pkgs/unimenu/default.nix b/lass/5pkgs/unimenu/default.nix deleted file mode 100644 index cf2a15277..000000000 --- a/lass/5pkgs/unimenu/default.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ - lib, - runCommand, - fetchurl, - writeText, - writers, - coreutils, - dmenu, - gnused, - libnotify, - xclip, - xdotool, - gawk, -}: let - unicode-file = runCommand "unicode.txt" {} '' - ${ - writers.writePython3 "generate.py" {flakeIgnore = ["E501" "E722"];} '' - import csv - - with open("${ - fetchurl { - url = "https://unicode.org/Public/UCD/latest/ucd/UnicodeData.txt"; - sha256 = "sha256-NgGOaGV/3LNIX2NmMP/oyFMuAcl3cD0oA/W4nWxf6vs="; - } - }", "r") as unicode_data: - reader = csv.reader(unicode_data, delimiter=";") - next(reader) # skip first row containing \0 - for row in reader: - codepoint = row[0] - name = row[1] - alternate_name = row[10] - try: - print(chr(int(codepoint, 16)), codepoint, name, alternate_name, sep=" ") - except: - continue - '' - } > $out - ''; - kaomoji-file = writeText "kaomoji.txt" '' - ¯\(°_o)/¯ dunno lol shrug dlol - ¯\_(ツ)_/¯ dunno lol shrug dlol - ( ͡° ͜ʖ ͡°) lenny - ¯\_( ͡° ͜ʖ ͡°)_/¯ lenny shrug dlol - ( ゚д゚) aaah sad noo - ヽ(^o^)丿 hi yay hello - (^o^: ups hehe - (^∇^) yay - ┗(`皿´)┛ angry argh - ヾ(^_^) byebye!! bye - <(^.^<) <(^.^)> (>^.^)> (7^.^)7 (>^.^<) dance - (-.-)Zzz... sleep - (∩╹□╹∩) oh noes woot - (╯°□°)╯ ┻━┻ table flip - (」゜ロ゜)」 why woot - (_゜_゜_) gloom I see you - ༼ ༎ຶ ෴ ༎ຶ༽ sad - (\/) (°,,,,°) (\/) krebs - ┳━┳ ヽ(ಠل͜ಠ)ノ putting table back - ┻━┻︵ \(°□°)/ ︵ ┻━┻ flip all dem tablez - (`・ω・´) bear look - ᕦ(ຈل͜ຈ)ᕤ strong flex muscle bicep - ᕦ(ò_óˇ)ᕤ strong flex muscle bicep - (๑>ᴗ<๑) excite - (∩ ` -´)⊃━━☆゚.*・。゚ wizard spell magic - ╰( ͡° ͜ʖ ͡° )つ──☆*:・゚ wizard spell magic - ◕ ◡ ◕ puss in boots big eye - ≋≋≋≋≋̯̫⌧̯̫(ˆ•̮ ̮•ˆ) nyan cat - ʕ•ᴥ•ʔ bear - (ԾɷԾ) adventure time - (⁀ᗢ⁀) happy yay - (≧◡≦) happy yay - \(º □ º )/ panic - 𓂺 penis - 𓂸 penis - __〆( ̄ー ̄ ) write down - __〆(º □ º) write down - __〆(^_^) write down - C= C= C= C= C=┌(;・ω・)┘ running fast here - ▓▒░(°◡°)░▒▓ dont care - (๑ᵔ⤙ᵔ๑) nom food eating - (·•᷄ࡇ •᷅ ) ohoh sad - ᕕ( ᐛ )ᕗ hehe lol letsgo - (^_~) wink - ''; -in - # ref https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode - writers.writeDashBin "unimenu" '' - history_file=$HOME/.cache/unimenu - PATH=${lib.makeBinPath [coreutils dmenu gnused libnotify xclip xdotool]} - chosen=$(cat "$history_file" ${kaomoji-file} ${unicode-file} | dmenu -p unicode -i -l 10 | tee --append "$history_file" | sed "s/ .*//") - - [ "$chosen" != "" ] || exit - - echo "$chosen" | tr -d '\n' | xclip -selection clipboard - - if [ -n "$1" ]; then - xdotool key Shift+Insert - else - notify-send --app-name="$(basename "$0")" "'$chosen' copied to clipboard." & - fi - '' diff --git a/lass/5pkgs/urban/default.nix b/lass/5pkgs/urban/default.nix deleted file mode 100644 index fb8adaed9..000000000 --- a/lass/5pkgs/urban/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, ... }: - -pkgs.writeScriptBin "urban" '' - #!/bin/sh - set -euf - term=$1 - curl -LsS 'http://www.urbandictionary.com/define.php?term='"$term" \ - | sed 's/<\/\?a\>[^>]*>//g' \ - | sed 's/<\([^>]*\)>/\n<\1\n/g' \ - | grep . \ - | sed -n '/
' \ - | grep -v '^' \ - | sed ' - s/"/"/g - s/'/'\'''/g - s/>/>/g - s/</>/g - ' -'' diff --git a/lass/5pkgs/xephyrify/default.nix b/lass/5pkgs/xephyrify/default.nix deleted file mode 100644 index 20c546dbb..000000000 --- a/lass/5pkgs/xephyrify/default.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ writeDashBin, writeHaskellPackage, coreutils, xorg, virtualgl, ... }: - -let - - xephyrify-xmonad = writeHaskellPackage "xephyrify-xmonad" { - executables.xmonad = { - extra-depends = [ - "containers" - "unix" - "xmonad" - ]; - text = /* haskell */ '' - module Main where - import XMonad - import Data.Monoid - import System.Posix.Process (executeFile) - import qualified Data.Map as Map - - main :: IO () - main = do - xmonad def - { workspaces = [ "1" ] - , layoutHook = myLayoutHook - , keys = myKeys - , normalBorderColor = "#000000" - , focusedBorderColor = "#000000" - , handleEventHook = myEventHook - } - - myEventHook :: Event -> X All - - myEventHook (ConfigureEvent { ev_event_type = 22 }) = do - spawn "${xorg.xrandr}/bin/xrandr >/dev/null 2>&1" - return (All True) - - myEventHook _ = do - return (All True) - - myLayoutHook = Full - myKeys _ = Map.fromList [] - ''; - }; - }; - -in writeDashBin "xephyrify" '' - NDISPLAY=''${NDISPLAY:-$(${coreutils}/bin/shuf -i 100-65536 -n 1)} - echo "using DISPLAY $NDISPLAY" - ${xorg.xorgserver}/bin/Xephyr -br -ac -reset -terminate -resizeable -dpi 60 -nolisten local :$NDISPLAY & - if test -n $DROP_TO_USER; then - sleep 1 - ls /tmp/.X11-unix/ - id - ${coreutils}/bin/chgrp "$DROP_TO_USER" "/tmp/.X11-unix/X$NDISPLAY" - ${coreutils}/bin/chmod 770 "/tmp/.X11-unix/X$NDISPLAY" - fi - XEPHYR_PID=$! - DISPLAY=:$NDISPLAY ${xephyrify-xmonad}/bin/xmonad & - XMONAD_PID=$! - DISPLAY=:$NDISPLAY ${virtualgl}/bin/vglrun "$@" - kill $XMONAD_PID - kill $XEPHYR_PID -'' diff --git a/lass/5pkgs/xml2json/default.nix b/lass/5pkgs/xml2json/default.nix deleted file mode 100644 index 78690d4b7..000000000 --- a/lass/5pkgs/xml2json/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: -let - pp = pkgs.python35Packages; -in pp.buildPythonPackage rec { - name = "xml2json-${version}"; - version = "22ffcd"; - propagatedBuildInputs = [ - pp.simplejson - ]; - src = pkgs.fetchFromGitHub { - owner = "hay"; - repo = "xml2json"; - rev = "${version}"; - sha256 = "1snjd6q6bk517350gdrl8kkphkra0iaz56i583h2q57ab09r29vc"; - }; - doCheck = false; -} diff --git a/lass/5pkgs/xonsh2/default.nix b/lass/5pkgs/xonsh2/default.nix deleted file mode 100644 index d55d22445..000000000 --- a/lass/5pkgs/xonsh2/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ lib, stdenv -, fetchFromGitHub -, python39Packages -, glibcLocales -, coreutils -, git -, extraInputs ? [] -}: let - - python3Packages = python39Packages; - -in python3Packages.buildPythonApplication rec { - pname = "xonsh2"; - version = "master"; - - # fetch from github because the pypi package ships incomplete tests - src = fetchFromGitHub { - owner = "anki-code"; - repo = "xonsh2"; - rev = "bd96fcdce9319ab6b90c7d9ac47d2249b61144d0"; - sha256 = "0b632rac8macfp2mmvhh1f34cf1m5qfpjajwnf676qk7jzn79vx6"; - }; - - LC_ALL = "en_US.UTF-8"; - - postPatch = '' - sed -ie 's|/usr/bin/env|${coreutils}/bin/env|' scripts/xon.sh - find scripts -name 'xonsh*' -exec sed -i -e "s|env -S|env|" {} \; - find -name "*.xsh" | xargs sed -ie 's|/usr/bin/env|${coreutils}/bin/env|' - patchShebangs . - ''; - - doCheck = false; - - checkPhase = '' - HOME=$TMPDIR pytest -k 'not test_repath_backslash and not test_os and not test_man_completion and not test_builtins and not test_main and not test_ptk_highlight and not test_pyghooks' - HOME=$TMPDIR pytest -k 'test_builtins or test_main' --reruns 5 - HOME=$TMPDIR pytest -k 'test_ptk_highlight' - ''; - - checkInputs = [ python3Packages.pytest python3Packages.pytest-rerunfailures glibcLocales git ]; - - propagatedBuildInputs = with python3Packages; [ ply prompt_toolkit pygments ] ++ extraInputs; - - meta = with lib; { - description = "A Python-ish, BASHwards-compatible shell"; - homepage = "https://xon.sh/"; - # changelog = "https://github.com/xonsh/xonsh/releases/tag/${version}"; - license = licenses.bsd3; - platforms = platforms.all; - }; - - passthru = { - shellPath = "/bin/xonsh2"; - }; -} diff --git a/lass/5pkgs/yt-next/default.nix b/lass/5pkgs/yt-next/default.nix deleted file mode 100644 index 8132b4f05..000000000 --- a/lass/5pkgs/yt-next/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ... }: - -pkgs.writeScriptBin "yt-next" '' - #! ${pkgs.bash}/bin/bash - - vid=$1 - num=''${NUM:-1} - - curl -Ls $1 \ - | grep 'href="/watch?v=' \ - | head -n$num \ - | sed 's,.*href="\([^"]*\)".*,https://youtube.com\1,' -'' -- cgit v1.2.3