commit a236fcb45e0b71d0fa4610acec084197cc058cf8 Author: Kate Adkins Date: Thu Nov 7 16:25:41 2024 -0700 initial commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4733cb9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.nix] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fe52977 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +nixos/configs/apple-silicon-support/asahi/AdminUserRecoveryInfo.plist filter=lfs diff=lfs merge=lfs -text +nixos/configs/apple-silicon-support/asahi/BuildManifest.plist filter=lfs diff=lfs merge=lfs -text +nixos/configs/apple-silicon-support/asahi/RestoreVersion.plist filter=lfs diff=lfs merge=lfs -text +nixos/configs/apple-silicon-support/asahi/SystemVersion.plist filter=lfs diff=lfs merge=lfs -text +nixos/configs/apple-silicon-support/asahi/stub_info.json filter=lfs diff=lfs merge=lfs -text +nixos/configs/apple-silicon-support/asahi/all_firmware.tar.gz filter=lfs diff=lfs merge=lfs -text +nixos/configs/apple-silicon-support/asahi/extras filter=lfs diff=lfs merge=lfs -text +nixos/configs/apple-silicon-support/asahi/installer.log filter=lfs diff=lfs merge=lfs -text +nixos/configs/apple-silicon-support/asahi/kernelcache.release.mac13g filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e0cbf89 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +tmux/plugins +.ccls-cache +result* +*.swp +taskrc-local diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..50a4227 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "proprietary"] + path = proprietary + url = git@git.katesiria.org:ktemkin/dotfiles-proprietary diff --git a/.vim/coc-settings.json b/.vim/coc-settings.json new file mode 100644 index 0000000..156236a --- /dev/null +++ b/.vim/coc-settings.json @@ -0,0 +1,7 @@ +{ + "cSpell.words": [ + "devicons", + "prettierrc", + "tabe" + ] +} \ No newline at end of file diff --git a/ModemManager/fcc-unlock.d/8086 b/ModemManager/fcc-unlock.d/8086 new file mode 100755 index 0000000..abcad64 --- /dev/null +++ b/ModemManager/fcc-unlock.d/8086 @@ -0,0 +1,107 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: CC0-1.0 +# 2024 Stoica Floris +# +# Lenovo-shipped XMM7560 (8086:7560) FCC unlock + +if [[ "$FCC_UNLOCK_DEBUG_LOG" == '1' ]]; then + exec 3>&1 4>&2 + trap 'exec 2>&4 1>&3' 0 1 2 3 + exec 1>>/var/log/mm-xmm7560-fcc.log 2>&1 +fi + +# require program name and at least 2 arguments +[ $# -lt 2 ] && exit 1 + +# first argument is DBus path, not needed here +shift + +# second and next arguments are control port names +for PORT in "$@"; do + # match port type in Linux 5.14 and newer + grep -q AT "/sys/class/wwan/$PORT/type" 2>/dev/null && { + AT_PORT=$PORT + break + } + # match port name in Linux 5.13 + echo "$PORT" | grep -q AT && { + AT_PORT=$PORT + break + } +done + +# fail if no AT port exposed +[ -n "$AT_PORT" ] || exit 2 + +DEVICE=/dev/${AT_PORT} + +at_command() { + exec 99<>"$DEVICE" + echo -e "$1\r" >&99 + read answer <&99 + read answer <&99 + echo "$answer" + exec 99>&- +} + +log() { + echo "$1" +} + +error() { + echo "$1" >&2 +} + +reverseWithLittleEndian() { + num="$1" + printf "%x" $(("0x${num:6:2}${num:4:2}${num:2:2}${num:0:2}")) +} + +VENDOR_ID_HASH="3df8c719" + +for i in {1..9}; do + log "Requesting challenge from WWAN modem (attempt #${i})" + RAW_CHALLENGE=$(at_command "at+gtfcclockgen") + CHALLENGE=$(echo "$RAW_CHALLENGE" | grep -o '0x[0-9a-fA-F]\+' | awk '{print $1}') + + if [ -n "$CHALLENGE" ]; then + log "Got challenge from modem: $CHALLENGE" + HEX_CHALLENGE=$(printf "%08x" "$CHALLENGE") + REVERSE_HEX_CHALLENGE=$(reverseWithLittleEndian "${HEX_CHALLENGE}") + COMBINED_CHALLENGE="${REVERSE_HEX_CHALLENGE}${VENDOR_ID_HASH}" + RESPONSE_HASH=$(printf "%s" "$COMBINED_CHALLENGE" | xxd -r -p | sha256sum | cut -d ' ' -f 1) + TRUNCATED_RESPONSE=$(printf "%.8s" "${RESPONSE_HASH}") + REVERSED_RESPONSE=$(reverseWithLittleEndian "$TRUNCATED_RESPONSE") + RESPONSE=$(printf "%d" "0x${REVERSED_RESPONSE}") + + log "Sending hash modem: $RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+gtfcclockver=$RESPONSE") + log "at+gtfcclockver response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+gtfcclockmodeunlock") + log "at+gtfcclockmodeunlock response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+cfun=1") + log "at+cfun response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+gtfcclockstate") + log "at+gtfcclockstate response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(echo "$UNLOCK_RESPONSE" | tr -d '\r') + + if [ "$UNLOCK_RESPONSE" = "1" ]; then + log "FCC was unlocked previously" + exit 0 + fi + + if [ "$UNLOCK_RESPONSE" = "OK" ]; then + log "FCC unlock success" + exit 0 + else + error "Unlock failed. Got response: $UNLOCK_RESPONSE" + fi + else + error "Failed to obtain FCC challenge. Got: ${RAW_CHALLENGE}" + fi + + sleep 0.5 +done + +exit 2 diff --git a/ModemManager/fcc-unlock.d/8086:7560 b/ModemManager/fcc-unlock.d/8086:7560 new file mode 100755 index 0000000..abcad64 --- /dev/null +++ b/ModemManager/fcc-unlock.d/8086:7560 @@ -0,0 +1,107 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: CC0-1.0 +# 2024 Stoica Floris +# +# Lenovo-shipped XMM7560 (8086:7560) FCC unlock + +if [[ "$FCC_UNLOCK_DEBUG_LOG" == '1' ]]; then + exec 3>&1 4>&2 + trap 'exec 2>&4 1>&3' 0 1 2 3 + exec 1>>/var/log/mm-xmm7560-fcc.log 2>&1 +fi + +# require program name and at least 2 arguments +[ $# -lt 2 ] && exit 1 + +# first argument is DBus path, not needed here +shift + +# second and next arguments are control port names +for PORT in "$@"; do + # match port type in Linux 5.14 and newer + grep -q AT "/sys/class/wwan/$PORT/type" 2>/dev/null && { + AT_PORT=$PORT + break + } + # match port name in Linux 5.13 + echo "$PORT" | grep -q AT && { + AT_PORT=$PORT + break + } +done + +# fail if no AT port exposed +[ -n "$AT_PORT" ] || exit 2 + +DEVICE=/dev/${AT_PORT} + +at_command() { + exec 99<>"$DEVICE" + echo -e "$1\r" >&99 + read answer <&99 + read answer <&99 + echo "$answer" + exec 99>&- +} + +log() { + echo "$1" +} + +error() { + echo "$1" >&2 +} + +reverseWithLittleEndian() { + num="$1" + printf "%x" $(("0x${num:6:2}${num:4:2}${num:2:2}${num:0:2}")) +} + +VENDOR_ID_HASH="3df8c719" + +for i in {1..9}; do + log "Requesting challenge from WWAN modem (attempt #${i})" + RAW_CHALLENGE=$(at_command "at+gtfcclockgen") + CHALLENGE=$(echo "$RAW_CHALLENGE" | grep -o '0x[0-9a-fA-F]\+' | awk '{print $1}') + + if [ -n "$CHALLENGE" ]; then + log "Got challenge from modem: $CHALLENGE" + HEX_CHALLENGE=$(printf "%08x" "$CHALLENGE") + REVERSE_HEX_CHALLENGE=$(reverseWithLittleEndian "${HEX_CHALLENGE}") + COMBINED_CHALLENGE="${REVERSE_HEX_CHALLENGE}${VENDOR_ID_HASH}" + RESPONSE_HASH=$(printf "%s" "$COMBINED_CHALLENGE" | xxd -r -p | sha256sum | cut -d ' ' -f 1) + TRUNCATED_RESPONSE=$(printf "%.8s" "${RESPONSE_HASH}") + REVERSED_RESPONSE=$(reverseWithLittleEndian "$TRUNCATED_RESPONSE") + RESPONSE=$(printf "%d" "0x${REVERSED_RESPONSE}") + + log "Sending hash modem: $RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+gtfcclockver=$RESPONSE") + log "at+gtfcclockver response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+gtfcclockmodeunlock") + log "at+gtfcclockmodeunlock response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+cfun=1") + log "at+cfun response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+gtfcclockstate") + log "at+gtfcclockstate response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(echo "$UNLOCK_RESPONSE" | tr -d '\r') + + if [ "$UNLOCK_RESPONSE" = "1" ]; then + log "FCC was unlocked previously" + exit 0 + fi + + if [ "$UNLOCK_RESPONSE" = "OK" ]; then + log "FCC unlock success" + exit 0 + else + error "Unlock failed. Got response: $UNLOCK_RESPONSE" + fi + else + error "Failed to obtain FCC challenge. Got: ${RAW_CHALLENGE}" + fi + + sleep 0.5 +done + +exit 2 diff --git a/README.md b/README.md new file mode 100644 index 0000000..a5b483c --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Kate's Dotfiles + +These are our personal dotfiles -- if you find this link, please don't pass it around. <3 + +## Notes + +Most things in here are managed by `NixOS`, nix-darwin`, or `home-manager`. The following things, +however, need to work on native Windows, and thus shouldn't be Nixified: + +- neovim's configuration +- wezterm's configruation +- xonsh's configruation diff --git a/age/all_recipients b/age/all_recipients new file mode 100644 index 0000000..37aba01 --- /dev/null +++ b/age/all_recipients @@ -0,0 +1,3 @@ +age1yubikey1qgkz2s97uzquemxx694vvqp2dj6328zpf4l3rj3mqfcnguvuhxcguw8fgxy +age1yubikey1qt5cjhklyek73awwaducjgn0g7l93xeuvcnudnac23kdyem2k7v7zlmn6p0 +age1yubikey1qtgvszdcz3n9a707l3k2mhaql9mdm6sqe69mr2hypl8n0qxs5m52sgu9wdd diff --git a/age/identities/yubikey-backup-5c b/age/identities/yubikey-backup-5c new file mode 100644 index 0000000..bc88429 --- /dev/null +++ b/age/identities/yubikey-backup-5c @@ -0,0 +1,7 @@ +# Serial: 26907034, Slot: 1 +# Name: KATE_YK_5NFC +# Created: Sun, 03 Mar 2024 00:54:50 +0000 +# PIN policy: Once (A PIN is required once per session, if set) +# Touch policy: Always (A physical touch is required for every decryption) +# Recipient: age1yubikey1qtgvszdcz3n9a707l3k2mhaql9mdm6sqe69mr2hypl8n0qxs5m52sgu9wdd +AGE-PLUGIN-YUBIKEY-1N2GE5QVZ9Z9GN2C6KSXJM diff --git a/age/identities/yubikey-keyring-5a b/age/identities/yubikey-keyring-5a new file mode 100644 index 0000000..d93b144 --- /dev/null +++ b/age/identities/yubikey-keyring-5a @@ -0,0 +1,7 @@ +# Serial: 26154720, Slot: 1 +# Name: 5A_BACKUP +# Created: Mon, 04 Mar 2024 22:40:29 +0000 +# PIN policy: Once (A PIN is required once per session, if set) +# Touch policy: Always (A physical touch is required for every decryption) +# Recipient: age1yubikey1qt5cjhklyek73awwaducjgn0g7l93xeuvcnudnac23kdyem2k7v7zlmn6p0 +AGE-PLUGIN-YUBIKEY-1UQTG7QVZPUAZPGC8AH5Z6 diff --git a/age/identities/yubikey-keyring-5c b/age/identities/yubikey-keyring-5c new file mode 100644 index 0000000..84af1ba --- /dev/null +++ b/age/identities/yubikey-keyring-5c @@ -0,0 +1,7 @@ +# Serial: 26908840, Slot: 1 +# Name: age identity 58701041 +# Created: Sun, 12 May 2024 23:45:49 +0000 +# PIN policy: Once (A PIN is required once per session, if set) +# Touch policy: Always (A physical touch is required for every decryption) +# Recipient: age1yubikey1qgkz2s97uzquemxx694vvqp2dj6328zpf4l3rj3mqfcnguvuhxcguw8fgxy +AGE-PLUGIN-YUBIKEY-14ZVF5QVZTPCPQSGTZ2YKJ diff --git a/age/recipients/yubikey-backup-5c.pub b/age/recipients/yubikey-backup-5c.pub new file mode 100644 index 0000000..9a621d9 --- /dev/null +++ b/age/recipients/yubikey-backup-5c.pub @@ -0,0 +1 @@ +age1yubikey1qtgvszdcz3n9a707l3k2mhaql9mdm6sqe69mr2hypl8n0qxs5m52sgu9wdd diff --git a/age/recipients/yubikey-keyring-5a.pub b/age/recipients/yubikey-keyring-5a.pub new file mode 100644 index 0000000..6b31c23 --- /dev/null +++ b/age/recipients/yubikey-keyring-5a.pub @@ -0,0 +1 @@ +age1yubikey1qt5cjhklyek73awwaducjgn0g7l93xeuvcnudnac23kdyem2k7v7zlmn6p0 diff --git a/age/recipients/yubikey-keyring-5c.pub b/age/recipients/yubikey-keyring-5c.pub new file mode 100644 index 0000000..ce7476b --- /dev/null +++ b/age/recipients/yubikey-keyring-5c.pub @@ -0,0 +1 @@ +age1yubikey1qgkz2s97uzquemxx694vvqp2dj6328zpf4l3rj3mqfcnguvuhxcguw8fgxy diff --git a/cargo/config.toml b/cargo/config.toml new file mode 100644 index 0000000..3953bb4 --- /dev/null +++ b/cargo/config.toml @@ -0,0 +1,9 @@ +[target.x86_64-apple-darwin] +rustflags = [ "-C", "linker=/usr/bin/clang"] + +[target.aarch64-apple-darwin] +rustflags = [ "-C", "linker=/usr/bin/clang"] + +[target.x86_64-unknown-linux-musl] +linker = "clang" +rustflags = "-Clink-arg=--target=x86_64-unknown-linux-musl -Clink-arg=-fuse-ld=lld" diff --git a/espanso/config/default.yml b/espanso/config/default.yml new file mode 100644 index 0000000..992901d --- /dev/null +++ b/espanso/config/default.yml @@ -0,0 +1,13 @@ +# +# Our espanso config. +# + +# Double tapping right alt turns espanso on and off +toggle_key: RIGHT_ALT + +# one can try Clipboard or Inject, too +backend: Auto + +# Enable/disable the config auto-reload after a file change is detected. +auto_restart: true + diff --git a/espanso/config/element.yml b/espanso/config/element.yml new file mode 100644 index 0000000..d618af5 --- /dev/null +++ b/espanso/config/element.yml @@ -0,0 +1,4 @@ +filter_title: "Element" + +includes: + - ../match/_messengers.yml diff --git a/espanso/config/mattermost.yml b/espanso/config/mattermost.yml new file mode 100644 index 0000000..4bbf2a9 --- /dev/null +++ b/espanso/config/mattermost.yml @@ -0,0 +1,4 @@ +filter_title: "Mattermost" + +includes: + - ../match/_messengers.yml diff --git a/espanso/config/nheko.yml b/espanso/config/nheko.yml new file mode 100644 index 0000000..3f984cf --- /dev/null +++ b/espanso/config/nheko.yml @@ -0,0 +1,4 @@ +filter_title: "nheko" + +includes: + - ../match/_messengers.yml diff --git a/espanso/config/signal.yml b/espanso/config/signal.yml new file mode 100644 index 0000000..1da15ee --- /dev/null +++ b/espanso/config/signal.yml @@ -0,0 +1,4 @@ +filter_title: "Signal" + +includes: + - ../match/_messengers.yml diff --git a/espanso/match/_messengers.yml b/espanso/match/_messengers.yml new file mode 100644 index 0000000..8d95176 --- /dev/null +++ b/espanso/match/_messengers.yml @@ -0,0 +1,47 @@ +# +# Matches for Signal. +# + +filter_title: "Signal" + +matches: + + - trigger: "o;" + word: true + replace: "⚪O>" + - trigger: "t;" + word: true + replace: "🔵T>" + - trigger: "k;" + word: true + replace: "🟣K>" + - trigger: "w;" + word: true + replace: "🟢W>" + - trigger: "s;" + word: true + replace: "🔴S>" + - trigger: "e;" + word: true + replace: "⚫E>" + + # keep the non-discord ones, too + - trigger: "zo" + word: true + replace: "⚪O>" + - trigger: "zt" + word: true + replace: "🔵T>" + - trigger: "zk" + word: true + replace: "🟣K>" + - trigger: "zw" + word: true + replace: "🟢W>" + - trigger: "zs" + word: true + replace: "🔴S>" + - trigger: "ze" + word: true + replace: "⚫E>" + diff --git a/espanso/match/base.yml b/espanso/match/base.yml new file mode 100644 index 0000000..15733c5 --- /dev/null +++ b/espanso/match/base.yml @@ -0,0 +1,64 @@ +# +# Matches for all programs. +# + +matches: + + # つ + - trigger: "tsu" + word: true + replace: "つ" + - trigger: "tsu's" + word: true + replace: "つ's" + + + # non-discord chats + - trigger: "zo" + word: true + replace: "⚪O>" + - trigger: "zt" + word: true + replace: "🔵つ>" + - trigger: "zk" + word: true + replace: "🟣K>" + - trigger: "zw" + word: true + replace: "🟢W>" + - trigger: "zs" + word: true + replace: "🔴S>" + - trigger: "ze" + word: true + replace: "⚫E>" + + # Puck + - trigger: "z1" + word: true + replace: "⑴" + - trigger: "z2" + word: true + replace: "⑵" + - trigger: "z3" + word: true + replace: "⑶" + + # Dates + - trigger: ":ndate" + word: true + replace: "{{fulldate}}" + vars: + - name: fulldate + type: date + params: + format: "%A, %B %d, %Y" + + # Emoji + - trigger: ":allemoji:" + word: true + replace: "🤍💙💜💚❤️🩶" + - trigger: "zah" + word: true + replace: "🤍💙💜💚❤️🩶" + diff --git a/espanso/match/packages/__noremove b/espanso/match/packages/__noremove new file mode 100644 index 0000000..e69de29 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4c362e3 --- /dev/null +++ b/flake.lock @@ -0,0 +1,1219 @@ +{ + "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "systems": "systems" + }, + "locked": { + "lastModified": 1723293904, + "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", + "owner": "ryantm", + "repo": "agenix", + "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "attic": { + "inputs": { + "crane": "crane", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1730257295, + "narHash": "sha256-OQl+aAsKiyygvpzck1u0sZf/R4T9zM903CgNDFmmzA8=", + "owner": "zhaofengli", + "repo": "attic", + "rev": "48c8b395bfbc6b76c7eae74df6c74351255a095c", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "attic", + "type": "github" + } + }, + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1708890466, + "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "665b3c6748534eb766c777298721cece9453fdae", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1725860795, + "narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "7f795bf75d38e0eea9fed287264067ca187b88a9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1716150083, + "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "type": "github" + } + }, + "crane": { + "inputs": { + "nixpkgs": [ + "attic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722960479, + "narHash": "sha256-NhCkJJQhD5GUib8zN9JrmYGMwt4lCRp6ZVNzIiYCl0Y=", + "owner": "ipetkov", + "repo": "crane", + "rev": "4c6c77920b8d44cd6660c1621dea6b3fc4b4c4f4", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "darwin_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730600078, + "narHash": "sha256-BoyFmE59HDF3uybBySsWVoyjNuHvz3Wv8row/mSb958=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4652874d014b82cb746173ffc64f6a70044daa7e", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "esp-dev": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1729678934, + "narHash": "sha256-fSyXeWJ+9IVJJvZztu1suJm/zp/FgfAzh8RVoveVssQ=", + "owner": "mirrexagon", + "repo": "nixpkgs-esp-dev", + "rev": "3f748af71ac7890e1f860801fdca2beef65e8353", + "type": "github" + }, + "original": { + "owner": "mirrexagon", + "repo": "nixpkgs-esp-dev", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "attic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "inputs": { + "systems": [ + "stylix", + "systems" + ] + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1689549921, + "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1713702291, + "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "46.1", + "repo": "gnome-shell", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730633670, + "narHash": "sha256-ZFJqIXpvVKvzOVFKWNRDyIyAo+GYdmEPaYi1bZB6uf0=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "8f6ca7855d409aeebe2a582c6fd6b6a8d0bf5661", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "lix": { + "flake": false, + "locked": { + "lastModified": 1730610940, + "narHash": "sha256-ZsTpii4kZcioRF3bu3/pS374R9GYQVyrMpBNr2ZUnVg=", + "ref": "refs/heads/main", + "rev": "b1a0e3c0029c2dd5fb7c8dd2db4f9e0b309c9f54", + "revCount": 16445, + "type": "git", + "url": "https://git@git.lix.systems/lix-project/lix" + }, + "original": { + "type": "git", + "url": "https://git@git.lix.systems/lix-project/lix" + } + }, + "lix-module": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "flakey-profile": "flakey-profile", + "lix": [ + "lix" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1727752861, + "narHash": "sha256-jowmo2aEzrEpPSM96IWtajuogdJm7DjAWxFTEb7Ct0s=", + "ref": "refs/heads/main", + "rev": "fd186f535a4ac7ae35d98c1dd5d79f0a81b7976d", + "revCount": 116, + "type": "git", + "url": "https://git@git.lix.systems/lix-project/nixos-module" + }, + "original": { + "type": "git", + "url": "https://git@git.lix.systems/lix-project/nixos-module" + } + }, + "nil": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1726716330, + "narHash": "sha256-mIuOP4I51eFLquRaxMKx67pHmhatZrcVPjfHL98v/M8=", + "owner": "oxalica", + "repo": "nil", + "rev": "c8e8ce72442a164d89d3fdeaae0bcc405f8c015a", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "nil", + "type": "github" + } + }, + "niri": { + "inputs": { + "flake-parts": "flake-parts_2", + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs_4", + "nixpkgs-stable": "nixpkgs-stable_2", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1730666848, + "narHash": "sha256-2KV8r72ieAmsFeU6wzJhV7q24WIIO70u5LdRBgJGYgE=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "22dfd130c044944b83017e646cca82d9ab2ad2a1", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1726304152, + "narHash": "sha256-4YDrKMwXGVOBkeaISbxqf24rLuHvO98TnqxWYfgiSeg=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "6a48728ffb1e638839b07f9ab2f06b2adb41dc61", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v0.1.9", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1730664018, + "narHash": "sha256-FBKtV07NQzb1l0UuxmKtW9wYTFWV9txjhrPMrZByTZ4=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "4c2f49d566579ee9a7f7528bde03c24ebaefd6fe", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, + "nix-flatpak": { + "locked": { + "lastModified": 1711997201, + "narHash": "sha256-J71xzQlVYsjagA4AsVwRazhBh2rZrPpKvxTgs6UzL7c=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "b76fa31346db7fc958a9898f3c594696ca71c4fd", + "type": "github" + }, + "original": { + "owner": "gmodena", + "ref": "v0.4.1", + "repo": "nix-flatpak", + "type": "github" + } + }, + "nix-formatter-pack": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs" + ], + "nmd": "nmd", + "nmt": "nmt" + }, + "locked": { + "lastModified": 1705252799, + "narHash": "sha256-HgSTREh7VoXjGgNDwKQUYcYo13rPkltW7IitHrTPA5c=", + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "rev": "2de39dedd79aab14c01b9e2934842051a160ffa5", + "type": "github" + }, + "original": { + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "attic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729742964, + "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "e04df33f62cdcf93d73e9a04142464753a16db67", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-on-droid": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nix-formatter-pack": "nix-formatter-pack", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-docs": "nixpkgs-docs", + "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", + "nmd": "nmd_2" + }, + "locked": { + "lastModified": 1720396533, + "narHash": "sha256-UFzk/hZWO1VkciIO5UPaSpJN8s765wsngUSvtJM6d5Q=", + "owner": "nix-community", + "repo": "nix-on-droid", + "rev": "f3d3b8294039f2f9a8fb7ea82c320f29c6b0fe25", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "nix-on-droid", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1703013332, + "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-docs": { + "locked": { + "lastModified": 1705957679, + "narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-for-bootstrap": { + "locked": { + "lastModified": 1720244366, + "narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1730504152, + "narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1724316499, + "narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1730327045, + "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "080166c15633801df010977d9d7474b4a6c549d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1729501122, + "narHash": "sha256-tScdcYQ37kMqlyqb5yizNDTKXZASLB4zHitlHwOg+/o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "56c7c4a3f5fdbef5bf81c7d9c28fbb45dc626611", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixpkgs-unstable", + "type": "indirect" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1726481836, + "narHash": "sha256-MWTBH4dd5zIz2iatDb8IkqSjIeFum9jAqkFxgHLdzO4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "20f9370d5f588fb8c72e844c54511cab054b5f40", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1725634671, + "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1729256560, + "narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=", + "path": "/nix/store/riqkpszjqk02bi1wppfg8ip5xvh102qd-source", + "rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nmd": { + "flake": false, + "locked": { + "lastModified": 1666190571, + "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", + "owner": "rycee", + "repo": "nmd", + "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" + } + }, + "nmd_2": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs-docs" + ], + "scss-reset": "scss-reset" + }, + "locked": { + "lastModified": 1705050560, + "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", + "owner": "~rycee", + "repo": "nmd", + "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", + "type": "sourcehut" + }, + "original": { + "owner": "~rycee", + "repo": "nmd", + "type": "sourcehut" + } + }, + "nmt": { + "flake": false, + "locked": { + "lastModified": 1648075362, + "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", + "owner": "rycee", + "repo": "nmt", + "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmt", + "type": "gitlab" + } + }, + "openxc7": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_6" + }, + "locked": { + "lastModified": 1725961608, + "narHash": "sha256-w5wBoO9jTgzgiAE/K+VfMvirt3kB2+TGE9TORq3ouQc=", + "owner": "openXC7", + "repo": "toolchain-nix", + "rev": "3ecf230d16fe46fca02ee321d9a1a66c04bffacf", + "type": "github" + }, + "original": { + "owner": "openXC7", + "repo": "toolchain-nix", + "type": "github" + } + }, + "root": { + "inputs": { + "agenix": "agenix", + "attic": "attic", + "darwin": "darwin_2", + "esp-dev": "esp-dev", + "flake-utils": "flake-utils_2", + "home-manager": "home-manager_2", + "lix": "lix", + "lix-module": "lix-module", + "nil": "nil", + "niri": "niri", + "nix-flatpak": "nix-flatpak", + "nix-on-droid": "nix-on-droid", + "nixpkgs": "nixpkgs_5", + "openxc7": "openxc7", + "stylix": "stylix", + "waveforms": "waveforms" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nil", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726453838, + "narHash": "sha256-pupsow4L79SBfNwT6vh/5RAbVZuhngIA0RTCZksXmZY=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "ca2e79cd22625d214b8437c2c4080ce79bd9f7d2", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "scss-reset": { + "flake": false, + "locked": { + "lastModified": 1631450058, + "narHash": "sha256-muDlZJPtXDIGevSEWkicPP0HQ6VtucbkMNygpGlBEUM=", + "owner": "andreymatin", + "repo": "scss-reset", + "rev": "0cf50e27a4e95e9bb5b1715eedf9c54dee1a5a91", + "type": "github" + }, + "original": { + "owner": "andreymatin", + "repo": "scss-reset", + "type": "github" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_5", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_3", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_6", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-tmux": "tinted-tmux" + }, + "locked": { + "lastModified": 1729963473, + "narHash": "sha256-uGjTjvvlGQfQ0yypVP+at0NizI2nrb6kz4wGAqzRGbY=", + "owner": "danth", + "repo": "stylix", + "rev": "04afcfc0684d9bbb24bb1dc77afda7c1843ec93b", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1696725948, + "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1716423189, + "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1696725902, + "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "waveforms": { + "inputs": { + "nixpkgs": "nixpkgs_7" + }, + "locked": { + "lastModified": 1728376004, + "narHash": "sha256-mTib24PapKexOaTUNsGiTtZFaXR2LYaQazVBGzlnAig=", + "owner": "liff", + "repo": "waveforms-flake", + "rev": "1d58c63da1ce63a2896d13a3d66238ff9aca89e4", + "type": "github" + }, + "original": { + "owner": "liff", + "repo": "waveforms-flake", + "type": "github" + } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1730166465, + "narHash": "sha256-nq7bouXQXaaPPo/E+Jbq+wNHnatD4dY8OxSrRqzvy6s=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "a713cf46cb7db84a0d1b57c3a397c610cad3cf98", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.5", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1730258684, + "narHash": "sha256-E+69sdxUhPSNI8+JlTL6KKbNv5qVD3L1y8hdVO37A44=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "b0ee6db9fa9901c675b3c7e952c2a8ce987a0f58", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e6ed8fa --- /dev/null +++ b/flake.nix @@ -0,0 +1,505 @@ +# +# Our system configuration, as a Nix flake. +# Now with bonus packages! +# +# vim: et:ts=2:sw=2: +# +{ + # + # The sources we depend on. + # + inputs = { + # Core and utilities. + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + + # Not nix -- lix! + lix = { + url = "git+https://git@git.lix.systems/lix-project/lix"; + flake = false; + }; + lix-module = { + url = "git+https://git@git.lix.systems/lix-project/nixos-module"; + inputs.lix.follows = "lix"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; + + # Home-manager. + home-manager = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Styling! + stylix = { + url = "github:danth/stylix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Attic cache. + attic = { + url = "github:zhaofengli/attic"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # For our phone. + nix-on-droid = { + url = "github:nix-community/nix-on-droid/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + + # Flakes for packages. + nil.url = "github:oxalica/nil"; + agenix.url = "github:ryantm/agenix"; + openxc7.url = "github:openXC7/toolchain-nix"; + niri.url = "github:sodiboo/niri-flake"; + waveforms.url = "github:liff/waveforms-flake"; + esp-dev.url = "github:mirrexagon/nixpkgs-esp-dev"; + + # Flatpack support + nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; + + # Various system type support. + darwin.url = "github:lnl7/nix-darwin/master"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; + }; + + # + # Package definitions for each of our various types. + # Used in the outputs section. + # + + # + # Our various products; mostly machine configurations. + # + outputs = + { + self, + nixpkgs, + flake-utils, + home-manager, + openxc7, + darwin, + agenix, + nil, + lix-module, + niri, + stylix, + waveforms, + esp-dev, + attic, + nix-flatpak, + nix-on-droid, + ... + }: + + # + # Our various packages; generated for each system. + # + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { inherit system; config.allowUnfree = true; }; + callPackage = pkgs.callPackage; + deprekages= self.outputs.packages; + in + { + # The packages themselves, + packages = rec { + # fonts + font-monolisa = callPackage ./fonts/monolisa.nix { }; + font-codicon = callPackage ./fonts/codicon.nix { }; + font-manrope = callPackage ./fonts/manrope.nix { }; + + # scientific things + ffts = callPackage ./packages/scopehal-apps/ffts.nix { }; + libsigrok4DSL = callPackage ./packages/scopehal-apps/libsigrok4DSL.nix { }; + vulkan-sdk = callPackage ./packages/scopehal-apps/vulkan-sdk.nix { }; + scopehal-apps = callPackage ./packages/scopehal-apps { deprekages = deprekages.${system}; }; + scopehal-sigrok-bridge = callPackage ./packages/scopehal-apps/sigrok-bridge.nix { + deprekages = deprekages.${system}; + }; + + # apps + navit = callPackage ./packages/navit.nix { }; + navit-with-maps = callPackage ./packages/navit.nix { with_maps = true; }; + binary-ninja = callPackage ./packages/binary-ninja.nix { }; + argos = callPackage ./packages/argos.nix { }; + todoist-electron = callPackage ./packages/todoist-electron.nix { }; + home-assistant-desktop = callPackage ./packages/home-assistant-desktop/x86_64-linux.nix { }; + flexbv = callPackage ./packages/flexbv.nix { }; + glowing-bear-desktop = callPackage ./packages/glowing-bear-desktop.nix { }; + hrvst-cli = callPackage ./packages/hrvst-cli { }; + notion-app = callPackage ./packages/notion-app { inherit _7zz; }; + + # utilities + ykush = callPackage ./packages/ykush.nix { }; + wsl-gpg-forward = callPackage ./windows/gpg-forward.nix { }; + oxfs = callPackage ./packages/oxfs.nix { }; + pcsclite = callPackage ./packages/pcsclite.nix { }; + age-plugin-yubikey = callPackage ./packages/age-plugin-yubikey.nix { inherit pcsclite; }; + humanfx = callPackage ./packages/humanfx { }; + clipboard-sync = callPackage ./packages/clipboard-sync.nix { }; + vsmartcard = callPackage ./packages/vsmartcard.nix { }; + pcsc-relay = callPackage ./packages/pcsc-relay.nix { }; + neard = callPackage ./packages/neard.nix { }; + libnfc = callPackage ./packages/libnfc.nix { inherit libnfc-nci; }; + jadx = callPackage ./packages/jadx { }; + firefox-webserial = callPackage ./packages/firefox-webserial { inherit ws-server; }; + ryzen-ppd = callPackage ./packages/ryzen-ppd { }; + avbroot = callPackage ./packages/avbroot { }; + okc-agents = callPackage ./packages/okc-agents.nix { }; + _7zz = pkgs._7zz.override { useUasm = true; }; + + # libraries + libnfc-nci = callPackage ./packages/libnfc-nci { }; + ws-server = callPackage ./packages/ws-server { }; + rubyPackages = callPackage ./packages/ruby-gems.nix { }; + + # jetbrains products + jetbrains-jdk = callPackage ./packages/jetbrains-jdk.nix { }; + jetbrains = import ./packages/jetbrains.nix { + inherit pkgs; + jdk = jetbrains-jdk; + }; + + # kernel modules + linuxPackages_i915-sriov = callPackage ./packages/i915-sriov/kernel.nix { }; + i915-sriov = callPackage ./packages/i915-sriov { linuxPackages = linuxPackages_i915-sriov; }; + linux-nfc-lenovo = callPackage ./packages/linux-nfc-lenovo { }; + + # hw support + dell = callPackage ./packages/dell { }; + + # udev rules~ + t5-udev-rules = callPackage ./packages/t5-udev-rules { }; + ykush-udev-rules = callPackage ./packages/ykush-udev-rules { }; + dreamsource-udev-rules = callPackage ./packages/dreamsource-udev-rules { }; + hantek-udev-rules = callPackage ./packages/hantek-udev-rules { }; + linux-nfc-lenovo-udev-rules = callPackage ./packages/linux-nfc-lenovo/udev.nix { }; + + # weechat + weechat-discord = callPackage ./packages/weechat-discord { }; + + # kakoune + kak-tree-sitter = callPackage ./packages/kak-tree-sitter { }; + + # xonsh and xontribs + xonsh-with-xontribs = pkgs.xonsh.override { + extraPackages = pythonPackages: [ + (callPackage ./packages/xontrib-whole-word-jumping.nix { }) + (callPackage ./packages/xontrib-term-integrations.nix { }) + (callPackage ./packages/xontrib-sh.nix { }) + ]; + }; + }; + } + ) + + # + # Our per-machine configurations. + # Appeneded to the output of the packages generated by eachDefaultSystem. + # + // rec { + + # + # Helpers. + # + + # Common to all machines, Linux or macOS. + commonModuleSet = [ + ./nixos/packages + + ./nixos/configs/stylix + ./nixos/configs/nix.nix + ./nixos/configs/dotfiles + ./nixos/configs/calendar.nix + ./nixos/configs/include-conf.nix + ./nixos/configs/flake-registry.nix + ./nixos/configs/storage-optimization.nix + + ./nixos/services/tailscale.nix + + lix-module.nixosModules.default + home-manager.nixosModules.home-manager + ]; + + # Modules for all linux machines. + linuxModuleSet = [ + ./nixos/configuration.linux.nix + + ./nixos/configs/udev.nix + ./nixos/configs/printing.nix + ./nixos/configs/virt-host.nix + ./nixos/configs/mount-rsync-kate.nix + ./nixos/configs/mount-fastmail-tmllc.nix + + ./nixos/services/taskwarrior.nix + + ./nixos/overlays/fixup-canon.nix + + # + ]; + + # Modules for Linux machines with Wayland GUIs. + linuxGuiModuleSet = [ + waveforms.nixosModule + nix-flatpak.nixosModules.nix-flatpak + + ./nixos/packages/gui.nix + ./nixos/packages/wine.nix + ./nixos/packages/flatpak.nix + ./nixos/packages/proprietary.nix + + ./nixos/configs/gui + ./nixos/configs/flatpak.nix + ./nixos/configs/fonts-linux.nix + ./nixos/configs/music-server.nix + + #./nixos/overlays/fixup-signal + ./nixos/overlays/fixup-imhex.nix + ./nixos/overlays/customize-gajim + ./nixos/overlays/sddm-no-vnc.nix + ./nixos/overlays/fixup-armcord.nix + ./nixos/overlays/jd-gui-wayland.nix + ./nixos/overlays/fixup-mattermost.nix + ./nixos/overlays/yubikey-touch-shitpost + ./nixos/overlays/add-depends-calibre.nix + + ./nixos/services/clipboard-sync.nix + ]; + + # Modules for all darwin machines. + darwinModuleSet = [ + ./nixos/configuration.darwin.nix + + ./nixos/packages/homebrew.nix + ./nixos/packages/appstore.nix + + ./nixos/configs/fonts-darwin.nix + ./nixos/configs/autosetup-darwin-aarch64.nix + ]; + + # Modules for offline linux machines. + linuxOfflineModuleSet = [ + ./nixos/packages/offline.nix + + ./nixos/configs/waydroid.nix + ]; + + # Helper functions for creating modules in the defintions below. + darwinModules = extraModules: commonModuleSet ++ darwinModuleSet ++ extraModules; + linuxModules = extraModules: commonModuleSet ++ linuxModuleSet ++ extraModules; + linuxGuiModules = extraModules: linuxModules (linuxGuiModuleSet ++ extraModules); + linuxOfflineGuiModules = extraModules: linuxGuiModules (linuxOfflineModuleSet ++ extraModules); + + # Helper that populates all of our special arguments. + mkSpecialArgsGeneric = ( + system: is-hm-standalone: is-droid: { + inherit + nixpkgs + stylix + is-hm-standalone + is-droid + ; + + niri = niri.outputs; + nil = nil.outputs.packages.${system}; + deprekages = self.outputs.packages.${system}; + agenix = agenix.outputs.packages.${system}; + openxc7 = openxc7.outputs.packages.${system}; + attic = attic.outputs.packages.${system}; + esp-dev = esp-dev.outputs.packages.${system}; + + # Helper to convert hm modules into NixOS or nix-on-droid modules. + callHm = module: (specialArgs: (import module) specialArgs); + normalizeModule = + if is-hm-standalone then + (module: module) + else + ( + if is-droid then + ( + module: + ( + { deprekages, ... }: + { + home-manager.config = + { pkgs, ... }@specialArgs: (import module) (specialArgs // { inherit deprekages; }); + } + ) + ) + else + ( + module: + ( + { deprekages, ... }: + { + home-manager.users.deprekated = + { pkgs, ... }@specialArgs: (import module) (specialArgs // { inherit deprekages; }); + } + ) + ) + ); + } + ); + + # Generic mkSpecialArgs for NixOS. + mkSpecialArgs = system: (mkSpecialArgsGeneric system false false); + + # Specialized mkSpecialArgs for standalone home-manager. + mkSpecialArgsHm = system: pkgs: ((mkSpecialArgsGeneric system true false) // { inherit pkgs; }); + mkSpecialArgsDroid = system: pkgs: ((mkSpecialArgsGeneric system false true) // { inherit pkgs; }); + + # + # Hosts! + # + + # Trailblazer (main desktop). + nixosConfigurations.trailblazer = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = mkSpecialArgs system; + modules = linuxOfflineGuiModules [ + ./nixos/hosts/trailblazer + ./nixos/configs/looking-glass.nix + ./nixos/configs/serve-cache.nix + ]; + }; + + # Valere (powerful laptop). + nixosConfigurations.valere = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = mkSpecialArgs system; + + modules = linuxOfflineGuiModules [ + ./nixos/hosts/valere.nix + ./nixos/configs/vmware.nix + ./nixos/configs/power-saving.nix + ]; + }; + + # Tohru (mid-tier laptop with more ram). + nixosConfigurations.tohru = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = mkSpecialArgs system; + + modules = linuxOfflineGuiModules [ + ./nixos/hosts/tohru.nix + ./nixos/configs/power-saving.nix + ./nixos/configs/looking-glass.nix + ]; + }; + + # Hinata (travel laptop). + nixosConfigurations.hinata = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = mkSpecialArgs system; + + modules = linuxOfflineGuiModules [ + ./nixos/hosts/hinata.nix + ./nixos/configs/power-saving.nix + ./nixos/configs/cellular.nix + ]; + }; + + # Veth (purse laptop). + nixosConfigurations.veth = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = mkSpecialArgs system; + + modules = linuxGuiModules [ + ./nixos/hosts/veth + ./nixos/configs/power-saving.nix + ]; + }; + + # Komashi (TMLLC T16 gen2). + nixosConfigurations.komashi = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = mkSpecialArgs system; + + modules = linuxOfflineGuiModules [ + ./nixos/hosts/komashi + + ./nixos/configs/vmware.nix + ./nixos/configs/cellular.nix + ./nixos/configs/nfc-kernel.nix + ./nixos/configs/power-saving.nix + ]; + }; + + # Utol (TMLLC T14 Gen1) + nixosConfigurations.utol = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = mkSpecialArgs system; + + modules = linuxGuiModules [ + ./nixos/hosts/utol + + ./nixos/configs/vmware.nix + ./nixos/configs/cellular.nix + ./nixos/configs/power-saving.nix + + ./nixos/packages/offline.nix + ]; + }; + + # Salas (TMLLC aarch64-linux, apple-silicon, build machine). + nixosConfigurations.salas = nixpkgs.lib.nixosSystem rec { + system = "aarch64-linux"; + specialArgs = mkSpecialArgs system; + + modules = linuxModules [ ./nixos/hosts/salas.nix ]; + }; + + # Nomon (TMLLC aarch64-linux, broadcom-silicon, test machine). + nixosConfigurations.nomon = nixpkgs.lib.nixosSystem rec { + system = "aarch64-linux"; + specialArgs = mkSpecialArgs system; + + modules = linuxModules [ ./nixos/hosts/salas.nix ]; + }; + + # Roshar (TMLLC aarch64-darwin, apple-silicon build machine). + darwinConfigurations.roshar = darwin.lib.darwinSystem rec { + system = "aarch64-darwin"; + specialArgs = mkSpecialArgs system; + + modules = darwinModules [ ./nixos/hosts/roshar.nix ]; + }; + + # Mako (x86_64-darwin, apple-silicon build machine). + darwinConfigurations.mako = darwin.lib.darwinSystem rec { + system = "x86_64-darwin"; + specialArgs = mkSpecialArgs system; + + modules = darwinModules [ ./nixos/hosts/mako.nix ]; + }; + + # Design, our phone. + nixOnDroidConfigurations.design = nix-on-droid.lib.nixOnDroidConfiguration rec { + pkgs = import nixpkgs { + system = "aarch64-linux"; + config.allowUnfree = true; + }; + extraSpecialArgs = mkSpecialArgsDroid "aarch64-linux" pkgs; + + modules = [ + ./nixos/hosts/design.nix + ./nixos/configuration.droid.nix + + ./nixos/configs/nix.droid.nix + ./nixos/configs/droid-gui.nix + ./nixos/configs/dotfiles/droid.nix + ./nixos/configs/flake-registry.nix + + ./nixos/packages/droid.nix + ./nixos/packages/offline.droid.nix + ]; + + }; + + }; +} diff --git a/flipper/.dolphin.state b/flipper/.dolphin.state new file mode 100644 index 0000000..5ef7896 Binary files /dev/null and b/flipper/.dolphin.state differ diff --git a/flipper/openocd-jtag.cfg b/flipper/openocd-jtag.cfg new file mode 100644 index 0000000..9c5b2f9 --- /dev/null +++ b/flipper/openocd-jtag.cfg @@ -0,0 +1,8 @@ +adapter driver cmsis-dap +adapter speed 4000 + +transport select jtag + +cmsis_dap_backend usb_bulk + +source [find interface/cmsis-dap.cfg] diff --git a/flipper/openocd-swd.cfg b/flipper/openocd-swd.cfg new file mode 100644 index 0000000..f934276 --- /dev/null +++ b/flipper/openocd-swd.cfg @@ -0,0 +1,8 @@ +adapter driver cmsis-dap +adapter speed 4000 + +transport select swd + +cmsis_dap_backend usb_bulk + +source [find interface/cmsis-dap.cfg] diff --git a/fonts/MonoLisa/README.md b/fonts/MonoLisa/README.md new file mode 100644 index 0000000..7c0fbf6 --- /dev/null +++ b/fonts/MonoLisa/README.md @@ -0,0 +1,21 @@ +# MonoLisa - Font follows function + +Congratulations for purchasing MonoLisa. I hope you have as much fun using it as we had creating the typeface. + +## Installation + +To install the font, please see [the FAQ online](https://monolisa.dev/faq) or consider the quick guides below: + +- macOS - 1. Select and open the otf versions of the font 2. Select "install font" +- Windows - Refer to https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows +- Linux and other systems - Please consult the documentation of your distribution. + +## Support + +You can reach us through `info@monolisa.dev`. Send us your questions, comments, and perhaps testimonials. + +If you have public feedback about the font, [please use the issue tracker](https://github.com/MonoLisaFont/feedback/issues). + +## License + +See the attached `license.md` file for the licensing terms. diff --git a/fonts/MonoLisa/license.md b/fonts/MonoLisa/license.md new file mode 100644 index 0000000..f27760d --- /dev/null +++ b/fonts/MonoLisa/license.md @@ -0,0 +1,185 @@ +# FaceType – End User License Agreement (EULA) + +FaceType says thank you for reading this and taking the time to understand this License Agreement! Your support makes this foundry possible. + +## Acknowledgments + +FaceType is willing to license the licensed product to Licensees only on the condition that the Licensee accepts the terms and conditions contained in this agreement. By placing an order for and accepting FaceType font software (electronic data), or by downloading the software accompanying this license, the Licensee acknowledges that he has read all of the terms and conditions of this agreement, understands them, and agrees to be bound by them. + +If the Licensee does not agree to these terms and conditions, he must promptly cease download or use of the licensed product and return the licensed product to FaceType or its reseller for a full refund of the license fee which the Licensee paid for the licensed product, and the Licensee must immediately delete any portion of the font software installed on Licensee’s computer(s). + +If you intend to create a trademark, logo, brand or corporate identy, a multinational campaign using any of FaceType’s typefaces or if the number of prints for large commercial projects exceeds 250,000, a special font license solely issued by FaceType is needed. Please contact us for more information: welcome@facetype.org + +## Types of Font Licenses + +Most font license distributors offer default font licenses. If not, please contact FaceType directly: welcome@facetype.org + +## 1. Desktop License + +### 1.a Definition + +With a desktop license, you may install a font into your computer’s operating system and use it in any of your applications that contain a fonts menu such as TextEdit, Microsoft Word Adobe Photoshop or Indesign. + +### 1.b The Licensee May + +Create personal or commercial print documents, posters, business cards, goods for sale, (such as clothing apparel and accessories), physical goods, static images, and other objects like stationery, mugs, T-shirts and the like. Desktop licenses are based on the number of computers (= computers) the fonts are installed onto. If more people intend to use the fonts, just add additional licenses. See ‘Multi-User Licenses’ below for more infos. + +### 1.c Embedding Restrictions + +PDF embedding of the font software into PDF documents is only permitted in a secured read-only mode that allows only printing and viewing, and prohibits editing, selecting, enhancing or modifying the text. + +Licensee must ensure that recipients of PDF documents cannot extract the FaceType font software from such PDF documents or use the embedded font software for editing purposes or for the creation of new documents. + +If you are unable to limit access to the document to ‘printing and viewing’ only, the electronic document(s) may not be used on computers that are not Licensed Computers. Examples of non-commercial, not-for-profit permitted usage include PDF documents supplied to Service Bureaus, printers, or any documents that disseminate personal, internal or business information. + +### 1.d Number of Users + +This electronic data may be installed on up to one (1) computer. If you are using this product with more than one (1) computers, the Licensee requires to obtain a Multi-User License for the appropriate number of computers (see Multi-User Licenses section below). + +### 1.e Multi-User Licenses + +FaceType calculates Multi-User Licenses based on the chart below. The price FaceType charges the Licensee will be calculated based on the number of computers the fonts will be installed onto: + +- 1-2 computers: single License x 1 +- 3–5 computers: single License x 2 +- 6–15 computers: single License x 3 +- 16–30 computers: single License x 4 +- 31–50 computers: single License x 5 +- 51–75 computers: single License x 6 +- 76–100 computers: single License x 7 +- 101–120 computers: single License x 8 +- 121–145 computers: single License x 9 +- 146–160 computers: single License x 10 +- 161–180 computers: single License x 11 +- 181–195 computers: single License x 12 +- 196–215 computers: single License x 13 +- 216–230 computers: single License x 14 +- 231–260 computers: single License x 15 +- 261–300 computers: single License x 16 +- 301–335 computers: single License x 17 +- 336–375 computers: single License x 18 +- 376–415 computers: single License x 19 +- 416–460 computers: single License x 20 +- 461–520 computers: single License x 21 +- 521–580 computers: single License x 22 +- 581–640 computers: single License x 23 +- 641–700 computers: single License x 24 +- 701–760 computers: single License x 25 +- 761–820 computers: single License x 26 +- 821–880 computers: single License x 27 +- 881–940 computers: single License x 28 +- 941–1000 computers: single License x 29 + +## 2. Webfont License + +A webfont license allows you to embed the purchased webfont into your website (a group of pages related to one domain, including sub-domains). If you only use static images with one of our fonts on your website a desktop license is sufficient. + +FaceType is not responsible for installing, embedding, hosting or updating the webfonts. Web design agencies or hosting providers are not allowed to share a single webfont license across their clients’ websites. The price FaceType charges the Licensee will be calculated based on the number of pageviews per month: + +- 10 000 pageviews per month or less: single License x 1 +- 100 000 pageviews per month or less: single License x 2 +- More than 100 000 pageviews per month: single License x 10 + +## 3. App License + +Select this license type when you are developing an app for iOS, Android, or Windows Phone or any other mobile OS, and you intend to embed the font files in your mobile application’s code. This license does not cover web apps. The amount of installations across the platforms (i. g. iOS, Android, …) is unlimited. + +An Apps License is also required when incorporating the font software into your hardware, software or any other products, such as application programs, interfaces, EPOS, WEPOS, POSReady, operating systems, electronics, electronic games, entertainment products, video on demand, gaming devices. + +## 4. Server License + +Select a server license when you need to install the font on Web Servers that will allow the generation of items such as PDF invoices, custom business cards, or other personalized products using Web to Print technologies. This license allows your customers to utilize the fonts you have purchased in order to customize the products that you offer, but the fonts can not be distributed or downloaded from the server. + +## 5. ePub License + +Choose one of our fonts available with an ePub license when creating layouts for publications intended for Kindles, iPads or other eReaders, ePublishing, ePub, eBooks, eZines, proprietary reader devices. If you just need a font to create a cover image, purchase a desktop license. An ePub license is valid for file formats such as PDF, EPUB 2.01, EPUB 3, and KF8. + +## General + +You agree to inform your employees or any other person having access to the FaceType software and copies thereof, of the terms and conditions of this Standard License Agreement and to ensure that they shall strictly abide by these terms and conditions. + +You agree that you will not export or re-export the Software in any form without the appropriate United States, European, and worldwide government licenses. + +You agree not to sublicense, sell, lease or otherwise transfer the electronic data without the prior written consent of FaceType. + +## Grant of License + +In consideration of payment of the license fee, included in the price paid by the Licensee for this product, the Licensor grants to the Licensee a non-exclusive right to use this product, which consists of electronic data to display and output PostScript®, TrueType® or OpenType® typefaces. The terms of this Agreement are contractual in nature and not mere recitations. + +## Prohibited Usage + +This product is licensed only to the Licensee, and may not be transferred to any third party at any time without the prior written consent of FaceType. + +The Licensee may not modify, translate, adapt, alter, decompile, disassemble, decrypt, reverse engineer, change or alter the embedding bits, the font name, legal notices contained in the font software, nor seek to discover the source code of the font data, convert into another font format, create bitmaps, add or subtract any glyphs, symbols or accents, or any other derivative works based on the electronic data in this product. + +The Licensee may not supply, directly or indirectly, any FaceType font data to any other firm, business or individual for any type of modifications or updates whatsoever. + +If the Licensee needs to modify or update the font data in anyway in the future, FaceType solely will perform and invoice this additional work at its normal prevailing rates. + +The Licensee may not duplicate, modify, adapt, translate or create derivative works based on the printed materials that may have been supplied with this product. It is a breach of this license agreement to use the product in any way that infringes the rights of any third party under copyright, trademark, patent or any other laws. + +In the event of infringing uses by the Licensee, this license immediately terminates and the Licensee is solely responsible for any such infringing uses including all legal and other damages that may be incurred. + +## Ownership + +FaceType retains intellectual property rights, title and ownership of any of its electronic data provided. This title and ownership extends to copies of the data installed on any computer, downloaded to any output device, or retained on other media by the Licensee as a backup. + +This license does not constitute an exclusive sale of the original product to the Licensee. This Agreement does not grant you any right to patents, copyrights, trade secrets, trade names, trademarks (whether registered or unregistered), or any other rights, franchises or licenses in respect of the electronic data. + +No rights are granted to you other than a License to use the electronic data on the terms expressly set forth in this Agreement. The Licensee further acknowledges and agrees that the structure, organisation and code of the font software are valuable trade secrets and confidential information of FaceType. + +The font software is protected by copyright including without limitation, by Austrian, and United States Copyright Law, international treaty provisions, and applicable laws in the jurisdiction of use. + +## Copy Restrictions + +This product is copyrighted and contains proprietary information and trade secrets of FaceType. Unauthorised copying of this product is expressly forbidden. + +You are permitted to create backups of the font software, provided that: (a) they are stored only at the site where this product is licensed, and (b) the full copyright information is included with each backup copy. + +You may be held legally responsible for any infringement of FaceType’s intellectual property rights that is caused or encouraged by your failure to abide by the terms of this Agreement. + +## Limited Warranty + +If the media or the font software contained in this FaceType product is found to be defective within 90 days of the date of delivery to the Licensee, FaceType will provide suitable replacements at no charge to the Licensee, provided the Licensee can provide proof of purchase. The entire risk of performance and quality of this product is with the Licensee. + +FaceType does not warrant that this product will operate with all other software products, or that it will satisfy your requirements. FaceType’s entire liability to the Licensee will not extend beyond replacement of defective media or refund of the purchase price. + +## Disclaimer + +Except as expressly provided above, this product is provided ‘as is’. FaceType does not make any warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. + +No oral or written information or advice given by FaceType, its dealers, distributors, agents, or employees will create a warranty or in any way increase the scope of this warranty, and Licensee may not rely upon any such information or advice. + +FaceType shall not be liable for any direct, indirect, consequential, or incidental damages or any other damages of any kind whatsoever (including damages from loss of business profits, business interruption and loss of business information) arising out of the use or inability to use this product. + +Because laws governing the exclusion or limitation of liability for consequential or incidental damages vary, the above limitation may not be applicable. + +## Update Registration + +At its option, FaceType will, from time to time, provide updates of this product to Licensees who have opted into receiving updates in their user profile. + +## Termination + +This Agreement is effective until terminated. This Agreement will terminate automatically without notice from FaceType, if the Licensee fails to comply with any provision contained herein. + +Upon termination of this Agreement, the Licensee must: (a) destroy all copies of the electronic data, including the copy on the disk media originally provided in this product, (b) destroy all written materials provided with this product, if any, and (c) provide FaceType with written verification that the product has been destroyed. + +## Severability + +If any provisions of this Agreement are held to be invalid, illegal or unenforceable, then such provision(s) shall be severed from it, and the validity, legality and enforceability of its remaining provisions shall not be affected or impaired. + +## Waiver + +Waiver of any right(s) at any time shall not constitute waiver of any right(s) at any future time. + +## License Agreement + +This Agreement may only be modified by FaceType. FaceType expressly reserves the right to amend, modify or change this Standard License Agreement at any time without prior notification. + +## Jurisdiction + +This Agreement represents the entire agreement between the Licensor and Licensee. FaceType may only modify this Agreement. The laws of Austria govern this License Agreement. If you have any questions concerning this Agreement or any matters regarding our products, please write to: welcome@facetype.org + +The FaceType collections are the brands and trademarks of FaceType. PostScript and Flash are registered trademark of Adobe Systems, Inc. TrueType®, OpenType® and Silverlight® are registered trademarks of Microsoft Corporation. All other brand or product names are the trademarks or registered trademarks of their respective holders and are duly recognised. + +© Copyright September 30th, 2019 – Georg Herold-Wildfellner, Marcus Sterz. diff --git a/fonts/MonoLisa/otf/MonoLisa-Bold.otf b/fonts/MonoLisa/otf/MonoLisa-Bold.otf new file mode 100644 index 0000000..f4771c1 Binary files /dev/null and b/fonts/MonoLisa/otf/MonoLisa-Bold.otf differ diff --git a/fonts/MonoLisa/otf/MonoLisa-BoldItalic.otf b/fonts/MonoLisa/otf/MonoLisa-BoldItalic.otf new file mode 100644 index 0000000..3d2af8b Binary files /dev/null and b/fonts/MonoLisa/otf/MonoLisa-BoldItalic.otf differ diff --git a/fonts/MonoLisa/otf/MonoLisa-Light.otf b/fonts/MonoLisa/otf/MonoLisa-Light.otf new file mode 100644 index 0000000..f3ca58f Binary files /dev/null and b/fonts/MonoLisa/otf/MonoLisa-Light.otf differ diff --git a/fonts/MonoLisa/otf/MonoLisa-LightItalic.otf b/fonts/MonoLisa/otf/MonoLisa-LightItalic.otf new file mode 100644 index 0000000..ca1d849 Binary files /dev/null and b/fonts/MonoLisa/otf/MonoLisa-LightItalic.otf differ diff --git a/fonts/MonoLisa/otf/MonoLisa-Medium.otf b/fonts/MonoLisa/otf/MonoLisa-Medium.otf new file mode 100644 index 0000000..5c8d4ed Binary files /dev/null and b/fonts/MonoLisa/otf/MonoLisa-Medium.otf differ diff --git a/fonts/MonoLisa/otf/MonoLisa-MediumItalic.otf b/fonts/MonoLisa/otf/MonoLisa-MediumItalic.otf new file mode 100644 index 0000000..9142f7d Binary files /dev/null and b/fonts/MonoLisa/otf/MonoLisa-MediumItalic.otf differ diff --git a/fonts/MonoLisa/otf/MonoLisa-Regular.otf b/fonts/MonoLisa/otf/MonoLisa-Regular.otf new file mode 100644 index 0000000..4c1ea54 Binary files /dev/null and b/fonts/MonoLisa/otf/MonoLisa-Regular.otf differ diff --git a/fonts/MonoLisa/otf/MonoLisa-RegularItalic.otf b/fonts/MonoLisa/otf/MonoLisa-RegularItalic.otf new file mode 100644 index 0000000..1af503a Binary files /dev/null and b/fonts/MonoLisa/otf/MonoLisa-RegularItalic.otf differ diff --git a/fonts/MonoLisa/ttf/MonoLisa-Bold.ttf b/fonts/MonoLisa/ttf/MonoLisa-Bold.ttf new file mode 100644 index 0000000..47a7c9f Binary files /dev/null and b/fonts/MonoLisa/ttf/MonoLisa-Bold.ttf differ diff --git a/fonts/MonoLisa/ttf/MonoLisa-BoldItalic.ttf b/fonts/MonoLisa/ttf/MonoLisa-BoldItalic.ttf new file mode 100644 index 0000000..ad5b03c Binary files /dev/null and b/fonts/MonoLisa/ttf/MonoLisa-BoldItalic.ttf differ diff --git a/fonts/MonoLisa/ttf/MonoLisa-Light.ttf b/fonts/MonoLisa/ttf/MonoLisa-Light.ttf new file mode 100644 index 0000000..7dcced4 Binary files /dev/null and b/fonts/MonoLisa/ttf/MonoLisa-Light.ttf differ diff --git a/fonts/MonoLisa/ttf/MonoLisa-LightItalic.ttf b/fonts/MonoLisa/ttf/MonoLisa-LightItalic.ttf new file mode 100644 index 0000000..4bca7e1 Binary files /dev/null and b/fonts/MonoLisa/ttf/MonoLisa-LightItalic.ttf differ diff --git a/fonts/MonoLisa/ttf/MonoLisa-Medium.ttf b/fonts/MonoLisa/ttf/MonoLisa-Medium.ttf new file mode 100644 index 0000000..2bb6ff7 Binary files /dev/null and b/fonts/MonoLisa/ttf/MonoLisa-Medium.ttf differ diff --git a/fonts/MonoLisa/ttf/MonoLisa-MediumItalic.ttf b/fonts/MonoLisa/ttf/MonoLisa-MediumItalic.ttf new file mode 100644 index 0000000..cd97ac4 Binary files /dev/null and b/fonts/MonoLisa/ttf/MonoLisa-MediumItalic.ttf differ diff --git a/fonts/MonoLisa/ttf/MonoLisa-Regular.ttf b/fonts/MonoLisa/ttf/MonoLisa-Regular.ttf new file mode 100644 index 0000000..ee0356c Binary files /dev/null and b/fonts/MonoLisa/ttf/MonoLisa-Regular.ttf differ diff --git a/fonts/MonoLisa/ttf/MonoLisa-RegularItalic.ttf b/fonts/MonoLisa/ttf/MonoLisa-RegularItalic.ttf new file mode 100644 index 0000000..a62fd94 Binary files /dev/null and b/fonts/MonoLisa/ttf/MonoLisa-RegularItalic.ttf differ diff --git a/fonts/MonoLisa/woff/MonoLisa-Bold.woff b/fonts/MonoLisa/woff/MonoLisa-Bold.woff new file mode 100644 index 0000000..c7acd12 Binary files /dev/null and b/fonts/MonoLisa/woff/MonoLisa-Bold.woff differ diff --git a/fonts/MonoLisa/woff/MonoLisa-BoldItalic.woff b/fonts/MonoLisa/woff/MonoLisa-BoldItalic.woff new file mode 100644 index 0000000..c73b59e Binary files /dev/null and b/fonts/MonoLisa/woff/MonoLisa-BoldItalic.woff differ diff --git a/fonts/MonoLisa/woff/MonoLisa-Light.woff b/fonts/MonoLisa/woff/MonoLisa-Light.woff new file mode 100644 index 0000000..c4beba4 Binary files /dev/null and b/fonts/MonoLisa/woff/MonoLisa-Light.woff differ diff --git a/fonts/MonoLisa/woff/MonoLisa-LightItalic.woff b/fonts/MonoLisa/woff/MonoLisa-LightItalic.woff new file mode 100644 index 0000000..bac336a Binary files /dev/null and b/fonts/MonoLisa/woff/MonoLisa-LightItalic.woff differ diff --git a/fonts/MonoLisa/woff/MonoLisa-Medium.woff b/fonts/MonoLisa/woff/MonoLisa-Medium.woff new file mode 100644 index 0000000..8a1dc12 Binary files /dev/null and b/fonts/MonoLisa/woff/MonoLisa-Medium.woff differ diff --git a/fonts/MonoLisa/woff/MonoLisa-MediumItalic.woff b/fonts/MonoLisa/woff/MonoLisa-MediumItalic.woff new file mode 100644 index 0000000..c44c0de Binary files /dev/null and b/fonts/MonoLisa/woff/MonoLisa-MediumItalic.woff differ diff --git a/fonts/MonoLisa/woff/MonoLisa-Regular.woff b/fonts/MonoLisa/woff/MonoLisa-Regular.woff new file mode 100644 index 0000000..093aea8 Binary files /dev/null and b/fonts/MonoLisa/woff/MonoLisa-Regular.woff differ diff --git a/fonts/MonoLisa/woff/MonoLisa-RegularItalic.woff b/fonts/MonoLisa/woff/MonoLisa-RegularItalic.woff new file mode 100644 index 0000000..814cc93 Binary files /dev/null and b/fonts/MonoLisa/woff/MonoLisa-RegularItalic.woff differ diff --git a/fonts/MonoLisa/woff2/MonoLisa-Bold.woff2 b/fonts/MonoLisa/woff2/MonoLisa-Bold.woff2 new file mode 100644 index 0000000..c89b33f Binary files /dev/null and b/fonts/MonoLisa/woff2/MonoLisa-Bold.woff2 differ diff --git a/fonts/MonoLisa/woff2/MonoLisa-BoldItalic.woff2 b/fonts/MonoLisa/woff2/MonoLisa-BoldItalic.woff2 new file mode 100644 index 0000000..4570180 Binary files /dev/null and b/fonts/MonoLisa/woff2/MonoLisa-BoldItalic.woff2 differ diff --git a/fonts/MonoLisa/woff2/MonoLisa-Light.woff2 b/fonts/MonoLisa/woff2/MonoLisa-Light.woff2 new file mode 100644 index 0000000..8f2a2c9 Binary files /dev/null and b/fonts/MonoLisa/woff2/MonoLisa-Light.woff2 differ diff --git a/fonts/MonoLisa/woff2/MonoLisa-LightItalic.woff2 b/fonts/MonoLisa/woff2/MonoLisa-LightItalic.woff2 new file mode 100644 index 0000000..651dbc0 Binary files /dev/null and b/fonts/MonoLisa/woff2/MonoLisa-LightItalic.woff2 differ diff --git a/fonts/MonoLisa/woff2/MonoLisa-Medium.woff2 b/fonts/MonoLisa/woff2/MonoLisa-Medium.woff2 new file mode 100644 index 0000000..0ef256e Binary files /dev/null and b/fonts/MonoLisa/woff2/MonoLisa-Medium.woff2 differ diff --git a/fonts/MonoLisa/woff2/MonoLisa-MediumItalic.woff2 b/fonts/MonoLisa/woff2/MonoLisa-MediumItalic.woff2 new file mode 100644 index 0000000..a1f0a53 Binary files /dev/null and b/fonts/MonoLisa/woff2/MonoLisa-MediumItalic.woff2 differ diff --git a/fonts/MonoLisa/woff2/MonoLisa-Regular.woff2 b/fonts/MonoLisa/woff2/MonoLisa-Regular.woff2 new file mode 100644 index 0000000..3cedeac Binary files /dev/null and b/fonts/MonoLisa/woff2/MonoLisa-Regular.woff2 differ diff --git a/fonts/MonoLisa/woff2/MonoLisa-RegularItalic.woff2 b/fonts/MonoLisa/woff2/MonoLisa-RegularItalic.woff2 new file mode 100644 index 0000000..518e390 Binary files /dev/null and b/fonts/MonoLisa/woff2/MonoLisa-RegularItalic.woff2 differ diff --git a/fonts/codicon.nix b/fonts/codicon.nix new file mode 100644 index 0000000..2ed0f8a --- /dev/null +++ b/fonts/codicon.nix @@ -0,0 +1,17 @@ +# +# Codicon package for Nix. +# + +{ pkgs }: +pkgs.stdenv.mkDerivation { + pname = "codicon"; + meta.description = "the codiconfont set"; + version = "0.1.0"; + + src = ./codicon; + + installPhase = '' + mkdir -p $out/share/fonts + cp -R $src $out/share/fonts/truetype + ''; +} diff --git a/fonts/codicon/codicon.ttf b/fonts/codicon/codicon.ttf new file mode 100644 index 0000000..807c949 Binary files /dev/null and b/fonts/codicon/codicon.ttf differ diff --git a/fonts/manrope.nix b/fonts/manrope.nix new file mode 100644 index 0000000..4dbec29 --- /dev/null +++ b/fonts/manrope.nix @@ -0,0 +1,25 @@ +# +# Manrope font, with italics. +# +{ + stdenv, + fetchFromGitHub +}: + +stdenv.mkDerivation rec { + pname = "manrope"; + meta.description = "the Manrope font set, with italics"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "malte-v"; + repo = "manrope-italic"; + rev = "8bfff2a5f0ba40ff8b793fe39e919c60380312b2"; + hash = "sha256-gWw+R/Qy3yIanA7C/UrmyDScd3DfaIHgN5aFDxqM6mY="; + }; + + installPhase = '' + mkdir -p $out/share/fonts + cp -R $src $out/share/fonts/opentype/ + ''; +} diff --git a/fonts/monolisa.nix b/fonts/monolisa.nix new file mode 100644 index 0000000..16f751f --- /dev/null +++ b/fonts/monolisa.nix @@ -0,0 +1,17 @@ +# +# MonoLisa package for Nix. +# + +{ pkgs }: +pkgs.stdenv.mkDerivation rec { + pname = "monolisa"; + meta.description = "the MonoLisa font set"; + version = "0.1.0"; + + src = ./MonoLisa/otf; + + installPhase = '' + mkdir -p $out/share/fonts + cp -R $src $out/share/fonts/opentype/ + ''; +} diff --git a/grc/grc.conf b/grc/grc.conf new file mode 100644 index 0000000..f578a95 --- /dev/null +++ b/grc/grc.conf @@ -0,0 +1,3 @@ +# lsusb +(^|[/\w\.]+/)lsusb\s +lsusb.conf diff --git a/grc/lsusb.conf b/grc/lsusb.conf new file mode 100644 index 0000000..9e92949 --- /dev/null +++ b/grc/lsusb.conf @@ -0,0 +1,21 @@ +regexp=.*:$ +colors=bold blue underline +- +regexp=^ (.*) (.*?)$ +colors=,blue,cyan +- +regexp=^ +(.*)( )(.*?):$ +colors=bold, underline, underline, underline +- +regexp=^ (.*): (.*) +colors=,magenta +- +regexp=(Bus )(\d+) (Device) (\d+): (ID) ([0-9a-f]+:[0-9a-f]+) (.*) +colors=, bold, blue, bold, blue, bold, green, yellow +- +regexp=.*root hub.* +colors=dark dark white +- +regexp=(Bus )(\d+) (Device) (\d+): (ID) (1d50:60e6) (.*) +colors=underline, bold underline, blue underline, bold underline, blue underline, bold underline, green underline, yellow underline + diff --git a/kak/colors/solarized-darker.kak b/kak/colors/solarized-darker.kak new file mode 100644 index 0000000..3badba9 --- /dev/null +++ b/kak/colors/solarized-darker.kak @@ -0,0 +1,116 @@ +# Solarized Darker + +evaluate-commands %sh{ + base03='rgb:002b36' + base02='rgb:073642' + base01='rgb:586e75' + base00='rgb:657b83' + base0='rgb:839496' + base1='rgb:93a1a1' + base2='rgb:eee8d5' + base3='rgb:fdf6e3' + yellow='rgb:b58900' + orange='rgb:cb4b16' + red='rgb:dc322f' + magenta='rgb:d33682' + violet='rgb:6c71c4' + blue='rgb:268bd2' + cyan='rgb:2aa198' + green='rgb:859900' + + echo " + # markup + face global title ${blue}+b + face global header ${blue} + face global mono ${base1} + face global block ${cyan} + face global link ${base1} + face global bullet ${yellow} + face global list ${green} + + # builtin + face global Default ${base0},default + face global PrimarySelection ${base03},${blue}+fg + face global SecondarySelection ${base01},${base1}+fg + face global PrimaryCursor ${base03},${base0}+fg + face global SecondaryCursor ${base03},${base01}+fg + face global PrimaryCursorEol ${base03},${base2}+fg + face global SecondaryCursorEol ${base03},${base3}+fg + face global LineNumbers ${base01},default + face global LineNumberCursor ${base0},${base03} + face global LineNumbersWrapped ${base02},default + face global MenuForeground ${base03},${yellow} + face global MenuBackground ${base1},${base02} + face global MenuInfo ${base01} + face global Information ${base02},${base1} + face global Error ${red},default+b + face global DiagnosticError ${red} + face global DiagnosticWarning ${yellow} + face global StatusLine ${base1},${base02}+b + face global StatusLineMode ${orange} + face global StatusLineInfo ${cyan} + face global StatusLineValue ${green} + face global StatusCursor ${base00},${base3} + face global Prompt ${yellow}+b + face global MatchingChar ${red},${base01}+b + face global BufferPadding ${base01},default + face global Whitespace ${base01}+f + + # code + face global value ${cyan} + face global type ${yellow} + face global variable ${blue} + face global module ${cyan} + face global function ${blue} + face global string ${cyan} + face global keyword ${green} + face global operator ${green} + face global attribute ${violet} + face global comment ${base01} + face global documentation comment + face global meta ${orange} + face global builtin default+b + + # tree-sitter + face global ts_attribute ${violet} + face global ts_comment ${base01}+i + face global ts_constant ${yellow} + face global ts_constructor ${cyan} + face global ts_diff_plus ${green} + face global ts_diff_minus ${red} + face global ts_diff_delta ${yellow} + face global ts_error ${red} + face global ts_function ${blue} + face global ts_hint ${violet} + face global ts_info ${violet} + face global ts_keyword ${green} + face global ts_label ${blue}+b + face global ts_markup_bold default+b + face global ts_markup_heading ${blue}+b + face global ts_markup_italic default+i + face global ts_list_checked ${blue} + face global ts_list_numbered ${cyan} + face global ts_list_unchecked ${green} + face global ts_label ${violet} + face global ts_url ${cyan} + face global ts_uri ${cyan} + face global ts_text default + face global ts_quote ${magenta} + face global ts_raw ${magenta} + face global ts_markup_strikethrough default+s + face global ts_namespace ${cyan}+b + face global ts_operator operator + face global ts_property ${violet} + face global ts_punctuation default + face global ts_special ${orange} + face global ts_spell ${red} + face global ts_string ${cyan} + face global ts_symbol ${cyan} + face global ts_tag ${violet} + face global ts_tag_error ${red} + face global ts_text default + face global ts_type ${violet} + face global ts_variable ${blue} + face global ts_warning ${yellow} +" +} diff --git a/kak/kak-lsp.toml b/kak/kak-lsp.toml new file mode 100644 index 0000000..5337fd9 --- /dev/null +++ b/kak/kak-lsp.toml @@ -0,0 +1,511 @@ +file_watch_support = false +snippet_support = true +verbosity = 2 + +[server] +# exit session if no requests were received during given period in seconds +# set to 0 to disable +timeout = 1800 # seconds = 30 minutes + +# This section overrides language IDs. +# By default, kakoune-lsp uses filetypes for the IDs. +# See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocumentItem +[language_ids] +c = "c_cpp" +cpp = "c_cpp" +javascript = "javascriptreact" +typescript = "typescriptreact" +protobuf = "proto" +sh = "shellscript" + +[language_server.bash-language-server] +filetypes = ["sh"] +roots = [".git", ".hg"] +command = "bash-language-server" +args = ["start"] + +[language_server.clangd] +filetypes = ["c", "cpp"] +roots = ["compile_commands.json", ".clangd", ".git", ".hg"] +command = "clangd" + +[language_server.clojure-lsp] +filetypes = ["clojure"] +roots = ["project.clj", ".git", ".hg"] +command = "clojure-lsp" +settings_section = "_" +[language_server.clojure-lsp.settings._] +# See https://clojure-lsp.io/settings/#all-settings +# source-paths-ignore-regex = ["resources.*", "target.*"] + +[language_server.cmake-language-server] +filetypes = ["cmake"] +roots = ["CMakeLists.txt", ".git", ".hg"] +command = "cmake-language-server" + +[language_server.crystalline] +filetypes = ["crystal"] +roots = ["shard.yml"] +command = "crystalline" + +[language_server.css-language-server] +filetypes = ["css"] +roots = ["package.json", ".git", ".hg"] +command = "vscode-css-language-server" +args = ["--stdio"] + +# [language_server.deno-lsp] +# filetypes = ["javascript", "typescript"] +# roots = ["package.json", "tsconfig.json", ".git", ".hg"] +# command = "deno" +# args = ["lsp"] +# settings_section = "deno" +# [language_server.deno-lsp.settings.deno] +# enable = true +# lint = true + +[language_server.less-language-server] +filetypes = ["less"] +roots = ["package.json", ".git", ".hg"] +command = "vscode-css-language-server" +args = ["--stdio"] + + +# See https://scalameta.org/metals/docs/integrations/new-editor +[language_server.metals] +filetypes = ["scala"] +roots = ["build.sbt", ".scala-build"] +command = "metals" +args = ["-Dmetals.extensions=false"] +settings_section = "metals" +[language_server.metals.settings.metals] +icons = "unicode" +isHttpEnabled = true +statusBarProvider = "show-message" +compilerOptions = { overrideDefFormat = "unicode" } +inlayHints.hintsInPatternMatch.enable = true +inlayHints.implicitArguments.enable = true +inlayHints.implicitConversions.enable = true +inlayHints.inferredTypes.enable = true +inlayHints.typeParameters.enable = true + +[language_server.nil] +filetypes = ["nix"] +command = "nil" +roots = ["flake.nix", "shell.nix", ".git", ".hg"] + +[language_server.scss-language-server] +filetypes = ["scss"] +roots = ["package.json", ".git", ".hg"] +command = "vscode-css-language-server" +args = ["--stdio"] + +[language_server.dls] +filetypes = ["d", "di"] +roots = [".git", "dub.sdl", "dub.json"] +command = "dls" + +[language_server.dart-lsp] +# start shell to find path to dart analysis server source +filetypes = ["dart"] +roots = ["pubspec.yaml", ".git", ".hg"] +command = "sh" +args = ["-c", "dart $(dirname $(command -v dart))/snapshots/analysis_server.dart.snapshot --lsp"] + +[language_server.jdtls] +filetypes = ["java"] +roots = ["mvnw", "gradlew", ".git", ".hg"] +command = "jdtls" +[language_server.jdtls.settings] +# See https://github.dev/eclipse/eclipse.jdt.ls +# "java.format.insertSpaces" = true + +[language_server.elixir-ls] +filetypes = ["elixir"] +roots = ["mix.exs"] +command = "elixir-ls" +settings_section = "elixirLS" +[language_server.elixir-ls.settings.elixirLS] +# See https://github.com/elixir-lsp/elixir-ls/blob/master/apps/language_server/lib/language_server/server.ex +# dialyzerEnable = true + +[language_server.elm-language-server] +filetypes = ["elm"] +roots = ["elm.json"] +command = "elm-language-server" +args = ["--stdio"] +settings_section = "elmLS" +[language_server.elm-language-server.settings.elmLS] +# See https://github.com/elm-tooling/elm-language-server#server-settings +runtime = "node" +elmPath = "elm" +elmFormatPath = "elm-format" +elmTestPath = "elm-test" + +[language_server.elvish] +filetypes = ["elvish"] +roots = [".git", ".hg"] +command = "elvish" +args = ["-lsp"] + +[language_server.erlang-ls] +filetypes = ["erlang"] +# See https://github.com/erlang-ls/erlang_ls.git for more information and +# how to configure. This default config should work in most cases though. +roots = ["rebar.config", "erlang.mk", ".git", ".hg"] +command = "erlang_ls" + +[language_server.gopls] +filetypes = ["go"] +roots = ["Gopkg.toml", "go.mod", ".git", ".hg"] +command = "gopls" +[language_server.gopls.settings.gopls] +# See https://github.com/golang/tools/blob/master/gopls/doc/settings.md +# "build.buildFlags" = [] +hints.assignVariableTypes = true +hints.compositeLiteralFields = true +hints.compositeLiteralTypes = true +hints.constantValues = true +hints.functionTypeParameters = true +hints.parameterNames = true +hints.rangeVariableTypes = true +"ui.completion.usePlaceholders" = true + +[language_server.haskell-language-server] +filetypes = ["haskell"] +roots = ["hie.yaml", "cabal.project", "Setup.hs", "stack.yaml", "*.cabal"] +command = "haskell-language-server-wrapper" +args = ["--lsp"] +settings_section = "_" +[language_server.haskell-language-server.settings._] +# See https://haskell-language-server.readthedocs.io/en/latest/configuration.html +# haskell.formattingProvider = "ormolu" + +[language_server.html-language-server] +filetypes = ["html"] +roots = ["package.json"] +command = "vscode-html-language-server" +args = ["--stdio"] +settings_section = "_" +[language_server.html-language-server.settings._] +# quotePreference = "single" +# javascript.format.semicolons = "insert" + +[language_server.intelephense] +filetypes = ["php"] +roots = [".htaccess", "composer.json"] +command = "intelephense" +args = ["--stdio"] +settings_section = "intelephense" +[language_server.intelephense.settings.intelephense] +storagePath = "/tmp/intelephense" + +[language_server.json-language-server] +filetypes = ["json"] +roots = ["package.json"] +command = "vscode-json-language-server" +args = ["--stdio"] + +# Requires Julia package "LanguageServer" +# Run: `julia --project=@kak-lsp -e 'import Pkg; Pkg.add("LanguageServer")'` to install it +# Configuration adapted from https://github.com/neovim/nvim-lspconfig/blob/bcebfac7429cd8234960197dca8de1767f3ef5d3/lua/lspconfig/julials.lua +[language_server.julia-language-server] +filetypes = ["julia"] +roots = ["Project.toml", ".git", ".hg"] +command = "julia" +args = [ + "--startup-file=no", + "--history-file=no", + "-e", + """ + ls_install_path = joinpath(get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")), "environments", "kak-lsp"); + pushfirst!(LOAD_PATH, ls_install_path); + using LanguageServer; + popfirst!(LOAD_PATH); + depot_path = get(ENV, "JULIA_DEPOT_PATH", ""); + buffer_file = ENV["kak_buffile"]; + project_path = let + dirname(something( + # 1. Check if there is an explicitly set project + Base.load_path_expand(( + p = get(ENV, "JULIA_PROJECT", nothing); + p === nothing ? nothing : isempty(p) ? nothing : p + )), + # 2. Check for Project.toml in current working directory + Base.current_project(pwd()), + # 3. Check for Project.toml from buffer's full file path excluding the file name + Base.current_project(dirname(buffer_file)), + # 4. Fallback to global environment + Base.active_project() + )) + end + server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path); + server.runlinter = true; + run(server); + """, +] +[language_server.julia-language-server.settings] +# See https://github.com/julia-vscode/LanguageServer.jl/blob/master/src/requests/workspace.jl +# Format options. See https://github.com/julia-vscode/DocumentFormat.jl/blob/master/src/DocumentFormat.jl +# "julia.format.indent" = 4 +# Lint options. See https://github.com/julia-vscode/StaticLint.jl/blob/master/src/linting/checks.jl +# "julia.lint.call" = true +# Other options, see https://github.com/julia-vscode/LanguageServer.jl/blob/master/src/requests/workspace.jl +# "julia.lint.run" = "true" + +[language_server.lua-language-server] +filetypes = ["lua"] +roots = [".git", ".hg"] +command = "lua-language-server" +settings_section = "Lua" +[language_server.lua-language-server.settings.Lua] +# See https://github.com/sumneko/vscode-lua/blob/master/setting/schema.json +# diagnostics.enable = true + +[language_server.markdown] +filetypes = ["markdown"] +roots = [".marksman.toml"] +command = "marksman" +args = ["server"] + +# [language_server.zk] +# filetypes = ["markdown"] +# roots = [".zk"] +# command = "zk" +# args = ["lsp"] + +[language_server.nimlsp] +filetypes = ["nim"] +roots = ["*.nimble", ".git", ".hg"] +command = "nimlsp" + +[language_server.ocamllsp] +filetypes = ["ocaml"] +# Often useful to simply do a `touch dune-workspace` in your project root folder if you have problems with root detection +roots = ["dune-workspace", "dune-project", "Makefile", "opam", "*.opam", "esy.json", ".git", ".hg", "dune"] +command = "ocamllsp" + +[language_server.pls] +filetypes = ["protobuf"] +roots = [".git", ".hg"] +command = "pls" # https://github.com/lasorda/protobuf-language-server + +[language_server.purescript-language-server] +filetypes = ["purescript"] +roots = ["spago.dhall", "spago.yaml", "package.json", ".git", ".hg"] +command = "purescript-language-server" +args = ["--stdio"] + +[language_server.pylsp] +filetypes = ["python"] +roots = ["requirements.txt", "setup.py", ".git", ".hg"] +command = "pylsp" +settings_section = "_" +[language_server.pylsp.settings._] +# See https://github.com/python-lsp/python-lsp-server#configuration +# pylsp.configurationSources = ["flake8"] +pylsp.plugins.jedi_completion.include_params = true + +# [language_server.pyright] +# filetypes = ["python"] +# roots = ["requirements.txt", "setup.py", "pyrightconfig.json", ".git", ".hg"] +# command = "pyright-langserver" +# args = ["--stdio"] + +# [language_server.ruff] +# filetypes = ["python"] +# roots = ["requirements.txt", "setup.py", ".git", ".hg"] +# command = "ruff-lsp" +# settings_section = "_" +# [language_server.ruff.settings._.globalSettings] +# organizeImports = true +# fixAll = true + +[language_server.r-language-server] +filetypes = ["r"] +roots = ["DESCRIPTION", ".git", ".hg"] +command = "R" +args = ["--slave", "-e", "languageserver::run()"] + +[language_server.racket-language-server] +filetypes = ["racket"] +roots = ["info.rkt"] +command = "racket" +args = ["-l", "racket-langserver"] + +[language_server.reason-ocamllsp] +filetypes = ["reason"] +roots = ["package.json", "Makefile", ".git", ".hg"] +command = "ocamllsp" + +# [language_server.rls] +# filetypes = ["rust"] +# roots = ["Cargo.toml"] +# command = "sh" +# args = [ +# "-c", +# """ +# if path=$(rustup which rls 2>/dev/null); then +# exec "$path" +# else +# exec rls +# fi +# """, +# ] +# settings_section = "rust" +# [language_server.rls.settings.rust] +# # See https://github.com/rust-lang/rls#configuration +# # features = [] + + +[language_server.rust-analyzer] +filetypes = ["rust"] +roots = ["Cargo.toml"] +command = "sh" +args = [ + "-c", + """ + if path=$(rustup which rust-analyzer 2>/dev/null); then + exec "$path" + else + exec rust-analyzer + fi + """, +] +[language_server.rust-analyzer.settings.rust-analyzer] +# See https://rust-analyzer.github.io/manual.html#configuration +# cargo.features = [] +check.command = "clippy" + +[language_server.solargraph] +filetypes = ["ruby"] +roots = ["Gemfile"] +command = "solargraph" +args = ["stdio"] +settings_section = "_" +[language_server.solargraph.settings._] +# See https://github.com/castwide/solargraph/blob/master/lib/solargraph/language_server/host.rb +# diagnostics = false + +[language_server.svelte-language-server] +filetypes = ["svelte"] +roots = ["package.json", "tsconfig.json", "jsconfig.json", ".git", ".hg"] +command = "svelteserver" +args = ["--stdio"] + +[language_server.taplo] +filetypes = ["toml"] +roots = [".git", ".hg"] +command = "taplo" +args = ["lsp", "stdio"] + +[language_server.terraform-ls] +filetypes = ["terraform"] +roots = ["*.tf"] +command = "terraform-ls" +args = ["serve"] +[language_server.terraform-ls.settings.terraform-ls] +# See https://github.com/hashicorp/terraform-ls/blob/main/docs/SETTINGS.md +# rootModulePaths = [] + +[language_server.texlab] +filetypes = ["latex"] +roots = [".git", ".hg"] +command = "texlab" +[language_server.texlab.settings.texlab] +# See https://github.com/latex-lsp/texlab/wiki/Configuration +# +# Preview configuration for zathura with SyncTeX search. +# For other PDF viewers see https://github.com/latex-lsp/texlab/wiki/Previewing +forwardSearch.executable = "zathura" +forwardSearch.args = [ + "%p", + "--synctex-forward", # Support texlab-forward-search + "%l:1:%f", + "--synctex-editor-command", # Inverse search: use Control+Left-Mouse-Button to jump to source. + """ + sh -c ' + echo " + evaluate-commands -client %%opt{texlab_client} %%{ + evaluate-commands -try-client %%opt{jumpclient} %%{ + edit -- %%{input} %%{line} + } + } + " | kak -p $kak_session + ' + """, +] + +[language_server.typescript-language-server] +filetypes = ["javascript", "typescript"] +roots = ["package.json", "tsconfig.json", "jsconfig.json", ".git", ".hg"] +command = "typescript-language-server" +args = ["--stdio"] +settings_section = "_" +[language_server.typescript-language-server.settings._] +# quotePreference = "double" +# typescript.format.semicolons = "insert" + +# [language_server.biome] +# filetypes = ["typescript", "javascript"] +# roots = ["biome.json", "package.json", "tsconfig.json", "jsconfig.json", ".git", ".hg"] +# command = "biome" +# args = ["lsp-proxy"] + +# [language_server.eslint] +# filetypes = ["javascript", "typescript"] +# roots = [".eslintrc", ".eslintrc.json"] +# command = "eslint-language-server" +# args = ["--stdio"] +# workaround_eslint = true +# [language_server.eslint.settings] +# codeActionsOnSave = { mode = "all", "source.fixAll.eslint" = true } +# format = { enable = true } +# quiet = false +# rulesCustomizations = [] +# run = "onType" +# validate = "on" +# experimental = {} +# problems = { shortenToSingleLine = false } +# codeAction.disableRuleComment = { enable = true, location = "separateLine" } +# codeAction.showDocumentation = { enable = false } + +[language_server.yaml-language-server] +filetypes = ["yaml"] +roots = [".git", ".hg"] +command = "yaml-language-server" +args = ["--stdio"] +settings_section = "yaml" +[language_server.yaml-language-server.settings.yaml] +# See https://github.com/redhat-developer/yaml-language-server#language-server-settings +# Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts +# format.enable = true + +[language_server.zls] +filetypes = ["zig"] +roots = ["build.zig"] +command = "zls" + +# Semantic tokens support +# See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_semanticTokens +# for the default list of tokens and modifiers. +# However, many language servers implement their own values. +# Make sure to check the output of `lsp-capabilities` and each server's documentation and source code as well. +# Examples: +# - TypeScript: https://github.com/microsoft/vscode-languageserver-node/blob/main/client/src/common/semanticTokens.ts +# - Rust Analyzer: https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/syntax_highlighting.rs +[semantic_tokens] +faces = [ + {face="documentation", token="comment", modifiers=["documentation"]}, + {face="comment", token="comment"}, + {face="function", token="function"}, + {face="keyword", token="keyword"}, + {face="module", token="namespace"}, + {face="operator", token="operator"}, + {face="string", token="string"}, + {face="type", token="type"}, + {face="default+d", token="variable", modifiers=["readonly"]}, + {face="default+d", token="variable", modifiers=["constant"]}, + {face="variable", token="variable"}, +] + diff --git a/kak/kak-tree-sitter.toml b/kak/kak-tree-sitter.toml new file mode 100644 index 0000000..f262ef1 --- /dev/null +++ b/kak/kak-tree-sitter.toml @@ -0,0 +1,1482 @@ +# kak-tree-sitter default configuration file. +# +# It is highly recommended for users to copy that file and edit it manually if they need to add support for languages +# not present yet. + +# List of features to be enabled/disabled. Most of those features can be +# overriden in the user configuration, or even on the CLI — see --with-* flags. +[features] +highlighting = true +text_objects = true + +[highlight] +# Top-level highlight capture group declarations. If your grammars uses a capture group that is not defined here, you +# have to add it to the list. +groups = [ + "attribute", + "comment", + "comment.block", + "comment.line", + "constant", + "constant.builtin", + "constant.builtin.boolean", + "constant.character", + "constant.character.escape", + "constant.macro", + "constant.numeric", + "constant.numeric.float", + "constant.numeric.integer", + "constructor", + "diff.plus", + "diff.minus", + "diff.delta", + "diff.delta.moved", + "embedded", + "error", + "function", + "function.builtin", + "function.macro", + "function.method", + "function.special", + "hint", + "include", + "info", + "keyword", + "keyword.conditional", + "keyword.control", + "keyword.control.conditional", + "keyword.control.except", + "keyword.control.exception", + "keyword.control.import", + "keyword.control.repeat", + "keyword.control.return", + "keyword.directive", + "keyword.function", + "keyword.operator", + "keyword.special", + "keyword.storage", + "keyword.storage.modifier", + "keyword.storage.modifier.mut", + "keyword.storage.modifier.ref", + "keyword.storage.type", + "label", + "load", + "markup.bold", + "markup.heading", + "markup.heading.1", + "markup.heading.2", + "markup.heading.3", + "markup.heading.4", + "markup.heading.5", + "markup.heading.6", + "markup.heading.marker", + "markup.italic", + "markup.link.label", + "markup.link.text", + "markup.link.url", + "markup.link.uri", + "markup.list.checked", + "markup.list.numbered", + "markup.list.unchecked", + "markup.list.unnumbered", + "markup.quote" , + "markup.raw", + "markup.raw.block", + "markup.raw.inline", + "markup.strikethrough", + "namespace", + "operator", + "punctuation", + "punctuation.bracket", + "punctuation.delimiter", + "punctuation.special", + "special", + "string", + "string.escape", + "string.regexp", + "string.special", + "string.special.path", + "string.special.symbol", + "string.symbol", + "tag", + "tag.error", + "text", + "type", + "type.builtin", + "type.enum.variant", + "variable", + "variable.builtin", + "variable.other.member", + "variable.parameter", + "warning", +] + +# astro +[language.astro.grammar.source.git] +url = "https://github.com/virchau13/tree-sitter-astro" +pin = "4be180759ec13651f72bacee65fa477c64222a1a" + +[language.astro.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "astro.so"] +link_flags = ["-O3"] + +[language.astro.queries.source.git] +url = "https://git.sr.ht/~hadronized/kak-tree-sitter" +pin = "862f6cd58b38d9d1b4abfb722b4a4b25bdae2586" + +[language.astro.queries] +path = "runtime/queries/astro" + +# awk +[language.awk.grammar.source.git] +url = "https://github.com/Beaglefoot/tree-sitter-awk" +pin = "8eaa762d05cc67c0e2cc53a0a71750b3c16733c2" + +[language.awk.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "awk.so"] +link_flags = ["-O3"] + +[language.awk.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.awk.queries] +path = "runtime/queries/awk" + +# bash +[language.bash.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-bash" +pin = "275effdfc0edce774acf7d481f9ea195c6c403cd" + +[language.bash.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.cc", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "bash.so"] +link_flags = ["-O3", "-lstdc++"] + +[language.bash.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.bash.queries] +path = "runtime/queries/bash" + +# bass +# TODO + +# beancount +# TODO + +# bibtex +[language.bibtex.grammar.source.git] +url = "https://github.com/latex-lsp/tree-sitter-bibtex" +pin = "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34" + +[language.bibtex.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "bibtex.so"] +link_flags = ["-O3"] + +[language.bibtex.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.bibtex.queries] +path = "runtime/queries/bibtex" + +# bicep +# TODO + +# c +[language.c.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-c" +pin = "7175a6dd5fc1cee660dce6fe23f6043d75af424a" + +[language.c.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "c.so"] +link_flags = ["-O3"] + +[language.c.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.c.queries] +path = "runtime/queries/c" + +# cabal +# TODO + +# cairo +# TODO + +# capnp +# TODO + +# clojure +# TODO + +# cmake +[language.cmake.grammar.source.git] +url = "https://github.com/uyha/tree-sitter-cmake" +pin = "6e51463ef3052dd3b328322c22172eda093727ad" + +[language.cmake.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "../scanner.cc", "-I", ".."] +compile_flags = ["-O3", "-flto=auto", "-march=native"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "scanner.o", "-o", "cmake.so"] +link_flags = ["-O3", "-lstdc++", "-flto=auto"] + +[language.cmake.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.cmake.queries] +path = "runtime/queries/cmake" + +# comment +[language.comment.grammar.source.git] +url = "https://github.com/stsewd/tree-sitter-comment" +pin = "94c99a66bb5051d8321b5900aee92b76450c50ce" + +[language.comment.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "comment.so"] +link_flags = ["-O3"] + +[language.comment.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.comment.queries] +path = "runtime/queries/comment" + +# common-lisp +# TODO + +# cpon +# TODO + +# cpp +[language.cpp.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-cpp" +pin = "670404d7c689be1c868a46f919ba2a3912f2b7ef" + +[language.cpp.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.cc", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "cpp.so"] +link_flags = ["-O3", "-lstdc++"] + +[language.cpp.queries.source.git] +url = "https://git.sr.ht/~hadronized/kak-tree-sitter" +pin = "b0ecb0d376c94d2fa4814816b41986bf5d735384" + +[language.cpp.queries] +path = "runtime/queries/cpp" + +# crystal +# TODO + +# c-sharp +[language.csharp.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-c-sharp" +pin = "92c0a9431400cd8b6b6ee7503f81da3ae83fc830" + +[language.csharp.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "csharp.so"] +link_flags = ["-O3"] + +[language.csharp.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "be307a420480178c1bc443992c8336f6471b8b7b" + +[language.csharp.queries] +path = "runtime/queries/c-sharp" + +# css +[language.css.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-css" +pin = "769203d0f9abe1a9a691ac2b9fe4bb4397a73c51" + +[language.css.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "css.so"] +link_flags = ["-O3"] + +[language.css.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.css.queries] +path = "runtime/queries/css" + +# cue +# TODO + +# d +# TODO + +# dart +# TODO + +# devicetree +# TODO + +# dhall +# TODO + +# diff +[language.diff.grammar.source.git] +url = "https://github.com/the-mikedavis/tree-sitter-diff" +pin = "fd74c78fa88a20085dbc7bbeaba066f4d1692b63" + +[language.diff.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "diff.so"] +link_flags = ["-O3"] + +[language.diff.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.diff.queries] +path = "runtime/queries/diff" + +# dockerfile +# TODO + +# dot +# TODO + +# dtd +# TODO + +# ecma +# TODO + +# edoc +# TODO + +# eex +# TODO + +# ejs +# TODO + +# elixir +[language.elixir.grammar.source.git] +url = "https://github.com/elixir-lang/tree-sitter-elixir" +pin = "511ea5e0088779e4bdd76e12963ab9a5fe99983a" + +[language.elixir.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "elixir.so"] +link_flags = ["-O3"] + +[language.elixir.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "be307a420480178c1bc443992c8336f6471b8b7b" + +[language.elixir.queries] +path = "runtime/queries/elixir" + +# elm +# TODO + +# elvish +# TODO + +# env +# TODO + +# erb +# TODO + +# erlang +# TODO + +# esdl +# TODO + +# fish +[language.fish.grammar.source.git] +url = "https://github.com/ram02z/tree-sitter-fish" +pin = "84436cf24c2b3176bfbb220922a0fdbd0141e406" + +[language.fish.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "../scanner.c", "-I", ".."] +compile_flags = ["-O3", "-march=native", "-flto=auto"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "scanner.o", "-o", "fish.so"] +link_flags = ["-O3", "-flto=auto"] + +[language.fish.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.fish.queries] +path = "runtime/queries/fish" + +# fortran +# TODO + +# gdscript +# TODO + +# git-attributes +# TODO + +# git-commit +[language.git-commit.grammar.source.git] +url = "https://github.com/the-mikedavis/tree-sitter-git-commit" +pin = "db88cffa3952dd2328b741af5d0fc69bdb76704f" + +[language.git-commit.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "git-commit.so"] +link_flags = ["-O3"] + +[language.git-commit.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.git-commit.queries] +path = "runtime/queries/git-commit" + +# git-config +# TODO + +# git-ignore +# TODO + +# git-rebase +# TODO + +# gleam +# TODO + +# glsl +# TODO + +# go +[language.go.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-go" +pin = "64457ea6b73ef5422ed1687178d4545c3e91334a" + +[language.go.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "go.so"] +link_flags = ["-O3"] + +[language.go.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.go.queries] +path = "runtime/queries/go" + +# godot-resource +# TODO + +# gomod +# TODO + +# gotmpl +# TODO + +# gowork +# TODO + +# graphql +# TODO + +# hare +# TODO + +# haskell +[language.haskell.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-haskell" +pin = "98fc7f59049aeb713ab9b72a8ff25dcaaef81087" + +[language.haskell.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "../scanner.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "scanner.o", "-o", "haskell.so"] +link_flags = ["-O3"] + +[language.haskell.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.haskell.queries] +path = "runtime/queries/haskell" + +# hcl +# TODO + +# heex +# TODO + +# hosts +# TODO + +# html +[language.html.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-html" +pin = "86c253e675e7fdd1c0482efe0706f24bafbc3a7d" + +[language.html.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "../scanner.cc", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "html.so"] +link_flags = ["-O3", "-lstdc++"] + +[language.html.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.html.queries] +path = "runtime/queries/html" + +# hurl +# TODO + +# iex +# TODO + +# ini +# TODO + +# java +[language.java.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-java" +pin = "09d650def6cdf7f479f4b78f595e9ef5b58ce31e" + +[language.java.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "java.so"] +link_flags = ["-O3"] + +[language.java.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.java.queries] +path = "runtime/queries/java" + +# javascript +[language.javascript.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-javascript" +pin = "f1e5a09b8d02f8209a68249c93f0ad647b228e6e" + +[language.javascript.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "javascript.so"] +link_flags = ["-O3"] + +[language.javascript.queries.source.git] +url = "https://git.sr.ht/~hadronized/kak-tree-sitter" +pin = "834d348b85868fbe9033231e72f29be361346aeb" + +[language.javascript.queries] +path = "runtime/queries/javascript" + +# jsdoc +# TODO + +# json +[language.json.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-json" +pin = "73076754005a460947cafe8e03a8cf5fa4fa2938" + +[language.json.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "json.so"] +link_flags = ["-O3"] + +[language.json.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.json.queries] +path = "runtime/queries/json" + +# jsonnet +# TODO + +# jsx +[language.jsx.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-javascript" +pin = "f1e5a09b8d02f8209a68249c93f0ad647b228e6e" + +[language.jsx.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "jsx.so"] +link_flags = ["-O3"] + +[language.jsx.queries.source.git] +url = "https://git.sr.ht/~hadronized/kak-tree-sitter" +pin = "834d348b85868fbe9033231e72f29be361346aeb" + +[language.jsx.queries] +path = "runtime/queries/jsx" + +# julia +[language.julia.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-julia" +pin = "2f885efd38a6a6abfefc81d53ecdd99812dcde69" + +[language.julia.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "-flto=auto", "../parser.c", "../scanner.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "-flto=auto", "parser.o", "scanner.o", "-o", "julia.so"] +link_flags = ["-O3"] + +[language.julia.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.julia.queries] +path = "runtime/queries/julia" + +# just +# TODO + +# kdl +# TODO + +# koka +[language.koka.grammar.source.git] +url = "https://github.com/mtoohey31/tree-sitter-koka" +pin = "96d070c3700692858035f3524cc0ad944cef2594" + +[language.koka.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "koka.so"] +link_flags = ["-O3" ] + +[language.koka.queries.source.git] +url = "https://github.com/mtoohey31/tree-sitter-koka" +pin = "96d070c3700692858035f3524cc0ad944cef2594" + +[language.koka.queries] +path = "queries" + +# kotlin +[language.kotlin.grammar.source.git] +url = "https://github.com/fwcd/tree-sitter-kotlin" +pin = "a4f71eb9b8c9b19ded3e0e9470be4b1b77c2b569" + +[language.kotlin.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "kotlin.so"] +link_flags = ["-O3"] + +[language.kotlin.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "f73e9a8d15fd5a87d472a49808baf42ba403f9bf" + +[language.kotlin.queries] +path = "runtime/queries/kotlin" + +# latex +[language.latex.grammar.source.git] +url = "https://github.com/latex-lsp/tree-sitter-latex" +pin = "dfe891922ccd2e7cef52eccb2775e1b576727165" + +[language.latex.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "latex.so"] +link_flags = ["-O3"] + +[language.latex.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.latex.queries] +path = "runtime/queries/latex" + +# lean +# TODO + +# ledger +# TODO + +# llvm +[language.llvm.grammar.source.git] +url = "https://github.com/benwilliamgraham/tree-sitter-llvm" +pin = "1b96e58faf558ce057d4dc664b904528aee743cb" + +[language.llvm.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "llvm.so"] +link_flags = ["-O3"] + +[language.llvm.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "e76020ddb93eeb051de606c24f92189c3fc55547" + +[language.llvm.queries] +path = "runtime/queries/llvm" + +# llvm-mir +# TODO + +# llvm-mir-yaml +# TODO + +# lua +# TODO + +# make +[language.make.grammar.source.git] +url = "https://github.com/alemuller/tree-sitter-make" +pin = "a4b9187417d6be349ee5fd4b6e77b4172c6827dd" + +[language.make.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "make.so"] +link_flags = ["-O3"] + +[language.make.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.make.queries] +path = "runtime/queries/make" + +# markdoc +# TODO + +# markdown +[language.markdown.grammar.source.git] +url = "https://github.com/MDeiml/tree-sitter-markdown" +pin = "aaf76797aa8ecd9a5e78e0ec3681941de6c945ee" + +[language.markdown.grammar] +path = "tree-sitter-markdown/src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "markdown.so"] +link_flags = ["-O3"] + +[language.markdown.queries.source.git] +url = "https://git.sr.ht/~hadronized/kak-tree-sitter" +pin = "d2d9761f309d6204a8f4480dc23f10558a165e29" + +[language.markdown.queries] +path = "runtime/queries/markdown" + +# markdown.inline +[language."markdown.inline".grammar.source.git] +url = "https://github.com/MDeiml/tree-sitter-markdown" +pin = "aaf76797aa8ecd9a5e78e0ec3681941de6c945ee" + +[language."markdown.inline".grammar] +path = "tree-sitter-markdown-inline/src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "markdown.inline.so"] +link_flags = ["-O3"] + +[language."markdown.inline".queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "56ccaedffbb8011e36012278e2a4861a8d435a60" + +[language."markdown.inline".queries] +path = "runtime/queries/markdown.inline" + +# matlab +# TODO + +# mermaid +# TODO + +# meson +# TODO + +# msbuild +# TODO + +# nasm +# TODO + +# nickel +# TODO + +# nim + +[language.nim.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "nim.so"] +link_flags = ["-O3"] + +[language.nim.grammar.source.git] +url = "https://github.com/alaviss/tree-sitter-nim" +pin = "961c2798cec9250c44f7d7225ddb33d47d25856a" + +[language.nim.queries] +path = "runtime/queries/nim" + +[language.nim.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "50c90cb47c9cdbb044d1a2de034285e0d198f43e" + +# nix + +[language.nix.grammar.source.git] +url = "https://github.com/nix-community/tree-sitter-nix" +pin = "763168fa916a333a459434f1424b5d30645f015d" + +[language.nix.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "nix.so"] +link_flags = ["-O3"] + +[language.nix.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "be307a420480178c1bc443992c8336f6471b8b7b" + +[language.nix.queries] +path = "runtime/queries/nix" + +# nu +[language.nu.grammar.source.git ] +url = "https://github.com/nushell/tree-sitter-nu" +pin = "786689b0562b9799ce53e824cb45a1a2a04dc673" + +[language.nu.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "nu.so"] +link_flags = ["-O3"] + +[language.nu.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "107763083405868f3679d8e12476ed0688896f87" + +[language.nu.queries] +path = "runtime/queries/nu" + +# ocaml +# TODO + +# ocaml-interface +# TODO + +# odin +# TODO + +# opencl +# TODO + +# openscad +# TODO + +# org +# TODO + +# pascal +# TODO + +# passwd +# TODO + +# pem +# TODO + +# perl +# TODO + +# php +# TODO + +# po +# TODO + +# ponylang +# TODO + +# prisma +# TODO + +# protobuf +# TODO + +# prql +# TODO + +# purescript +[language.purescript.grammar.source.git] +url = "https://github.com/postsolar/tree-sitter-purescript/" +pin = "1615ac3b9c3b572259bce7a30c14cb06d6c2f2ff" + +[language.purescript.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "../scanner.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "scanner.o", "-o", "purescript.so"] +link_flags = ["-O3"] + +[language.purescript.queries.source.git] +url = "https://github.com/postsolar/tree-sitter-purescript" +pin = "1615ac3b9c3b572259bce7a30c14cb06d6c2f2ff" + +[language.purescript.queries] +path = "queries" + +# python +[language.python.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-python" +pin = "de221eccf9a221f5b85474a553474a69b4b5784d" + +[language.python.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.cc", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "python.so"] +link_flags = ["-O3", "-lstdc++"] + +[language.python.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.python.queries] +path = "runtime/queries/python" + +# qml +# TODO + +# r +# TODO + +# racket +# TODO + +# regex +# TODO + +# rego +# TODO + +# rescript +# TODO + +# rmarkdown +# TODO + +# robot +# TODO + +# ron +# TODO + +# rst +# TODO + +# ruby +[language.ruby.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-ruby" +pin = "206c7077164372c596ffa8eaadb9435c28941364" + +[language.ruby.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.cc", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "c++" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "ruby.so"] +link_flags = ["-O3", "-lstdc++"] + +[language.ruby.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.ruby.queries] +path = "runtime/queries/ruby" + +# rust +[language.rust.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-rust" +pin = "0431a2c60828731f27491ee9fdefe25e250ce9c9" + +[language.rust.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "rust.so"] +link_flags = ["-O3"] + +[language.rust.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "3e963b3c1b5eb4b5cd7f33b8ef6d6642de210a9b" + +[language.rust.queries] +path = "runtime/queries/rust" + +# scss +[language.scss.grammar.source.git] +url = "https://github.com/serenadeai/tree-sitter-scss" +pin = "c478c6868648eff49eb04a4df90d703dc45b312a" + +[language.scss.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "scss.so"] +link_flags = ["-O3"] + +[language.scss.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "be307a420480178c1bc443992c8336f6471b8b7b" + +[language.scss.queries] +path = "runtime/queries/scss" + +# sage +# TODO + +# scala +# TODO + +# scheme +[language.scheme.grammar.source.git] +url = "https://github.com/6cdh/tree-sitter-scheme" +pin = "c0741320bfca6b7b5b7a13b5171275951e96a842" + +[language.scheme.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "scheme.so"] +link_flags = ["-O3"] + +[language.scheme.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.scheme.queries] +path = "runtime/queries/scheme" + +# scss +# TODO + +# slint +# TODO + +# smithy +# TODO + +# sml +# TODO + +# solidity +# TODO + +# sql +# TODO + +# sshclientconfig +# TODO + +# starlark +# TODO + +# svelte +# TODO + +# sway +# TODO + +# swift +# TODO + +# tablegen +# TODO + +# task +# TODO + +# tfvars +# TODO + +# toml +[language.toml.grammar.source.git] +url = "https://github.com/ikatyang/tree-sitter-toml" +pin = "8bd2056818b21860e3d756b5a58c4f6e05fb744e" + +[language.toml.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "toml.so"] +link_flags = ["-O3"] + +[language.toml.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.toml.queries] +path = "runtime/queries/toml" + +# tsq +# TODO + +# tsx +[language.tsx.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-typescript" +pin = "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf" + +[language.tsx.grammar] +path = "tsx/src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "tsx.so"] +link_flags = ["-O3"] + +[language.tsx.queries.source.git] +url = "https://git.sr.ht/~hadronized/kak-tree-sitter" +pin = "b0ecb0d376c94d2fa4814816b41986bf5d735384" + +[language.tsx.queries] +path = "runtime/queries/tsx" + +# twig +# TODO + +# typescript +[language.typescript.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-typescript" +pin = "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf" + +[language.typescript.grammar] +path = "typescript/src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typescript.so"] +link_flags = ["-O3"] + +[language.typescript.queries.source.git] +url = "https://git.sr.ht/~hadronized/kak-tree-sitter" +pin = "b0ecb0d376c94d2fa4814816b41986bf5d735384" + +[language.typescript.queries] +path = "runtime/queries/typescript" + +# ungrammar +# TODO + +# unison +[language.unison.grammar.source.git] +url = "https://github.com/kylegoetz/tree-sitter-unison" +pin = "1f505e2447fa876a87aee47ff3d70b9e141c744f" + +[language.unison.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "unison.so"] +link_flags = ["-O3"] + +[language.unison.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "be307a420480178c1bc443992c8336f6471b8b7b" + +[language.unison.queries] +path = "runtime/queries/unison" + +# uxntal +# TODO + +# v +# TODO + +# vala +# TODO + +# verilog +[language.verilog.grammar.source.git] +url = "https://github.com/tree-sitter/tree-sitter-verilog" +pin = "902031343056bc0b11f3e47b33f036a9cf59f58d" + +[language.verilog.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "verilog.so"] +link_flags = ["-O3"] + +[language.verilog.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "cb286b7a5df247057602f3bba3254b4c58093375" + +[language.verilog.queries] +path = "runtime/queries/verilog" + +# vhdl +# TODO + +# vhs +# TODO + +# vue +[language.vue.grammar.source.git] +url = "https://github.com/ikatyang/tree-sitter-vue" +pin = "91fe2754796cd8fba5f229505a23fa08f3546c06" + +[language.vue.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.cc", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "vue.so"] +link_flags = ["-O3", "-lstdc++"] + +[language.vue.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "be307a420480178c1bc443992c8336f6471b8b7b" + +[language.vue.queries] +path = "runtime/queries/vue" + +# wast +# TODO + +# wat +# TODO + +# wgsl +# TODO + +# wit +# TODO + +# xit +# TODO + +# xml +[language.xml.grammar.source.git] +url = "https://github.com/RenjiSann/tree-sitter-xml" +pin = "48a7c2b6fb9d515577e115e6788937e837815651" + +[language.xml.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "xml.so"] +link_flags = ["-O3"] + +[language.xml.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.xml.queries] +path = "runtime/queries/xml" + +# yaml +[language.yaml.grammar.source.git] +url = "https://github.com/ikatyang/tree-sitter-yaml" +pin = "0e36bed171768908f331ff7dff9d956bae016efb" + +[language.yaml.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.cc", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "yaml.so"] +link_flags = ["-O3", "-lstdc++"] + +[language.yaml.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "dbd248fdfa680373d94fbc10094a160aafa0f7a7" + +[language.yaml.queries] +path = "runtime/queries/yaml" + +# yuck +# TODO + +# zig +[language.zig.grammar.source.git] +url = "https://github.com/maxxnino/tree-sitter-zig" +pin = "0d08703e4c3f426ec61695d7617415fff97029bd" + +[language.zig.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "parser.o", "-o", "zig.so"] +link_flags = ["-O3"] + +[language.zig.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "bc737404e8ad462b4101987730f4a76658d132ad" + +[language.zig.queries] +path = "runtime/queries/zig" + +# typst +[language.typst.grammar.source.git] +url = "https://github.com/uben0/tree-sitter-typst" +pin = "13863ddcbaa7b68ee6221cea2e3143415e64aea4" + +[language.typst.grammar] +path = "src" +compile = "cc" +compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."] +compile_flags = ["-O3"] +link = "cc" +link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typst.so"] +link_flags = ["-O3"] + +[language.typst.queries.source.git] +url = "https://github.com/helix-editor/helix" +pin = "eeb8782c542c20069a81f78bec9ec0b15c0c7050" + +[language.typst.queries] +path = "runtime/queries/typst" diff --git a/kak/kakrc b/kak/kakrc new file mode 100644 index 0000000..e5bb31b --- /dev/null +++ b/kak/kakrc @@ -0,0 +1,2 @@ +NOTE: This is not the kakrc file! That's generated by Nix. +The subfolders here are what's included. diff --git a/kak/sudo-write.kak b/kak/sudo-write.kak new file mode 100644 index 0000000..79a1f41 --- /dev/null +++ b/kak/sudo-write.kak @@ -0,0 +1,71 @@ +# save the current buffer to its file as root using `sudo` +# (optionally pass the user password to sudo if not cached) + +define-command -hidden sudo-write-cached-password %{ + # easy case: the password was already cached, so we don't need any tricky handling + eval -save-regs f %{ + reg f %sh{ mktemp -t XXXXXX } + write! %reg{f} + eval %sh{ + sudo -n -- dd if="$kak_main_reg_f" of="$kak_buffile" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "edit!" + else + echo 'fail "Unknown failure"' + fi + rm -f "$kak_main_reg_f" + } + } +} + +define-command -hidden sudo-write-prompt-password %{ + prompt -password 'Password:' %{ + eval -save-regs r %{ + eval -draft -save-regs 'tf|"' %{ + reg t %val{buffile} + reg f %sh{ mktemp -t XXXXXX } + write! %reg{f} + + # write the password in a buffer in order to pass it through STDIN to sudo + # somewhat dangerous, but better than passing the password + # through the shell scope's environment or interpolating it inside the shell string + # 'exec |' is pretty much the only way to pass data over STDIN + edit -scratch '*sudo-password-tmp*' + reg '"' "%val{text}" + exec + reg | %{ + sudo -S -- dd if="$kak_main_reg_f" of="$kak_main_reg_t" > /dev/null 2>&1 + if [ $? -eq 0 ]; then + printf 'edit!' + else + printf 'fail "Incorrect password?"' + fi + rm -f "$kak_main_reg_f" + } + exec '|' + exec -save-regs '' '%"ry' + delete-buffer! '*sudo-password-tmp*' + } + eval %reg{r} + } + } +} + +define-command sudo-write -docstring "Write the content of the buffer using sudo" %{ + eval %sh{ + # tricky posix-way of getting the first character of a variable + # no subprocess! + if [ "${kak_buffile%"${kak_buffile#?}"}" != "/" ]; then + # not entirely foolproof as a scratch buffer may start with '/', but good enough + printf 'fail "Not a file"' + exit + fi + # check if the password is cached + if sudo -n true > /dev/null 2>&1; then + printf sudo-write-cached-password + else + printf sudo-write-prompt-password + fi + } +} + diff --git a/kak/wezterm-tab.kak b/kak/wezterm-tab.kak new file mode 100644 index 0000000..a14eb45 --- /dev/null +++ b/kak/wezterm-tab.kak @@ -0,0 +1,70 @@ +# https://wezfurlong.org/wezterm/index.html +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + + +provide-module wezterm-tab %{ + +# ensure that we're running under screen +evaluate-commands %sh{ + [ -z "${kak_opt_windowing_modules}" ] || [ -n "$WEZTERM_UNIX_SOCKET" ] || echo 'fail wezterm not detected' +} + +define-command wezterm-tab-terminal-impl -hidden -params 2.. %{ + nop %sh{ + wezterm cli "$@" + } +} + +define-command wezterm-tab-terminal-vertical -params 1.. -docstring ' +wezterm-terminal-vertical []: create a new terminal as a wezterm pane +The current pane is split into two, top and bottom +The program passed as argument will be executed in the new terminal' \ +%{ + wezterm-tab-terminal-impl split-pane --cwd "%val{client_env_PWD}" --bottom --pane-id "%val{client_env_WEZTERM_PANE}" -- %arg{@} +} +complete-command wezterm-tab-terminal-vertical shell + +define-command wezterm-tab-terminal-horizontal -params 1.. -docstring ' +wezterm-terminal-horizontal []: create a new terminal as a wezterm pane +The current pane is split into two, left and right +The program passed as argument will be executed in the new terminal' \ +%{ + wezterm-tab-terminal-impl split-pane --cwd "%val{client_env_PWD}" --right --pane-id "%val{client_env_WEZTERM_PANE}" -- %arg{@} +} +complete-command wezterm-tab-terminal-horizontal shell + +define-command wezterm-tab-terminal-tab -params 1.. -docstring ' +wezterm-terminal-tab []: create a new terminal as a wezterm tab +The program passed as argument will be executed in the new terminal' \ +%{ + wezterm-tab-terminal-impl spawn --cwd "%val{client_env_PWD}" --pane-id "%val{client_env_WEZTERM_PANE}" -- %arg{@} +} +complete-command wezterm-tab-terminal-tab shell + +define-command wezterm-tab-terminal-window -params 1.. -docstring ' +wezterm-terminal-window []: create a new terminal as a wezterm window +The program passed as argument will be executed in the new terminal' \ +%{ + wezterm-tab-terminal-impl spawn --cwd "%val{client_env_PWD}" --pane-id "%val{client_env_WEZTERM_PANE}" -- %arg{@} +} +complete-command wezterm-tab-terminal-window shell + +define-command wezterm-tab-focus -params ..1 -docstring ' +wezterm-focus []: focus the given client +If no client is passed then the current one is used' \ +%{ + evaluate-commands %sh{ + if [ $# -eq 1 ]; then + printf %s\\n " + evaluate-commands -client '$1' focus + " + elif [ -n "${kak_client_env_WEZTERM_PANE}" ]; then + wezterm cli activate-pane --pane-id "${kak_client_env_WEZTERM_PANE}" > /dev/null 2>&1 + fi + } +} +complete-command -menu wezterm-tab-focus client + +alias global focus wezterm-tab-focus + +} diff --git a/karabiner-elements/complex_modifications/move_with_mouse.json b/karabiner-elements/complex_modifications/move_with_mouse.json new file mode 100644 index 0000000..34702b1 --- /dev/null +++ b/karabiner-elements/complex_modifications/move_with_mouse.json @@ -0,0 +1,67 @@ +{ + "title": "Use mouse buttons to move workspaces", + "rules": [ + { + "description": "Switch workspaces using trackball buttons (1+3), (2+4), and 4", + "manipulators": [ + { + "type": "basic", + "from": { + "simultaneous": [ + { "pointing_button": "button3" }, + { "pointing_button": "button1" } + ], + "simultaneous_options": { + "detect_key_down_uninterruptedly": true, + "key_down_order": "insensitive", + "key_up_order": "insensitive", + "key_up_when": "any" + } + }, + "to": { + "key_code": "left_arrow", + "modifiers": [ "control" ] + } + }, + { + "type": "basic", + "from": { + "simultaneous": [ + { "pointing_button": "button4" }, + { "pointing_button": "button2" } + ], + + "simultaneous_options": { + "key_down_order": "insensitive", + "key_up_order": "insensitive", + "key_up_when": "any" + } + + }, + "to": { + "key_code": "right_arrow", + "modifiers": [ "control" ] + } + }, + { + "type": "basic", + "from": { + "pointing_button": "button3" + }, + "to": { + "key_code": "mission_control" + } + }, + { + "type": "basic", + "from": { + "pointing_button": "button4" + }, + "to": { + "key_code": "mission_control" + } + } + ] + } + ] +} diff --git a/khal/config b/khal/config new file mode 100644 index 0000000..4bd8d38 --- /dev/null +++ b/khal/config @@ -0,0 +1,15 @@ +[calendars] + +[[metrology_calendar_local]] +path = ~/.local/share/calendars/* +type = discover + +[locale] +timeformat = %H:%M +dateformat = %Y-%m-%d +longdateformat = %Y-%m-%d +datetimeformat = %Y-%m-%d %H:%M +longdatetimeformat = %Y-%m-%d %H:%M + +[default] +default_calendar = kate@metrolo.gy diff --git a/kinesis/active/do_not_edit.txt b/kinesis/active/do_not_edit.txt new file mode 100755 index 0000000..589010d Binary files /dev/null and b/kinesis/active/do_not_edit.txt differ diff --git a/kinesis/active/dvorak.txt b/kinesis/active/dvorak.txt new file mode 100755 index 0000000..e69de29 diff --git a/kinesis/active/qwerty.txt b/kinesis/active/qwerty.txt new file mode 100755 index 0000000..d8f7a19 --- /dev/null +++ b/kinesis/active/qwerty.txt @@ -0,0 +1,7 @@ +[pause]>[play] +[caps]>[delete] +[lctrl]>[lwin] +[rwin]>[rctrl] +[rctrl]>[lwin] +[delete]>[escape] +{intl-\}>{speed9}{-lshift}{`}{+lshift} diff --git a/kinesis/active/state.txt b/kinesis/active/state.txt new file mode 100755 index 0000000..3056210 --- /dev/null +++ b/kinesis/active/state.txt @@ -0,0 +1,10 @@ +startup_file=qwerty.txt +key_click_tone=ON +toggle_tone=ON +macro_disable=OFF +macro_speed=9 +status_play_speed=3 +power_user=true +program_key_lock=OFF + +v_drive_open_on_startup=ON diff --git a/kinesis/active/version.txt b/kinesis/active/version.txt new file mode 100755 index 0000000..48ee2ec --- /dev/null +++ b/kinesis/active/version.txt @@ -0,0 +1,3 @@ +Model name: Advantage2 Keyboard +Firmware version: 1.0.521.us (4MB), 06/25/2020 +Bootloader version: 1.0.1 diff --git a/looking-glass-contrib/IddSampleDriver.zip b/looking-glass-contrib/IddSampleDriver.zip new file mode 100644 index 0000000..f349a13 Binary files /dev/null and b/looking-glass-contrib/IddSampleDriver.zip differ diff --git a/looking-glass-contrib/nvfbcwrp32.dll b/looking-glass-contrib/nvfbcwrp32.dll new file mode 100644 index 0000000..7a0e075 Binary files /dev/null and b/looking-glass-contrib/nvfbcwrp32.dll differ diff --git a/looking-glass-contrib/nvfbcwrp64.dll b/looking-glass-contrib/nvfbcwrp64.dll new file mode 100644 index 0000000..7708af5 Binary files /dev/null and b/looking-glass-contrib/nvfbcwrp64.dll differ diff --git a/looking-glass/client.ini b/looking-glass/client.ini new file mode 100644 index 0000000..ec8a74e --- /dev/null +++ b/looking-glass/client.ini @@ -0,0 +1,3 @@ +[input] +escapeKey=KEY_F12 +captureOnFocus=yes diff --git a/macos/USB Prober.app/Contents/Info.plist b/macos/USB Prober.app/Contents/Info.plist new file mode 100644 index 0000000..9316d8e --- /dev/null +++ b/macos/USB Prober.app/Contents/Info.plist @@ -0,0 +1,48 @@ + + + + + BuildMachineOSBuild + 13E28 + CFBundleDevelopmentRegion + English + CFBundleExecutable + USB Prober + CFBundleGetInfoString + 666.4.0, Copyright © 2002-2014 Apple Inc. All rights reserved. + CFBundleIconFile + USBProberIcon.icns + CFBundleIdentifier + com.apple.USBProber + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + USB Prober + CFBundlePackageType + APPL + CFBundleShortVersionString + 666.4.0 + CFBundleSignature + USBP + CFBundleVersion + 666.4.0 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 5A3005 + DTPlatformVersion + GM + DTSDKBuild + 13E28 + DTSDKName + + DTXcode + 0502 + DTXcodeBuild + 5A3005 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/macos/USB Prober.app/Contents/MacOS/USB Prober b/macos/USB Prober.app/Contents/MacOS/USB Prober new file mode 100755 index 0000000..356358c Binary files /dev/null and b/macos/USB Prober.app/Contents/MacOS/USB Prober differ diff --git a/macos/USB Prober.app/Contents/PkgInfo b/macos/USB Prober.app/Contents/PkgInfo new file mode 100644 index 0000000..cf477ff --- /dev/null +++ b/macos/USB Prober.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPLUSBP \ No newline at end of file diff --git a/macos/USB Prober.app/Contents/Resources/English.lproj/InfoPlist.strings b/macos/USB Prober.app/Contents/Resources/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..fa4b2ee Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/English.lproj/InfoPlist.strings differ diff --git a/macos/USB Prober.app/Contents/Resources/English.lproj/MainMenu.nib b/macos/USB Prober.app/Contents/Resources/English.lproj/MainMenu.nib new file mode 100644 index 0000000..c4d7a58 Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/English.lproj/MainMenu.nib differ diff --git a/macos/USB Prober.app/Contents/Resources/KLog.kext/Contents/Info.plist b/macos/USB Prober.app/Contents/Resources/KLog.kext/Contents/Info.plist new file mode 100644 index 0000000..8aea5a0 --- /dev/null +++ b/macos/USB Prober.app/Contents/Resources/KLog.kext/Contents/Info.plist @@ -0,0 +1,71 @@ + + + + + BuildMachineOSBuild + 13E28 + CFBundleDevelopmentRegion + English + CFBundleExecutable + KLog + CFBundleGetInfoString + 650.4.0, Copyright © 2000-2012 Apple Inc. All rights reserved. + CFBundleIdentifier + com.apple.iokit.KLog + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Extension to log USB events + CFBundlePackageType + KEXT + CFBundleShortVersionString + 650.4.0 + CFBundleSignature + ???? + CFBundleVersion + 650.4.0 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 5A3005 + DTPlatformVersion + GM + DTSDKBuild + 13E28 + DTSDKName + + DTXcode + 0502 + DTXcodeBuild + 5A3005 + IOKitPersonalities + + KLog + + CFBundleIdentifier + com.apple.iokit.KLog + IOClass + com_apple_iokit_KLog + IOMatchCategory + com_apple_iokit_KLog + IOProviderClass + IOResources + IOResourceMatch + IOKit + + + OSBundleCompatibleVersion + 1.0 + OSBundleLibraries + + com.apple.iokit.IOUSBFamily + 3.0.0 + com.apple.kpi.bsd + 9.0.0 + com.apple.kpi.iokit + 9.0.0 + com.apple.kpi.libkern + 9.0.0 + + + diff --git a/macos/USB Prober.app/Contents/Resources/KLog.kext/Contents/MacOS/KLog b/macos/USB Prober.app/Contents/Resources/KLog.kext/Contents/MacOS/KLog new file mode 100755 index 0000000..baa2333 Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/KLog.kext/Contents/MacOS/KLog differ diff --git a/macos/USB Prober.app/Contents/Resources/KLog.kext/Contents/Resources/English.lproj/InfoPlist.strings b/macos/USB Prober.app/Contents/Resources/KLog.kext/Contents/Resources/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..f64ea0a Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/KLog.kext/Contents/Resources/English.lproj/InfoPlist.strings differ diff --git a/macos/USB Prober.app/Contents/Resources/SetKLogPermissions.sh b/macos/USB Prober.app/Contents/Resources/SetKLogPermissions.sh new file mode 100644 index 0000000..c27e625 --- /dev/null +++ b/macos/USB Prober.app/Contents/Resources/SetKLogPermissions.sh @@ -0,0 +1,4 @@ +cd /System/Library/Extensions/ +/usr/sbin/chown -R root:wheel KLog.kext +find KLog.kext -type d -exec /bin/chmod 0755 {} \; +find KLog.kext -type f -exec /bin/chmod 0644 {} \; diff --git a/macos/USB Prober.app/Contents/Resources/USBProberIcon.icns b/macos/USB Prober.app/Contents/Resources/USBProberIcon.icns new file mode 100644 index 0000000..dce7242 Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/USBProberIcon.icns differ diff --git a/macos/USB Prober.app/Contents/Resources/USBVendors.txt b/macos/USB Prober.app/Contents/Resources/USBVendors.txt new file mode 100644 index 0000000..254c335 --- /dev/null +++ b/macos/USB Prober.app/Contents/Resources/USBVendors.txt @@ -0,0 +1,2229 @@ +1|Kavi-EVAL +1000|EndPoints Inc. +1001|Thesys Microelectronics +1003|Atmel Corporation +1005|Mitel Corporation +1006|Mitsumi +1008|Hewlett Packard +1009|Genoa Technology +1010|Oak Technology, Inc +1011|Adaptec, Inc. +1012|Diebold, Inc. +1016|Epson Research Center +1017|KeyTronic Corp. +1019|OPTi Inc. +1020|Elitegroup Computer Systems +1021|Xilinx Inc. +1022|Farallon Comunications +1024|National Semiconductor +1026|ALi Corporation +1026|Acer Labs Inc. +1027|Future Technology Devices International Limited +1028|NCR Corporation +1029|Sand Microelectronics, Inc. +1029|inSilicon +1031|Fujitsu Personal Systems, Inc. +1032|Quanta Computer Inc. +1033|NEC Corporation +1034|Eastman Kodak Company +1035|Weltrend Semiconductor +1037|VIA Technologies, Inc. +1038|MCCI +1041|BUFFALO INC. +1041|Melco, Inc. +1043|Leadtek Research Inc. +1044|Giga-Byte Technology Co., Ltd. +1046|Winbond Electronics Corp. +1050|Phoenix Technologies Ltd. +1054|Creative Labs +1057|Nokia Corporation +1058|ADI Systems Inc. +1059|CATC +1060|SMSC +1061|Motorola Semiconductors HK, Ltd. +1062|Integrated Device Technology +1063|Motorola Electronics Taiwan Ltd. +1064|Advanced Gravis Computer Ltd. +1065|Cirrus Logic Inc. +1066|Ericsson Austrian, AG +1068|Innovative Semiconductors, Inc. +1071|Molex Inc. +1072|Fujitsu Component Limited +1073|ITAC Systems, Inc. +1074|Unisys Corp. +1077|Hyundai Electronics America +1078|Taugagreining HF +1080|Advanced Micro Devices +1085|Lexmark International Inc. +1086|LG Electronics USA Inc. +1088|EIZO NANAO CORPORATION +1090|Ericsson Inc. +1091|Gateway 2000 +1094|NMB Technologies Corporation +1097|Eldim +1098|Shamrock Technology Co., Ltd. +1100|CCL/ITRI +1101|Siemens Nixdorf AG +1102|Alps Electric Co., Ltd. +1103|ThrustMaster, Inc. +1105|Texas Instruments +1106|Mitsubishi Electronics America, Inc. +1107|CMD Technology +1110|Analog Devices, Inc. +1111|Silicon Integrated Systems Corp. +1112|KYE Systems Corp. +1113|Adobe Systems, Inc. +1114|SONICblue Incorporated +1115|Renesas Electronics Corp. +1117|Nortel Networks +1118|Microsoft Corporation +1121|Primax Electronics +1123|EATON +1124|AMP/Tycoelectronics +1128|Wieson Technologies Co., Ltd. +1130|CHERRY GmbH +1131|American Megatrends +1132|Toshiba +1133|Logitech Inc. +1134|Behavior Tech Computer Corporation +1137|Philips Consumer Lifestyle BV +1138|Sun Microsystems +1139|Sanyo Information Business Co., Ltd. +1140|Sanyo Electric Co. Ltd. +1141|TECO Infor-ion System +1144|Connectix +1146|Semtech Corporation +1147|Silitek Corp. +1148|Dell Computer Corp. +1149|Kensington +1150|LSI Corporation +1151|Plantronics, Inc. +1152|Toshiba America Info. Systems, Inc. +1154|Kyocera Corporation +1155|STMicroelectronics +1160|Cirque Corporation +1161|Foxconn / Hon Hai +1165|ITE Tech Inc. +1165|Integrated Technology Express +1165|Integrated Technology Express, Inc. +1169|Capetronic (Kaohsiung ) Corp. +1170|Samsung SemiConductor, Inc. +1170|Samsung Semiconductor, Inc. +1174|Micron Electronics +1175|Smile International, Inc. +1177|Yamaha Corporation +1179|Curtis Connections +1181|VLSI Technology, Inc. +1183|Compaq Computer Corporation +1188|Hitachi, Ltd. +1189|Acer Peripherals Inc. +1189|BenQ Corporation +1189|Benq Corporation +1190|Nokia Display Products +1191|Visioneer +1192|Multivideo Labs, Inc. +1193|Canon Inc. +1200|Nikon Corporation +1201|Pan International +1203|IBM Corporation +1204|Cypress Semiconductor +1205|ROHM Co., Ltd. +1207|Compal Electronics, Inc. +1208|Seiko Epson Corp. +1209|Rainbow Technologies, Inc. +1211|I-O Data Device, Inc. +1215|TDK Corporation +1221|Fujitsu Ltd. +1222|Toshiba America Electronic Components +1223|Micro Macro Technologies +1224|Konica Corporation +1226|Lite-On Technology Corp. +1227|FUJIFILM Corporation +1227|Fuji Photo Film Co., Ltd. +1228|ST-Ericsson +1228|Philips Semiconductors +1229|Tatung Company of America, Inc. +1230|ScanLogic Corporation +1231|Myson Century, Inc. +1233|ITT Cannon +1234|Altec Lansing Technologies, Inc. +1236|LSI Logic Corporation +1238|Mentor Graphics +1239|Oki Semiconductor +1240|Microchip Technology Inc. +1241|Holtek Semiconductor, Inc. +1242|Panasonic Corporation +1244|Huan Hsin Holdings Ltd. +1245|Sharp Corporation +1246|MindShare, Inc. +1247|Interlink Electronics +1249|Iiyama Corporation +1250|Exar Corporation +1254|SCM Microsystems +1254|Shuttle Technology +1255|Elo TouchSystems +1256|Samsung Electronics Co., Ltd. +1257|PC-Tel Inc. +1259|Northstar Systems Corp. +1259|Northstar Systems, Inc +1260|Tokyo Electron Device Limited +1261|Annabooks +1265|Victor Company of Japan, Limited +1266|Chicony Electronics Co., Ltd. +1267|ELAN Microelectronics Corportation +1267|Elan Microelectronics Corportation +1271|Newnex Technology Corp. +1272|FuturePlus Systems +1273|Brother Industries, Ltd. +1273|Brother International Corporation +1274|Dallas Semiconductor +1275|Biostar Microtech Int'l Corp. +1276|SUNPLUS TECHNOLOGY CO., LTD. +1277|Soliton Systems K.K. +1278|PFU Limited +1279|E-CMOS Corp. +1281|Fujikura/DDK +1282|Acer, Inc. +1284|Hayes Microcomputer Products +1286|3Com Corporation +1287|Hosiden Corporation +1288|Clarion Co., Ltd. +1289|Aztech Systems Ltd +1293|Belkin Corporation +1295|KC Technology Inc. +1296|Sejin Electron Inc. +1300|FCI Electronics +1302|Longwell Electronics/Longwell Company +1303|Butterfly Communications +1304|EzKEY Corp. +1305|Star Micronics Co., LTD +1308|Shuttle Inc. +1309|American Power Conversion +1310|Scientific Atlanta, Inc. +1311|IO Systems Inc. fomerly Elite Electronics, Inc. +1312|Taiwan Semiconductor Manufacturing Co. +1314|ACON, Advanced-Connectek, Inc. +1315|ATEN GMBH +1316|Sola Electronics +1317|PLX Technology, Inc. +1318|Temic MHS S.A. +1319|ALTRA +1320|ATI Technologies, Inc. +1321|Aladdin Knowledge Systems +1322|Crescent Heart Software +1323|Tekom Technologies, Inc +1324|Canon Development Americas +1329|Wacom Technology Corp. +1330|Systech Corporation +1334|Welch Allyn Inc. +1335|Inventec Corporation +1336|Caldera International, Inc. +1337|Shyh Shiun Terminals Co. LTD +1338|Preh Werke Gmbh & Co. KG +1340|Institut of Microelectronic and Mechatronic Systems +1341|Silicon Architect +1342|Mobility Electronics +1343|Synopsys, Inc. +1344|UniAccess AB +1345|Sirf Technology, Inc +1347|ViewSonic Corporation +1349|Xirlink, Inc. +1350|Polaroid Corporation +1351|Anchor Chips Inc. +1356|Sony Corporation +1360|Fuji Xerox Co., Ltd. +1362|Philips Monitors +1363|STMicroelectronics Imaging Division +1363|VLSI Vision Ltd. +1364|Dictaphone Corp. +1366|Asahi Kasei Microsystems Co., Ltd +1367|ATEN International Co. Ltd. +1369|Cadence Design Systems, Inc. +1373|Samsung Electro-Mechanics Co. +1374|CTX Opto-Electronics Corp. +1376|Interface Corporation +1378|Telex Communications Inc. +1379|Immersion Corporation +1380|Chinon Industries, Inc. +1381|Peracom Networks, Inc. +1382|Monterey International Corp. +1383|Xyratex +1386|WACOM Co., Ltd. +1388|Belkin Research & Development +1389|Eizo +1390|Elecom Co., Ltd. +1391|Korea Data Systems Co., Ltd. +1393|Interex, Inc. +1394|Conexant Systems, Inc. +1395|Zoran Corporation +1397|Philips Creative Display Solutions +1398|BAFO/Quality Computer Accessories +1403|Y-E Data, Inc. +1404|AVM GmbH +1405|Shark Multimedia Inc. +1406|Nintendo Co., Ltd. +1407|QuickShot Limited +1410|Roland Corporation +1411|Padix Co., Ltd. +1412|RATOC System Inc. +1413|FlashPoint Technology, Inc. +1416|Sapien Design +1419|Infineon Technologies +1419|Siemens Semiconductor +1420|In Focus Systems +1421|Micrel Semiconductor +1422|Tripath Technology Inc. +1423|Alcor Micro, Corp. +1424|OMRON Corporation +1426|Exide Electronics +1429|Zoran Microelectronics Ltd. +1430|MicroTouch Systems Inc. +1432|Nigata Canotec Co., Inc. +1435|Iomega Corporation +1436|A-Trend Technology Co., Ltd. +1437|Advanced Input Devices +1438|Intelligent Instrumentation +1439|LaCie +1441|USC Corporation +1442|Fuji Film Microdevices Co. Ltd. +1443|ARC International +1443|V Automation Inc. +1444|Ortek Technology, Inc. +1445|Sampo Technology Corp. +1446|Cisco Systems, Inc. +1447|Bose Corporation +1448|Spacetec IMC Corporation +1449|OmniVision Technologies, Inc. +1451|In-System Design +1452|Apple Inc. +1453|Y.C. Cable U.S.A., Inc +1454|Jing-Mold Enterprise Co., Ltd. +1456|Fountain Technologies, Inc +1457|First International Computer, Inc. +1460|LG Semicon Co., Ltd. +1461|Dialogic Corp +1462|Proxima Corporation +1463|Medianix Semiconductor, Inc. +1466|DigitalPersona, Inc. +1469|RAFI GmbH & Co. KG +1470|Tyco Electronics +1472|Keil Software +1473|Kawasaki Microelectronics, Inc. +1473|Kawasaki Steel +1474|Mediaphonics S.A. +1477|Digi International Inc. +1478|Qualcomm, Inc +1479|Qtronix Corp +1480|Cheng Uei Precision Industry Co., Ltd +1480|Foxlink/Cheng Uei Precision Industry Co., Ltd. +1481|Semtech Corporation +1482|Ricoh Company Ltd. +1483|PowerVision Technologies Inc. +1484|ELSA AG +1485|Silicom LTD. +1486|SICAN Gmbh +1487|Sung Forn Co. LTD. +1488|Lunar Corporation +1489|Brainboxes Limited +1490|Wave Systems Corp. +1494|Philips Semiconductors, CICT +1495|Thomas and Betts +1496|Ultima Electronics Corp. +1497|Axiohm Transaction Solutions +1498|Microtek International Inc. +1499|Sun Corporation +1500|Lexar Media, Inc. +1501|Delta Electronics Inc. +1504|Symbol Technologies +1505|Syntek Design Technology Inc. +1507|Genesys Logic, Inc. +1508|Red Wing Corporation +1509|Fuji Electric FA Components & Systems Co. Ltd. +1510|Keithley Instruments +1513|Kawasaki Microelectronics America, Inc. +1515|FFC Limited +1516|COM21, Inc. +1518|Cytechinfo Inc. +1519|Anko Electronic Co., Ltd. +1520|Canopus Co., Ltd. +1522|Dexin Corporation, Ltd. +1523|PI Engineering, Inc +1525|Unixtar Technology Inc. +1526|AOC International +1527|RFC Distribution(s) PTE Ltd. +1529|Datalogic Scanning, Inc. +1529|PSC Scanning, Inc. +1530|Siemens Telecommunications Systems Limited +1532|Harman International +1533|STD Manufacturing Ltd. +1534|CHIC TECHNOLOGY CORP +1535|LeCroy Corporation +1536|Barco Display Systems +1537|Jazz Hipster Corporation +1538|Vista Imaging Inc. +1539|Novatek Microelectronics Corp. +1540|Jean Co, Ltd. +1542|Royal Information Electronics Co., Ltd. +1543|Bridge Information Co., Ltd. +1545|SMK Manufacturing Inc. +1546|Worth Data, Inc. +1546|Worthington Data Solutions, Inc. +1547|Solid Year Co., Ltd. +1548|EEH Datalink Gmbh +1550|Transmonde Technologies, Inc. +1551|Joinsoon Electronics Mfg. Co., Ltd. +1553|Totoku Electric Co., LTD. +1555|TransAct Technologies Incorporated +1556|Bio-Rad Laboratories +1558|Future Techno Designs PVT. LTD. +1560|Chia Shin Technology Corp. +1561|Seiko Instruments Inc. +1562|Veridicom +1564|Act Labs, Ltd. +1565|Quatech, Inc. +1566|Nissei Electric Co. +1568|Alaris, Inc. +1569|ODU-Steckverbindungssysteme GmbH and Co. KG +1571|Littelfuse, Inc. +1572|Apex PC Solutions, Inc. +1574|Nippon Systems Development Co., Ltd. +1577|Zida Technologies Limited +1578|MosArt Semiconductor Corp. +1578|ProVision Technology, Inc. +1579|Greatlink Electronics Taiwan Ltd. +1581|Taiwan Tai-Hao Enterprises Co. Ltd. +1582|MAIN SUPER ENTERPRISES CO.,LTD. +1582|Mainsuper Enterprises Co., Ltd. +1583|Sin Sheng Terminal & Machine Inc. +1588|Crucial Technology/Micron Semiconductor Products +1588|Micron Technology, Inc. +1590|Sierra Imaging, Inc. +1592|Avision, Inc. +1593|Chrontel, Inc. +1594|Techwin Corporation +1597|Fong Kai Industrial Co., Ltd. +1599|New Technology Cable Ltd. +1600|Hitex Development Tools +1601|Woods Industries, Inc. +1602|VIA Medical Corporation +1604|TEAC Corporation +1605|Who Vision Systems, Inc. +1608|Inside Out Networks +1611|Analog Devices, Inc. Development Tools +1612|Ji-Haw Industrial Co., Ltd +1614|Suyin Corporation +1615|WIBU-Systems AG +1617|Likom Technology Sdn. Bhd. +1618|Stargate Solutions, Inc. +1620|Granite Microsystems, Inc. +1621|Space Shuttle Hi-Fi Wire and Cable Industry Co, Ltd. +1621|Space Shuttle Hi-Tech Co.,Ltd. +1622|Glory Mark Electronic Ltd. +1623|Tekcon Electronics Corp. +1624|Sigma Designs, Inc. +1626|Optoelectronics Co., Ltd. +1630|Silicon Graphics +1631|Good Way Technology Co., Ltd. & GWC technology Inc +1632|TSAY-E (BVI) International Inc. +1633|Hamamatsu Photonics K.K. +1635|Topmax Electronic Co., Ltd. +1640|WordWand +1641|Oce Printing Systems GmbH +1642|Total Technologies, Ltd. +1643|Intermart Systems, Inc. +1645|Entrega Technologies Inc. +1646|Acer Semiconductor America, Inc. +1647|SigmaTel, Inc. +1650|Labtec Inc. +1652|KME Mouse Electronic Enterprise Co., Ltd. +1652|Key Mouse Electronic Enterprise Co., Ltd. +1653|DrayTek Corp. +1654|Teles AG +1655|Aiwa Co., Ltd. +1656|ACARD Technology Corp. +1659|Prolific Technology, Inc. +1660|Efficient Networks, Inc. +1661|Hohner Corp. +1662|Intermec Technologies (S) Pte Ltd. +1663|Virata Ltd. +1664|Avance Logic, Inc. +1664|Realtek Semiconductor Corp., CPP Div. +1665|Siemens Information and Communication Products +1669|ISDN*tek +1670|Minolta Co., Ltd. +1674|Pertech Inc. +1675|Potrans International, Inc. +1680|Golden Bridge Electech Inc. +1683|Hagiwara Sys-Com Co., Ltd. +1684|Lego Group +1688|Chuntex (CTX) +1689|Tektronix, Inc. +1690|Askey Computer Corporation +1691|Thomson Consumer Electronics +1693|Hughes Network Systems +1694|Welcat Inc. +1698|Topro Technology Inc. +1699|Saitek PLC +1700|Xiamen Doowell Electron Co., Ltd. +1701|Divio +1703|MicroStore, Inc. +1705|Westell +1706|Sysgration Ltd. +1708|Fujitsu Laboratories of America, Inc. +1709|Greatland Electronics Taiwan Ltd. +1710|Testronic Labs +1711|Harting, Inc. of North America +1714|N*ABLE Technologies, Inc. +1720|Pixela Corporation +1721|Alcatel +1722|Smooth Cord & Connector Co., Ltd. +1723|EDA Inc. +1724|Oki Data Corporation +1725|AGFA-Gevaert NV +1726|AME Optimedia Technology Co. Ltd. +1726|Asia Microelectronic Development, Inc. +1727|Leoco Corporation +1732|Bizlink Technology, Inc. +1733|Hagenuk, GmbH +1734|Infowave Software Inc. +1736|SIIG, Inc. +1737|Taxan (Europe) Ltd. +1738|Newer Technology, Inc. +1739|Synaptics Inc. +1740|Terayon Communication Systems +1741|Keyspan +1744|Traveling Software, Inc. +1745|Daewoo Electronics Co Ltd +1747|Mitsubishi Electric Corporation +1748|Cisco Systems +1749|Toshiba America Electronic Components, Inc. +1750|Aashima Technology B.V. +1751|Network Computing Devices (NCD) +1752|Technical Marketing Research, Inc. +1754|Phoenixtec Power Co., Ltd. +1755|Paradyne +1756|Compeye Corporation +1758|Heisei Electronics Co. Ltd. +1760|Multi-Tech Systems, Inc. +1761|ADS Technologies, Inc. +1764|Alcatel Microelectronics +1766|Tiger Jet Network, Inc. +1771|PC Expert Tech. Co., Ltd. +1775|I.A.C. Geometrische Ingenieurs B.V. +1776|T.N.C Industrial Co., Ltd. +1777|Opcode Systems Inc. +1778|Emine Technology Company +1782|Wintrend Technology Co., Ltd. +1786|HSD S.r.L +1788|Motorola Semiconductor Products Sector/US +1789|Boston Acoustics +1790|Gallant Computer, Inc. +1793|Supercomal Wire & Cable SDN. BHD. +1795|Bencent Tzeng Co., Ltd. +1795|Bvtech Industry Inc. +1797|NKK Corporation +1798|Ariel Corporation +1800|Putercom Co., Ltd. +1801|SSL +1802|Oki Electric Industry Co., Ltd +1802|Oki Electric Industry Co., Ltd. +1805|Comoss Electronic Co., Ltd. +1806|Excel Cell Electronic Co., Ltd. +1808|Connect Tech Inc. +1809|Magic Control Technology Corp. +1811|Interval Research Corp. +1815|ZNK Corporation +1816|Imation Corp. +1817|Tremon Enterprised Co., Ltd. +1820|Xionics Document Technologies, Inc. +1821|Dialogic Corporation +1821|Eicon Networks Corporation +1822|Ariston Technologies +1827|Centillium Communications Corporation +1830|Vanguard International Semiconductor-America +1838|Sunix Co., Ltd. +1841|SusTeen, Inc. +1842|Goldfull Electronics & Telecommunications Corp. +1843|ViewQuest Technologies, Inc. +1844|LASAT Communications A/S +1846|Lorom Industrial Co., Ltd. +1848|Mad Catz, Inc. +1850|Chaplet Systems, Inc. +1851|Suncom Technologies +1859|BBnig und Kallenbach oHG +1861|Syntech Information Co., Ltd. +1862|ONKYO Corporation +1863|Labway Corporation +1864|Strong Man Enterprise Co., Ltd. +1865|EVer Electronics Corp. +1866|Ming Fortune Industry Co., Ltd. +1867|Polestar Tech. Corp. +1868|C-C-C Group PLC +1869|Micronas GmbH +1870|Digital Stream Corporation +1877|Aureal Semiconductor +1879|Network Technologies, Inc. +1883|Sophisticated Circuits, Inc. +1891|M-Audio +1892|Cyber Power Systems, Inc. +1893|X-Rite Incorporated +1894|Jess-Link Products Co., Ltd. (JPC) +1895|Tokheim Corporation +1896|Camtel Technology Corp. +1897|SURECOM Technology Corp. +1898|Smart Technology Enablers, Inc. +1899|HID Global GmbH +1900|Partner Tech +1901|Denso Corporation +1902|Kuan Tech Enterprise Co., Ltd. +1903|Jhen Vei Electronic Co., Ltd. +1904|Welch Allyn, Inc - Medical Division +1908|AmTRAN Technology Co., Ltd. +1909|Longshine Electronics Corp. +1910|Inalways Corporation +1911|Comda Advanced Technology Corporation +1912|Volex, Inc. +1913|Fairchild Semiconductor +1914|Sankyo Seiki Mfg. Co., Ltd. +1915|Linksys +1916|Forward Electronics Co., Ltd. +1919|Well Excellent and Most Corp. +1921|SanDisk Corporation +1922|Trackerball +1929|Logitec +1932|GTCO CalComp Peripherals +1934|BRINCOM +1936|Pro-Image Manufacturing Co., Ltd +1937|Copartner Technology Corporation +1938|Axis Communications AB +1939|Wha Yu Industrial Co., Ltd. +1940|ABL Electronics Corporation +1941|SiCore Systems, Inc. +1942|Certicom Corp. +1943|Grandtech Semiconductor Corporation +1947|Sagem +1949|Alfadata Computer Corp. +1954|National Technical Systems +1955|ONNTO Corp. +1956|Be Incorporated +1958|ADMtek Incorporated +1962|corega K.K. +1963|Freecom Computer Peripherals +1969|IMP, Inc. +1970|Motorola BCS +1971|Plustek, Inc. +1972|OLYMPUS CORPORATION +1972|Olympus Optical Co., Ltd. +1973|Mega World International Ltd. +1974|Marubun Corp. +1975|TIME Interconnect Ltd. +1976|AboCom Systems, Inc. +1980|Canon Computer Sytems, Inc. +1981|Webgear Inc. +1982|Veridicom +1984|Code Mercenaries GmbH +1988|Datafab Systems Inc. +1989|APG Cash Drawer +1990|Share Wave, Inc. +1990|ShareWave, Inc. +1991|Powertech Industrial Co., Ltd. +1992|B.U.G., Inc. +1993|Allied Telesyn International +1994|AVerMedia Technologies, Inc. +1996|Carry Technology Co., Ltd. +1999|Casio Computer Co., Ltd. +2001|D-Link Corporation +2001|D-Link System +2002|Aptio Products Inc. +2003|Cyberdata Corp. +2007|GCC Technologies, Inc. +2010|Arasan Chip Systems Inc. +2015|David Electronics Company, Ltd. +2018|Elmeg GmbH and Co., Ltd. +2019|Planex Communications, Inc. +2020|Movado Enterprise Co., Ltd. +2021|QPS, Inc. +2022|Allied Cable Corporation +2023|Mirvo Toys, Inc. +2024|Labsystems +2027|Double-H Technology Co., Ltd. +2028|Taiyo Electric Wire & Cable Co., Ltd. +2038|Circuit Assembly Corp. +2039|Century Corporation +2041|Dotop Technology, Inc. +2049|Mag-Tek +2050|Mako Technologies, LLC +2051|Zoom Telephonics, Inc. +2057|Genicom Corp. +2058|Evermuch Technology Co., Ltd. +2061|TECO Image Systems Co., Ltd. +2064|Personal Communication Systems, Inc. +2067|Mattel, Inc. +2075|Indigita Corporation +2076|Mipsys +2078|AlphaSmart, Inc. +2082|REUDO Corporation +2085|GC Protronics +2086|Data Transit +2087|BroadLogic, Inc. +2088|Sato Corporation +2089|DirecTV Broadband +2093|Handspring Visor +2096|Palm Inc. +2098|Kouwell Electronics Corp. +2099|Source Corporation +2101|Action Star Enterprise Co., Ltd. +2105|Samsung Aerospace Industries Ltd. +2106|Accton Technology Corporation +2112|Argosy Research Inc. +2113|Rioport.com Inc. +2116|Welland Industrial Co., Ltd. +2118|NETGEAR, Inc. +2125|Minton Optic Industry Co., Ltd. +2128|Fast Point Technologies, Inc. +2129|Macronix International Co., Ltd. +2130|CSEM +2135|Gerber Scientific Products, Inc. +2136|Hitachi Maxell Ltd. +2137|Minolta Systems Laboratory, Inc. +2138|Xircom +2146|Teletrol Systems, Inc. +2147|Filanet Corporation +2151|Data Translation, Inc. +2154|Emagic Soft-und Hardware Gmbh +2158|System TALKS Inc. +2159|MEC IMEX INC/HPT +2160|Metricom +2163|Xpeed Inc. +2164|A-Tec Subsystem, Inc. +2169|Comtrol Corporation +2172|ADESSO/Kbtek America Inc. +2173|JATON Corporation +2174|Fujitsu Computer Products of America +2175|QualCore Logic Inc +2176|APT Technologies Inc. +2179|Recording Industry Association of America (RIAA) +2181|Boca Research, Inc. +2182|XAC Automation Corp. +2183|Hannstar Electronics Corp. +2194|DioGraphy Inc. +2204|United Technologies Research Cntr. +2205|Icron Technologies Corporation +2206|NST Co., Ltd. +2213|e9 Inc. +2216|Andrea Electronics +2222|Mace Group, Inc. +2228|Sorenson Vision, Inc. +2232|J. Gordon Electronic Design, Inc. +2233|RadioShack Corporation +2233|Tandy Corporation/Radio Shack +2235|Texas Instruments Japan +2237|Citizen Watch Co., Ltd. +2238|Meilenstein GmbH +2244|Proxim, Inc. +2247|TAI TWUN ENTERPRISE CO., LTD. +2248|2Wire, Inc +2249|Nippon Telegraph and Telephone Corp. +2250|AIPTEK International Inc. +2253|Jue Hsun Ind. Corp. +2254|Long Well Electronics Corp. +2255|Productivity Enhancement Products +2259|Virtual Ink +2260|Siemens PC Systems +2265|Increment P Corporation +2269|Billionton Systems, Inc. +2271|Spyrus Inc. +2276|Pioneer Corporation +2277|LITRONIC +2278|Gemalto SA +2279|PAN-INTERNATIONAL WIRE & CABLE (M) SDN BHD +2280|Integrated Memory Logic +2281|Extended Systems, Inc. +2282|Ericsson Inc., Blue Ridge Labs +2284|M-Systems Flash Disk Pioneers +2286|CCSI/HESSO +2288|CardScan Inc. +2289|CTI Electronics Corporation +2293|SYSTEC Co., Ltd. +2294|Logic 3 International Limited +2296|Keen Top International Enterprise Co., Ltd. +2297|Wipro Technologies +2298|CAERE +2299|Socket Communications +2300|Sicon Cable Technology Co. Ltd. +2301|Digianswer A/S +2303|AuthenTec, Inc. +2305|VST Technologies +2310|FARADAY Technology Corp. +2313|Audio-Technica Corp. +2314|Trumpion Microelectronics Inc +2315|Neurosmith +2316|Silicon Motion, Inc. - Taiwan +2317|MULTIPORT Computer Vertriebs GmbH +2318|Shining Technology, Inc. +2319|Fujitsu Devices Inc. +2320|Alation Systems, Inc. +2321|Philips Speech Processing +2322|Voquette, Inc. +2323|Asante' Technologies, Inc. +2325|GlobeSpan, Inc. +2327|SmartDisk Corporation +2334|Garmin International +2336|Echelon Co. +2337|GoHubs, inc. +2338|Dymo Corporation +2339|IC Media Corporation +2340|Xerox +2340|Xerox Corporation +2343|Summus, Ltd. +2344|Oxford Semiconductor Ltd. +2345|American Biometric Company +2346|Toshiba Information & Industrial Sys. And Services +2347|Sena Technologies, Inc. +2352|Toshiba Corporation +2353|Harmonic Data Systems Ltd. +2354|Crescentec Corporation +2355|Quantum Corp. +2356|Netcom Systems +2361|Lumberg, Inc. +2362|Pixart Imaging, Inc. +2363|Plextor LLC +2365|InnoSync, Inc. +2366|J.S.T. Mfg. Co., Ltd. +2367|OLYMPIA Telecom Vertriebs GmbH +2368|Japan Storage Battery Co., Ltd. +2369|Photobit Corporation +2370|i2Go.com, LLC +2371|HCL Technologies Ltd. +2372|KORG, Inc. +2373|PASCO Scientific +2381|Cable Television Laboratories +2385|Kingston Technology Company +2388|RPM Systems Corporation +2389|NVIDIA +2390|BSquare Corporation +2391|Agilent Technologies, Inc. +2392|CompuLink Research, Inc. +2393|Cologne Chip Designs GmbH +2394|Portsmith +2395|Medialogic Corporation +2396|K-Tec Electronics +2397|Polycom, Inc. +2408|Catalyst Enterprises, Inc. +2417|GretagMacbeth AG +2419|Axalto +2419|Schlumberger +2420|Datagraphix, a business unit of Anacomp +2421|OL'E Communications, Inc. +2422|Adirondack Wire & Cable +2423|Lightsurf Technologies +2424|Beckhoff Gmbh +2425|Jeilin Technology Corp., Ltd. +2426|Minds At Work LLC +2427|Knudsen Engineering Limited +2428|Marunix Co., Ltd. +2429|Rosun Technologies, Inc. +2431|Barun Electronics Co. Ltd. +2433|Oak Technology Ltd. +2436|Apricorn +2438|Matsushita Electric Works, Ltd. +2444|Vitana Corporation +2445|INDesign +2446|Integrated Intellectual Property Inc. +2447|Kenwood TMI Corporation +2454|Integrated Telecom Express, Inc. +2467|PairGain Technologies +2468|Contech Research, Inc. +2469|VCON Telecommunications +2470|Poinchips +2471|Data Transmission Network Corp. +2472|Lin Shiung Enterprise Co., Ltd. +2473|Smart Card Technologies Co., Ltd. +2474|Intersil Corporation +2475|Japan Cash Machine Co., Ltd. +2478|Tripp Lite +2482|Franklin Electronic Publishers +2483|Altius Solutions, Inc. +2484|MDS Telephone Systems +2485|Celltrix Technology Co., Ltd. +2497|ARRIS International +2498|NISCA Corporation +2499|ACTIVCARD, INC. +2500|ACTiSYS Corporation +2501|Memory Corporation +2508|Workbit Corporation +2509|Psion Dacom Plc +2510|City Electronics Ltd. +2511|Electronics Testing Center, Taiwan +2513|NeoMagic Inc. +2514|Vreelin Engineering Inc. +2515|COM ONE +2521|Jungo +2522|A-FOUR TECH CO., LTD. +2523|Measurement Computing Corporation +2524|AIMEX Corporation +2525|Fellowes Inc. +2525|Fellowes Manufacturing Co. +2527|Addonics Technologies Corp. +2529|Intellon Corporation +2533|Jo-Dan International, Inc. +2534|Silutia, Inc. +2535|Real 3D, Inc. +2536|AKAI professional M.I. Corp. +2537|CHEN-SOURCE INC. +2549|ARESCOM +2550|RocketChips, Inc. +2551|EDU-SCIENCE (H.K.) LIMITED +2552|SoftConnex Technologies, Inc. +2553|Bay Associates +2554|Mtek Vision +2555|Altera +2559|Gain Technology Corp. +2560|Liquid Audio +2561|ViA, Inc. +2571|Cybex Computer Products Corporation +2577|Xentec Incorporated +2578|Cambridge Silicon Radio Ltd. +2579|Telebyte Inc. +2580|Spacelabs Healthcare +2580|Spacelabs Medical Inc. +2581|Scalar Corporation +2582|Trek Technology (S) Pte Ltd +2583|HOYA Corporation +2584|Heidelberger Druckmaschinen AG +2585|Hua Geng Technologies Inc. +2593|Medtronic Physio Control Corp. +2594|Century Semiconductor USA, Inc. +2595|NDS Technologies Israel Ltd. +2617|Gilat Satellite Networks Ltd. +2618|PentaMedia Co., Ltd. +2620|NTT DoCoMo,Inc. +2621|Varo Vision +2627|Boca Systems Inc. +2628|TurboLinux +2629|Look&Say co., Ltd. +2630|Davicom Semiconductor, Inc. +2631|Hirose Electric Co., Ltd. +2632|I/O Interconnect +2635|Fujitsu Media Devices Limited +2636|COMPUTEX Co., Ltd. +2637|Evolution Electronics Ltd. +2638|Steinberg Soft-und Hardware GmbH +2639|Litton Systems Inc. +2640|Mimaki Engineering Co., Ltd. +2641|Sony Electronics Inc. +2642|JEBSEE ELECTRONICS CO., LTD. +2643|Portable Peripheral Co., Ltd. +2650|Electronics For Imaging, Inc. +2651|EASICS NV +2652|Broadcom Corp. +2653|Diatrend Corporation +2654|Spinnaker Systems Inc. +2661|FullAudio, Inc. +2662|ClearCube Technology +2662|INT LABS +2663|Medeli Electronics Co, Ltd. +2664|COMAIDE Corporation +2665|Chroma ate Inc. +2666|Newcom Inc. +2667|Green House Co., Ltd. +2668|Integrated Circuit Systems Inc. +2669|UPS Manufacturing +2670|Benwin +2671|Core Technology, Inc. +2672|International Game Technology +2673|VIPColor Technologies USA, Inc. +2674|Sanwa Denshi +2685|Intertek NSTL +2686|Octagon Systems Corporation +2687|AVerMedia MicroSystems +2688|Rexon Technology Corp., Ltd +2689|CHESEN ELECTRONICS CORP. +2690|SYSCAN +2691|NextComm, Inc. +2692|Maui Innovative Peripherals +2693|IDEXX LABS +2694|NITGen Co., Ltd. +2700|Tecmar +2701|Picturetel +2702|Japan Aviation Electronics Industry Ltd. (JAE) +2703|Young Chang Co. Ltd. +2704|Candy Technology Co., Ltd. +2705|Globlink Technology Inc. +2706|EGO SYStems Inc. +2707|C Technologies AB (publ) +2708|Intersense +2723|Lava Computer Mfg. Inc. +2724|Develco Elektronik +2725|First International Digital +2726|Perception Digital Limited +2727|Wincor Nixdorf GmbH & Co KG +2728|TriGem Computer, Inc. +2729|Baromtec Co. +2730|Japan CBM Corporation +2731|Vision Shape Europe SA. +2732|iCompression Inc. +2733|Rohde & Schwarz GmbH & Co. KG +2734|NEC infrontia Corporation +2734|Nitsuko Corporation +2735|digitalway co., ltd. +2736|Arrow Strong Electronics CO. LTD +2755|SANYO Semiconductor Company Micro +2756|LECO CORPORATION +2757|I & C Corporation +2758|Singing Electrons, Inc. +2759|Panwest Corporation +2760|Vimicro Corporation +2760|Z-Star Microelectronics Corporation +2761|Micro Solutions, Inc. +2764|Koga Electronics Co. +2765|ID Tech +2766|ZyDAS Technology Corporation +2767|Intoto, Inc. +2768|Intellix Corp. +2769|Remotec Technology Ltd. +2770|Service & Quality Technology Co., Ltd. +2787|Allion Test Labs, Inc. +2788|Taito Corporation +2789|MacroSystem Digital Video AG +2790|EVI, Inc. +2791|Neodym Systems Inc. +2792|System Support Co., Ltd. +2793|North Shore Circuit Design L.L.P. +2794|SciEssence, LLC +2795|TTP Communications Ltd. +2796|Neodio Technologies Corporation +2800|Option NV +2806|SILVER I CO., LTD. +2807|B2C2, Inc. +2812|Zaptronix Ltd +2813|Tateno Dennou, Inc. +2814|Cummins Engine Company +2815|Jump Zone Network Products, Inc. +2816|INGENICO +2821|ASUSTek Computer Inc. +2828|Todos Data System AB +2830|GN Netcom +2831|AVID Technology +2832|Pcally +2833|I Tech Solutions Co., Ltd. +2846|Electronic Warfare Assoc., Inc. (EWA) +2847|Insyde Software +2848|TransDimension Inc. +2849|Yokogawa Electric Corporation +2850|Japan System Development Co. Ltd. +2851|Pan-Asia Electronics Co., Ltd. +2852|Link Evolution Corp. +2855|Ritek Corporation +2856|Kenwood Corporation +2860|Village Center, Inc. +2864|NewHeights Software +2867|Contour Design, Inc. +2871|Hitachi ULSI Systems Co., Ltd. +2873|Omnidirectional Control Technology Inc. +2874|IPaxess +2875|Bromax Communications, Inc. +2876|Olivetti S.p.A +2876|Olivetti Tecnost +2878|Kikusui Electronics Corporation +2881|Hal Corporation +2888|TechnoTrend AG +2889|ASCII Corporation +2894|Musical Electronics Ltd. +2898|Colorado MicroDisplay, Inc +2900|Sinbon Electronics Co., Ltd. +2905|Lake Communications Ltd. +2912|Nsine Limited +2913|NEC Viewtechnology, Ltd. +2914|Orange Micro, Inc. +2917|Expert Magnetics Corp. +2921|CacheVision +2922|Maxim Integrated Products +2927|Nagano Japan Radio Co., Ltd +2928|PortalPlayer, Inc +2933|Roland DG Corporation +2949|Elkat Electronics (M) SDN. BHD. +2950|Exputer Systems, Inc. +2965|ASIX Electronics Corp. +2965|ASIX Electronics Corporation +2966|SEWON TELECOM +2967|O2 Micro, Inc. +2991|U.S. Robotics +2992|Concord Camera Corp. +2994|Ambit Microsystems Corporation +2995|Ofuji Technology +2996|HTC Corporation +2997|Murata Manufacturing Co., Ltd. +3000|Hitachi Semiconductor and Devices Sales Co., Ltd. +3000|Renesas Technology Sales Co., Ltd. +3009|FUW YNG ELECTRONICS COMPANY LTD +3010|Seagate LLC +3011|IPWireless, Inc. +3014|ExWAY Inc. +3015|X10 Wireless Technology, Inc. +3019|Perfect Technic Enterprise Co. LTD +3034|Realtek Semiconductor Corp. +3035|Ericsson AB +3042|Kanda Tsushin Kogyo Co., LTD +3044|Elka International Ltd. +3045|DOME Imaging Systems, Inc +3046|Wonderful Photoelectricity (DongGuan), Co., Ltd. +3054|LTK International Limited +3056|Pace Micro Technology PLC +3062|Addonics Technologies, Inc. +3063|Sunny Giken Inc. +3064|Fujitsu Siemens Computers GmbH +3078|Hasbro, Inc. +3079|Infinite Data Storage LTD +3083|Dura Micro, Inc. +3093|Iris Graphics +3100|Hang Zhou Silan Microelectronics Co. Ltd +3106|TallyGenicom L.P. +3108|Taiyo Yuden Co., Ltd. +3109|Sampo Corporation +3128|Der An Electric Wire & Cable Co. Ltd. +3129|Aeroflex +3130|Furui Precise Component (Kunshan) Co., Ltd +3131|Komatsu Ltd. +3132|Radius Co., Ltd. +3140|Motorola iDEN +3141|Sonix Technology Co., Ltd. +3154|Sealevel Systems, Inc. +3156|GLORY LTD. +3157|Spectrum Digital Inc. +3158|Billion Bright Limited +3159|Imaginative Design Operation Co. Ltd. +3161|Dong Guan Shinko Wire Co., Ltd. +3168|Apogee Electronics Corp +3170|Chant Sincere Co., Ltd +3171|Toko, Inc. +3172|Signality System Engineering Co., Ltd. +3173|Eminence Enterprise Co., Ltd. +3175|Concept Telecom Ltd +3176|Whanam Electronics Co., Ltd. +3190|Solid State System Co., Ltd. +3193|NuConnex Technologies PTE LTD +3194|Wing-Span Enterprise Co., Ltd. +3208|Kyocera Wireless Corp. +3209|Honda Tsushin Kogyo Co., Ltd +3213|Tempo +3214|Cesscom Co., Ltd. +3225|Innochips Co., Ltd. +3226|Hanwool Robotics Corp. +3238|Castles Technology Co. Ltd. +3245|Motorola CGISS +3245|Motorola G&PS +3247|Buslink +3255|Singatron Enterprise Co. Ltd. +3256|Opticis Co., Ltd. +3259|Shanghai Darong Electronics Co., Ltd. +3261|Pentel Co., Ltd. (Electronics Equipment Div.) +3262|Keryx Technologies, Inc. +3263|Union Genius Computer Co., Ltd +3264|Kuon Yi Industrial Corp. +3266|Timex Corporation +3268|emsys GmbH +3270|INTERMAGIC CORP. +3274|AMPHENOL +3276|DOMEX TECHNOLOGY CORPORATION +3289|Shin Din Cable Ltd. +3294|Z-Com INC. +3313|e-CONN ELECTRONIC CO., LTD. +3314|ENE Technology Inc. +3315|Atheros Communications, Inc. +3318|Compucable Corporation +3321|Central System Research Co., Ltd. +3324|Minolta-QMS, Inc. +3340|Astron Electronics Co., Ltd. +3343|Feng Shin Cable Co. Ltd. +3347|BMF CORPORATION +3348|Array Comm, Inc. +3349|OnStream b.v. +3350|Hi-Touch Imaging Technologies Co., Ltd. +3351|NALTEC, Inc. +3353|Hank Connection Industrial Co., Ltd. +3381|Dah Kun Co., Ltd. +3388|SRI CABLE TECHNOLOGY LTD. +3389|TANGTOP TECHNOLOGY CO., LTD. +3391|MTS Systems Corporation +3393|Ta Yun Electronic Technology Co., Ltd. +3394|FULL DER CO., LTD. +3401|Maxtor +3402|NF Corporation +3403|Grape Systems Inc. +3405|Coherent Inc. +3406|Agere Systems Netherland BV +3409|Volex (Asia) Pte Ltd +3411|HMI Co., Ltd. +3413|ASKA Technologies Inc. +3414|AVLAB Technology, Inc. +3423|CSI, Inc. +3424|IVL Technologies Ltd. +3425|MEILU ELECTRONICS (SHENZHEN) CO., LTD. +3426|Darfon Electronics Corp. +3427|Fritz Gegauf AG +3428|DXG Technology Corp. +3429|KMJP CO., LTD. +3430|TMT +3431|Advanet Inc. +3432|Super Link Electronics Co., Ltd. +3433|NSI +3434|Megapower International Corp. +3435|And-Or Logic +3440|Try Computer Co. LTD. +3442|Winmate Communication Inc. +3443|Hit's Communications INC. +3446|MFP Korea, Inc. +3447|Power Sentry/Newpoint +3448|Japan Distributor Corporation +3450|MARX CryptoTech LP +3452|Taiwan Line Tek Electronic Co., Ltd. +3453|Add-On Technology Co., Ltd. +3454|American Computer & Digital Components +3455|Essential Reality LLC +3456|H.R. Silvine Electronics Inc. +3457|TechnoVision +3459|Think Outside, Inc. +3463|Dolby Laboratories Inc. +3465|Oz Software +3466|KING JIM CO., LTD. +3467|Ascom Telecommunications Ltd. +3468|C-MEDIA ELECTRONICS INC. +3469|Promotion & Display Technology Ltd. +3470|Global Sun Technology Inc. +3471|Pitney Bowes +3472|Sure-Fire Electrical Corporation +3480|Mars Semiconductor Corp. +3481|Trazer Technologies Inc. +3482|RTX Telecom A/S +3483|Tat Shing Electrical Co. +3484|Chee Chen Hi-Technology Co., Ltd. +3485|Sanwa Supply Inc +3486|Avaya +3487|Powercom Co., Ltd. +3488|Danger Research +3489|Suzhou Peter's Precise Industrial Co., Ltd. +3491|Nippon Electro-Sensory Devices Corporation +3495|IOGEAR, Inc. +3501|Westover Scientific +3504|Micro-Star International Co., Ltd. +3505|Wen Te Electronics Co., Ltd. +3506|Shian Hwi Plug Parts, Plastic Factory +3507|Tekram Technology Co. Ltd. +3508|Chung Fu Chen Yeh Enterprise Corporation +3518|Jiuh Shiuh Precision Industry Co., Ltd. +3519|Quik Tech Solutions +3520|Great Notions +3521|Tamagawa Seiki Co., Ltd. +3523|Athena Smartcard Solutions Inc. +3524|Macpower Peripherals Ltd. +3525|SDK Co, Ltd. +3526|Precision Squared Technology Corporation +3527|First Cable Line, Inc. +3537|Contek Electronics Co., Ltd. +3538|Power Quotient International Co., Ltd. +3539|MediaQ +3540|Custom Engineering SPA +3541|California Micro Devices +3543|KOCOM CO., LTD +3545|HighSpeed Surfing +3546|Integrated Circuit Solution Inc. +3547|Tamarack Inc. +3548|Takaotec +3549|Datelink Technology Co., Ltd. +3550|UBICOM, INC +3552|BD Consumer Healthcare +3562|UTECH Electronic (D.G.) Co., Ltd. +3563|Lean Horn Co. +3564|Callserve Communications Ltd. +3565|Novasonics +3566|Lifetime Memory Products +3567|Full Rise Electronic Co., Ltd. +3574|Sitecom Europe B.V. +3575|Mobile Action Technology Inc. +3576|Hoya Computer Co., Ltd. +3577|Nice Fountain Industrial Co., Ltd. +3578|Toyo Communication Equipment Co., Ltd. +3580|General Touch Technology Co., Ltd. +3585|Sheng Xiang Investment Ltd. +3586|Doowon Co., LTD +3587|Nippon Systemware Co., Ltd. +3591|Viewtek Co., Ltd +3592|Winbest Technology Co., Ltd. +3593|Winskon Cabling Specialist Co., Ltd. +3599|VMWare, Inc. +3602|Danam Communications Inc. +3603|Lugh Networks, Inc. +3605|Tellert Elektronik GmbH +3606|JMTEK, LLC +3607|Walex Electronic Ltd. +3608|UNIWIDE Technologies +3615|Cabin Industrial Co., Ltd. +3618|Symbian Ltd. +3619|Liou Yuane International Ltd. +3620|Samson Electric Wire Co., Ltd. +3621|VinChip Systems, Inc. +3622|J-Phone East Co., Ltd. +3632|HeartMath LLC +3636|Micro Computer Control Corp. +3637|3Pea Technologies, Inc. +3638|TiePie engineering +3639|Alpha Data Corp. +3640|Stratitec, Inc. +3641|Smart Modular Technologies, Inc. +3642|Neostar Technology Co., Ltd. +3643|Mansella Ltd. +3644|Raytec Electronic Co., Ltd. +3650|Puretek Industrial Co., Ltd. +3651|Holly Lin International Technology Inc. +3652|Sun-Riseful Technology Co., Ltd. +3653|SafeNet B.V. +3654|Delphi Automotive +3654|Delphi Corporation +3658|Shenzhen Bao Hing Electric Wire & Cable Mfr. Co. +3659|System General Corp. +3660|Radica Games Ltd. +3661|Hong Shi Precision Corp. +3662|Lih Duo Intl. Co., Ltd. +3669|Speed Dragon Multimedia Ltd. +3674|ACTIVE CO., LTD. +3675|Union Power Information Industrial Co., Ltd. +3676|Bitland Information Technology Co., Ltd. +3677|Neltron Industrial Co., Ltd. +3678|Conwise Technology Co., Ltd. +3679|Entone Technologies +3680|XAVi Technologies Corp. +3681|E-Pen InMotion Inc. +3687|Fossil +3689|A Global Partner Corporation +3690|Megawin Technology Co., Ltd. +3696|Tokyo Electronic Industry Co, LTD. +3697|Schwarzer GmbH +3698|Hsi-Chin Electronics Co., Ltd. +3699|MCK Communications, Inc. +3700|Accu-Automation Corp. +3701|TVS Electronics Limited +3704|Ascom Powerline Communications Ltd. +3707|On-Tech Industry Co., Ltd. +3708|Legend Holdings Limited +3714|Ching Tai Electric Wire & Cable Co., Ltd. +3715|Shin An Wire & Cable Co. +3716|Elelux International Ltd. +3721|PRT Manufacturing Ltd. +3722|FinePoint Innovations, Inc. +3723|KAO SHIN PRECISION INDUSTRY CO., LTD. +3724|Well Force Electronic Co., Ltd +3725|MediaTek Inc. +3728|WiebeTech LLC +3729|VTech Engineering Canada Ltd. +3730|C'S GLORY ENTERPRISE CO., LTD. +3731|eM Technics Co., Ltd. +3733|Future Technology Co., Ltd +3734|APLUX Communications Ltd. +3735|Fingerworks, Inc. +3736|Advanced Analogic Technologies, Inc. +3737|Parallel Dice Co., Ltd. +3738|TA HSING INDUSTRIES LTD. +3739|ADTEC CORPORATION +3743|TAMURA CORPORATION +3744|Ours Technology Inc. +3750|Nihon Computer Co., Ltd. +3751|MSL Enterprises Corp. +3752|CenDyne, Inc. +3757|HUMAX Co., Ltd. +3761|WIS Technologies, Inc. +3762|Y-S ELECTRONIC CO., LTD. +3763|Saint Technology Corp. +3767|Endor AG +3768|Mettler-Toledo (Albstadt) GmbH +3774|VWEB Corporation +3775|Omega Technology of Taiwan Inc. +3776|LHI Technology (China) Co., Ltd. +3777|ABIT Computer Corporation +3778|Sweetray Industrial Ltd. +3779|AXELL CO., LTD. +3780|Ballracing Developments Ltd. +3781|GT Information System Co., Ltd. +3782|InnoVISION Multimedia Limited +3783|Theta Link Corporation +3789|Lite-On IT Corp. +3790|TaiSol Electronics Co., Ltd. +3791|Phogenix Imaging, LLC +3794|Kyoto Micro Computer Co., LTD. +3795|Wing-Tech Enterprise Co., Ltd. +3801|Holy Stone Enterprise Co., Ltd. +3802|ISE Electronics Corp. +3802|NORITAKE ITRON CORPORATION +3807|e-MDT Co., Ltd. +3808|SHIMA SEIKI MFG., LTD. +3809|Sarotech Co., Ltd. +3810|AMI Semiconductor Inc. +3811|ComTrue Technology Corporation (Taiwan) +3812|Sunrich Technology (H.K.) Ltd. +3822|Digital STREAM Technology, Inc. +3823|D-WAV SCIENTIFIC CO., LTD. +3824|Hitachi Cable, Ltd. +3825|Aichi Micro Intelligent Corporation +3826|I/OMAGIC CORPORATION +3827|Lynn Products, Inc. +3828|DSI Datotech +3829|PointChips +3830|Yield Microelectronics Corp. +3831|SM Tech Co., Ltd. +3837|Oasis Semiconductor +3838|WEM TECHNOLOGY INC. +3846|Visual Frontier Precision Corp. +3848|CSL Wire & Plug (Shen Zhen) Company +3852|CAS Corporation +3853|HORI CO., LTD. +3854|Energy Full Corp. +3858|MARS ENGINEERING CORPORATION +3859|Acetek Technology Co., Ltd. +3865|ORACOM CO., Ltd. +3867|Onset Computer Corporation +3868|Funai Electric Co., Ltd. +3869|Iwill Corporation +3872|GENNUM CORPORATION +3873|IOI Technology Corporation +3874|SENIOR INDUSTRIES, INC. +3875|Leader Tech Manufacturer Co., Ltd +3876|FLEX-P INDUSTRIES SDN.BHD. +3885|ViPower, Inc. +3886|Geniality Maple Technology Co., Ltd. +3886|Good Man Corporation +3887|Priva Design Services +3888|Jess Technology Co., Ltd. +3889|Chrysalis Development +3890|YFC-BonEagle Electric Co., Ltd. +3890|YFC-Boneagle Electric Co., Ltd. +3891|Futek Electronics, Co., Ltd. +3895|Kokuyo Co., Ltd. +3896|Nien-Yi Industrial Corp. +3905|RDC Semiconductor Co., Ltd. +3906|Nital Consulting Services, Inc. +3915|St. John Technology Co., Ltd. +3916|WORLDWIDE CABLE OPTO CORP. +3917|Microtune, Inc. +3918|Freedom Scientific +3922|WING KEI ELECTRICAL CO., LTD. +3923|Dongguan White Horse Cable Factory Ltd. +3923|Taiyo Cable (Dongguan) Co. Ltd. +3924|Kawai Musical Instruments Mfg. Co., Ltd. +3925|AmbiCom, Inc. +3932|PRAIRIECOMM, INC. +3933|NewAge International, LLC +3935|Key Technology Corporation +3936|GuangZhou Chief Tech Electronic Technology Co. Ltd. +3937|Varian Inc. +3938|Acrox Technologies Co., Ltd. +3944|TEPCO UQUEST, LTD. +3945|DIONEX CORPORATION +3946|Vibren Technologies Inc. +3955|DFI +3964|DQ Technology, Inc. +3965|NetBotz, Inc. +3966|Fluke Networks Corporation +3976|VTech Holdings Ltd. +3979|Yazaki Corporation +3980|Young Generation International Corp. +3981|Uniwill Computer Corp. +3982|Kingnet Technology Co., Ltd. +3983|SOMA NETWORKS +3991|CviLux Corporation +3992|CYBERBANK CORP. +3998|Lucent Technologies +4003|STARCONN Electronic Co., Ltd. +4004|ATL Technology +4005|SOTEC CO., LTD. +4007|EPOX COMPUTER CO., LTD. +4008|Logic Controls, Inc. +4015|Winpoint Electronic Corp. +4016|Haurtian Wire & Cable Co., Ltd. +4017|Inclose Design Inc. +4018|Conteck Co., Ltd. +4024|Wistron Corporation +4025|AACOM CORPORATION +4026|SAN SHING ELECTRONICS CO., LTD.. +4027|Bitwise Systems, Inc. +4033|MITAC INTERNATIONAL CORP. +4034|PLUG AND JACK INDUSTRIAL INC. +4038|Dataplus Supplies, Inc. +4046|Sony Ericsson Mobile Communications AB +4047|Dynastream Innovations Inc. +4048|Tulip Computers B.V. +4052|Tenovis GmbH & Co., KG +4053|Direct Access Technology, Inc. +4057|Elgato Systems GmbH +4060|Micro Plus +4068|IN-TECH ELECTRONICS LIMITED +4069|TC&C ELECTRONIC CO.,LTD (SUNTECC, INC.) +4074|United Computer Accessories +4075|CRS ELECTRONIC CO., LTD. +4076|UMC Electronics Co., Ltd. +4077|ACCESS CO., LTD. +4078|Xsido Corporation +4079|MJ RESEARCH, INC. +4086|Core Valley Co., Ltd. +4087|CHI SHING COMPUTER ACCESSORIES CO., LTD. +4095|Aopen Inc. +4096|Speed Tech Corp. +4097|Ritronics Components (S) Pte. Ltd. +4099|SIGMA CORPORATION +4100|LG Electronics Inc. +4101|Animeta Systems, Inc. +4101|Apacer Technology Inc. +4105|Lumanate, Inc. +4106|AV Chaseway Ltd. +4107|Chou Chin Industrial Co., Ltd. +4109|NETOPIA, INC. +4112|FUKUDA DENSHI CO., LTD. +4113|Mobile Media Tech. +4114|SDKM Fibres, Wires & Cables Berhad +4115|TST-Touchless Sensor Technology AG +4116|Densitron Technologies PLC +4117|Softronics Pty. Ltd. +4118|Xiamen Hung's Enterprise Co., Ltd. +4119|SPEEDY INDUSTRIAL SUPPLIES PTE. LTD. +4130|Shinko Shoji Co., Ltd. +4133|Hyper-PALTEK +4134|Newly Corporation +4135|Time Domain +4136|Inovys Corporation +4137|Atlantic Coast Telesys +4138|RAMOS Technology Co., Ltd. +4139|Infotronic America, Inc. +4140|Etoms Electronics Corp. +4141|Winic Corporation +4143|WENZHOU YIHUA COMMUNICATED CONNECTOR CO., LTD. +4145|Comax Technology Inc. +4146|C-One Technology Corp. +4147|Nucam Corporation +4163|iCreate Technologies Corporation +4164|Chu Yuen Enterprise Co., Ltd. +4168|Targus Group International +4172|AMCO TEC International Inc. +4179|Immanuel Electronics Co., Ltd. +4180|BMS International Beheer N.V. +4181|Complex Micro Interconnection Co., Ltd. +4182|Hsin Chen Ent Co., Ltd. +4183|ON Semiconductor +4184|Western Digital Technologies, Inc. +4185|Giesecke & Devrient GmbH +4188|Freeway Electronic Wire & Cable (Dongguan) Co., Ltd. +4189|Delkin Devices, Inc. +4190|Valence Semiconductor Design Limited +4191|Chin Shong Enterprise Co., Ltd. +4192|Easthome Industrial Co., Ltd. +4202|Loyal Legend Limited +4204|Curitel Communications, Inc. +4205|San Chieh Manufacturing Ltd. +4206|ConectL +4207|Money Controls +4214|GCT Semiconductor, Inc. +4222|MIDORIYA ELECTRIC CO., LTD. +4223|KidzMouse, Inc. +4226|Shin-Etsukaken Co., Ltd. +4227|CANON ELECTRONICS INC. +4228|PANTECH CO., LTD. +4234|Chloride Power Protection +4235|Grand-tek Technology Co., Ltd. +4236|Robert Bosch GmbH +4238|Lotes Co., Ltd. +4249|Surface Optics Corporation +4255|eSOL Co., Ltd. +4256|HIROTECH, INC. +4259|MITSUBISHI MATERIALS CORPORATION +4265|SK Teletech Co., Ltd. +4266|Cables To Go +4267|USI Co., Ltd. +4268|Honeywell, Inc. +4270|Princeton Technology Corp. +4277|Comodo +4283|TM Technology Inc. +4284|Dinging Technology Co., Ltd. +4285|TMT TECHNOLOGY, INC. +4292|Silicon Laboratories, Inc. +4293|Sanei Electric Inc. +4294|Intec, Inc. +4299|eratech +4300|GBM Connector Co., Ltd. +4301|Kycon Inc. +4308|Man Boon Manufactory Ltd. +4309|Uni Class Technology Co., Ltd. +4310|Actions Semiconductor Co., Ltd. +4318|Authenex, Inc. +4319|In-Win Development Inc. +4320|Bella Corporation +4321|CABLEPLUS LTD. +4322|Nada Electronics, Ltd. +4332|Vast Technologies Inc. +4347|Pictos Technologies, Inc. +4352|VirTouch Ltd. +4353|EASYPASS INDUSTRIAL CO., LTD. +4360|BRIGHTCOM TECHNOLOGIES LTD. +4362|MOXA Technologies Co., Ltd. +4368|Analog Devices Canada Ltd. +4370|YM ELECTRIC CO., LTD. +4371|Medion AG +4381|Centon Electronics +4382|VSO Electric Co., Ltd. +4398|Master Hill Electric Wire and Cable Co., Ltd. +4399|Cellon International +4400|Tenx Technology, Inc. +4401|Integrated System Solution Corp. +4412|Arin Tech Co., Ltd. +4413|Mapower Electronics Co. Ltd. +4417|V ONE MULTIMEDIA PTE LTD +4422|Shimane SANYO Electric Co., Ltd. +4423|Ever Great Electric Wire and Cable Co., Ltd. +4427|Sphairon Technologies GmbH +4428|Tinius Olsen Testing Machine Co., Inc. +4429|Alpha Imaging Technology Corp. +4443|Salix Technology Co., Ltd. +4450|Secugen Corporation +4451|DeLorme Publishing Inc. +4452|YUAN High-Tech Development Co., Ltd. +4453|Telson Electronics Co., Ltd. +4454|Bantam Interactive Technologies +4455|Salient Systems Corporation +4456|BizConn International Corp. +4462|Gigastorage Corp. +4463|Silicon 10 Technology Corp. +4469|Sheng Yih Technologies Co., Ltd. +4469|Shengyih Steel Mold Co., Ltd. +4477|Santa Electronic Inc. +4478|JNC, Inc. +4482|Venture Corporation Limited +4483|Digital Dream Co. Europe Ltd. +4484|Kyocera Elco Corporation +4488|Bloomberg L.P. +4489|Trisat Industrial Co., Ltd. +4495|You Yang Technology Co., Ltd. +4496|Tripace +4497|Loyalty Founder Enterprise Co., Ltd. +4503|Technoimagia Co., Ltd. +4504|StarShine Technology Corp. +4505|Sierra Wireless Inc. +4506|DONG GUAN JALINK ELECTRONICES CO.,LTD +4506|ZHAN QI Technology Co., Ltd. +4515|Technovas Co., Ltd. +4520|Hoeft & Wessel AG +4522|GlobalMedia Group, LLC +4523|Exito Electronics Co., Ltd. +4527|Valence Semiconductor +4528|ATECH FLASH TECHNOLOGY +4529|New Motion Tec. Corp. +4544|Sanmos Microelectronics Corp. +4552|Fullcom Technology Corp. +4553|Monster Cable Products, Inc. +4559|Nemoto Kyorindo Co., Ltd. +4566|FUJIFILM AXIA CO., LTD. +4571|Topfield Co., Ltd. +4581|CHUFON Technology Co., Ltd. +4582|K.I. Technology Co. Ltd. +4583|Rockford Corporation +4584|NAAT Technology Corp. +4585|Wincan Technology Co., Ltd. +4586|PAN RAM International Corp. +4587|VTech Innovation L.P. dba Advanced American Telephones +4588|Hitachi Computer Peripherals Co., Ltd. +4591|Cableplus Industrial Co., Ltd. +4597|Siemens Mobile Phones +4610|KUK JE TONG SHIN CO., LTD. +4622|HUDSON SOFT CO., LTD. +4631|Goyatek Technology Inc. +4632|Geutebrueck GmbH +4633|COMPAL COMMUNICATIONS, INC. +4638|Jungsoft Co., Ltd. +4643|SKYCABLE ENTERPRISE. CO., LTD. +4649|EPO Science & Technology Inc. +4655|Takasic +4656|Chipidea-Microelectronica, S.A. +4657|CHI MEI COMMUNICATION SYSTEMS, INC. +4667|De La Rue Systems Automatizacao +4668|K-Won C & C Co., Ltd. +4674|MAC SYSTEM CO., LTD. +4682|AirVast Technology Inc. +4683|NYKO Technologies, Inc. +4689|Iwaya Corporation +4690|Nextway Co., Ltd. +4691|Erebus Limited +4698|Shintake Sangyo Co., Ltd. +4703|ADATA Technology Co., Ltd. +4705|All Ring Tech Co., Ltd. +4706|MICRO VISION CO., LTD. +4707|Opti Japan Corporation +4708|Covidien Energy-based Devices +4715|Veridian Systems +4716|Aristocrat Technologies +4717|Bel Stewart +4718|Strobe Data, Inc. +4719|TwinMOS Technologies Inc. +4720|Procomp Informatics Ltd. +4721|Foxda Technology Industrial (Shenzhen) Co., Ltd. +4722|Linear Technology Corporation +4736|Animeta Systems Inc. +4737|Gean Sen Electronic Co., Ltd. +4742|MARVELL SEMICONDUCTOR, INC. +4753|Flarion Technologies +4754|Fire International Ltd. +4756|RISO KAGAKU CORP. +4763|CyberTAN Technology Inc. +4764|Min Aik Technology Co., Ltd. +4765|Yueqing Longhua Electronics Factory +4771|KENT WORLD CO., LTD. +4772|Guangdong Matsunichi Communications Technology Co., Ltd +4775|Trendchip Technologies Corp. +4779|Honey Bee Electronic International Ltd. +4781|Asahi Seiko Co., Ltd. +4786|DICKSON Company +4787|Megaforce Company Ltd. +4792|Zhejiang Xinya Electronic Technology Co., Ltd. +4793|Freehand Systems, Inc. +4794|Sony Computer Entertainment America +4797|Sun Light Application Co., Ltd. +4809|Newmen Technology Corp. Ltd. +4817|Huawei Technologies Co., Ltd. +4818|LINE TECH INDUSTRIAL CO., LTD. +4823|BETTER WIRE FACTORY CO., LTD. +4824|Araneus Information Systems Oy +4825|DIGITFAB INTERNATIONAL CO., LTD. +4829|Alec Electronics Co.,Ltd. +4830|National Display Systems +4836|Bruel & Kjaer Sound & Vibration Meas. A/S +4841|Mindspeed Technologies +4852|Glovic Electronics Corp. +4853|Dynamic System Electronics Corp. +4855|Memorex Products, Inc. +4857|RF-LINK SYSTEMS, INC. +4858|RF Micro Devices +4862|E.U CONNECTOR(M) SDN BHD. +4870|Torcon Instruments Inc. +4871|USBest Technology Inc. +4882|ICS Electronics +4887|PC-CRAFT Co., Ltd. +4888|O'RITE TECHNOLOGY Co., Ltd. +4895|Ayuttha Technology Corp. +4899|Zeustech Company Limited +4900|H-Mod, Inc. +4905|Appairent Technologies, Inc. +4906|Envara +4907|Konica Minolta Holdings, Inc. +4908|Le Prestique International (H.K.) Ltd. +4923|FLASH SUPPORT GROUP, INC. +4924|G-Design Technology +4930|Sutter Instrument Company +4933|Sino Lite Technology Corp. +4936|Katsuragawa Electric Co., Ltd. +4950|Techpoint Electric Wire & Cable Co., Ltd. +4955|M-System Co., Ltd. +4970|Pelco +4971|STEC +4971|SimpleTech +4972|Datastor Technology Co., Ltd. +4976|Swissbit AG +4980|American Anko Co. +4981|TCL MOBILE COMMUNICATION CO., LTD. +4982|Vimtron Electronics Co., Ltd. +4989|Pericom Semiconductor Corp. +5054|Ricoh Printing Systems, Ltd. +5066|JyeTai Precision Industrial Co., Ltd. +5071|Wisair Ltd. +5073|A-Max Technology Macao Commercial Offshore Co. Ltd. +5075|AzureWave Technologies, Inc. +5084|ALEREON, INC. +5085|i.Tech Dynamic Limited +5089|Kaibo Wire & Cable (Shenzhen) Co., Ltd. +5117|Initio Corporation +5118|Phison Electronics Corp. +5122|Bowe Bell & Howell +5134|Telechips, Inc. +5136|Novatel Wireless, Inc. +5145|ABILITY ENTERPRISE CO., LTD. +5153|Sensor Technologies America, Inc. +5161|Vega Technologies Industrial (Austria) Co. +5168|RedOctane +5169|Pertech Resources, Inc. +5173|Wistron NeWeb Corp. +5174|Denali Software, Inc. +5180|Altek Corporation +5206|Extending Wire & Cable Co., Ltd. +5217|Staccato Communications +5234|Hangzhou H3C Technologies Co., Ltd. +5242|Formosa Industrial Computing, Inc. +5242|Formosa21 Inc. +5246|UPEK Inc. +5247|Hama GmbH & Co., KG +5255|DSP Group, Ltd. +5262|EVATRONIX SA +5271|Panstrong Company Ltd. +5293|CTK Corporation +5294|Printronix Inc. +5295|ATP Electronics Inc. +5296|StarTech.com Ltd. +5312|Rockwell Automation, Inc. +5314|Gemlight Computer Ltd. +5325|MOAI ELECTRONICS CORPORATION +5336|JAMER INDUSTRIES CO., LTD. +5349|SAIN Information & Communications Co., Ltd. +5357|Shure Inc. +5375|Twinhead International Corp. +5376|Ellisys +5377|Pine-Tum Enterprise Co., Ltd. +5393|BridgeCo, AG +5398|Skymedi Corporation +5404|VeriSilicon Holdings Co., Ltd. +5408|Bitwire Corp. +5421|JMicron Technology Corp. +5422|HLDS (Hitachi-LG Data Storage, Inc.) +5440|Phihong Technology Co., Ltd. +5451|PNY Technologies Inc. +5453|ConnectCounty Holdings Berhad +5454|D & M Holdings, Inc. +5460|Prolink Microsystems Corporation +5480|Sunf Pu Technology Co., Ltd +5487|Quantum Corporation +5488|ALLTOP TECHNOLOGY CO., LTD. +5499|Ketron SRL +5502|U-MEDIA Communications, Inc. +5510|Sitor Electronics (Shenzhen) Co., Ltd. +5511|SMA Technologie AG +5517|Oakley Inc. +5528|Kunshan Guoji Electronics Co., Ltd. +5538|Freescale Semiconductor, Inc. +5540|Afa Technologies, Inc. +5546|Hong Kong Gearway Electronics Co., Ltd. +5577|D-Box Technologies +5589|Coulomb Electronics Ltd. +5596|Hynix Semiconductor Inc. +5600|Seong Ji Industrial Co., Ltd. +5609|Pacific Digital Corp. +5612|Belcarra Technologies Corp. +5638|UMAX +5640|Inside Out Networks +5645|Samtec +5657|L & K Precision Technology Co., Ltd. +5650|Soft DB Inc. +5665|Wionics Research +5672|Stonestreet One, Inc. +5679|WiQuest Communications, Inc. +5681|Focus Enhancements +5694|HongLin Electronics Co., Ltd. +5706|ChipX +5728|Creatix Polymedia GmbH +5736|Actiontec Electronics, Inc. +5753|Total Phase +5762|Maxwise Production Enterprise Ltd. +5764|Godspeed Computer Corp. +5766|ZOOM Corporation +5767|Kingmax Digital Inc. +5782|Hitachi Video and Information System, Inc. +5783|VTEC TEST, INC. +5797|Shenzhen Zhengerya Technology Co., Ltd. +5804|Dongguan ChingLung Wire & Cable Co., Ltd. +5836|silex technology, Inc. +5843|Frontline Test Equipment, Inc. +5855|King Billion Electronics Co., Ltd. +5877|Futurelogic Inc. +5895|ARTIMI +5901|Avnera +5942|CANON IMAGING SYSTEMS INC. +5943|Hong Kong Applied Science and Technology Research Inst. +5955|General Atomics +5960|MQP Electronics Ltd. +5964|ASMedia Technology Inc. +5977|LucidPort Technology, Inc. +5998|UD electronic corp. +6001|Shenzhen Alex Connector Co., Ltd. +6002|System Level Solutions, Inc. +60186|Empia Technology, Inc. +6020|TopSeed Technology Corp. +6024|ShenZhen Litkconn Technology Co., Ltd. +6038|Printrex, Inc. +6039|JALCO CO., LTD. +6053|Advanced Connection Technology Inc. +6055|MICOMSOFT CO., LTD. +6083|Singim International Corp. +6095|Hip Hing Cable & Plug Mfy. Ltd. +6096|Sanford L.P. +6099|Korea Techtron Co., Ltd. +6121|DisplayLink (UK) Ltd. +6127|Lenovo +6133|K.K. Rocky +6134|Unicomp, Inc +6168|Osteosys Co., Ltd. +6185|Suzhou YuQiu Technology Co., Ltd. +6193|Gwo Jinn Industries Co., Ltd. +6194|Huizhou Shenghua Industrial Co., Ltd. +6228|Memory Devices Ltd. +6241|Tech Technology Industrial Company +6242|Teridian Semiconductor Corp. +6257|Aveo Technology Corp. +6271|Siano Mobile Silicon Ltd. +6292|SyntheSys Research, Inc. +6296|Summit Microelectronics +6297|Linkiss Co., Ltd. +6326|Mikkon Technology Limited +6353|Google Inc. +6357|Starline International Group Limited +6371|Fitilink Integrated Technology, Inc. +6394|Kuang Ying Computer Equipment Co., Ltd. +6397|FineArch Inc. +6413|Motorola GSG +6420|Alco Digital Devices Limited +6421|Nordic Semiconductor ASA +6425|Pixelworks +6434|Power 7 Technologies Corp. +6447|Avago Technologies, Pte. +6448|Shenzhen Xianhe Technology Co., Ltd. +6449|Ningbo Broad Telecommunication Co., Ltd. +6473|Lab126 +6483|Ironkey Inc. +6487|BIOS Corporation +6503|CASIO HITACHI Mobile Communications Co., Ltd. +6507|Wispro Technology Inc. +6512|Dane-Elec Corp. USA +6537|Nuconn Technology Corp. +6541|Fairchild Imaging +6543|Beceem Communications Inc. +6544|Acron Precision Industrial Co., Ltd. +6556|Richnex Microelectronics Corporation +6557|Dexxon +6559|Benica Corporation +6568|Biforst Technology Inc. +6581|B & W Group +6582|Infotech Logistic, LLC +6607|Parrot SA +6625|WeiDuan Electronic Accessory (S.Z.) Co., Ltd. +6632|Industrial Technology Research Institute +6640|Jyh Woei Industrial Co., Ltd. +6666|USB-IF non-workshop +6674|KES Co., Ltd. +6693|Amphenol East Asia Ltd. +6698|Seagate Branded Solutions +6709|Astec Power, a division of Emerson Network Power +6710|Biwin Technology Ltd. +6720|TERMINUS TECHNOLOGY INC. +6721|Action Electronics Co., Ltd. +6730|Silicon Image +6731|SafeBoot International B.V. +6753|Abbott Diabetes Care +6762|Spansion Inc. +6765|SamYoung Electronics Co., Ltd +6766|Global Unichip Corp. +6767|Sagem Orga GmbH +6772|Oberthur Technologies +6777|Bayer Health Care LLC +6779|Lumberg Connect GmbH +6786|Proconn Technology Co., Ltd. +6793|Dynalith Systems Co., Ltd. +6794|Simula Technology Inc. +6795|SGS Taiwan Ltd. +6808|Leica Camera AG +6820|Data Drive Thru, Inc. +6821|UBeacon Technologies, Inc. +6822|eFortune Technology Corp. +6830|Johnson Component & Equipments Co., Ltd. +6859|Salcomp Plc +6865|Desan Wire Co., Ltd. +6884|ic-design Reinhard Gottinger GmbH +6885|Jianduan Technology (Shenzhen) Co., Ltd +6893|High Top Precision Electronic Co., Ltd. +6894|Dongguan Chang'an Jinxia Rex Electronics Factory +6894|SHEN ZHEN REX TECHNOLOGY CO., LTD. +6895|Octekconn Incorporation +6940|CORSAIR MEMORY INC. +6944|MStar Semiconductor, Inc. +6946|WiLinx Corp. +6962|Ugobe Inc. +6966|ViXS Systems, Inc. +6983|Energizer Holdings, Inc. +6984|Plastron Precision Co., Ltd. +7001|K.S. Terminals Inc. +7002|Chao Zhou Kai Yuan Electric Co., Ltd. +7013|The Hong Kong Standards and Testing Centre Ltd. +7046|Dongguan Guanshang Electronics Co., Ltd. +7048|ShenMing Electron (Dong Guan) Co., Ltd. +7054|Amlogic, Inc. +7055|Super Talent Technology, Inc. +7062|N-Trig +7065|Shenzhen Yuanchuan Electronic +7073|JINQ CHERN ENTERPRISE CO., LTD. +7099|T & A Mobile Phones +7108|Ford Motor Co. +7118|Contac Cable Industrial Limited +7119|Sunplus Innovation Technology Inc. +7151|Shenzhen Tongyuan Network-Communication Cables Co., Ltd +7152|RealVision Inc. +7158|Orient Semiconductor Electronics, Ltd. +7181|Relm Wireless +7184|Lanterra Industrial Co., Ltd. +7194|Datel Electronics Ltd. +7195|Volkswagen of America, Inc. +7199|Goldvish S.A. +7200|Fuji Electric Device Technology Co., Ltd. +7201|ADDMM LLC +7202|ZHONGSHAN CHIANG YU ELECTRIC CO., LTD. +7206|Shanghai Haiying Electronics Co., Ltd. +7207|SHENZHEN D&S INDUSTRIES LIMITED +7217|LS Cable Ltd. +7223|Sonavation, Inc. +7229|NONIN MEDICAL INC. +7230|Wep Peripherals +7241|Cherng Weei Technology Corp. +7275|Philips & Lite-ON Digital Solutions Corporation +7276|Skydigital Inc. +7287|Kaetat Industrial Co., Ltd. +7288|Datascope Corp. +7289|Unigen Corporation +7290|LighTuning Technology Inc. +7291|Shenzhen Luxshare Precision Industry Co., Ltd. +7304|Somagic, Inc. +7305|HONGKONG WEIDIDA ELECTRON LIMITED +7310|ASTRON INTERNATIONAL CORP. +7320|ALPINE ELECTRONICS, INC. +7328|ACCARIO Inc. +7329|Symwave, Inc. +7347|Aces Electronics Co., Ltd. +7348|OPEX CORPORATION +7358|Texas Instruments - Stellaris +7359|FORTAT SKYMARK INDUSTRIAL COMPANY +7360|PlantSense +7370|NextWave Broadband Inc. +7373|Bodatong Technology (Shenzhen) Co., Ltd. +7380|adp corporation +7381|Firecomms Ltd. +7382|Antonio Precise Products Manufactory Ltd. +7390|Telecommunications Technology Association (TTA) +7391|WonTen Technology Co., Ltd. +7392|EDIMAX TECHNOLOGY CO., LTD. +7393|Amphenol KAE +7420|ANDES TECHNOLOGY CORPORATION +7421|Flextronics Digital Design Japan, LTD. +7432|NINGBO HENTEK DRAGON ELECTRONICS CO., LTD. +7433|TechFaith Wireless Technology Limited +7434|Johnson Controls, Inc. The Automotive Business Unit +7435|HAN HUA CABLE & WIRE TECHNOLOGY (J.X.) CO., LTD. +7444|ALPHA-SAT TECHNOLOGY LIMITED +7455|Diostech Co., Ltd. +7456|SAMTACK INC. +7465|Horng Tong Enterprise Co., Ltd. +7473|XINTRONIX LIMITED +7490|DRAGON JOY LIMITED +7491|Montage Technology, Inc. +7492|Adirondack Digital Imaging Systems, Inc. +7493|Qisda Corporation +7494|nSys Design Systems +7496|Shenzhen XinYonghui Precise Technology Co., Ltd. +7497|SHENZHEN LINKCONN ELECTRONICS CO., LTD. +7501|Pegatron Corporation +7502|INPHI CORPORATION +7503|ADVANCED CHIP EXPRESS INC. +7516|Fresco Logic Inc. +7517|QIXING INDUSTRIAL (HK) CO. +7519|ViVOtech, Inc. +7520|ASAP International Co., Ltd. +7529|Walta Electronic Co., Ltd. +7530|ARICENT TECHNOLOGIES (HOLDINGS) LTD. +7531|The Linux Foundation +7537|Finisar Corporation +7542|LongCheng Electronic & Communication CO., LTD. +7543|Yueqing Changling Electronic Instrument Corp., Ltd. +7544|CAMBRIDGE SEMICONDUCTOR LTD. +7545|Shenzhen My-Power Technology Co., Ltd. +7546|SHINWA INTERNATIONAL HOLDINGS LTD. +7551|Ecrio +7552|PLDA +7553|YongXin Plastic & Hardware Co., Ltd. +7556|Kechenda Plastic Electronic Factory +7557|NINGBO SHUNSHENG COMMUNICATION APPARATUS CO., LTD. +7564|Wuxi AlphaScale IC Systems, Inc. +7582|CSR, Inc. +7583|KUNMING ELECTRONICS CO., LTD. +7584|Parade Technologies, Inc. +7607|SMedia Technology Corporation +7608|HD MEDICAL INC. +7613|Terawins +7614|S.R.N. Corporation +7615|Signostics Pty. Ltd. +7618|Datalogic Mobile Inc. +7628|Document Capture Technologies, Inc. +7629|HIN KUI MACHINE & METAL INDUSTRIAL CO., LTD. +7639|REDMERE TECHNOLOGY +7640|BUFFALO KOKUYO SUPPLY INC. +7641|EFFICERE TECHNOLOGIES +7647|GDA Technologies, Inc. +7648|Shenzhen Excelstor Technology Ltd. +7649|Actions Microelectronics Co., Ltd. +7650|ENTERY INDUSTRIAL CO., LTD. +7651|SHENZHEN REX ELECTRONICS CO., LTD. +7652|DAEWOO ELECTRONICS CORPORATION +7658|Yesin Electronics Technology Co., Ltd. +7659|SHIUH CHI PRECISION INDUSTRY CO., LTD. +7665|HUATIANYUAN ELECTRONIC INDUSTRY CO., LTD. +7666|Telecommunication Metrology Center of MII +7667|CRESYN CO., LTD. +7668|SHEN ZHEN FORMAN PRECISION INDUSTRY CO., LTD. +7680|Jupiter Systems +7682|GLOBEMASTER TECHNOLOGIES CO., LTD. +7687|GETA ELECTRONICS (DONG GUAN) CO., LTD. +7688|Inventure, Inc. +7696|Point Grey Research Inc. +7697|Hoya Xponent +7708|CMS PRODUCTS +7709|Kanguru Solutions +7711|INVIA +7712|JDSU +7722|NANOFORTI INC. +7731|KOBIAN CANADA INC. +7738|Continental Automotive Systems Inc. +7741|Chipsbrand Technologies (HK) Co., Limited +7751|HUNG TA H.T.ENTERPRISE CO., LTD. +7758|Etron Technology, Inc. +7789|WAN SHIH ELECTRONIC (H.K.) CO., LTD. +7795|COMLINK ELECTRONICS CO., LTD. +7817|Vtion Information Technology (Fujian) Co., Ltd. +7843|Concraft Holding Co., Ltd. +7846|novero GmbH +7863|WIN WIN PRECISION INDUSTRIAL CO., LTD. +7881|MOSER BAER INDIA LIMITED +7867|NuCORE Technology, Inc. +7898|AIRTIES WIRELESS NETWORKS +7899|BLACKMAGIC DESIGN PTY. +7976|Cal-Comp Electronics & Communications +7977|Analogix Semiconductor, Inc. +7985|SASKEN COMMUNICATION TECH LTD. +7989|Amphenol Shouh Min Industry +7996|Chang Yang Electronics Company Ltd. +8009|ITT Corporation +8027|KYODO COMMUNICATIONS & ELECTRONICS INC. +8053|Innostor Co., Ltd. +8063|NOVA Sensors +8064|MagicPixel Inc. +8073|Dongguan Goldconn Electronics Co., Ltd. +8074|Morning Star Industrial Co., Ltd. +8108|DIFFON CORPORATION +8109|Cresta Technology Inc. +8116|Owl Computing Technologies, Inc. +8117|Siemens Enterprise Communications GmbH & Co. KG +8137|NXP Semiconductors +8172|NIAN YEONG ENTERPRISE CO., LTD. +8193|D-Link Corporation +8205|Belkin Electronic (Changzhou) Co., Ltd. +8220|Freeport Resources Enterprises Corp. +8232|DETAS TECHNOLOGY LTD. +8237|Snowbush IP (a division of Gennum) +8256|Hauppauge Computer Works, Inc. +8284|Shenzhen Tronixin Electronics Co., Ltd. +8317|CESI Technology Co., Ltd. +8334|ICT-LANTO LIMITED +8341|China Electronics Technology Limited +8342|Microconn Electronic Co., Ltd. +8367|Shenzhen CARVE Electronics Co., Ltd. +8384|FENGHUA KINGSUN CO., LTD. +8386|Sumitomo Electric Ind., Ltd., Optical Comm. R&D Lab +8408|Changzhou Xinchao Technologies, Inc. +8432|Insight Technology Incorporated +8439|SOFTHARD Technology Ltd. +8445|NOVO NORDISK A/S +8446|Elektrobit Inc. +8457|VIA Labs, Inc. +8492|Shenzhen Linoya Electronic Co., Ltd. +8494|Amphenol AssembleTech (Xiamen) Co., Ltd. +8504|iVina, Inc. +8550|JVC KENWOOD Holdings, Inc. +8551|Zhejiang Fousine Science & Technology Co., Ltd. +8563|HUIZHOU HUANGJI PRECISIONS FLEX ELECTRONICAL CO., LTD. +8564|Transcend Information, Inc. +8565|Light Blue Optics, Inc. +8566|TMC/Allion Test Labs +8583|ESPACE SERVICES MULTIMEDIAS +8584|CalDigit +8618|TAKASAKI KYODO COMPUTING CENTER CO., LTD. +8627|Dongguan Teconn Electronics Technology Co., Ltd. +8629|SHENZHEN JASON ELECTRONICS CO., LTD. +8644|Netcom Technology (HK) Limited +8658|NeoLAB Convergence +8659|Compupack Technology Co., Ltd. +8660|Eduplayer Co., Ltd. +8665|Verification Technology, Inc. +8666|Valor Auto Companion, Inc. +8667|G-Max Technology Co., Ltd. +8681|Jiafuh Metal & Plastic (ShenZhen) Co., Ltd. +8682|JUST MAKE ELECTRONICS CO., LTD. +8695|Wuerth-Elektronik eiSos GmbH & Co. KG +8705|Elan Digital Systems Ltd. +8706|Walex Electronic (Wu Xi) Co., Ltd. +8707|Shin Shin Co., Ltd. +8709|3eYamaichi Electronics Co., Ltd. +8710|Wiretek International Investment Ltd. +8711|Fuzhou Rockchip Electronics Co., Ltd. +8734|Linktec Technologies Co., Ltd. +8756|T-CONN PRECISION CORPORATION +8770|Zhihe Electronics Technology Co., Ltd. +8784|Evernew Wire & Cable Co., Ltd. +8785|QuieTek Corp. +8786|TSANSUN TECH. CO., LTD. +8793|Skypine Electronics (Shenzhen) Co., Ltd. +8804|Entourage Systems, Inc. +8815|Koyo Trading Co., Ltd. +8816|XiaMen GaoLuChang Electronics Co. Ltd. +8831|Granite River Labs +8839|Shenzhen Oversea Win Technology Co., Ltd. +8840|Digital EMC Co., Ltd. +8841|Sun Fair Electric Wire & Cable (HK) Co., Ltd. +8842|Hotron Precision Electronic Ind. Corp. +8843|Shenzhen DLK Electronics Technology Co., Ltd. +8855|Evolution Technology Corporation +8873|Valor Communication, Inc. +8874|AppliedMicro +8875|Trigence Semiconductor, Inc. +8888|Motorola MDS +8889|eTurboTouch Technology Inc. +8890|Technology Innovation International Co., Ltd. +8903|MEMUP +8904|Karming Electronic (Shenzhen) Co., Ltd. +8923|Phase One A/S +8932|Shenyang Tongzhen Precision Electronic Technology Co. +8959|Avnet +8964|Pinnacle +8979|Kunshan Jiahua Electronics Co., Ltd. +8980|INQ Mobile Limited +8981|Avery Design Systems, Inc. +8982|DongGuan Potec Electric Industrial Co., Ltd. +8983|Huawei Device Co., Ltd. +8998|CHAO KUEI MOLD INDUSTRIAL CO., LTD. +9008|Tensorcom +9009|PUZZLE LOGIC INC. +9028|HAMBURG INDUSTRIES CO., LTD. +9036|Zenverge Inc. +9037|Skype Inc. +9048|Greenconn Corporation +9049|Shenzhen Autone-Tronic Technology Co., Ltd. +9050|Top Yang Technology Enterprise Co., Ltd. +9051|KangXiang Electronic Co., Ltd. +9068|ZheJiang Chunsheng Electronics Co., Ltd. +9069|e-supplies Co., Ltd. +9090|Trigaudio, Inc. +9131|Shenzhen Zhengtong Electronics Co., Ltd. +9132|Marunix Electron Limited +9147|EMI STOP CORP. +9316|Nest Labs +9797|Lead Data Inc. +9808|Electronics For Imaging, Inc. +10351|Bretford Manufacturing, Inc. +10393|Toptronic Industrial Co., Ltd. +12662|WHANAM ELECTRONICS CO., Ltd. MS division +13878|INVIBRO +14627|National Instruments +16700|Dell Inc. +16962|USB Design By Example +21827|UC-Logic Technology Corp. +21930|OnSpec Electronic Inc. +24576|TRIDENT MICROSYSTEMS (Far East) Ltd. +25452|CoreLogic, Inc. +27253|Shanghai Jujo Electronics Co., Ltd. +32902|Intel Corporation +32903|Intel Corporation +38672|Moschip Semiconductor Technology +60186|Empia Technology, Inc. diff --git a/macos/USB Prober.app/Contents/Resources/clean.tiff b/macos/USB Prober.app/Contents/Resources/clean.tiff new file mode 100644 index 0000000..898b0a2 Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/clean.tiff differ diff --git a/macos/USB Prober.app/Contents/Resources/detail.tiff b/macos/USB Prober.app/Contents/Resources/detail.tiff new file mode 100644 index 0000000..25a0181 Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/detail.tiff differ diff --git a/macos/USB Prober.app/Contents/Resources/mark.tiff b/macos/USB Prober.app/Contents/Resources/mark.tiff new file mode 100644 index 0000000..2d1745f Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/mark.tiff differ diff --git a/macos/USB Prober.app/Contents/Resources/reenumerate b/macos/USB Prober.app/Contents/Resources/reenumerate new file mode 100755 index 0000000..9e9275d Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/reenumerate differ diff --git a/macos/USB Prober.app/Contents/Resources/reload.tiff b/macos/USB Prober.app/Contents/Resources/reload.tiff new file mode 100644 index 0000000..46b2a48 Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/reload.tiff differ diff --git a/macos/USB Prober.app/Contents/Resources/usbmacro b/macos/USB Prober.app/Contents/Resources/usbmacro new file mode 100644 index 0000000..486ee31 --- /dev/null +++ b/macos/USB Prober.app/Contents/Resources/usbmacro @@ -0,0 +1,122 @@ +define showEHCITD + set $td = (struct EHCIGeneralTransferDescriptor*)$arg0 + + printf "shared.nextTD 0x%x\n", $td->pShared->nextTD + printf "shared.altTD 0x%x\n", $td->pShared->altTD + + # Bytes to Transfer = bit 30:16, PID = bit 9:8, status = bit 7:0 + set $txBytes = ($td->pShared->flags & 0x7FFF0000) >> 16 + set $PID = ($td->pShared->flags & 0x300) >> 8 + set $status = ($td->pShared->flags & 0xFF) + printf "shared.flags 0x%x ==> TxB: %d PID: 0x%x Status: 0x%x\n", $td->pShared->flags, $txBytes, $PID, $status + printf "shared.BuffPtr 0x%x\n", $td->pShared->BuffPtr + + # print buffer contents + # x/4 $td->pShared->BuffPtr +end + +# +# Shows only Async Queue Head +# TODO : Show Periodic Queue Head +# +define showallEHCIQHead + if $argc > 0 + set $ehciQHead = (*(struct AppleUSBEHCI*)$arg0)->_AsyncHead + set $qHeadIndex = 1 + if $ehciQHead == 0 + printf "showallEHCIQHead: No active QHeads available\n" + end + while $ehciQHead > 0 + set $fn = (*(struct AppleEHCIQueueHead *)$ehciQHead)->_functionNumber + set $ep = (*(struct AppleEHCIQueueHead *)$ehciQHead)->_endpointNumber + + set $qTD = (*(struct AppleEHCIQueueHead *)$ehciQHead)->_qTD + set $tailTD = (*(struct AppleEHCIQueueHead *)$ehciQHead)->_TailTD + set $hBitSet = ((*(struct EHCIQueueHeadShared*)((*(struct AppleEHCIQueueHead *)$ehciQHead)->_sharedLogical))->flags & (0x8000)) >> 15 + set $td = (struct EHCIGeneralTransferDescriptor*)$qTD + set $logicalNext = (*(struct AppleEHCIQueueHead *)$ehciQHead)->_logicalNext + set $sharedPhys = (*(struct AppleEHCIQueueHead *)$ehciQHead)->_sharedPhysical + + printf "AppleEHCIQueueHead[%d]: 0x%x ======================================================\n", $qHeadIndex, $ehciQHead + printf "fn: %x ep: %x qTD: 0x%x tailTD: 0x%x hBitSet: 0x%x\n", $fn, $ep, $qTD, $tailTD, $hBitSet + printf "_sharedPhysical: 0x%x _logicalNext: 0x%x\n", $sharedPhys, $logicalNext + + # print transfer overlay area + printf "transfer overlay area " + p/x *(struct EHCIQueueHeadShared*)(*(struct AppleEHCIQueueHead *)$ehciQHead)->_sharedLogical + + # print the td list if they are available + set $tdIndex = 1 + while $td != $tailTD + printf "===== EHCIGeneralTransferDescriptor[%d]: 0x%x =====\n", $tdIndex, $td + showEHCITD $td + p/x *(struct EHCIGeneralTransferDescriptor*)$td + set $tdIndex = $tdIndex + 1 + set $td = (*(struct EHCIGeneralTransferDescriptor*)$td)->pLogicalNext + end + + set $qHeadIndex = $qHeadIndex + 1 + set $ehciQHead = $logicalNext + end + else + printf "\n\tshowallEHCIQHead \n" + printf "\t - AppleUSBEHCI object from showregistry \"AppleUSBEHCI ...>\"\n" + printf "\n\t Example:\n" + printf "\t \n" + printf "\t (gdb) showregistry\n" + printf "\t :\n" + printf "\t +-o AppleUSBEHCI ,.......\n" + printf "\t :\n" + printf "\t \n" + printf "\t (gdb) showallEHCIQHead 0xffffff80263bb000\n\n" + end +end + +document showallEHCIQHead +Syntax: (gdb) showallEHCIQHead +| - AppleUSBEHCI object from showregistry "AppleUSBEHCI ...>" +| +| Example: +| +| (gdb) showregistry +| : +| +-o AppleUSBEHCI ,....... +| : +| +| (gdb) showallEHCIQHead 0xffffff80263bb000 +end + +# The following will print the TRBs in the ring for a particular slot and endpoint +define printTRB + set $slotID = $arg1 + set $ep = $arg2 + set $i = 0 + set $end = (((struct AppleUSBXHCI *)$arg0)->_slots[$slotID].rings[$ep]).transferRingSize + set $dq = (((struct AppleUSBXHCI *)$arg0)->_slots[$slotID].rings[$ep]).transferRingDequeueIdx + set $eq = (((struct AppleUSBXHCI *)$arg0)->_slots[$slotID].rings[$ep]).transferRingEnqueueIdx + + printf "TRB for Slot: %d, EP: %d (transferRingEnqueueIdx: %d, transferRingDequeueIdx: %d)\n", $slotID, $ep, $eq, $dq + while ( $i < $end ) + set $offs0=(((struct AppleUSBXHCI *)$arg0)->_slots[$slotID].rings[$ep]).transferRing[$i].offs0 + set $offs4=(((struct AppleUSBXHCI *)$arg0)->_slots[$slotID].rings[$ep]).transferRing[$i].offs4 + set $offs8=(((struct AppleUSBXHCI *)$arg0)->_slots[$slotID].rings[$ep]).transferRing[$i].offs8 + set $offsC=(((struct AppleUSBXHCI *)$arg0)->_slots[$slotID].rings[$ep]).transferRing[$i].offsC + printf "TRB[%03d]: 0x%08x 0x%08x 0x%08x 0x%08x\n",$i++, $offs0, $offs4, $offs8, $offsC + end +end + +document printTRB +Syntax: (gdb) printTRB +| - AppleUSBXHCI object from showregistry "AppleUSBXHCI ...>" +| - The slotID for the device +| - The Endpoint # for the slot +| +| Example: +| +| (gdb) showregistry +| : +| +-o AppleUSBXHCI ,....... +| : +| +| (gdb) printTRB 0xffffff80263bb000 22 1 +end diff --git a/macos/USB Prober.app/Contents/Resources/usbtracer b/macos/USB Prober.app/Contents/Resources/usbtracer new file mode 100755 index 0000000..bfc5cda Binary files /dev/null and b/macos/USB Prober.app/Contents/Resources/usbtracer differ diff --git a/macos/karabiner.json b/macos/karabiner.json new file mode 100644 index 0000000..086225b --- /dev/null +++ b/macos/karabiner.json @@ -0,0 +1,260 @@ +{ + "global": { + "check_for_updates_on_startup": true, + "show_in_menu_bar": false, + "show_profile_name_in_menu_bar": false + }, + "profiles": [ + { + "complex_modifications": { + "parameters": { + "basic.simultaneous_threshold_milliseconds": 50, + "basic.to_delayed_action_delay_milliseconds": 500, + "basic.to_if_alone_timeout_milliseconds": 1000, + "basic.to_if_held_down_threshold_milliseconds": 500 + }, + "rules": [] + }, + "devices": [ + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [ + { + "from": { + "key_code": "f1" + }, + "to": { + "key_code": "f1" + } + }, + { + "from": { + "key_code": "f2" + }, + "to": { + "key_code": "f2" + } + }, + { + "from": { + "key_code": "f3" + }, + "to": { + "key_code": "f3" + } + }, + { + "from": { + "key_code": "f4" + }, + "to": { + "key_code": "f4" + } + }, + { + "from": { + "key_code": "f5" + }, + "to": { + "key_code": "f5" + } + }, + { + "from": { + "key_code": "f6" + }, + "to": { + "key_code": "f6" + } + }, + { + "from": { + "key_code": "f7" + }, + "to": { + "key_code": "f7" + } + }, + { + "from": { + "key_code": "f8" + }, + "to": { + "key_code": "f8" + } + }, + { + "from": { + "key_code": "f9" + }, + "to": { + "key_code": "f9" + } + }, + { + "from": { + "key_code": "f10" + }, + "to": { + "key_code": "f10" + } + }, + { + "from": { + "key_code": "f11" + }, + "to": { + "key_code": "f11" + } + }, + { + "from": { + "key_code": "f12" + }, + "to": { + "key_code": "f12" + } + } + ], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 6919, + "vendor_id": 6940 + }, + "ignore": false, + "manipulate_caps_lock_led": false, + "simple_modifications": [] + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 627, + "vendor_id": 1452 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [] + } + ], + "fn_function_keys": [ + { + "from": { + "key_code": "f1" + }, + "to": { + "consumer_key_code": "display_brightness_decrement" + } + }, + { + "from": { + "key_code": "f2" + }, + "to": { + "consumer_key_code": "display_brightness_increment" + } + }, + { + "from": { + "key_code": "f3" + }, + "to": { + "key_code": "mission_control" + } + }, + { + "from": { + "key_code": "f4" + }, + "to": { + "key_code": "launchpad" + } + }, + { + "from": { + "key_code": "f5" + }, + "to": { + "key_code": "illumination_decrement" + } + }, + { + "from": { + "key_code": "f6" + }, + "to": { + "key_code": "illumination_increment" + } + }, + { + "from": { + "key_code": "f7" + }, + "to": { + "consumer_key_code": "rewind" + } + }, + { + "from": { + "key_code": "f8" + }, + "to": { + "consumer_key_code": "play_or_pause" + } + }, + { + "from": { + "key_code": "f9" + }, + "to": { + "consumer_key_code": "fastforward" + } + }, + { + "from": { + "key_code": "f10" + }, + "to": { + "consumer_key_code": "mute" + } + }, + { + "from": { + "key_code": "f11" + }, + "to": { + "consumer_key_code": "volume_decrement" + } + }, + { + "from": { + "key_code": "f12" + }, + "to": { + "consumer_key_code": "volume_increment" + } + } + ], + "name": "Default profile", + "selected": true, + "simple_modifications": [ + { + "from": { + "key_code": "caps_lock" + }, + "to": { + "key_code": "escape" + } + } + ], + "virtual_hid_keyboard": { + "caps_lock_delay_milliseconds": 0, + "country_code": 0, + "keyboard_type": "ansi" + } + } + ] +} \ No newline at end of file diff --git a/navit/navit.xml b/navit/navit.xml new file mode 100644 index 0000000..1fd7d19 --- /dev/null +++ b/navit/navit.xml @@ -0,0 +1,442 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Main menu + Actions + Show +Map + Settings + Tools + Route + About + Quit + + Actions + Bookmarks + Former +Destinations + + + Town + Coordinates + Stop +Navigation + + Settings + Display + Maps + + Vehicle + + Rules + + Display + + Layout + Fullscreen + Window Mode + 3D + 2D + Auto zoom + Manual zoom + Layers + + Tools + Show Locale + Network info + + Route + Zoom to route + Description + Height Profile + Waypoints + Drop last +Waypoint + Drop next +Waypoint + + Map Point + + + Layout + + + Maps + + + Layers + + + Vehicle + + + + + + Satellite Status + + + NMEA Data + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nixos/.gitignore b/nixos/.gitignore new file mode 100644 index 0000000..317b2ec --- /dev/null +++ b/nixos/.gitignore @@ -0,0 +1,3 @@ +local.nix +configuration.nix +hardware-configuration.nix diff --git a/nixos/configs/autosetup-darwin-aarch64.nix b/nixos/configs/autosetup-darwin-aarch64.nix new file mode 100644 index 0000000..f0ac33a --- /dev/null +++ b/nixos/configs/autosetup-darwin-aarch64.nix @@ -0,0 +1,28 @@ +# +# Automatic first-time setup of the maschine via nix-darwin. +# +# vim: et:ts=2:sw=2: +# +{ config, pkgs, ... }: +let + username = "deprekated"; +in +{ + + # Script commands that ensure our system is in a known state. + # Must be idempotent. + system.activationScripts.extraActivation.text = '' + + # Install Homebrew + which /opt/homebrew/bin/brew 2>&1 > /dev/null || sudo -u ${username} /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + # Install Rosetta + stat /Library/Apple/usr/share/rosetta/rosetta 2>&1 > /dev/null || softwareupdate --install-rosetta + + # Ensure SSH is on. + systemsetup -setremotelogin on 2>&1 > /dev/null + + # Change shell to xonsh + chsh -s $(which xonsh) ${username} + ''; +} diff --git a/nixos/configs/build-machine-users.nix b/nixos/configs/build-machine-users.nix new file mode 100644 index 0000000..3a39c25 --- /dev/null +++ b/nixos/configs/build-machine-users.nix @@ -0,0 +1,24 @@ +# Adds users to build machines. +{ ... }: +{ + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.puck = { + isNormalUser = true; + description = "puck"; + extraGroups = [ + "audio" + "disk" + "dialout" + "libvirtd" + "networkmanager" + "plugdev" + "qmemu-libvirtd" + "video" + "wheel" + "input" + "kvm" + ]; + }; + +} diff --git a/nixos/configs/calendar.nix b/nixos/configs/calendar.nix new file mode 100644 index 0000000..395bd7d --- /dev/null +++ b/nixos/configs/calendar.nix @@ -0,0 +1,14 @@ +# +# Configuration for CalDAV sync (no GUI required). +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +{ + environment.systemPackages = [ + pkgs.vdirsyncer + ]; + + # Set up a per-user mail sync. + home-manager.users.deprekated.services.vdirsyncer.enable = true; +} diff --git a/nixos/configs/cellular.nix b/nixos/configs/cellular.nix new file mode 100644 index 0000000..7327260 --- /dev/null +++ b/nixos/configs/cellular.nix @@ -0,0 +1,31 @@ +# +# Provides cellular support. +# +# vim: et:ts=2:sw=2: +# +{ + lib, + pkgs, + deprekages, + ... +}: +{ + environment.systemPackages = with pkgs; [ + atinout + libqmi + modem-manager-gui + modemmanager + + calls + callaudiod + ]; + + # We can't just start the ModemManager service, + # since it's shipped in a broken way in nixpkgs. + # Instead, we'll mark it as wanted by NetworkManager. + systemd.services.NetworkManager = { + wants = [ "ModemManager.service" ]; + after = [ "ModemManager.service" ]; + }; + +} diff --git a/nixos/configs/dotfiles/default.nix b/nixos/configs/dotfiles/default.nix new file mode 100644 index 0000000..01f5aaf --- /dev/null +++ b/nixos/configs/dotfiles/default.nix @@ -0,0 +1,16 @@ +# +# Our dotfile configuration, via home-manager. +# +{ callHm, normalizeModule, ... }: +{ + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + home-manager.users.deprekated = callHm ./hm.nix; + + # Additional HM config modules. + imports = [ + (normalizeModule ./kakoune.hm.nix) + (normalizeModule ./kakoune-lsp.hm.nix) + ]; +} diff --git a/nixos/configs/dotfiles/droid.nix b/nixos/configs/dotfiles/droid.nix new file mode 100644 index 0000000..f8945e8 --- /dev/null +++ b/nixos/configs/dotfiles/droid.nix @@ -0,0 +1,13 @@ +# +# Our dotfile configuration, via home-manager. +# +{ callHm, normalizeModule, ... }: +{ + home-manager.config = callHm ./hm.nix; + + # Additional HM config modules. + imports = [ + (normalizeModule ./kakoune.hm.nix) + (normalizeModule ./kakoune-lsp.hm.nix) + ]; +} diff --git a/nixos/configs/dotfiles/hm.nix b/nixos/configs/dotfiles/hm.nix new file mode 100644 index 0000000..7a8f2c8 --- /dev/null +++ b/nixos/configs/dotfiles/hm.nix @@ -0,0 +1,61 @@ +{ ... }: +{ + home.username = "deprekated"; + home.homeDirectory = "/home/deprekated"; + + # Tie our configruation to the version it was written for. + home.stateVersion = "24.05"; + + # + # Git. + # + programs.git = { + enable = true; + lfs.enable = true; + + # Note: we no longer set a name, here, forcing us to choose our e-mail and username + # on a per-project basis. + + # Use main as our branch names. + extraConfig = { + init.defaultBranch = "main"; + }; + }; + + # Manuals are broken on macOS, for now. :( + manual.manpages.enable = false; + + # + # "Raw file" dotfiles. + # These aren't generated by Nix, specifically so we can use them on Windows as well. + # + + # xonsh + xdg.configFile.xonsh.source = ../../../xonsh; + + # wezterm + xdg.configFile.wezterm.source = ../../../wezterm; + + # calendar / contact sync + xdg.configFile.khal.source = ../../../khal; + xdg.configFile.vdirsyncer.source = ../../../vdirsyncer; + + # looking-glass + xdg.configFile.looking-glass.source = ../../../looking-glass; + + # neovim + xdg.configFile."nvim".source = ../../../nvim; + + # tmux + xdg.configFile."tmux".source = ../../../tmux; + + # kakoune + #xdg.configFile."kak/autoload".source = ../../../kak/autoload; + xdg.configFile."kak/wezterm-tab.kak".source = ../../../kak/wezterm-tab.kak; + xdg.configFile."kak/sudo-write.kak".source = ../../../kak/sudo-write.kak; + + # taskwarrior + xdg.configFile."task/taskrc".source = ../../../taskwarrior/taskrc; + xdg.dataFile."task/hooks".source = ../../../taskwarrior/hooks; + +} diff --git a/nixos/configs/dotfiles/kakoune-lsp.hm.nix b/nixos/configs/dotfiles/kakoune-lsp.hm.nix new file mode 100644 index 0000000..fa54a49 --- /dev/null +++ b/nixos/configs/dotfiles/kakoune-lsp.hm.nix @@ -0,0 +1,88 @@ +# +# Kakoune LSP and tree-sitter configuration. +# +{ ... }: +{ + # General LSP configuration. + xdg.configFile."kak-lsp/kak-lsp.toml".source = ../../../kak/kak-lsp.toml; + xdg.configFile."kak-tree-sitter/config.toml".source = ../../../kak/kak-tree-sitter.toml; + xdg.configFile."kak/colors".source = ../../../kak/colors; + + programs.kakoune.config = { + + # LSP keybinds + keyMappings = [ + { + mode = "user"; + key = "l"; + effect = ":enter-user-mode lsp"; + docstring = "LSP commands"; + } + { + mode = "user"; + key = "A"; + effect = ":lsp-code-actions"; + docstring = "bring up the code actions menu"; + } + { + mode = "user"; + key = "F"; + effect = ":lsp-code-actions"; + docstring = "automatically execute first code action"; + } + { + mode = "object"; + key = ""; + effect = "-lsp-object"; + docstring = "LSP commands"; + } + { + mode = "object"; + key = "f"; + effect = "lsp-object"; + docstring = "LSP any symbol"; + } + { + mode = "object"; + key = "t"; + effect = "lsp-object"; + docstring = "LSP any symbol"; + } + { + mode = "object"; + key = "d"; + effect = "lsp-diagnostic-object --include-warnings"; + docstring = "LSP commands"; + } + { + mode = "object"; + key = "D"; + effect = "lsp-diagnostic-object"; + docstring = "LSP commands"; + } + ]; + + hooks = [ + # Allow tab to move through completions. + { + name = "InsertCompletionShow"; + option = ".*"; + commands = '' + try %{ + # this command temporarily removes cursors preceded by whitespace; + # if there are no cursors left, it raises an error, does not + # continue to execute the mapping commands, and the error is eaten + # by the `try` command so no warning appears. + execute-keys -draft 'h\h' + map window insert + map window insert + hook -once -always window InsertCompletionHide .* %{ + unmap window insert + unmap window insert + } + } + ''; + } + ]; + }; +} diff --git a/nixos/configs/dotfiles/kakoune-lsp.nix b/nixos/configs/dotfiles/kakoune-lsp.nix new file mode 100644 index 0000000..bf25375 --- /dev/null +++ b/nixos/configs/dotfiles/kakoune-lsp.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + home-manager.users.deprekated = specialArgs: (import ./kakoune-lsp.hm.nix) specialArgs; +} diff --git a/nixos/configs/dotfiles/kakoune.hm.nix b/nixos/configs/dotfiles/kakoune.hm.nix new file mode 100644 index 0000000..131b56e --- /dev/null +++ b/nixos/configs/dotfiles/kakoune.hm.nix @@ -0,0 +1,180 @@ +# +# Kakoune, one of our main editors. +# +{ pkgs, deprekages, ... }: +{ + programs.kakoune = { + enable = true; + + config = { + tabStop = 2; + numberLines.enable = true; + + hooks = [ + + # Automatically enable the LSP when a supported file is found. + { + name = "WinSetOption"; + option = "filetype=(python|nix|c|cpp|rust|ruby)"; + commands = '' + lsp-enable-window + + # Finally, inject our buffer name in front of the modeline, so tabs are named correctly. + set global -remove modelinefmt "%val{bufname}" + set global modelinefmt "%val{bufname} - %opt{modelinefmt}" + ''; + } + + # Additional file types. + { + name = "BufCreate"; + option = ".*\\.typ"; + commands = '' + set-option buffer filetype typst + addhl buffer/ wrap -word + ''; + } + + # Spell checking. + { + name = "ModeChange"; + option = "push:[^:]*:next-key\\[user.spell\\]"; + commands = '' + hook -once -always window NormalIdle .* spell-clear + spell en_US + ''; + } + ]; + + keyMappings = [ + # Vertical selections. + { + mode = "user"; + key = "v"; + effect = ":vertical-selection-down"; + docstring = "select matching lines down"; + } + { + mode = "user"; + key = ""; + effect = ":vertical-selection-up"; + docstring = "select matching lines up"; + } + { + mode = "user"; + key = "V"; + effect = ":vertical-selection-up-and-down"; + docstring = "select matching lines (bidirectional)"; + } + + # Shortcuts. + { + mode = "user"; + key = "a"; + effect = ""; + docstring = "select around"; + } + { + mode = "user"; + key = "i"; + effect = ""; + docstring = "select inside"; + } + { + mode = "user"; + key = "q"; + effect = "Q"; + docstring = "select inside double quotes"; + } + { + mode = "user"; + key = "Q"; + effect = "QC"; + docstring = "change inside double quotes"; + } + + # Spell-checking. + { + mode = "user"; + key = "s"; + effect = ": enter-user-mode -lock spell"; + docstring = "enter spelling mode"; + } + { + mode = "spell"; + key = "a"; + effect = ":spell-add; spell en_US"; + docstring = "add word to spell-checker"; + } + { + mode = "spell"; + key = "r"; + effect = ":_spell-replace"; + docstring = "suggest spelling replacements"; + } + { + mode = "spell"; + key = "n"; + effect = ":spell-next"; + docstring = "move to the next word"; + } + ]; + }; + + extraConfig = '' + + # Set up our LSP host. + eval %sh{kak-lsp --kakoune -s $kak_session} + + # Use a cat assistant, which puck think is cute. + set global ui_options terminal_assistant=cat + + # Use tree-sitter for coloring. + eval %sh{ ${deprekages.kak-tree-sitter}/bin/kak-tree-sitter -dks --init $kak_session } + colorscheme solarized-darker + + # Use wezterm when possible, and tmux otherwise. + source ${../../../kak/wezterm-tab.kak} + set global windowing_modules 'wezterm-tab' 'tmux' + + # Enable auotmatic hovering. + lsp-auto-hover-enable + set global lsp_hover_anchor true + + # Rainbow brackets. + require-module rainbow + + # Editorconfig. + hook global BufOpenFile .* editorconfig-load + hook global BufNewFile .* editorconfig-load + + # Set up spellchecking. + define-command -hidden -params 0 _spell-replace %{ + hook -always -once window ModeChange push:prompt:next-key\[user.spell\] %{ + execute-keys + } + hook -once -always window NormalIdle .* %{ + enter-user-mode -lock spell + spell en_US + } + spell-replace + } + + # Misc plugins. + source ${../../../kak/sudo-write.kak} + ''; + + plugins = with pkgs.kakounePlugins; [ + connect-kak + kak-ansi + kak-prelude + kakoune-extra-filetypes + kakoune-lsp + kakoune-rainbow + kakoune-state-save + kakoune-vertical-selection + deprekages.kak-tree-sitter + parinfer-rust + ]; + }; +} diff --git a/nixos/configs/dotfiles/kakoune.nix b/nixos/configs/dotfiles/kakoune.nix new file mode 100644 index 0000000..e1dc024 --- /dev/null +++ b/nixos/configs/dotfiles/kakoune.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + home-manager.users.deprekated = specialArgs: (import ./kakoune.hm.nix) specialArgs; + + # Additional HM config modules. + imports = [ + ./kakoune-lsp.hm.nix + ]; +} diff --git a/nixos/configs/dotfiles/neovim-ide.nix b/nixos/configs/dotfiles/neovim-ide.nix new file mode 100644 index 0000000..1c5bb8c --- /dev/null +++ b/nixos/configs/dotfiles/neovim-ide.nix @@ -0,0 +1,16 @@ +# +# Neovim home-manager configuration (CoC). +# +# vim: et:ts=2:sw=2: +# +{ ... }: +{ + home-manager.users.deprekated = + { pkgs, lib, ... }: + { + programs.neovim = { + + plugins = [ pkgs.vimPlugins.LazyVim ]; + }; + }; +} diff --git a/nixos/configs/dotfiles/neovim-line.nix b/nixos/configs/dotfiles/neovim-line.nix new file mode 100644 index 0000000..1d1d7d0 --- /dev/null +++ b/nixos/configs/dotfiles/neovim-line.nix @@ -0,0 +1,241 @@ +# +# Neovim home-manager configuration (CoC). +# +# vim: et:ts=2:sw=2: +# +{ config, ... }: +{ + home-manager.users.deprekated = + { pkgs, ... }: + let + colors = config.lib.stylix.colors; + in + { + + # CoC configuration for Neovim. + programs.neovim = { + + # Use LuaLine... + plugins = with pkgs.vimPlugins; [ lualine-nvim ]; + + # ... and insert its config. + extraLuaConfig = '' + local lualine = require('lualine') + + local colors = { + bg = '#${colors.base00}', + fg = '#${colors.base07}', + red = '#${colors.base08}'; + green = '#${colors.base0B}'; + blue = '#${colors.base0D}'; + yellow = '#${colors.base0A}'; + magenta = '#${colors.base0E}'; + orange = '#${colors.base09}'; + cyan = '#${colors.base0C}'; + black = '#${colors.base03}'; + white = '#${colors.base05}'; + } + + -- auto change color according to neovims mode + local mode_colors = { + n = colors.violet, + i = colors.green, + v = colors.blue, + [''] = colors.blue, + V = colors.blue, + c = colors.magenta, + no = colors.violet, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.red, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.violet, + t = colors.violet, + } + + local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand('%:p:h') + local gitdir = vim.fn.finddir('.git', filepath .. ';') + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, + } + + local config = { + options = { + icons_enabled = true, + theme = 'solarized_dark', + component_separators = "", + section_separators = { left = '', right = '' }, + }, + sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {} + }, + } + + -- + -- Helpers. + -- + local function ins_far_left(component) + table.insert(config.sections.lualine_a, component) + end + local function ins_left(component) + table.insert(config.sections.lualine_b, component) + end + local function ins_near_left(component) + table.insert(config.sections.lualine_c, component) + end + local function ins_near_right(component) + table.insert(config.sections.lualine_x, component) + end + local function ins_right(component) + table.insert(config.sections.lualine_y, component) + end + local function ins_far_right(component) + table.insert(config.sections.lualine_z, component) + end + + -- + -- Left section. + -- + + -- Show the current mode, using a neovim icon. + ins_far_left { + function() + return ' ' + end, + color = function() + return { bg = mode_colors[vim.fn.mode()] } + end, + padding = { right = 1 }, + } + + -- Show the file's size. + ins_far_left { + 'filesize', + cond = conditions.buffer_not_empty, + color = function() + return { bg = mode_colors[vim.fn.mode()] } + end, + padding = { right = 1 }, + } + + ins_left { + 'filename', + cond = conditions.buffer_not_empty, + color = { fg = colors.bg, gui = 'bold' }, + } + + ins_left { 'location' } + ins_left { 'progress', color = { fg = colors.bg, gui = 'bold' } } + + ins_near_left { + 'diagnostics', + symbols = { error = ' ', warn = ' ', info = ' ' }, + diagnostics_color = { + color_error = { fg = colors.red }, + color_warn = { fg = colors.yellow }, + color_info = { fg = colors.cyan }, + }, + } + + -- + -- Center section. + -- + + -- Move things to the center using a hack. + ins_near_left { + function() + return '%=' + end, + } + + ins_near_left { + -- Lsp server name . + function() + local msg = 'no active lsp' + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + icon = ' lsp:', + color = { fg = colors.fg, gui = 'bold' }, + } + + -- + -- Right section + -- + + -- Add components to right sections + ins_right { + 'o:encoding', + cond = conditions.hide_in_width, + color = { fg = colors.bg, gui = 'bold' }, + } + + ins_right { + 'fileformat', + fmt = string.upper, + color = { fg = colors.bg, gui = 'bold' }, + } + + ins_far_right { + 'branch', + icon = '', + color = { fg = colors.violet, gui = 'bold' }, + } + + ins_far_right { + 'diff', + symbols = { added = ' ', modified = '󰝤 ', removed = ' ' }, + diff_color = { + added = { fg = colors.violet }, + modified = { fg = colors.bg }, + removed = { fg = colors.yellow }, + }, + cond = conditions.hide_in_width, + } + + -- + -- Finally, initialize things! + -- + lualine.setup(config) + ''; + }; + }; +} diff --git a/nixos/configs/dotfiles/neovim-lsp.nix b/nixos/configs/dotfiles/neovim-lsp.nix new file mode 100644 index 0000000..c46b685 --- /dev/null +++ b/nixos/configs/dotfiles/neovim-lsp.nix @@ -0,0 +1,233 @@ +# +# Neovim home-manager configuration (CoC). +# +# vim: et:ts=2:sw=2: +# +{ nil, ... }: +{ + home-manager.users.deprekated = + { pkgs, ... }: + { + + # CoC configuration for Neovim. + programs.neovim = { + + extraPackages = with pkgs; [ clang-tools ]; + + coc = { + enable = true; + + pluginConfig = '' + set completeopt=menu,menuone,preview,noselect,noinsert + + function! CheckBackspace() abort + let l:col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' + endfunction + + " Accept the selected completion with . + inoremap coc#pum#visible() ? coc#pum#confirm() : "\" + + " Select the next completion with . + inoremap coc#pum#visible() ? coc#pum#next(1) : CheckBackspace() ? "\" : coc#refresh() + + " Select the previous completion with + inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" + ''; + + settings = { + + suggest = { + enablePreview = true; + floatEnable = true; + autoTrigger = "always"; + preferCompleteThanJumpPlaceholder = true; + maxCompleteItemCount = 100; + snippetsSupport = false; + localityBonus = true; + minTriggerInputLength = 3; + acceptSuggestionOnCommitCharacter = true; + noselect = true; + removeDuplicateItems = true; + }; + + colors.filetypes = [ + "vim" + "c" + "cpp" + "python" + "rust" + ]; + + semanticTokens.filetypes = [ + "vim" + "c" + "cpp" + "python" + "rust" + ]; + + diagnostic = { + diagnostic.checkCurrentLine = true; + diagnostic.virtualText = true; + diagnostic.virtualTextLevel = "error"; + diagnostic.separateRelatedInformationAsDiagnostics = true; + }; + + signature = { + enable = true; + target = "float"; + }; + + hover.target = "float"; + codeLens.enable = false; + + coc = { + preferences = { + currentFunctionSymbolAutoUpdate = true; + jumpCommand = "tabe"; + + formatOnSaveFiletypes = [ + "css" + "typescript" + "javascript" + "cpp" + "nix" + "rust" + ]; + }; + }; + + cpp = { + referencesCodeLens.enable = false; + }; + c = { + referencesCodeLens.enable = false; + }; + swift = { + referencesCodeLens.enable = false; + }; + + vimlsp.trace.server = "messages"; + git.enableGlobalStatus = false; + json.enable = true; + json.trace.server = "messages"; + + python = { + linting = { + enabled = true; + pylintUseMinimalCheckers = true; + pylintEnabled = true; + pylintArgs = [ + "--max-line-length" + "120" + "--max-args" + "8" + "--extension-pkg-whitelist=PySide2" + "--disable=C0326" + "--disable=no-else-return" + ]; + }; + formatting.provider = "black"; + }; + + pyright.trace.server = "messages"; + python.analysis.useLibraryCodeForTypes = true; + + rust-analyzer = { + serverPath = "/run/current-system/sw/bin/rust-analyzer"; + lens.implementations = false; + trace.server = "messages"; + updates.checkOnStartup = false; + }; + + suggest.completionItemKindLabels = { + variable = "var"; + function = "fun"; + method = "meth"; + module = "mod"; + value = "val"; + default = "default"; + keyword = "key"; + class = "class"; + unit = "unit"; + field = "field"; + property = "prop"; + constant = "const"; + operator = "op"; + reference = "ref"; + typeParameter = "type param"; + text = "text"; + enum = "enum"; + file = "file"; + color = "color"; + event = "event"; + folder = "folder"; + struct = "struct"; + snippet = "snip"; + interface = "interface"; + enumMember = "enum member"; + }; + + languageserver = { + nix = { + command = "${nil.nil}/bin/nil"; + filetypes = [ "nix" ]; + rootPatterns = [ "flake.nix" ]; + settings.nil.formatting.command = [ "${pkgs.nixfmt-rfc-style}/bin/nixfmt" ]; + }; + }; + + diagnostic-languageserver = { + enable = true; + + formatFiletypes = { + "js" = "prettier"; + "c" = "clang-format"; + "cpp" = "clang-format"; + "nix" = "nixfmt"; + }; + + formatters = { + prettier = { + command = "prettier"; + args = [ + "--stdin" + "--stdin-filepath" + "%filepath" + ]; + rootPatterns = [ + ".prettierrc" + ".prettierrc.json" + ".prettierrc.toml" + ".prettierrc.json" + ".prettierrc.yml" + ".prettierrc.yaml" + ".prettierrc.json5" + ".prettierrc.js" + ".prettierrc.cjs" + "prettier.config.js" + "prettier.config.cjs" + ]; + }; + clang-format = { + command = "clang-format"; + args = [ "%filepath" ]; + rootPatterns = [ ".clang-format" ]; + }; + nixfmt.command = "${pkgs.nixfmt-rfc-style}/bin/nixfmt"; + }; + }; + + explorer = { + icon = { + source = "vim-devicons"; + enableNerdfont = true; + }; + width = 30; + }; + }; + }; + }; + }; +} diff --git a/nixos/configs/dotfiles/neovim.nix b/nixos/configs/dotfiles/neovim.nix new file mode 100644 index 0000000..b94a227 --- /dev/null +++ b/nixos/configs/dotfiles/neovim.nix @@ -0,0 +1,170 @@ +# +# Neovim home-manager configuration. +# +# vim: et:ts=2:sw=2: +# +{ ... }: +{ + imports = [ + ./neovim-lsp.nix + ./neovim-ide.nix + ./neovim-line.nix + ]; + + home-manager.users.deprekated = + { pkgs, ... }: + { + + # Squish our whole neovim config into Nix, for some reason. + programs.neovim = { + enable = true; + + # Make standard tools prefer neovim. + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + + # Install the plugins we use via Nix. + plugins = with pkgs.vimPlugins; [ + ctrlp-vim + editorconfig-nvim + lualine-nvim + nerdcommenter + nerdtree + nvim-fzf + rainbow + surround-nvim + vim-devicons + vim-easy-align + vim-eunuch + vim-solarized8 + telescope-nvim + + # CoC plugins + coc-diagnostic + coc-clangd + coc-rust-analyzer + coc-pyright + coc-tsserver + coc-spell-checker + coc-explorer + coc-json + coc-java + ]; + + # Requirements for our vim. + extraPackages = with pkgs.tree-sitter-grammars; [ + pkgs.tree-sitter + tree-sitter-bash + tree-sitter-c + tree-sitter-cmake + tree-sitter-cpp + tree-sitter-css + tree-sitter-go + tree-sitter-javascript + tree-sitter-json + tree-sitter-lua + tree-sitter-nix + tree-sitter-python + tree-sitter-rust + tree-sitter-typescript + tree-sitter-vim + ]; + + extraConfig = '' + scriptencoding utf-8 + + syntax on + filetype plugin indent on + + let mapleader="," + + """ Options + set number " Show line numbers. + set modeline " Allow vim commands in text file comments. + set undofile " Persistent undo tree. + set incsearch " Incremental search. + set tabstop=4 " Number of visual spaces to be displayed per HT. + set expandtab " Expand tabs to spaces by default. + set shiftwidth=0 " Use tabstop value for indenting. + set lazyredraw " Only redraw when we need to. + set scrolloff=2 " Keep 2 lines between the end of the buffer and the cursor. + set sidescrolloff=2 " Keep 2 characters between the current column and the screen edge. + set mouse=n " Enable the mouse in normal mode. + set colorcolumn=120 + set wildmenu " Tab-complete command menu. + set wildmode=longest:full,full " Most bash-like way. + set wildignorecase " Ignore case when completing. + set splitright " Make :vsplit put the new window on the right. + set splitbelow " Make :split put the new window on the bottom. + set foldlevel=5 " Don't fold almost anything by default. + set hidden " Allow for hidden, modified but not written buffers. + set bufhidden=hide " Hide buffers instead of deleting or unloading them. + set ignorecase + set smartcase + set gdefault + set cindent " A good basis/default for many languages, though this is usually overridden by the filetype plugin. + set cinoptions=l1,j1 " Indent case blocks correct, and indent Java anonymous classes correctly. + " Autowrap comments using textwidth, inserting the comment leader, + " and remove the comment leader when joining lines when it makes sense. + set formatoptions=cj + " Don't display . on folds. + set fillchars=fold:\ + set diffopt=algorithm:patience + set fsync " Syncs the filesystem after :write. + set nowrap + + set updatetime=1000 "Lets languageservers update faster, and shortens the time for CursorHold. + set noshowmode " We're using lualine, so showing the mode in the command line is redundant. + + " Have the visual-selection indent commands re-highlight the last visual selection after indenting. + vnoremap > >gv + vnoremap < + + " Leader Q should banish the current window. + map q :only \| :q + + " Leader W should save and then banish the current window. + map q :only \| :wq + + " Fold augroups, functions, Lua, and Python + let g:vimsyn_folding = 'aflP' + + " Support embedded Lua and Python. + let g:vimsyn_embed = 'lP' + + " Highlight whitespace errors. + let g:c_space_errors = 1 + let g:python_space_error_highlight = 1 + + let g:python_highlight_builtins = 1 + let g:python_highlight_builtin_funcs = 1 + let g:python_highlight_builtin_types = 1 + let g:python_highlight_exceptions = 1 + let g:python_highlight_string_formatting = 1 + let g:python_highlight_string_format = 1 + let g:python_highlight_indent_errors = 1 + let g:python_highlight_space_errors = 1 + let g:python_highlight_class_vars = 1 + + let g:xsh_highlight_all = v:true + + let g:NERDCustomDelimiters = { 'dosini': { 'left': '#' }, 'xonsh': { 'left': '#' } } + + " Use truecolor. + set termguicolors + + " Make Solaried8 a biiiit darker. + set background=dark + colorscheme solarized8 + highlight Normal guibg=#001E27 + highlight LineNR ctermfg=11 guibg=#0B262D + + ''; + }; + }; +} diff --git a/nixos/configs/droid-gui.nix b/nixos/configs/droid-gui.nix new file mode 100644 index 0000000..71f0b36 --- /dev/null +++ b/nixos/configs/droid-gui.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +{ + # Support packages. + environment.packages = with pkgs; [ + xdg-desktop-portal + wezterm + mesa + roxterm + ]; + + # + # XOrg setup. + # + home-manager.config.xsession = { + enable = true; + + # Use i3 as our primary window manager on HM-managed sessions. + windowManager.i3 = { + enable = true; + + config = { + modifier = "Mod4"; + + terminal = "${pkgs.wezterm}/bin/wezterm"; + }; + }; + }; +} diff --git a/nixos/configs/flake-registry.nix b/nixos/configs/flake-registry.nix new file mode 100644 index 0000000..2bdeab4 --- /dev/null +++ b/nixos/configs/flake-registry.nix @@ -0,0 +1,36 @@ +# +# Flake registery configuration module. +# +# vim: et:ts=2:sw=2: +# +{ nixpkgs, ... }: +{ + + nix = { + registry = { + + # Add _this_ flake to the flake registry. + deprekages.to = { + type = "git"; + url = "https://git.katesiria.org/deprekages/dotfiles"; + }; + + # Pin nixpkgs to the version we specified in our flakes. + nixpkgs = { + from = { + id = "nixpkgs"; + type = "indirect"; + }; + flake = nixpkgs; + }; + }; + + # And ensure the flake registry uses it, too. + nixPath = [ + "nixpkgs=flake:nixpkgs" + "/nix/var/nix/profiles/per-user/root/channels" + ]; + + }; + +} diff --git a/nixos/configs/flatpak.nix b/nixos/configs/flatpak.nix new file mode 100644 index 0000000..5a20e60 --- /dev/null +++ b/nixos/configs/flatpak.nix @@ -0,0 +1,26 @@ +# +# Support using flatpak apps in Nix. +# Apps themselves are added in nixos/packages/flatpak.nix +# +{ ... }: +{ + services.flatpak = { + enable = true; + + # Automatically update flatpak apps on activation, weekly. + update.auto.enable = true; + + # Provide additional places to get flatpaks from. + remotes = [ + { + name = "flathub"; + location = "https://flathub.org/repo/flathub.flatpakrepo"; + } + { + name = "kitinerary"; + location = "https://cdn.kde.org/flatpak/kitinerary-workbench-nightly/kitinerary-workbench-nightly.flatpakrepo"; + } + ]; + + }; +} diff --git a/nixos/configs/fonts-darwin.nix b/nixos/configs/fonts-darwin.nix new file mode 100644 index 0000000..f502c26 --- /dev/null +++ b/nixos/configs/fonts-darwin.nix @@ -0,0 +1,13 @@ +# +# Font configuration. +# Generally, don't edit this file. Instead, edit the linux fonts list. +# +# vim: et:ts=2:sw=2: +# +{ deprekages, ... }: +let + linuxConfig = (import ./fonts-linux.nix) { inherit deprekages; }; +in +{ + fonts.fonts = linuxConfig.fonts.packages; +} diff --git a/nixos/configs/fonts-linux.nix b/nixos/configs/fonts-linux.nix new file mode 100644 index 0000000..4223a8c --- /dev/null +++ b/nixos/configs/fonts-linux.nix @@ -0,0 +1,24 @@ +# +# Font configuration. +# +# vim: et:ts=2:sw=2: +# +{ deprekages, pkgs, ... }: +{ + fonts = { + packages = [ + deprekages.font-monolisa + deprekages.font-codicon + deprekages.font-manrope + pkgs.terminus-nerdfont + pkgs.terminus_font + ]; + + fontconfig.localConf = '' + + lcdlight + + ''; + + }; +} diff --git a/nixos/configs/gnome.nix b/nixos/configs/gnome.nix new file mode 100644 index 0000000..677876d --- /dev/null +++ b/nixos/configs/gnome.nix @@ -0,0 +1,36 @@ +# vim: et:ts=2:sw=2: +# +# Configruation for running a GNOME XServer +# +{ config, pkgs, ... }: + +{ + imports = [ + ./fonts.nix + ./gui-packages.nix + ]; + + # + # GUI setup. + # + + # Use plasma + X11. + services.xserver = { + enable = true; + + desktopManager.gnome.enable = true; + displayManager.gdm.enable = true; + }; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + +} diff --git a/nixos/configs/gui/default.nix b/nixos/configs/gui/default.nix new file mode 100644 index 0000000..fc9b744 --- /dev/null +++ b/nixos/configs/gui/default.nix @@ -0,0 +1,144 @@ +# vim: et:ts=2:sw=2: +{ + niri, + pkgs, + config, + ... +}: +{ + # Use niri. + nixpkgs.overlays = [ niri.overlays.niri ]; + imports = [ + + # Imports that add additional functionality + ./niri.nix + ./mako.nix + ./waybar.nix + ./nirilock-fancy.nix + + # Core niri import. + niri.nixosModules.niri + ( + { ... }: + { + + # Enable Niri system-wide. + programs.niri = { + enable = true; + package = pkgs.niri-unstable; + }; + + # We configure a cache ourselves; skip the upstream autoconf. + niri-flake.cache.enable = false; + } + ) + ]; + + environment.systemPackages = with pkgs; [ + wtype + wl-clipboard + brightnessctl + sddm-chili-theme + nirilock-fancy + + xdg-desktop-portal-gtk + xdg-desktop-portal-gnome + + # Terrible hack to type things in Wayland. + (pkgs.writeScriptBin "haxtype" '' + #!/usr/bin/env bash + + declare -A direct_windows=( + [\"org.gajim.Gajim\"]=1 + [\"nheko\"]=1 + ) + + # Get the current application ID; we'll use it to + appid=$(niri msg -j focused-window | ${pkgs.jq}/bin/jq .app_id) + + # If this is a Direct window, inject data from wtype directly. + if [[ -n "''${direct_windows[$appid]}" ]]; then + ${wtype}/bin/wtype "$1 " + echo "Using direct input!" + exit 0 + fi + + # If this is a Wezterm window, use its special text input. + if [[ $appid == \""org.wezfurlong.wezterm\"" ]]; then + wezterm cli send-text "$1 " + exit 0 + fi + + # + # Otherwise, use the clipboard (ugh). + # + TEMPFILE=$(${coreutils-full}/bin/coreutils --coreutils-prog=mktemp) + + # Save the clipboard. + ${wl-clipboard}/bin/wl-paste -n > $TEMPFILE + MIMETYPE=$(${wl-clipboard}/bin/wl-paste -l | head -n 1) + + # Type our our message. + echo -n "$1" | ${wl-clipboard}/bin/wl-copy + ${wtype}/bin/wtype -M Ctrl v -m Ctrl + ${wtype}/bin/wtype ' ' + + # Resetore the clipboard and clear our buffer. + cat $TEMPFILE | ${wl-clipboard}/bin/wl-copy -t $MIMETYPE + rm $TEMPFILE + '') + ]; + + xdg.portal = { + enable = true; + + # These enable common operations and screencasting. + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk + xdg-desktop-portal-gnome + ]; + }; + + # Set up everything per-user but niri; which is in its own module. + home-manager.users.deprekated = + { pkgs, config, ... }: + { + + # Use mako as a notification daemon. + services.mako = { + enable = true; + defaultTimeout = 10000; + }; + + # Use fuzzel as a launcher. + programs.fuzzel = { + enable = true; + settings.main.terminal = "wezterm"; + }; + }; + + # Use a graphical greeter. + services.displayManager = { + defaultSession = "niri"; + + sddm = { + enable = true; + autoNumlock = true; + wayland.enable = true; + theme = "chili"; + }; + }; + + # Use KDE connect. + programs.kdeconnect.enable = true; + + # Enable sound with pipewire. + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/nixos/configs/gui/mako.nix b/nixos/configs/gui/mako.nix new file mode 100644 index 0000000..7569819 --- /dev/null +++ b/nixos/configs/gui/mako.nix @@ -0,0 +1,24 @@ +# +# Uses Mako as a system notification daemon. +# +# vim: et:ts=2:sw=2: +# +{ ... }: +{ + + # Set up everything per-user but niri; which is in its own module. + home-manager.users.deprekated = + { pkgs, config, ... }: + { + + # Use mako as a notification daemon. + services.mako = { + enable = true; + defaultTimeout = 10000; + + width = 400; + height = 200; + }; + + }; +} diff --git a/nixos/configs/gui/niri.nix b/nixos/configs/gui/niri.nix new file mode 100644 index 0000000..61880df --- /dev/null +++ b/nixos/configs/gui/niri.nix @@ -0,0 +1,335 @@ +# +# Configure Niri, our wayland compositor. +# +# vim: et:ts=2:sw=2: +{ + lib, + pkgs, + niri, + ... +}: +let + niri-flake = niri; +in +{ + # Add in some basic control utilities to our system config. + environment.systemPackages = [ + pkgs.wlrctl + ]; + + # + # Niri configuration. + # + home-manager.users.deprekated = + { + pkgs, + config, + niri, + ... + }: + with lib; + let + binds = + { + suffixes, + prefixes, + substitutions ? { }, + }: + + # + # This quite-useful monstrosity stolen from @sodiboo. + # + let + replacer = replaceStrings (attrNames substitutions) (attrValues substitutions); + format = + prefix: suffix: + let + actual-suffix = + if isList suffix.action then + { + action = head suffix.action; + args = tail suffix.action; + } + else + { + inherit (suffix) action; + args = [ ]; + }; + + action = replacer "${prefix.action}-${actual-suffix.action}"; + in + { + name = "${prefix.key}+${suffix.key}"; + value.action.${action} = actual-suffix.args; + }; + pairs = + attrs: fn: + concatMap ( + key: + fn { + inherit key; + action = attrs.${key}; + } + ) (attrNames attrs); + in + listToAttrs (pairs prefixes (prefix: pairs suffixes (suffix: [ (format prefix suffix) ]))); + + xwayland-satellite-loop = pkgs.writeScriptBin "xwayland-satellite-loop" '' + #!${pkgs.bash}/bin/bash + + while true; do + ${niri-flake.packages."${pkgs.system}".xwayland-satellite-unstable}/bin/xwayland-satellite + done + ''; + in + { + + # + # Core Niri settings. + # + programs.niri.settings = { + + # Use Wayland programs when possible. + environment = { + NIXOS_OZONE_WL = "1"; + SHELL_TYPE = "prompt_toolkit"; + XDG_DATA_DIRS = "/var/lib/flatpak/exports/share:/home/deprekated/.nix-profile/share:/nix/profile/share:/home/deprekated/.local/state/nix/profile/share:/etc/profiles/per-user/deprekated/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share"; + + # Provided by xwayland-satellite below. + DISPLAY = ":0"; + }; + + # Avoid client-side decorations, when possible. + prefer-no-csd = true; + + # Don't show our hotkeys on startup. + hotkey-overlay.skip-at-startup = true; + + # + # Adjust our layouts. + # + layout = { + + # No wasted space between windows. + gaps = 0; + + # Default to half the screen. + default-column-width = { + proportion = 1.0 / 2.0; + }; + + # Set up the column widths for Meta+R. + preset-column-widths = [ + { proportion = 1.0 / 2.0; } + { proportion = 2.0 / 3.0; } + { proportion = 1.0 / 3.0; } + ]; + + # Improve the color of focused windows. + border = { + active = { + color = "#268BD2"; + }; + }; + }; + + # + # Keyboard, mouse, etc. settings. + # + input = { + + # Moving focus with the keyboard should move the mouse. + warp-mouse-to-focus = true; + + touchpad = { + + # No tap to click, but use the number of fingers to press + # multiple buttons. + tap = false; + tap-button-map = "left-right-middle"; + click-method = "clickfinger"; + + # Disable while typing. + dwt = true; + + # Use natural scrolling. + natural-scroll = true; + }; + + trackpoint = { + accel-speed = 0.2; + accel-profile = "flat"; + }; + + keyboard = { + # Make caps lock a second escape, and ralt a compose. + xkb.options = "caps:escape,compose:ralt"; + }; + }; + + # + # Per-application settings. + # + window-rules = [ + + # Wezterm workaround: wezterm gets sad when it + # doesn't get to set its own width, so let it. + { + matches = [ { app-id = "^org.wezfurlong.wezterm$"; } ]; + default-column-width = { }; + } + + # Bitwig needs to set its own width. + { + matches = [ { app-id = "^com.bitwig.BitwigStudio$"; } ]; + default-column-width = { }; + } + + # Let gamescope be fullscreen, by default. + { + matches = [ { app-id = "^gamescope$"; } ]; + default-column-width = { + proportion = 1.0; + }; + } + ]; + + # + # Key bindings. + # + binds = + with config.lib.niri.actions; + let + sh = spawn "sh" "-c"; + in + lib.attrsets.mergeAttrsList [ + { + # Kate keys. + "Mod+O".action = sh "haxtype '⚪O>'"; + "Mod+T".action = sh "haxtype '🔵T>'"; + "Mod+K".action = sh "haxtype '🟣K>'"; + "Mod+W".action = sh "haxtype '🟢W>'"; + "Mod+S".action = sh "haxtype '🔴S>'"; + "Mod+E".action = sh "haxtype '⚫E>'"; + + # Kate keys. + "Mod+F1".action = sh "haxtype ⑴"; + "Mod+F2".action = sh "haxtype ⑵"; + "Mod+F3".action = sh "haxtype ⑶"; + + "Print".action = screenshot; + + "Mod+Return".action = spawn "wezterm"; + "Mod+D".action = spawn "fuzzel"; + "Mod+Space".action = spawn "fuzzel"; + + "XF86AudioRaiseVolume".action = sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; + "XF86AudioLowerVolume".action = sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; + "XF86AudioMute".action = sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + + "XF86MonBrightnessDown".action = sh "brightnessctl set 10%-"; + "XF86MonBrightnessUp".action = sh "brightnessctl set 10%+"; + + "XF86Messenger".action = sh "rfkill toggle bluetooth"; + "XF86Go".action = sh "rfkill toggle wwan"; + "Cancel".action = sh "rfkill block nfc"; + "XF86Favorites".action = sh "mpc toggle"; + + # Lenovo buttons. + "0x47".action = sh "brightnessctl set 10%-"; + "0x48".action = sh "brightnessctl set 10%+"; + + "Mod+Q".action = close-window; + + "XF86AudioPrev".action = sh "mpc prev"; + "XF86AudioNext".action = sh "mpc next"; + "XF86AudioPlay".action = sh "mpc toggle"; + } + (binds { + suffixes."Left" = "column-left"; + suffixes."Down" = "window-down"; + suffixes."Up" = "window-up"; + suffixes."Right" = "column-right"; + prefixes."Mod" = "focus"; + prefixes."Mod+Ctrl" = "move"; + prefixes."Mod+Shift" = "focus-monitor"; + prefixes."Mod+Shift+Ctrl" = "move-window-to-monitor"; + substitutions."monitor-column" = "monitor"; + substitutions."monitor-window" = "monitor"; + }) + (binds { + suffixes."Home" = "first"; + suffixes."End" = "last"; + prefixes."Mod" = "focus-column"; + prefixes."Mod+Ctrl" = "move-column-to"; + }) + (binds { + suffixes."U" = "workspace-down"; + suffixes."I" = "workspace-up"; + prefixes."Mod" = "focus"; + prefixes."Mod+Ctrl" = "move-window-to"; + prefixes."Mod+Shift" = "move"; + }) + (binds { + suffixes = builtins.listToAttrs ( + map (n: { + name = toString n; + value = [ + "workspace" + n + ]; + }) (range 1 9) + ); + prefixes."Mod" = "focus"; + prefixes."Mod+Ctrl" = "move-window-to"; + }) + { + "Mod+Comma".action = consume-window-into-column; + "Mod+Period".action = expel-window-from-column; + + "Mod+R".action = switch-preset-column-width; + "Mod+F".action = maximize-column; + "Mod+Shift+F".action = fullscreen-window; + "Mod+C".action = center-column; + + "Mod+Minus".action = set-column-width "-10%"; + "Mod+Plus".action = set-column-width "+10%"; + "Mod+Shift+Minus".action = set-window-height "-10%"; + "Mod+Shift+Plus".action = set-window-height "+10%"; + + "Mod+Print".action = screenshot-window; + + "Mod+Shift+E".action = quit; + "Mod+Shift+P".action = power-off-monitors; + + "Mod+Shift+Ctrl+T".action = toggle-debug-tint; + } + ]; + + # Startup our wallpaper and our credential manager. + spawn-at-startup = + let + niri-init = pkgs.writeScriptBin "niri-init" '' + #!${pkgs.bash}/bin/bash + systemctl --user restart swaybg + niri msg action spawn -- gnome-keyring + + sleep 2 + + systemctl --user stop waybar + niri msg action spawn -- waybar + + sleep 2 + + niri msg action spawn -- ${xwayland-satellite-loop}/bin/xwayland-satellite-loop + niri msg action spawn -- home-assistant-desktop + + sleep 10 + + niri msg action spawn -- kdeconnect-cli -l + ''; + in + [ { command = [ "${niri-init}/bin/niri-init" ]; } ]; + }; + }; +} diff --git a/nixos/configs/gui/nirilock-fancy.nix b/nixos/configs/gui/nirilock-fancy.nix new file mode 100644 index 0000000..f75103c --- /dev/null +++ b/nixos/configs/gui/nirilock-fancy.nix @@ -0,0 +1,55 @@ +# +# Fixes an issue where pcsclite doesn't +# +# vim: et:ts=2:sw=2: +# +{ lib, pkgs, ... }: +let + + overlay = + final': prev': + let + depsPath = + with prev'; + lib.makeBinPath [ + coreutils + grim + gawk + jq + swaylock + imagemagick + getopt + fontconfig + wmctrl + ]; + + in + { + nirilock-fancy = prev'.swaylock-fancy.overrideAttrs ( + final: prev: { + + # Patch this to use niri instead of swaylock, and to increase the blur. + postPatch = '' + substituteInPlace swaylock-fancy \ + --replace-fail \ + "poutputs=\$(swaymsg -t get_outputs | jq -r '.[] | select(.active != false) | .name')" \ + "poutputs=\$(niri msg -j outputs | jq -r '.[] | .name')" \ + --replace-fail \ + "filter:sigma=1.5" \ + "filter:sigma=2.5" + ''; + + # Create our Nirilock script. + postInstall = '' + mv $out/bin/swaylock-fancy $out/bin/nirilock-fancy + wrapProgram $out/bin/nirilock-fancy \ + --prefix PATH : "${depsPath}" + ''; + + } + ); + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/configs/gui/waybar-yubikey.sh b/nixos/configs/gui/waybar-yubikey.sh new file mode 100755 index 0000000..f9d97d0 --- /dev/null +++ b/nixos/configs/gui/waybar-yubikey.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# +# Copied from: +# https://github.com/maximbaz/dotfiles/blob/40c0f7e/.local/bin/waybar-yubikey + +socket="${XDG_RUNTIME_DIR:-/run/user/$UID}/yubikey-touch-detector.socket" + +while true; do + touch_reasons=() + + if [ ! -e "$socket" ]; then + printf '{"text": "Waiting for YubiKey socket"}\n' + while [ ! -e "$socket" ]; do sleep 1; done + fi + printf '{"text": ""}\n' + + nc -U "$socket" | while read -n5 cmd; do + reason="${cmd:0:3}" + + if [ "${cmd:4:1}" = "1" ]; then + touch_reasons+=("$reason") + else + for i in "${!touch_reasons[@]}"; do + if [ "${touch_reasons[i]}" = "$reason" ]; then + unset 'touch_reasons[i]' + break + fi + done + fi + + if [ "${#touch_reasons[@]}" -eq 0 ]; then + printf '{"text": ""}\n' + else + tooltip="uwubikey wants to be touched, because ${touch_reasons[@]}" + printf '{"text": " 🔐 ", "tooltip": "%s"}\n' "$tooltip" + fi + done + + sleep 1 +done diff --git a/nixos/configs/gui/waybar.nix b/nixos/configs/gui/waybar.nix new file mode 100644 index 0000000..ce754d3 --- /dev/null +++ b/nixos/configs/gui/waybar.nix @@ -0,0 +1,517 @@ +# +# Use Waybar with our GUI. +# +# vim: et:ts=2:sw=2: +{ + lib, + pkgs, + deprekages, + config, + ... +}: +let + hostname = config.networking.hostName; + isSmallScreen = (hostname == "utol"); +in +{ + + # Pull in some dependencies for our bar. + environment.systemPackages = with pkgs; [ networkmanagerapplet ]; + + # Enable the yubikey touch detector, for our icon. + programs.yubikey-touch-detector.enable = true; + + # + # Set up our waybar configuration in home-manager. + # + home-manager.users.deprekated = + { pkgs, config, ... }: + let + + icons = rec { + calendar = "󰃭 "; + clock = " "; + puclock = "󱑆"; + cpu = ""; + ram = ""; + battery.charging = "󱐋"; + battery.horizontal = [ + " " + " " + " " + " " + " " + ]; + battery.vertical = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + battery.levels = battery.vertical; + network.disconnected = "󰤮 "; + network.ethernet = "󰈀 "; + network.strength = [ + "󰤟 " + "󰤢 " + "󰤥 " + "󰤨 " + ]; + bluetooth.on = "󰂯"; + bluetooth.off = "󰂲"; + bluetooth.battery = "󰥉"; + volume.source = "󱄠"; + volume.muted = "󰝟"; + volume.levels = [ + "󰕿" + "󰖀" + "󰕾" + ]; + idle = { + on = "󰅶"; + off = "󰾪"; + }; + vpn = "󰌆 "; + music = { + playing = ""; + paused = ""; + stopped = ""; + missing = "󰌙"; + }; + + speed = { + slow = "󰾆"; + medium = "󰾅"; + fast = "󰓅"; + }; + }; + colors = config.lib.stylix.colors; + + # Create a TODO-list handler. + waybar-todos = pkgs.writeScriptBin "waybar-todos" '' + #!${pkgs.python3}/bin/python3 + + import subprocess + import json + + def get_count(*filter): + return int(subprocess.run(['${pkgs.taskwarrior3}/bin/task', 'count', *filter], capture_output=True, text=True).stdout) + + def get_tasks(*filter): + return subprocess.run(['${pkgs.taskwarrior3}/bin/task', 'ls', *filter], capture_output=True, text=True).stdout + + priority = get_count("(+TODAY or +OVERDUE)", "priority:H") + due_today = get_count("+TODAY") + overdue = get_count("+OVERDUE") + + overdue_color = ' color="#dc322f" ' if overdue else ' color="#93a1a1" ' + overdue_text = " {overdue} ".format(overdue=overdue, overdue_color=overdue_color) if overdue else "" + + priority_text = ' 󱕈 {priority} '.format(priority=priority) if priority else "" + + today_color = "" if due_today else ' color="#93a1a1" ' + + data = {} + data['text'] = "{overdue_text}{priority_text}󰃶 {due_today} ".format(overdue_text=overdue_text, due_today=due_today, today_color=today_color, priority_text=priority_text) + data['tooltip'] = get_tasks("(+TODAY or +OVERDUE)") + + print(json.dumps(data)) + ''; + + # From the Waybar wiki. + waybar-events = pkgs.writeScriptBin "waybar-events" '' + #!${pkgs.python3}/bin/python3 + + import calendar + import subprocess + import datetime + import json + import html + import sys + + data = {} + + today = datetime.date.today().strftime("%Y-%m-%d") + next_week = (datetime.date.today() + + datetime.timedelta(days=10)).strftime("%Y-%m-%d") + tomorrow = (datetime.date.today() + + datetime.timedelta(days=1)).strftime("%Y-%m-%d") + + human_events = subprocess.check_output('khal list now ' + next_week, shell=True).decode('utf-8') + machine_events = subprocess.check_output('khal list now ' + next_week + ' -d "Holidays in United States" --once -f "{title}|{start-date}|{start-time}" -df ""', shell=True).decode('utf-8') + + if not machine_events: + sys.exit(0) + + next_event = machine_events.split("\n")[0] + event, date, time = next_event.split('|') + + # Generate our hover-over text. + lines = human_events.split("\n") + new_lines = [] + for line in lines: + if line.startswith("To hide observances") or (line == ""): + continue + + clean_line = html.escape(line).split(" ::")[0] + if len(clean_line) and not clean_line[0] in ['0', '1', '2']: + clean_line = "\n"+clean_line+"" if (',' in clean_line) else clean_line + + new_lines.append(clean_line) + tooltip = "\n".join(new_lines).strip() + + if tomorrow in date: + date = "tomorrow" + else: + weekday = datetime.datetime.fromisoformat(date).weekday() + date = calendar.day_name[weekday].lower() + + + # Add time suffixes when appropriate. + time_suffix = "" + if time: + time_suffix = " @ " + time + + date_suffix = "" + if today not in date: + date_suffix = ", " + date + + + # In the typical case, display the next event. + data['text'] = html.escape(" " + event[0:30] + date_suffix + time_suffix) + + # Display our nice, human-readable event ouptut on hover. + data['tooltip'] = tooltip + + # Finally, send the data to Waybar. + print(json.dumps(data)) + ''; + + waybar-title = pkgs.writeScriptBin "waybar-title" '' + #!${pkgs.bash}/bin/bash + niri msg --json focused-window | jq -c '{text: (if ((.title | length) > 40) then (.title[:38] + "…") else .title end), tooltip: .app_id}' | sed 's/&[ $]/\& /g' + ''; + + waybar-puck-countdown = pkgs.writeScriptBin "waybar-puck-countdown" '' + #!${pkgs.python3}/bin/python3 + + import json + + from datetime import datetime, timezone + + now = datetime.now(timezone.utc) + puck_day = "2024-09-01 17:57:00-06:00" + puck_time = datetime.fromisoformat(puck_day) + until = puck_time - now + + response = { + "text": f" 󰧒 {until.days}d {until.seconds // 60 // 60}h", + "tooltip": f"days until {puck_day}" + } + + print(json.dumps(response)) + ''; + + in + { + # + # Core Waybar settings. + # + programs.waybar = { + enable = true; + systemd.enable = true; + }; + programs.waybar.settings.mainBar = { + layer = "top"; + #mode = "overlay"; + + modules-left = [ + "clock" + #"clock#otherzone" + #"custom/puckdown" + "custom/todoist" + "mpd" + ]; + modules-center = [ + "custom/title" + "wlr/taskbar" + ]; + modules-right = [ + "tray" + "custom/events" + "privacy" + "custom/yubikey" + "wireplumber" + "battery" + ]; + + battery = { + interval = 5; + format = "{icon} {capacity}%"; + format-charging = "{icon} {capacity}% ${icons.battery.charging}"; + format-icons = icons.battery.levels; + states.warning = 30; + states.critical = 15; + }; + + cpu = { + format = "${icons.cpu} {usage}% @ {avg_frequency:0.1f}GHz"; + }; + + memory = { + format = "${icons.ram} {used:0.1f}G / {total:0.1f}G"; + }; + + clock = { + interval = 1; + format = "${icons.clock} {:%H:%M %A, %B %d %Z}"; + + tooltip-format = "${icons.calendar} {:%a, %Y-%m-%d}\n\n{calendar}"; + + calendar = { + mode = "month"; + format = { + weeks = "W{}"; + months = "{}"; + days = "{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + }; + + "clock#otherzone" = { + interval = 1; + format = "${icons.puclock} {:%H:%M %Z}"; + timezone = "Europe/Amsterdam"; + tooltip-format = '' + Homosexuality Statistics + + Homosexuality is online. + Homosexuality levels are CRITICAL. + ''; + }; + + network = { + on-click = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor"; + tooltip = false; + format-disconnected = icons.network.disconnected; + format-ethernet = "${icons.network.ethernet}"; + format-wifi = "{icon} {essid}"; + format-icons = icons.network.strength; + }; + + bluetooth = { + format = "{icon}"; + format-disabled = "{icon}"; + format-icons = { + inherit (icons.bluetooth) on off; + connected = icons.bluetooth.on; + }; + format-connected = "{icon} {device_alias}"; + }; + "bluetooth#battery" = { + format = ""; + format-connected-battery = "${icons.bluetooth.battery} {device_battery_percentage}%"; + }; + + wireplumber = { + on-click = "${pkgs.pavucontrol}/bin/pavucontrol -t 1"; + format = "{icon} {volume}%"; + tooltip-format = "${icons.volume.source} {node_name}"; + format-muted = "${icons.volume.muted}"; + format-icons = icons.volume.levels; + reverse-scrolling = 1; + }; + + # Displays an icon when our yubikey is waiting for touch. + "custom/yubikey" = { + exec = ./waybar-yubikey.sh; + return-type = "json"; + }; + + "custom/todoist" = { + exec = "${waybar-todos}/bin/waybar-todos"; + exec-on-even = false; + return-type = "json"; + interval = 60; + on-click = "${deprekages.todoist-electron}/bin/todoist-electron --ozone-platform-hint=auto"; + tooltip = true; + }; + + "custom/events" = { + exec = "${waybar-events}/bin/waybar-events"; + format = "{}"; + tooltip = true; + return-type = "json"; + interval = 60; + on-click = "${pkgs.wezterm}/bin/wezterm start ikhal"; + }; + + "custom/title" = { + exec = "${waybar-title}/bin/waybar-title"; + format = "{}"; + tooltip = true; + return-type = "json"; + interval = 1; + }; + + "custom/puckdown" = { + exec = "${waybar-puck-countdown}/bin/waybar-puck-countdown"; + format = "{}"; + tooltip = true; + return-type = "json"; + interval = 60 * 5; + }; + + "wlr/taskbar" = { + format = "{icon}"; + tooltip-format = "{app_id}"; + + on-click = "activate"; + }; + + tray = { + icon-size = 21; + spacing = 10; + }; + + # Display indicators when we're sharing video or audio. + privacy = { + icon-spacing = 4; + icon-size = 18; + transition-duration = 250; + modules = [ + { + type = "screenshare"; + tooltip = false; + tooltip-icon-size = 24; + } + { + type = "audio-out"; + tooltip = false; + tooltip-icon-size = 24; + } + { + type = "audio-in"; + tooltip = false; + tooltip-icon-size = 24; + } + ]; + }; + + mpd = { + on-click = "mpc toggle"; + format = "${icons.music.playing} {artist} - {title}"; + format-paused = "${icons.music.paused} {artist} - {title}"; + format-stopped = ""; + format-disconnected = "${icons.music.missing}"; + tooltip-format = "${icons.music.playing} {artist} - {title}"; + max-length = 60; + }; + + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = icons.idle.on; + deactivated = icons.idle.off; + }; + + tooltip-format-activated = "System blocked from going idle."; + tooltip-format-deactivated = "System allowed to go idle."; + }; + }; + stylix.targets.waybar.enable = false; + programs.waybar.style = + let + colors = config.lib.stylix.colors; + modules = s: "${s ".modules-left"}, ${s ".modules-center"}, ${s ".modules-right"}"; + module = s: modules (m: "${m} > ${s} > *"); + in + '' + * { + border: none; + font-family: ${config.stylix.fonts.monospace.name}; + font-weight: 400; + font-size: ${if isSmallScreen then "17" else toString config.stylix.fonts.sizes.desktop}px; + color: #${colors.base06}; + } + + window#waybar { + background: #${colors.base00}; + } + + #taskbar button { + padding: 0 0.4em; + } + + #taskbar button.active { + background: #${colors.base01}; + } + + #tray image, + #taskbar image { + -gtk-icon-transform: scale(0.75); + margin: -5px -4px; + padding: 0px 2px; + } + + ${modules lib.id} { + margin: 0; + } + + ${module "*"} { + padding: 0 5px; + margin: 0; + font-size: 75%; + } + + ${module ":not(:first-child)"} { + border-left: 1px solid #${colors.base01}; + } + + ${module ":not(:last-child)"} { + border-right: 1px solid #${colors.base01}; + } + + #battery.charging { + color: #${colors.green}; + } + + #battery.warning:not(.charging) { + color: #${colors.yellow}; + } + + #battery.critical:not(.charging) { + animation: critical-blink steps(8) 1s infinite alternate; + } + + @keyframes critical-blink { + to { + color: #${colors.red}; + } + } + ''; + + # + # Restart waybar when niri starts. + # + programs.niri.settings.spawn-at-startup = [ + { + command = [ + "systemctl" + "--user" + "restart" + "waybar" + ]; + } + { command = [ "nm-applet" ]; } + ]; + }; +} diff --git a/nixos/configs/headless.nix b/nixos/configs/headless.nix new file mode 100644 index 0000000..9fd49b4 --- /dev/null +++ b/nixos/configs/headless.nix @@ -0,0 +1,27 @@ +# vim: et:ts=2:sw=2: +{ config, pkgs, ... }: + +{ + # + # Xrdp, for being able to connect via Windows clients. + # + services.xserver = { + enable = true; + displayManager.sddm.enable = true; + desktopManager.plasma5.enable = true; + }; + + services.xrdp = { + enable = true; + defaultWindowManager = "${pkgs.fluxbox}/bin/fluxbox"; + }; + networking.firewall.allowedTCPPorts = [ 3389 ]; + + # + # x2go, for connecting from macOS and Linux + # + services.x2goserver = { + enable = true; + settings = { }; + }; +} diff --git a/nixos/configs/hm-gui.nix b/nixos/configs/hm-gui.nix new file mode 100644 index 0000000..20018a6 --- /dev/null +++ b/nixos/configs/hm-gui.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +{ + # Support packages. + home.packages = with pkgs; [ + xdg-desktop-portal + wezterm + mesa + roxterm + ]; + + # + # XOrg setup. + # + xsession = { + enable = true; + + # Use i3 as our primary window manager on HM-managed sessions. + windowManager.i3 = { + enable = true; + + config = { + modifier = "Mod4"; + + terminal = "${pkgs.wezterm}/bin/wezterm"; + }; + }; + }; +} diff --git a/nixos/configs/i915-sriov.nix b/nixos/configs/i915-sriov.nix new file mode 100644 index 0000000..593eb42 --- /dev/null +++ b/nixos/configs/i915-sriov.nix @@ -0,0 +1,39 @@ +# +# Configuration for using SR-IOV with i915. +# +# vim: et:ts=2:sw=2: +# +{ deprekages, pkgs, ... }: +{ + # Use looking-glass a as a viewer for SRIOV. + imports = [ + ./looking-glass.nix + ]; + + # Support Intel device SRIOV. + boot = { + # Use our kernel, with its specialized config. + kernelPackages = deprekages.linuxPackages_i915-sriov; + kernelParams = [ + "iommu=pt" + "intel_iommu=on" + "i915.enable_guc=3" + "i915.max_vfs=7" + ]; + + # This replaces the i915 module with an extended one. + extraModulePackages = [ deprekages.i915-sriov ]; + }; + + # Make a virtual function for a VM ready and available on VM start. + virtualisation.libvirtd.hooks.qemu = { + + ready_sriov = pkgs.writeScript "sriov.sh" '' + #!${pkgs.bash}/bin/bash + echo 0 > /sys/devices/pci0000:00/0000:00:02.0/sriov_drivers_autoprobe + echo 1 > /sys/devices/pci0000:00/0000:00:02.0/sriov_numvfs + ''; + + }; + +} diff --git a/nixos/configs/include-conf.nix b/nixos/configs/include-conf.nix new file mode 100644 index 0000000..2c7e3ae --- /dev/null +++ b/nixos/configs/include-conf.nix @@ -0,0 +1,14 @@ +# +# Configuration snippet to include source files in a build. +# +# vim: et:ts=2:sw=2: +# +{ config, pkgs, ... }: +{ + # Make the current contents of the dotfiles repo show up at + # /etc/captured_dotfiles, so we can always find the source of the + # system closure we were built against. (This is excellent for bisecting + # generations to see where a problem started; or for passing a generation + # to another machine without encapsulating the store data.) + environment.etc.captured_dotfiles.source = ../../.; +} diff --git a/nixos/configs/lenovo-nfc-userland.nix b/nixos/configs/lenovo-nfc-userland.nix new file mode 100644 index 0000000..13a4839 --- /dev/null +++ b/nixos/configs/lenovo-nfc-userland.nix @@ -0,0 +1,31 @@ +# +# Configuration for Lenovo NFC readers. +# +{ + deprekages, + config, + pkgs, + ... +}: +{ + # Provide libnfc for working with the hardware. + environment.systemPackages = [ + deprekages.libnfc + ]; + + # Build the kernel module that provides access to libnfc, + # and ensure it's preferred over hard NFC. + boot.extraModulePackages = [ + (pkgs.callPackage ../../packages/linux-nfc-lenovo { + linuxPackages = config.boot.kernelPackages; + }) + ]; + boot.blacklistedKernelModules = [ + "nxp_nci" + "nxp_nci_i2c" + ]; + + # Finally, ensure we have access to the device. + services.udev.packages = [ deprekages.linux-nfc-lenovo-udev-rules ]; + +} diff --git a/nixos/configs/looking-glass.nix b/nixos/configs/looking-glass.nix new file mode 100644 index 0000000..aab9c51 --- /dev/null +++ b/nixos/configs/looking-glass.nix @@ -0,0 +1,46 @@ +# +# Looking glass for virtualization on machines that can do +# GPU passthrough. +# +# vim: et:ts=2:sw=2: +{ + pkgs, + ... +}: +{ + + # + # Setup instructions. + # + + # 1. Install looking glass in the guest VM. + # Be sure to get a matching version. + # 2. If using an NVIDIA GPU, hook the encoder using the following patches: + # https://github.com/keylase/nvidia-patch/tree/master/win + # -> DLLs are included in ../../looking-glass-contrib. + # -> Rename %WINDIR%\system32\NvFBC64.dll -> %WINDIR%\system32\NvFBC64_.dll + # -> Copy the `nvfbcwrp64.dll` to %WINDIR%\system32\NvFBC64.dll. + # -> Rename %WINDIR%\SysWOW64\NvFBC.dll -> %WINDIR%\SysWow64\NvFBC_.dll + # -> Copy the `nvfbcwrp32.dll` to %WINDIR%\SysWOW64\NvFBC.dll. + # 3. Install https://github.com/ge9/IddSampleDriver onto the machine. + # -> Be sure to install its root cert by running the included batch file. + # -> Preferably use the Device Manager or devcon to install this. + # -> A copy is included ../../looking-glass-contrib. + # 4. Disable the e.g. QXL video device in the VM. + # 5. Start the VM and the looking glass client. + + # + # NixOS configuration. + # + + # Create the SHM file we'll use for display. + systemd.tmpfiles.rules = [ + "f /dev/shm/looking-glass 0660 deprekages kvm -" + ]; + + # Provide the looking-glass client. + environment.systemPackages = [ + pkgs.looking-glass-client + ]; + +} diff --git a/nixos/configs/mount-fastmail-tmllc.nix b/nixos/configs/mount-fastmail-tmllc.nix new file mode 100644 index 0000000..cb235b8 --- /dev/null +++ b/nixos/configs/mount-fastmail-tmllc.nix @@ -0,0 +1,37 @@ + +## Automatically mount our rsync.net backup site. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +{ + config = { + systemd.services.fastmail-tmllc-mount = { + description = "fastmail-tmllc mount"; + + # Start once we're online. + wantedBy = [ "default.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + + # Run using our local rclone config. + environment = { + HOME = "/home/deprekated"; + }; + + # Ensure our mountpoint exists. + preStart = '' + ${pkgs.umount}/bin/umount /home/deprekated/tmllc-fastmail || true + mkdir -p /home/deprekated/tmllc-fastmail + ''; + + # Run rclone mount. + serviceConfig = { + Type = "notify"; + + ExecStart = "${pkgs.rclone}/bin/rclone mount --allow-other --uid 1000 --gid 100 --file-perms 600 --dir-perms 700 --vfs-cache-mode full tmllc:/ /home/deprekated/tmllc-fastmail"; + Restart = "on-failure"; + }; + }; + }; +} diff --git a/nixos/configs/mount-rsync-kate.nix b/nixos/configs/mount-rsync-kate.nix new file mode 100644 index 0000000..8ff2b07 --- /dev/null +++ b/nixos/configs/mount-rsync-kate.nix @@ -0,0 +1,37 @@ +# +# Automatically mount our rsync.net backup site. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +{ + config = { + systemd.services.rsync-kate = { + description = "rsync-kate mount"; + + # Start once we're online. + wantedBy = [ "default.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + + # Run using our local rclone config. + environment = { + HOME = "/home/deprekated"; + }; + + # Ensure our mountpoint exists. + preStart = '' + ${pkgs.umount}/bin/umount /home/deprekated/rsync-kate || true + mkdir -p /home/deprekated/rsync-kate + ''; + + # Run rclone mount. + serviceConfig = { + Type = "notify"; + + ExecStart = "${pkgs.rclone}/bin/rclone mount --allow-other --uid 1000 --gid 100 --file-perms 600 --dir-perms 700 --vfs-cache-mode full rsync-kate:. /home/deprekated/rsync-kate"; + Restart = "on-failure"; + }; + }; + }; +} diff --git a/nixos/configs/music-server.nix b/nixos/configs/music-server.nix new file mode 100644 index 0000000..fa0eabd --- /dev/null +++ b/nixos/configs/music-server.nix @@ -0,0 +1,37 @@ +# +# Configuration for machines that should run our music server. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +{ + + home-manager.users.deprekated = + { pkgs, config, ... }: + { + + # Use mopidy as our music server. + services.mopidy = { + enable = true; + + extensionPackages = with pkgs; [ + mopidy-iris + mopidy-mpd + mopidy-tidal + mopidy-bandcamp + ]; + + settings = { + + # Use tidal, for now. + tidal = { + enabled = true; + quality = "LOSSLESS"; + }; + + }; + }; + + }; + +} diff --git a/nixos/configs/nfc-kernel.nix b/nixos/configs/nfc-kernel.nix new file mode 100644 index 0000000..956319e --- /dev/null +++ b/nixos/configs/nfc-kernel.nix @@ -0,0 +1,12 @@ +# +# Configuration for Lenovo NFC readers. +# +{ deprekages, ... }: +{ + # This is equivalent to services.neard.enable, but uses our fixup'd package. + environment.systemPackages = [ deprekages.neard ]; + services.dbus.packages = [ deprekages.neard ]; + + systemd.packages = [ deprekages.neard ]; + systemd.services.neard.enable = true; +} diff --git a/nixos/configs/nix.droid.nix b/nixos/configs/nix.droid.nix new file mode 100644 index 0000000..e7d062c --- /dev/null +++ b/nixos/configs/nix.droid.nix @@ -0,0 +1,21 @@ +# +# General nix settings. +# +# vim: et:ts=2:sw=2: +# +{ config, ... }: +{ + nix = { + # Use nix, lix, and our local cache. + substituters = [ + "https://cache.nixos.org" + "https://cache.lix.systems" + "https://niri.cachix.org" + ]; + trustedPublicKeys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" + "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" + ]; + }; +} diff --git a/nixos/configs/nix.nix b/nixos/configs/nix.nix new file mode 100644 index 0000000..1d2f358 --- /dev/null +++ b/nixos/configs/nix.nix @@ -0,0 +1,52 @@ +# +# General nix settings. +# +# vim: et:ts=2:sw=2: +# +{ config, ... }: +{ + + nix = { + settings = { + + # Use nix, lix, and our local cache. + substituters = [ + "https://cache.nixos.org" + "https://cache.lix.systems" + "https://niri.cachix.org" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" + "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" + ]; + + }; + + # For non-trailblazer machines, allow building on Trailblazer. + distributedBuilds = !(config.networking.hostName == "trailblazer"); + buildMachines = + if config.nix.distributedBuilds then + [ + { + system = "x86_64-linux"; + protocol = "ssh"; + + hostName = "trailblazer.kate.ts.polytheon.org"; + + sshUser = "deprekated"; + sshKey = "/home/deprekated/.ssh/id_ed25519"; + + maxJobs = 24; + speedFactor = 25; + } + ] + else + [ ]; + }; + + nixpkgs.config.permittedInsecurePackages = [ + "olm-3.2.16" + ]; + +} diff --git a/nixos/configs/power-saving.nix b/nixos/configs/power-saving.nix new file mode 100644 index 0000000..52b8812 --- /dev/null +++ b/nixos/configs/power-saving.nix @@ -0,0 +1,40 @@ +# +# Laptop power-saving configuration. +# +# vim: et:ts=2:sw=2: +# +{ config, pkgs, ... }: +{ + # Keep our thermals nice and happy. + services.thermald.enable = true; + + # Set up a power saving policy manager. + services.tlp = { + enable = true; + settings = { + + # Keep our battery healthy, when possible. + # Comment this out before trips or etc, if needed. + START_CHARGE_THRESH_BAT0 = 75; + STOP_CHARGE_THRESH_BAT0 = 80; + + # + # Battery optimizations, so we don't burn through power as hard. + # + + # Don't run bluetooth or cellular unless we turn them on explicitly. + DEVICES_TO_DISABLE_ON_STARTUP = "bluetooth"; + + # Conserve power harder when on battery, and push performance harder on AC. + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + PLATFORM_PROFILE_ON_BAT = "low-power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + PLATFORM_PROFILE_ON_AC = "performance"; + + # Disable turbo boost on battery. + CPU_BOOST_ON_BAT = 0; + CPU_HWP_DYN_BOOST_ON_BAT = 0; + + }; + }; +} diff --git a/nixos/configs/printing.nix b/nixos/configs/printing.nix new file mode 100644 index 0000000..d56e268 --- /dev/null +++ b/nixos/configs/printing.nix @@ -0,0 +1,42 @@ +# +# Configures a machine to print. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +{ + services.printing = { + + # Run as a "stateless" service in which printing is + # configrued via Nix. + enable = true; + stateless = true; + + drivers = [ + pkgs.canon-cups-ufr2 + ]; + }; + + # + # Printers. + # + hardware.printers = { + + ensurePrinters = [ + { + name = "Canon_MF4800"; + location = "Laundry Room"; + deviceUri = "socket://192.168.50.239:9100"; + model = "file://CNRCUPSMF4800ZS.ppd"; + ppdOptions = { + PageSize = "Letter"; + }; + } + ]; + + ensureDefaultPrinter = "Canon_MF4800"; + }; + + # Enables config uis. + services.system-config-printer.enable = true; +} diff --git a/nixos/configs/serve-cache.nix b/nixos/configs/serve-cache.nix new file mode 100644 index 0000000..902f802 --- /dev/null +++ b/nixos/configs/serve-cache.nix @@ -0,0 +1,23 @@ +# +# Configuration for serving a binary cache from a machine. +# +{ config, ... }: +{ + # Build our basic store service... + services.nix-serve = { + enable = true; + secretKeyFile = "/var/cache-priv-key.pem"; + }; + + # ... and serve it over tailscale. + services.nginx = { + enable = true; + recommendedProxySettings = true; + + virtualHosts = { + "${config.networking.hostName}.kate.ts.polytheon.org" = { + locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}"; + }; + }; + }; +} diff --git a/nixos/configs/storage-optimization.nix b/nixos/configs/storage-optimization.nix new file mode 100644 index 0000000..b7de5b2 --- /dev/null +++ b/nixos/configs/storage-optimization.nix @@ -0,0 +1,18 @@ +# +# Configuration for systems that have limited storage, or which should +# otherwise have automatic cleanup and optimization of the store. +# +# vim: et:ts=2:sw=2: +# +{ config, pkgs, ... }: + +{ + # Enable automatic GC to keep this system light. + nix.gc = { + automatic = true; + options = "--delete-older-than 14d"; + }; + + # Enable storage optimization, when possible. + nix.settings.auto-optimise-store = true; +} diff --git a/nixos/configs/stylix/default.nix b/nixos/configs/stylix/default.nix new file mode 100644 index 0000000..450d428 --- /dev/null +++ b/nixos/configs/stylix/default.nix @@ -0,0 +1,57 @@ +# +# Theming for Nix. +# +# vim: et:ts=2:sw=2: +{ stylix, ... }: +{ + imports = [ + stylix.nixosModules.stylix + ( + { pkgs, config, ... }: + { + stylix = { + enable = true; + image = ./sapphic_mountains.png; + + polarity = "dark"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/solarized-dark.yaml"; + fonts.monospace.package = pkgs.callPackage ../../../fonts/monolisa.nix { }; + fonts.monospace.name = "MonoLisa"; + + fonts.sansSerif.package = pkgs.ubuntu-sans; + fonts.sansSerif.name = "Ubuntu Nerd Font"; + fonts.serif = config.stylix.fonts.sansSerif; + + fonts.sizes.applications = 12; + fonts.sizes.desktop = 12; + + cursor.package = pkgs.phinger-cursors; + cursor.name = "phinger-cursors-light"; + cursor.size = 24; + }; + } + ) + ]; + + home-manager.users.deprekated = + { + lib, + pkgs, + config, + ... + }: + { + systemd.user.services."swaybg" = { + Unit = { + Description = "wallpapers! brought to you by stylix!"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + Requisite = [ "graphical-session.target" ]; + }; + Service = { + ExecStart = "${pkgs.swaybg}/bin/swaybg -i ${config.stylix.image}"; + Restart = "on-failure"; + }; + }; + }; +} diff --git a/nixos/configs/stylix/sapphic_mountains.png b/nixos/configs/stylix/sapphic_mountains.png new file mode 100644 index 0000000..c667aaf Binary files /dev/null and b/nixos/configs/stylix/sapphic_mountains.png differ diff --git a/nixos/configs/ubuntu-container.nix b/nixos/configs/ubuntu-container.nix new file mode 100644 index 0000000..7c2135a --- /dev/null +++ b/nixos/configs/ubuntu-container.nix @@ -0,0 +1,12 @@ +# +# Config for systems that want a Ubuntu container available. +# +# vim: et:ts=2:sw=2: +# +{ config, pkgs, ... }: + +{ + # Use LXD as our container host. + virtualisation.lxd.enable = true; + virtualisation.lxc.lxcfs.enable = true; +} diff --git a/nixos/configs/udev.nix b/nixos/configs/udev.nix new file mode 100644 index 0000000..6a73676 --- /dev/null +++ b/nixos/configs/udev.nix @@ -0,0 +1,25 @@ +# +# udev rules, in general +# +# vim: et:ts=2:sw=2: +# +{ deprekages, pkgs, ... }: +{ + services.udev = { + + packages = [ + deprekages.ykush-udev-rules + deprekages.hantek-udev-rules + deprekages.dreamsource-udev-rules + deprekages.humanfx + pkgs.numworks-udev-rules + pkgs.android-udev-rules + ]; + + extraRules = '' + # Brother p-touch cube + SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "20af", MODE = "0666" + ''; + + }; +} diff --git a/nixos/configs/virt-host.nix b/nixos/configs/virt-host.nix new file mode 100644 index 0000000..468e460 --- /dev/null +++ b/nixos/configs/virt-host.nix @@ -0,0 +1,24 @@ +# +# Hypervisor configuration using KVM. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +{ + virtualisation.libvirtd.enable = true; + + # Enable USB passthrough. + virtualisation.spiceUSBRedirection.enable = true; + + # Set our system to use libvirt, too. + boot.kernelModules = [ + "kvm-amd" + "kvm-intel" + ]; + environment.systemPackages = with pkgs; [ + libvirt + virtiofsd + virt-manager + spice-gtk + ]; +} diff --git a/nixos/configs/vmware.nix b/nixos/configs/vmware.nix new file mode 100644 index 0000000..75f6d7a --- /dev/null +++ b/nixos/configs/vmware.nix @@ -0,0 +1,17 @@ +# +# VMware virtualization for non-passthrough VMs. +# +# vim: et:ts=2:sw=2: +{ + pkgs, + ... +}: +{ + + # Use VMWare, and not KVM. + virtualisation.vmware.host.enable = true; + environment.systemPackages = [ + pkgs.vmware-workstation + ]; + +} diff --git a/nixos/configs/waydroid.nix b/nixos/configs/waydroid.nix new file mode 100644 index 0000000..77e051d --- /dev/null +++ b/nixos/configs/waydroid.nix @@ -0,0 +1,13 @@ +# +# Waydroid support. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +{ + virtualisation.waydroid.enable = true; + + environment.systemPackages = with pkgs; [ + waydroid + ]; +} diff --git a/nixos/configs/weechat/default.nix b/nixos/configs/weechat/default.nix new file mode 100644 index 0000000..da4e138 --- /dev/null +++ b/nixos/configs/weechat/default.nix @@ -0,0 +1,68 @@ +# +# Configuration that sets up our local weechat env. +# +# vim: et:ts=2:sw=2: +# +{ + pkgs, + lib, + deprekages, + ... +}: +let + + # + # WeeChat. + # + + # List each of the scripts we want to use. + scripts = with pkgs.weechatScripts; [ + colorize_nicks + wee-slack + weechat-matrix + weechat-notify-send + ]; + + # Create an easy way to + script-initializers-list = map ( + script: "/script load ${script}/share/${lib.lists.head script.scripts}" + ) scripts; + script-initializers = builtins.concatStringsSep "\n" script-initializers-list; + + # Create a customized weechat. + weechat = pkgs.weechat.override { + configure = + { availablePlugins, ... }: + { + plugins = (builtins.attrValues availablePlugins) ++ [ deprekages.weechat-discord ]; + + # Load our plugins on startup, and set up our color theme. + init = '' + ${script-initializers} + + /set weechat.bar.status.color_bg 0 + /set weechat.bar.title.color_bg 0 + /set weechat.color.chat_nick_colors 1,2,3,4,5,6 + /set buffers.color.hotlist_message_fg 7 + /set weechat.bar.buffers.position top + + /set buflist.format.buffer ''${format_number}''${cut:20,...,''${format_nick_prefix}''${format_name}} + ''; + + }; + }; +in +{ + + # Use signald, so we can connect up to signal. + services.signald = { + enable = true; + user = "deprekated"; + }; + + # Provide weechat, and related packages. + environment.systemPackages = with pkgs; [ + signaldctl + weechat + ]; +} diff --git a/nixos/configuration.darwin.nix b/nixos/configuration.darwin.nix new file mode 100644 index 0000000..f6be9f3 --- /dev/null +++ b/nixos/configuration.darwin.nix @@ -0,0 +1,231 @@ +# +# NixOS-ish configuration for macOS machines, via nix-darwin. +# +# vim: et:ts=2:sw=2: +# +{ config, pkgs, ... }: + +{ + # Allow non-free packages. + nixpkgs.config.allowUnfree = true; + + # Our core user account. + users.users.deprekated = { + name = "deprekated"; + home = "/Users/deprekated"; + }; + + # Use our default configuration.nix scheme. + environment.darwinConfig = "/Users/deprekated/dotfiles/nixos/configuration.nix"; + + # Use xonsh as our default shell. + environment.loginShell = "/run/current-system/sw/bin/xonsh"; + + # Xonsh is currently broken in unstable. + # Add a harmless workaround to all of our systems. + imports = [ + ./overlays/always-wrap-xonsh.nix + ]; + + # Use macOS's terminfo directories by default. + # Squish our user in there, too. + environment.variables.TERMINFO_DIRS = [ + "/usr/share/terminfo" + "/Users/deprekated/.terminfo" + ]; + + # Auto upgrade nix package and the daemon service. + services.nix-daemon.enable = true; + + # Use font configuration like in normal NixOS. + fonts.fontDir.enable = true; + + # Allow use of e.g. 'nix search'. + nix.settings.trusted-users = [ "deprekated" ]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 4; + + # + # macOS Configruation + # + system.defaults = { + + # OS-level configuration. + NSGlobalDomain = { + + # Always use dark mode. + AppleInterfaceStyle = "Dark"; + + # Don't use two-finger swipes as 'back' and 'forward'. + AppleEnableSwipeNavigateWithScrolls = false; + AppleEnableMouseSwipeNavigateWithScrolls = false; + + # Allow full-OS keyboard control. + AppleKeyboardUIMode = 3; + + # Disable press-and-hold for keys in favor of key repeat. + ApplePressAndHoldEnabled = true; + + # Always show file extensions in Finder. + AppleShowAllExtensions = true; + + # Speed up our key repeat. + KeyRepeat = 2; + InitialKeyRepeat = 10; + + # In general, have Apple not mess with our text. + NSAutomaticCapitalizationEnabled = false; + NSAutomaticDashSubstitutionEnabled = false; + NSAutomaticPeriodSubstitutionEnabled = false; + NSAutomaticQuoteSubstitutionEnabled = null; + NSAutomaticSpellingCorrectionEnabled = false; + + # Don't automatically terminate inactive apps. + NSDisableAutomaticTermination = false; + + # Always start with Save dialog panels expanded. + NSNavPanelExpandedStateForSaveMode = true; + NSNavPanelExpandedStateForSaveMode2 = true; + + }; + + # More than just the dock configruation; also controls hot corners. + dock = { + autohide = true; + + # Put the dock on the left side of the screen, where we won't have to see it. + orientation = "left"; + + # Make the dock as tiny as possible, so we don't really see it. + tilesize = 16; + + # Disable hot corners. + wvous-bl-corner = 1; + wvous-br-corner = 1; + wvous-tl-corner = 1; + wvous-tr-corner = 1; + }; + + finder = { + # Necessary for true finder, instead of Finder embeds. + AppleShowAllExtensions = true; + + # Don't show icons on the desktop. + CreateDesktop = false; + + # Search in the current folder, instead of the whole mac. + FXDefaultSearchScope = "SCcf"; + + # Don't warn us on changing a file extension. + FXEnableExtensionChangeWarning = false; + + # Defeault to the list view in Finder windows. + FXPreferredViewStyle = "Nlsv"; + + # Show the pathbar, which gives us breadcrumbs to the current folder. + ShowPathbar = true; + + # Show the status bar, which has some useful metadata. + ShowStatusBar = true; + + # Use the POSIX path in the finder title, rather than just the folder name. + _FXShowPosixPathInTitle = true; + + }; + + # Don't provide a Guest account. + loginwindow.GuestEnabled = false; + + # Default to capturing screenshots in PNG. + screencapture.type = "png"; + + # TODO: validate and enable these + CustomUserPreferences = { + + # Don't play system UI sounds. + "NSGlobalDomain"."com.apple.sound.uiaudio.enabled" = 0; + + # Avoid creating .DS_Store files on network or USB volumes. + "com.apple.desktopservices" = { + DSDontWriteNetworkStores = true; + DSDontWriteUSBStores = true; + }; + + ## Increase bluetooth sound quality at the cost of a little RAM. + "com.apple.BluetoothAudioAgent"."Apple Bitpool Min (editable)" = 80; + + # Enable AirDrop over Ethernet + "com.apple.NetworkBrowser".BrowseAllInterfaces = true; + + ## Don't show the touchbar or sidebar in Sidecar. + "com.apple.sidecar.display" = { + showTouchbar = false; + showSidebar = false; + }; + + ## Finder options not yet internalized by Nix. + "com.apple.finder" = { + # Start new Finder sessions in our home folder. + NewWindowTarget = "PfLo"; + NewWindowTargetPath = "file://\${HOME}"; + + # Keep folders at the top of the Finder lists. + _FXSortFoldersFirst = true; + }; + + ## Configure raycast so it's already set up for us. + "com.raycast.macos" = { + + # Pretend this isn't a new install. + onboardingCompleted = 1; + onboarding_showTasksProgress = 0; + amplitudePulseAnalyticsTracker_didSendInstallationEvent = 1; + showGettingStartedLink = 0; + raycastAnonymousId = "0FA9106D-B1ED-4CEE-AEE3-DD578111EEC1"; + raycastGlobalHotkey = "Command-49"; + raycastInstallationDate = "2023-07-21 20:00:16 +0000"; + raycastLoginItemAutoInstalled = "2023-07-21 20:00:17 +0000"; + + # Misc configuration. + showFavoritesInCompactMode = 0; + raycastShouldFollowSystemAppearance = 0; + raycastPreferredWindowMode = "compact"; + raycastCurrentThemeId = "bundled-raycast-dark"; + raycastCurrentThemeIdDarkAppearance = "bundled-raycast-dark"; + }; + + }; + + # We don't bother configuring spotlight, here, since + # Raycast works much, much better with Nix, as it supports symliks. + + }; + + # Use CapsLock as a second escape key. + system.keyboard = { + enableKeyMapping = true; + remapCapsLockToEscape = true; + }; + + # Run extra initialization on provisioning. + environment.extraInit = '' + # Show the ~/Library folder + chflags nohidden /home/deprekated/Library + + # Show the /Volumes folder + chflags nohidden /Volumes + ''; + + # Fix Trelllis' database path by linking it into the environment. + environment.postBuild = '' + mkdir -p ''${out}/share/trellis + ln -s ${pkgs.lib.lists.last pkgs.trellis.srcs} ''${out}/share/trellis/database + ''; + +} diff --git a/nixos/configuration.droid.nix b/nixos/configuration.droid.nix new file mode 100644 index 0000000..eed4f37 --- /dev/null +++ b/nixos/configuration.droid.nix @@ -0,0 +1,29 @@ +{ pkgs, deprekages, ... }: +{ + + nix.package = pkgs.lix; + + environment.motd = ""; + + # Use xonsh. + user.shell = "${deprekages.xonsh-with-xontribs}/bin/xonsh"; + + # Get some basic packages in our env. + environment.packages = with pkgs; [ + inetutils + deprekages.xonsh-with-xontribs + ]; + + # Termux tool support. + android-integration = { + am.enable = true; + termux-open.enable = true; + termux-open-url.enable = true; + termux-reload-settings.enable = true; + termux-setup-storage.enable = true; + termux-wake-lock.enable = true; + termux-wake-unlock.enable = true; + unsupported.enable = true; + xdg-open.enable = true; + }; +} diff --git a/nixos/configuration.linux.nix b/nixos/configuration.linux.nix new file mode 100644 index 0000000..60f48f9 --- /dev/null +++ b/nixos/configuration.linux.nix @@ -0,0 +1,107 @@ +# +# Our generic NixOS configuration for all systems. +# Individual machines are set up in ../flake.nix and their ./hosts entries. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, deprekages, ... }: + +{ + # Ensures the system state isn't changed breakingly (e.g. by updating + # a program to a version that takes a newer data format) from the version + # listed here. + system.stateVersion = "23.11"; + + # + # Generic system settings. + # + time.timeZone = "America/Denver"; + #time.timeZone = "Europe/Amsterdam"; + i18n.defaultLocale = "en_GB.utf8"; + + # Allow use of e.g. 'nix search' and flakes. + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + # Allow use of unfree software. + nixpkgs.config.allowUnfree = true; + + # You can trust us. I swear. + nix.settings.trusted-users = [ "deprekated" ]; + + # Xonsh is currently broken in unstable. + # Add a harmless workaround to all of our systems. + imports = [ + ./overlays/always-wrap-xonsh.nix + ]; + + # + # General tweaks and fixes. + # + + # Make systemd not hang here forever. + systemd.extraConfig = "DefaultTimeoutStopSec=20"; + + # + # Users. + # + + # Create a device groups, which are useful for USB stuffs. + users.groups.plugdev = { }; + users.groups.input = { }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.deprekated = { + isNormalUser = true; + description = "Kate Adkins"; + uid = 1000; + + extraGroups = [ + "audio" + "disk" + "dialout" + "libvirtd" + "networkmanager" + "plugdev" + "qmemu-libvirtd" + "video" + "wheel" + "input" + "kvm" + ]; + + # Use xonsh as our default shell. + shell = deprekages.xonsh-with-xontribs; + }; + + programs.xonsh = { + enable = true; + package = deprekages.xonsh-with-xontribs; + }; + + # + # Services + # + services.pcscd.enable = true; + services.openssh.enable = true; + virtualisation.docker.enable = true; + + services.udev.packages = [ + pkgs.minipro + ]; + + services.fwupd.enable = true; + + # Use avahi for local DNS. + services.avahi = { + enable = true; + nssmdns4 = true; + nssmdns6 = true; + publish = { + enable = true; + userServices = true; + }; + }; +} diff --git a/nixos/hosts/ashyn.nix b/nixos/hosts/ashyn.nix new file mode 100644 index 0000000..7ab4c7b --- /dev/null +++ b/nixos/hosts/ashyn.nix @@ -0,0 +1,64 @@ +# +# Per-system configuration for Ashyn. +# +# vim: et:ts=2:sw=2: +# +{ + config, + deprekages, + pkgs, + lib, + modulesPath, + ... +}: +{ + system.stateVersion = "23.11"; + + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "ashyn"; + networking.firewall.enable = false; + + networking.wireless.iwd = { + enable = true; + settings.General.EnableNetworkConfiguration = true; + + }; + + # + # Hardware config. + # + + boot.initrd.availableKernelModules = [ "usb_storage" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/6e249370-ed24-4628-954e-84a2c435c153"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1D37-3AD8"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/nixos/hosts/braize.nix b/nixos/hosts/braize.nix new file mode 100644 index 0000000..80d002a --- /dev/null +++ b/nixos/hosts/braize.nix @@ -0,0 +1,67 @@ +# +# Per-system configuration for Braize. +# +# vim: et:ts=2:sw=2: +# +{ + config, + deprekages, + pkgs, + lib, + modulesPath, + ... +}: +{ + system.stateVersion = "23.11"; + + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "braize"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + # + # Hardware config. + # + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/050c80f9-4668-4ee0-90a1-00e8daad0075"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/4A2B-515B"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/design.nix b/nixos/hosts/design.nix new file mode 100644 index 0000000..cebb67f --- /dev/null +++ b/nixos/hosts/design.nix @@ -0,0 +1,24 @@ +{ deprekages, lib, ... }: +{ + + system.stateVersion = "24.05"; + + # Use OpenKeychain on Android + environment.packages = [ + deprekages.okc-agents + ]; + + # Set up nix for flakes + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + + # Set your time zone + time.timeZone = "America/Denver"; + + # Design on nix-on-droid requires a different username/dir. + home-manager.config = { + home.username = lib.mkForce "nix-on-droid"; + home.homeDirectory = lib.mkForce "/data/data/com.termux.nix/files/home"; + }; +} diff --git a/nixos/hosts/hinata.nix b/nixos/hosts/hinata.nix new file mode 100644 index 0000000..532d9a4 --- /dev/null +++ b/nixos/hosts/hinata.nix @@ -0,0 +1,100 @@ +# +# Per-system configuration for Hinata. +# +# vim: et:ts=2:sw=2: +# +{ + config, + deprekages, + pkgs, + lib, + modulesPath, + ... +}: +{ + system.stateVersion = "23.11"; + + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "hinata"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + # This is a local machine, rather than our typical network-accesed ones. + # Run an ssh-agent locally. + programs.ssh.startAgent = true; + + # + # Niri configuration for our monitors. + # + home-manager.users.deprekated.programs.niri.settings = { + outputs."eDP-1".scale = 2.0; + }; + + # Override stylix font sizes. + stylix.fonts.sizes.desktop = lib.mkForce 18; + + # Restart waybar when niri starts. + home-manager.users.deprekated.programs.niri.settings.spawn-at-startup = [ + { + command = [ + "modem-manager-gui" + "--invisible" + ]; + } + ]; + + # + # Hardware config. + # + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "thunderbolt" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/af2b4691-8c2d-42a5-8201-84e3cfea5465"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/0388-1879"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wwan0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.opengl = { + enable = true; + driSupport = true; + }; +} diff --git a/nixos/hosts/komashi/cellular.nix b/nixos/hosts/komashi/cellular.nix new file mode 100644 index 0000000..70736c7 --- /dev/null +++ b/nixos/hosts/komashi/cellular.nix @@ -0,0 +1,140 @@ +# +# Cellular configuration for Komashi. +# +# vim: et:ts=2:sw=2: +# +{ + pkgs, + deprekages, + ... +}: +{ + config = { + + # + # Set up ModemManager to FCC unlock this device. + # + environment.etc."ModemManager/fcc-unlock.d/8086:7560" = { + text = '' + #!${pkgs.bash}/bin/bash + + # SPDX-License-Identifier: CC0-1.0 + # 2024 Stoica Floris + # + # Lenovo-shipped XMM7560 (8086:7560) FCC unlock + + # Ensure we can touch coreutils. + PATH=$PATH:${pkgs.coreutils}/bin + + if [[ "$FCC_UNLOCK_DEBUG_LOG" == '1' ]]; then + exec 3>&1 4>&2 + trap 'exec 2>&4 1>&3' 0 1 2 3 + exec 1>>/var/log/mm-xmm7560-fcc.log 2>&1 + fi + + # require program name and at least 2 arguments + [ $# -lt 2 ] && exit 1 + + # first argument is DBus path, not needed here + shift + + # second and next arguments are control port names + for PORT in "$@"; do + # match port type in Linux 5.14 and newer + ${pkgs.gnugrep}/bin/grep -q AT "/sys/class/wwan/$PORT/type" 2>/dev/null && { + AT_PORT=$PORT + break + } + # match port name in Linux 5.13 + echo "$PORT" | ${pkgs.gnugrep}/bin/grep -q AT && { + AT_PORT=$PORT + break + } + done + + # fail if no AT port exposed + [ -n "$AT_PORT" ] || exit 2 + + DEVICE=/dev/''${AT_PORT} + + at_command() { + exec 99<>"$DEVICE" + echo -e "$1\r" >&99 + read answer <&99 + read answer <&99 + echo "$answer" + exec 99>&- + } + + log() { + echo "$1" + } + + error() { + echo "$1" >&2 + } + + reverseWithLittleEndian() { + num="$1" + printf "%x" $(("0x''${num:6:2}''${num:4:2}''${num:2:2}''${num:0:2}")) + } + + VENDOR_ID_HASH="3df8c719" + + for i in {1..9}; do + sleep 2 + log "Requesting challenge from WWAN modem (attempt #''${i})" + RAW_CHALLENGE=$(at_command "at+gtfcclockgen") + CHALLENGE=$(echo "$RAW_CHALLENGE" | ${pkgs.gnugrep}/bin/grep -o '0x[0-9a-fA-F]\+' | ${pkgs.gawk}/bin/awk '{print $1}') + + if [ -n "$CHALLENGE" ]; then + log "Got challenge from modem: $CHALLENGE" + HEX_CHALLENGE=$(printf "%08x" "$CHALLENGE") + REVERSE_HEX_CHALLENGE=$(reverseWithLittleEndian "''${HEX_CHALLENGE}") + COMBINED_CHALLENGE="''${REVERSE_HEX_CHALLENGE}''${VENDOR_ID_HASH}" + RESPONSE_HASH=$(printf "%s" "$COMBINED_CHALLENGE" | ${pkgs.xxd}/bin/xxd -r -p | sha256sum | cut -d ' ' -f 1) + TRUNCATED_RESPONSE=$(printf "%.8s" "''${RESPONSE_HASH}") + REVERSED_RESPONSE=$(reverseWithLittleEndian "$TRUNCATED_RESPONSE") + RESPONSE=$(printf "%d" "0x''${REVERSED_RESPONSE}") + + log "Sending hash modem: $RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+gtfcclockver=$RESPONSE") + log "at+gtfcclockver response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+gtfcclockmodeunlock") + log "at+gtfcclockmodeunlock response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+cfun=1") + log "at+cfun response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(at_command "at+gtfcclockstate") + log "at+gtfcclockstate response = $UNLOCK_RESPONSE" + UNLOCK_RESPONSE=$(echo "$UNLOCK_RESPONSE" | tr -d '\r') + + at_command "at+xdns=0,1" + sleep 1 + + if [ "$UNLOCK_RESPONSE" = "1" ]; then + log "FCC was unlocked previously" + exit 0 + fi + + if [ "$UNLOCK_RESPONSE" = "OK" ]; then + log "FCC unlock success" + exit 0 + else + error "Unlock failed. Got response: $UNLOCK_RESPONSE" + fi + else + error "Failed to obtain FCC challenge. Got: ''${RAW_CHALLENGE}" + fi + + sleep 0.5 + done + + exit 2 + ''; + + # Let anyone execute this. + mode = "555"; + }; + }; + +} diff --git a/nixos/hosts/komashi/default.nix b/nixos/hosts/komashi/default.nix new file mode 100644 index 0000000..d383a9e --- /dev/null +++ b/nixos/hosts/komashi/default.nix @@ -0,0 +1,164 @@ +# +# Per-system configuration for Komashi. +# +# vim: et:ts=2:sw=2: +# +{ + lib, + pkgs, + config, + modulesPath, + ... +}: +{ + system.stateVersion = "23.11"; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ./cellular.nix + ]; + + # Bootloader. + boot.loader.systemd-boot = { + enable = true; + + # Include the UEFI shell. + extraFiles = { + "efi/shell/shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi"; + }; + extraEntries = { + "shell.conf" = '' + title UEFI Shell + efi /efi/shell/shell.efi + sort-key z_shell + ''; + }; + }; + + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "komashi"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + # This is a local machine, rather than our typical network-accesed ones. + # Run an ssh-agent locally. + programs.ssh.startAgent = true; + + # Support our Thunderbolt3 port. + services.hardware.bolt.enable = true; + + # Support our fingerprint reader. + services.fprintd.enable = true; + + # Support bluetooth. + hardware.bluetooth = { + enable = true; + powerOnBoot = false; + + settings = { + General = { + + # Support A2DP. + Enable = "Source,Sink,Media,Socket"; + + # Enable experimental featurees, like reading device battery levels. + Experimental = true; + }; + + }; + }; + + services.blueman.enable = true; + + # + # Niri configuration for our monitors. + # + # + home-manager.users.deprekated = { + programs.niri.settings = { + + # Left monitor. + outputs."DP-3" = { + position = { + x = 0; + y = 0; + }; + scale = 1.0; + }; + + # Laptop screen. + outputs."eDP-1" = { + position = { + x = 1920; + y = 0; + }; + scale = 1.0; + }; + + # Right monitor. + outputs."DP-1" = { + position = { + x = 1920 * 2; + y = 0; + }; + scale = 1.0; + }; + }; + + # Also position waybar on only one monitor. + programs.waybar.settings.mainBar.output = "eDP-1"; + }; + + # Override stylix font sizes. + stylix.fonts.sizes.desktop = lib.mkForce 24; + + # + # Hardware config. + # + boot.initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + "thunderbolt" + ]; + boot.initrd.kernelModules = [ ]; + + boot.kernelModules = [ + "kvm-intel" + "thunderbolt" + "acpi_call" + ]; + boot.extraModulePackages = [ config.boot.kernelPackages.acpi_call ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/d1b23c80-a9d3-4142-a26f-2318018d767d"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/0958-3417"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.docker0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/laudna.nix b/nixos/hosts/laudna.nix new file mode 100644 index 0000000..1926212 --- /dev/null +++ b/nixos/hosts/laudna.nix @@ -0,0 +1,105 @@ +# +# Per-system configuration for Laudna. +# +# vim: et:ts=2:sw=2: +# +{ + config, + deprekages, + pkgs, + lib, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + networking.hostName = "laudna"; + + # + # CLion server support (experimental). + # + nixpkgs.overlays = [ (import ../overlays/clion/default.nix) ]; + environment.systemPackages = [ + pkgs.jetbrains.clion + pkgs.dsview + ]; + + # + # Hardware setup. + # + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + boot.loader.systemd-boot.memtest86.enable = true; + + # As a build server, Laudna should never sleep. + systemd.targets.sleep.enable = false; + systemd.targets.suspend.enable = false; + systemd.targets.hibernate.enable = false; + systemd.targets.hybrid-sleep.enable = false; + + # + # Drivers + # + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.opengl.enable = true; + hardware.opengl.driSupport = true; + hardware.enableRedistributableFirmware = true; + hardware.nvidia.modesetting.enable = true; + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; + + boot.kernelPackages = pkgs.linuxPackages_latest; + + # + # Services. + # + networking.networkmanager.enable = true; + services.onedrive.enable = true; + + # + # Extra packages for Laudna. + # + + # + # Hardware configuration. + # + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/14ed4687-28ab-4c74-822f-137e785e8acd"; + fsType = "ext4"; + }; + + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/B368-B3DB"; + fsType = "vfat"; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/4d40dc84-693f-4ac9-ac08-c374ada4bbbd"; } ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/pike/default.nix b/nixos/hosts/pike/default.nix new file mode 100644 index 0000000..bf08448 --- /dev/null +++ b/nixos/hosts/pike/default.nix @@ -0,0 +1,109 @@ +# +# Per-system configuration for Pike. +# +# vim: et:ts=2:sw=2: +# +{ + config, + deprekages, + pkgs, + lib, + modulesPath, + ... +}: +{ + system.stateVersion = "23.11"; + + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "pike"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + # This is a local machine, rather than our typical network-accesed ones. + # Run an ssh-agent locally. + programs.ssh.startAgent = true; + + # Fingerprint reader! + services.fprintd.enable = true; + + # + # Rotate the screen. + # + boot.kernelParams = [ "fbcon=rotate:1" ]; + + # Wayland+weston doesn't seem to rotate properly, so we'll run SDDM on X. + services.displayManager.sddm.wayland.enable = lib.mkForce false; + services.xserver = { + enable = true; + displayManager = { + + # Rotate SDDM. + setupCommands = '' + ${pkgs.xorg.xrandr}/bin/xrandr --output DSI-1 --auto --rotate right; + ''; + }; + + }; + + # + # Niri configuration. + # + home-manager.users.deprekated.programs.niri.settings = { + outputs."DSI-1".transform.rotation = 270; + + input.touchpad = { + tap = false; + }; + + }; + # Override stylix font sizes. + stylix.fonts.sizes.desktop = lib.mkForce 12; + + # + # Hardware config. + # + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + services.hardware.bolt.enable = true; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/d1b23c80-a9d3-4142-a26f-2318018d767d"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/0958-3417"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp175s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp174s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/pike/rotate-touch.sh b/nixos/hosts/pike/rotate-touch.sh new file mode 100755 index 0000000..b2ceafb --- /dev/null +++ b/nixos/hosts/pike/rotate-touch.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +xinput set-prop 'pointer:Goodix Capacitive TouchScreen' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1 diff --git a/nixos/hosts/roshar.nix b/nixos/hosts/roshar.nix new file mode 100644 index 0000000..36bfc9a --- /dev/null +++ b/nixos/hosts/roshar.nix @@ -0,0 +1,17 @@ +# +# Per-system configuration for Roshar. +# +# vim: et:ts=2:sw=2: +# +{ config, pkgs, ... }: + +{ + # Set this machine's hostname. + networking.computerName = "roshar"; + networking.hostName = "roshar"; + networking.localHostName = "roshar"; + system.defaults.smb.ServerDescription = "roshar"; + + # Enable automatic GC to keep this system light. + nix.gc.automatic = true; +} diff --git a/nixos/hosts/tohru.nix b/nixos/hosts/tohru.nix new file mode 100644 index 0000000..058dc8a --- /dev/null +++ b/nixos/hosts/tohru.nix @@ -0,0 +1,93 @@ +# +# Per-system configuration for Valere. +# +# vim: et:ts=2:sw=2: +# +{ + config, + lib, + deprekages, + modulesPath, + ... +}: +{ + system.stateVersion = "23.11"; + + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "tohru"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + # This is a local machine, rather than our typical network-accesed ones. + # Run an ssh-agent locally. + programs.ssh.startAgent = true; + + # + # Niri configuration for our monitors. + # + + # Disabled until we replace the monitor on this. + #home-manager.users.deprekated.programs.niri.settings = { + # outputs."eDP-1".scale = 2.0; + #}; + + # Override stylix font sizes. + stylix.fonts.sizes.desktop = lib.mkForce 24; + + # Save power! + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", ATTR{power/control}="auto" + ''; + + # + # Hardware config. + # + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + # Disallow nouveau so the NVIDIA device is available for VFIO. + boot.blacklistedKernelModules = [ "nouveau" ]; + boot.extraModprobeConfig = '' + options nouveau modeset=0 + ''; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/8d5584ce-527a-471b-bbb9-d4c0de3eb579"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/5B5B-5C98"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/trailblazer/default.nix b/nixos/hosts/trailblazer/default.nix new file mode 100644 index 0000000..06494b8 --- /dev/null +++ b/nixos/hosts/trailblazer/default.nix @@ -0,0 +1,273 @@ +# +# Per-system configuration for Trailblazer. +# +# vim: et:ts=2:sw=2: +# +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +let + ledOffScript = pkgs.writeScriptBin "ledsoff" '' + #!${pkgs.bash}/bin/bash + openrgb -d 0 -m off -b 0 + openrgb -d 1 -m off -b 0 + openrgb -d 2 -m off -b 0 + openrgb -d 3 -m off -b 0 + openrgb -d 4 -m off -b 0 + openrgb -d "Corsair Lighting Node Pro" -m direct -z 0 -s 100 -b 0 -c black + openrgb -d "Corsair Lighting Node Pro" -m direct -z 1 -s 100 -b 0 -c black + ''; + + ledOnScript = pkgs.writeScriptBin "ledson" '' + #!${pkgs.bash}/bin/bash + openrgb -d 0 -m direct -c $1 -b 100 + openrgb -d 1 -m direct -c $1 -b 100 + openrgb -d 2 -m direct -c $1 -b 100 + openrgb -d 3 -m direct -c $1 -b 100 + openrgb -d 4 -m direct -c $1 -b 100 + openrgb -d "Corsair Lighting Node Pro" -m direct -z 0 -s 100 -b 100 -c $1 + openrgb -d "Corsair Lighting Node Pro" -m direct -z 1 -s 100 -b 100 -c $1 + ''; + + commandScript = pkgs.writeScriptBin "trailblazer-command-daemon" '' + #!${pkgs.xonsh}/bin/xonsh + + print("[I] Trailblazer command service started. Waiting for command.") + print("----------------------------") + + for verb in !(${pkgs.mosquitto}/bin/mosquitto_sub -h fuuka -t trailblazer/command): + verb = verb.strip() + + if verb == "lights/off": + print("[I] Got a 'lights out' request. Making things quiet.") + + # Turn off monitors on each niri session, + sockets = g`/var/run/user/1000/niri*.sock` + for socket in sockets: + print(f"[I] Turning off monitors on niri instance {socket}.") + !(env NIRI_SOCKET=@(socket) niri msg action power-off-monitors) + + print("[I] Turning off RGB leds.") + !(${ledOffScript}/bin/ledsoff) + + print("[I] Everything should be... well, not-shiny, captain!") + + if verb == "lights/ledsoff": + print("[I] Turning off RGB leds.") + !(${ledOffScript}/bin/ledsoff) + + elif verb == "lights/o": + print("[I] Setting lights to 'sight colors.") + !(${ledOnScript}/bin/ledson white) + + elif verb == "lights/t": + print("[I] Setting lights to tsu colors.") + !(${ledOnScript}/bin/ledson blue) + + elif verb == "lights/k": + print("[I] Setting lights to Kaye colors.") + !(${ledOnScript}/bin/ledson purple) + + elif verb == "lights/w": + print("[I] Setting lights to Whim colors.") + !(${ledOnScript}/bin/ledson green) + + elif verb == "lights/s": + print("[I] Setting lights to Scar colors.") + !(${ledOnScript}/bin/ledson red) + + elif verb == "lights/e": + print("[I] Setting lights to Echo colors.") + !(${ledOnScript}/bin/ledson gray) + + elif verb == "suspend": + print("[I] Going to sleep, as requested.") + !(systemctl suspend) + + else: + print(f"[W] ignoring unknown verb '{verb}'") + + print("----------------------------") + ''; +in +{ + system.stateVersion = "23.11"; + + imports = [ + #./ups.nix + (modulesPath + "/installer/scan/not-detected.nix") + ../../configs/build-machine-users.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "trailblazer"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + # This is a local machine, rather than our typical network-accesed ones. + # Run an ssh-agent locally. + programs.ssh.startAgent = true; + + # Let fuse run as our user and still mount with proper perms. + programs.fuse.userAllowOther = true; + + # Optimize our system for virtualisation. + boot.kernelPackages = pkgs.linuxPackages_zen; + + # Disallow nouveau so the NVIDIA device is available for VFIO. + boot.blacklistedKernelModules = [ "nouveau" ]; + + # Allow IOMMU members to be sorted into their own groups for passthrough. + boot.kernelParams = [ + "iommu=on" + "amd_iommu=on" + "pcie_acs_override=downstream,multifunction" + ]; + + # Enable fingerprint reader. + services.fprintd.enable = true; + + # + # Niri configuration for our monitors. + # + home-manager.users.deprekated = { + + programs.niri.settings = { + + # Top monitor. + outputs."DP-2" = { + scale = 1.0; + position = { + x = 0; + y = 0; + }; + }; + + # Bottom monitor. + outputs."DP-3" = { + scale = 1.0; + position = { + x = 0; + y = 1440; + }; + mode = { + width = 3440; + height = 1440; + refresh = 144.0; + }; + }; + + # Right, vertical monitor. + # Note that the y position here makes the monitor not -so- offset. + outputs."HDMI-A-1" = { + scale = 1.0; + position = { + x = 3440; + y = 1440; + }; + }; + + input.tablet.map-to-output = "HDMI-A-1"; + }; + + # Also position waybar on only one monitor. + programs.waybar.settings.mainBar.output = "DP-3"; + }; + + # Override stylix font sizes. + stylix.fonts.sizes.desktop = lib.mkForce 16; + + # Use kwin for sddm instead of westin, to account for multi-monitor. + services.displayManager.sddm.wayland.compositor = "kwin"; + + # Use OpenRGB so we can silence our LEDs when appropriate. + services.hardware.openrgb = { + enable = true; + package = pkgs.openrgb-with-all-plugins; + motherboard = "amd"; + }; + + # Provide docker for remote tasks. + virtualisation.docker.enable = true; + users.users.deprekated.extragroups = [ "docker" ]; + + # + # Trailblazer remote service (allows trailblazer things to be controlled via Home Assistant. + # + systemd.services.trailblazer-commands = { + description = "trailblazer command service"; + + # Start once we're online. + wantedBy = [ "default.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + + script = "${commandScript}/bin/trailblazer-command-daemon"; + }; + + # + # Hardware config. + # + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + "dm-raid" + ]; + boot.initrd.kernelModules = [ ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; + boot.kernelModules = [ + "kvm-amd" + "v4l2loopback" + ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/nix"; + fsType = "xfs"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-label/home"; + fsType = "xfs"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp26s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp25s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + boot.swraid.enable = true; + boot.swraid.mdadmConf = '' + MAILADDR kate@ktemk.in + ARRAY /dev/md/nixos:0 level=raid0 num-devices=2 metadata=1.2 UUID=325ee7dc:7fcc6062:635e902f:af2552dc + devices=/dev/nvme0n1p1,/dev/nvme1n1p1 + ''; +} diff --git a/nixos/hosts/trailblazer/ups.nix b/nixos/hosts/trailblazer/ups.nix new file mode 100644 index 0000000..fae874d --- /dev/null +++ b/nixos/hosts/trailblazer/ups.nix @@ -0,0 +1,60 @@ +# +# Uninterruptable power supply configuration. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +let + upspass = "upsaccess"; +in +{ + # Create a user to run the UPS daemon. + services.openssh.settings.DenyUsers = [ "ups" ]; + users.users.ups = { + isSystemUser = true; + password = upspass; + group = "ups"; + shell = "/bin/false"; + }; + users.groups.ups = { }; + + power.ups = { + enable = true; + upsd.enable = true; + + users.deprekated = { + instcmds = [ "all" ]; + actions = [ + "set" + "fsd" + ]; + upsmon = "primary"; + passwordFile = "${pkgs.writeText "password" upspass}"; + }; + + # Serve a single UPS. + ups.lix = { + description = "UPS guarding the TMLLC build server and the Lix build cluster."; + + driver = "usbhid-ups"; + port = "auto"; + directives = [ + "vendorid = '051D'" + "productid = '0002'" + "product = 'Back-UPS NS 1500M2 FW:957.e5 .D USB FW:e5'" + "serial = '5B2333T55573'" + "vendor = 'American Power Conversion'" + "bus = '009'" + ]; + }; + + upsmon = { + enable = true; + monitor.lix = { + powerValue = 1; + user = "deprekated"; + }; + }; + + }; +} diff --git a/nixos/hosts/utol/cellular.nix b/nixos/hosts/utol/cellular.nix new file mode 100644 index 0000000..046e752 --- /dev/null +++ b/nixos/hosts/utol/cellular.nix @@ -0,0 +1,53 @@ +# +# Cellular configuration for Scadrial. +# +# vim: et:ts=2:sw=2: +# +{ + pkgs, + ... +}: +{ + config = { + + # + # Set up ModemManager to FCC unlock this device. + # + environment.etc."ModemManager/fcc-unlock.d/1eac:1001" = { + text = '' + #!${pkgs.bash}/bin/sh + + # require program name and at least 2 arguments + [ $# -lt 2 ] && exit 1 + + # first argument is DBus path, not needed here + shift + + # second and next arguments are control port names + for PORT in "$@"; do + # match port type in Linux 5.14 and newer + grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null && { + MBIM_PORT=$PORT + break + } + # match port name in Linux 5.13 + echo "$PORT" | grep -q MBIM && { + MBIM_PORT=$PORT + break + } + done + + # fail if no MBIM port exposed + [ -n "$MBIM_PORT" ] || exit 2 + + # run mbimcli operation + ${pkgs.libmbim}/bin/mbimcli --device-open-proxy --device="/dev/$MBIM_PORT" --quectel-set-radio-state=on + exit $? + ''; + + # Let anyone execute this. + mode = "555"; + }; + }; + +} diff --git a/nixos/hosts/utol/default.nix b/nixos/hosts/utol/default.nix new file mode 100644 index 0000000..e94fe2c --- /dev/null +++ b/nixos/hosts/utol/default.nix @@ -0,0 +1,125 @@ +# +# Per-system configuration for Utol +# +# vim: et:ts=2:sw=2: +# +{ + lib, + pkgs, + config, + modulesPath, + ... +}: +{ + system.stateVersion = "23.11"; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ./cellular.nix + ./power-saving.nix + ]; + + # Bootloader. + boot.loader.systemd-boot = { + enable = true; + + # Include the UEFI shell. + extraFiles = { + "efi/shell/shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi"; + }; + extraEntries = { + "shell.conf" = '' + title UEFI Shell + efi /efi/shell/shell.efi + sort-key z_shell + ''; + }; + + }; + + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "utol"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + # This is a local machine, rather than our typical network-accesed ones. + # Run an ssh-agent locally. + programs.ssh.startAgent = true; + + # Support our fingerprint reader. + services.fprintd.enable = true; + + # Support finer Ryzen control. + hardware.cpu.amd.ryzen-smu.enable = true; + programs.ryzen-monitor-ng.enable = true; + environment.systemPackages = [ + pkgs.ryzenadj + ]; + + # Support bluetooth. + hardware.bluetooth = { + enable = true; + powerOnBoot = false; + + settings = { + General = { + + # Support A2DP. + Enable = "Source,Sink,Media,Socket"; + + # Enable experimental featurees, like reading device battery levels. + Experimental = true; + }; + + }; + }; + + services.blueman.enable = true; + + # Override stylix font sizes. + stylix.fonts.sizes.desktop = lib.mkForce 18; + + # + # Hardware config. + # + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/f71b83c9-c375-4684-8671-7770dfe3db89"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/5295-6CD7"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/18677338-4b9c-4241-9a2e-2ecb53163968"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp2s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/utol/power-saving.nix b/nixos/hosts/utol/power-saving.nix new file mode 100644 index 0000000..a11e3ef --- /dev/null +++ b/nixos/hosts/utol/power-saving.nix @@ -0,0 +1,50 @@ +# +# Power Saving configuration for utol. +# FIXME: module this +# +{ pkgs, deprekages, ... }: +let + + ppdConfig = pkgs.writeText "ryzen-ppd.conf" '' + [ryzenadj] + limits = ["stapm_limit", "fast_limit", "slow_limit", "apu_slow_limit", "tctl_temp", "apu_skin_temp_limit"] + monitor = stapm_limit + + # Profiles contain power and thermal limits in the same order as the limit names defined in the + # [ryzenadj] section. The following table shows settings recorded in Windows while moving the power + # slider and running 'ryzenadj -i'. On Linux the balanced profile was the default. Additionally a + # custom profile with slightly increased limits is included. + # Format: JSON array of integers. Defaults: None + [profiles] + battery = [ 11000, 8800, 8800, 12000, 70, 45 ] + low-power = [ 11000, 9900, 9900, 13500, 70, 45 ] + balanced = [ 20000, 20000, 15000, 15000, 86, 45 ] + performance = [ 30000, 30000, 28000, 17000, 96, 64 ] + + [ac] + profile = performance + update_rate_s = 4 + + [battery] + profile = low-power + update_rate_s = 32 ''; + +in +{ + # Set up upower to notify ryzen-ppd... + services.upower.enable = true; + + # ... and ryzen-ppd itself to run our configruation. + systemd.services.ryzen-ppd = { + description = "ryzen power management configuration"; + wantedBy = [ "default.target" ]; + + # Run rclone mount. + serviceConfig = { + Type = "simple"; + + ExecStart = "${deprekages.ryzen-ppd}/bin/ryzen-ppd -c ${ppdConfig}"; + Restart = "on-failure"; + }; + }; +} diff --git a/nixos/hosts/valere.nix b/nixos/hosts/valere.nix new file mode 100644 index 0000000..5bd3f8f --- /dev/null +++ b/nixos/hosts/valere.nix @@ -0,0 +1,109 @@ +# +# Per-system configuration for Valere. +# +# vim: et:ts=2:sw=2: +# +{ + config, + lib, + deprekages, + modulesPath, + ... +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "valere"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + # This is a local machine, rather than our typical network-accesed ones. + # Run an ssh-agent locally. + programs.ssh.startAgent = true; + + # Provide support for our RGB controller. + # Note on valere in particular this requires our overlay. + environment.systemPackages = [ + deprekages.humanfx + deprekages.dell.fan + deprekages.dell.bios-fan-control + ]; + + # + # Niri configuration for our monitors. + # + home-manager.users.deprekated.programs.niri.settings = { + outputs."eDP-1".scale = 1.5; + }; + + # Override stylix font sizes. + stylix.fonts.sizes.desktop = lib.mkForce 18; + + # Save power! + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", ATTR{power/control}="auto" + ''; + + # + # Hardware config. + # + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "vmd" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + + # Disallow nouveau so the NVIDIA device is available for VFIO. + boot.blacklistedKernelModules = [ "nouveau" ]; + boot.extraModprobeConfig = '' + options nouveau modeset=0 + ''; + + # Support virtualization, thunderbolt, and poking the APCI directly. >.> + boot.kernelModules = [ + "kvm-intel" + "thunderbolt" + "acpi_call" + ]; + boot.extraModulePackages = [ config.boot.kernelPackages.acpi_call ]; + + # Support thunderbolt. + services.hardware.bolt.enable = true; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/bb880b80-992f-4e56-bb80-c5c4df0ddd72"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/5B37-C691"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/50f20263-9632-439d-b57d-b9ee8f13d62b"; } ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/veth/default.nix b/nixos/hosts/veth/default.nix new file mode 100644 index 0000000..30c539c --- /dev/null +++ b/nixos/hosts/veth/default.nix @@ -0,0 +1,114 @@ +# +# Per-system configuration for Veth. +# +# vim: et:ts=2:sw=2: +# +{ + config, + deprekages, + pkgs, + lib, + modulesPath, + ... +}: +{ + system.stateVersion = "23.11"; + + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Networking. + networking.hostName = "veth"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; + + # This is a local machine, rather than our typical network-accesed ones. + # Run an ssh-agent locally. + programs.ssh.startAgent = true; + + # + # Rotate the screen. + # + boot.kernelParams = [ "fbcon=rotate:1" ]; + + # Wayland+weston doesn't seem to rotate properly, so we'll run SDDM on X. + services.displayManager.sddm.wayland.enable = lib.mkForce false; + services.xserver = { + enable = true; + + displayManager = { + + # Rotate SDDM. + setupCommands = '' + ${pkgs.xorg.xrandr}/bin/xrandr --output eDP-1 --auto --rotate right; + ''; + }; + + }; + + # + # Niri configuration for our monitors. + # + home-manager.users.deprekated.programs.niri.settings = { + outputs."eDP-1".transform.rotation = 270; + }; + + # Override stylix font sizes. + stylix.fonts.sizes.desktop = lib.mkForce 32; + + # + # Undervolting. + # + services.undervolt = { + enable = true; + + # Voltages are in mV. + coreOffset = -70; + gpuOffset = -100; + }; + + # + # Hardware config. + # + boot.initrd.availableKernelModules = [ + "xhci_pci" + "usb_storage" + "usbhid" + "sd_mod" + "sdhci_pci" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/04ac3013-5745-4194-a469-d4beee909a34"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/134E-5DB2"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/veth/rotate-touch.sh b/nixos/hosts/veth/rotate-touch.sh new file mode 100755 index 0000000..b2ceafb --- /dev/null +++ b/nixos/hosts/veth/rotate-touch.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +xinput set-prop 'pointer:Goodix Capacitive TouchScreen' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1 diff --git a/nixos/overlays/add-depends-calibre.nix b/nixos/overlays/add-depends-calibre.nix new file mode 100644 index 0000000..934cd67 --- /dev/null +++ b/nixos/overlays/add-depends-calibre.nix @@ -0,0 +1,29 @@ +# +# Makes Calibre support plugins that need libcrypto. +# +# vim: et:ts=2:sw=2: +# +{ ... }: +let + overlay = finalPkgs: prevPkgs: { + calibre = prevPkgs.calibre.overrideAttrs { + + doCheck = false; + installCheckPhase = ""; + + # Also include libcrypto in an accessible path. + preFixup = '' + for program in $out/bin/*; do + wrapProgram $program \ + ''${qtWrapperArgs[@]} \ + ''${gappsWrapperArgs[@]} \ + --prefix PATH : "${finalPkgs.poppler_utils.out}/bin" \ + --prefix LD_LIBRARY_PATH : "${finalPkgs.openssl_3_3.out}/lib" + done + ''; + }; + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/always-wrap-xonsh.nix b/nixos/overlays/always-wrap-xonsh.nix new file mode 100644 index 0000000..3c169c4 --- /dev/null +++ b/nixos/overlays/always-wrap-xonsh.nix @@ -0,0 +1,14 @@ +# +# Forces xonsh to always be wrapped. +# +# vim: et:ts=2:sw=2: +# +{ deprekages, ... }: +let + forceWrapOverlay = final': prev': { + xonsh = deprekages.xonsh-with-xontribs.overridePythonAttrs { dontWrapPythonPrograms = false; }; + }; +in +{ + nixpkgs.overlays = [ forceWrapOverlay ]; +} diff --git a/nixos/overlays/clion/default.nix b/nixos/overlays/clion/default.nix new file mode 100644 index 0000000..051cead --- /dev/null +++ b/nixos/overlays/clion/default.nix @@ -0,0 +1,40 @@ +final: prev: + +{ + jetbrains = prev.jetbrains // { + clion = prev.jetbrains.clion.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ + ./remote.patch + ]; + + installPhase = + (old.installPhase or "") + + '' + makeWrapper "$out/$pname/bin/remote-dev-server.sh" "$out/bin/$pname-remote-dev-server" \ + --prefix PATH : "$out/libexec/$pname:${ + final.lib.makeBinPath [ + final.jdk + final.coreutils + final.gnugrep + final.which + final.git + ] + }" \ + --prefix LD_LIBRARY_PATH : "${ + final.lib.makeLibraryPath ([ + # Some internals want libstdc++.so.6 + final.stdenv.cc.cc.lib + final.libsecret + final.e2fsprogs + final.libnotify + ]) + }" \ + --set-default JDK_HOME "$jdk" \ + --set-default ANDROID_JAVA_HOME "$jdk" \ + --set-default JAVA_HOME "$jdk" \ + --set CLION_JDK "$jdk" \ + --set CLION_VM_OPTIONS ${old.vmoptsFile} + ''; + }); + }; +} diff --git a/nixos/overlays/clion/remote.patch b/nixos/overlays/clion/remote.patch new file mode 100644 index 0000000..9b978f5 --- /dev/null +++ b/nixos/overlays/clion/remote.patch @@ -0,0 +1,101 @@ +diff --git a/plugins/remote-dev-server/bin/launcher.sh b/plugins/remote-dev-server/bin/launcher.sh +index 085c648..133990e 100755 +--- a/plugins/remote-dev-server/bin/launcher.sh ++++ b/plugins/remote-dev-server/bin/launcher.sh +@@ -71,10 +71,6 @@ + rm -f "$TEMP_REMOTE_DEV_VM_OPTIONS" + fi + +- if [ -n "${TEMP_JBR:-}" ]; then +- rm -rf "$TEMP_JBR" +- fi +- + if [ -n "${XVFB_PID:-}" ]; then + kill -9 "$XVFB_PID" >/dev/null 2>&1 + fi +@@ -309,72 +305,6 @@ + mkdir -p "$IJ_HOST_CONFIG_DIR" || (echo "Failed to create $IJ_HOST_CONFIG_DIR" 1>&2; exit 1) + mkdir -p "$IJ_HOST_SYSTEM_DIR" || (echo "Failed to create $IJ_HOST_SYSTEM_DIR" 1>&2; exit 1) + +-# ------------------------------------------------------------------------------------- +-# Patch JBR to make self-contained JVM (requires nothing from host system except glibc) +-# ------------------------------------------------------------------------------------- +-if [ -n "${REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS:-}" ]; then +- # already set by environment +- echo "\$REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS=$REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS" +-elif [ $IS_DARWIN -eq 1 ]; then +- REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS=0 +-elif /lib64/ld-linux-x86-64.so.2 2>&1 | grep -q "gcompat ELF interpreter stub"; then +- # Not usable under Alpine and other musl-based linux distributions (x86-64) +- REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS=0 +-elif /lib/ld-linux-aarch64.so.1 2>&1 | grep -q "gcompat ELF interpreter stub"; then +- # Not usable under Alpine and other musl-based linux distributions (aarch64) +- REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS=0 +-else +- REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS=1 +-fi +- +-if [ $REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS -eq 1 ]; then +- SELFCONTAINED_LIBS="$REMOTE_DEV_SERVER_DIR/selfcontained/lib" +- if [ ! -d "$SELFCONTAINED_LIBS" ]; then +- echo "ERROR! Unable to locate libraries for self-contained idea distribution. Directory not found: '$SELFCONTAINED_LIBS'." 1>&2 +- exit 1 +- fi +- +- TEMP_JBR="$IJ_HOST_SYSTEM_DIR/pid.$$.temp.jbr" +- rm -rf "$TEMP_JBR" +- cp -r --symbolic-link "$IDE_HOME/jbr" "$TEMP_JBR" +- +- export "${IDE_PRODUCT_UC}_JDK=$TEMP_JBR" +- +- patch_bin_file() { +- file="$1" +- extra_arg="" +- if [ "$(basename "$file")" = "java" ]; then +- extra_arg="\"-Djava.home=$TEMP_JBR\"" +- fi +- mv "$file" "$file.bin" +- +- case $(uname -m) in +- x86_64) +- LD_LINUX=/lib64/ld-linux-x86-64.so.2 +- ;; +- aarch64) +- LD_LINUX=/lib/ld-linux-aarch64.so.1 +- ;; +- *) +- echo "Unsupported architecture $(uname -m)" 1>&2 +- exit 1 +- ;; +- esac +- +- cat >"$file" < "${TEMP_REMOTE_DEV_VM_OPTIONS}.tmp" && mv "${TEMP_REMOTE_DEV_VM_OPTIONS}.tmp" "${TEMP_REMOTE_DEV_VM_OPTIONS}" + +-if [ $REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS -eq 1 ]; then +- # Since TEMP_JBR is built on symlinks, java tries to resolve it and calculates java.home incorrectly +- # Make sure java.home points to our patched JBR +- echo "-Djava.home=$TEMP_JBR" >>"$TEMP_REMOTE_DEV_VM_OPTIONS" +-fi +- + if [ $IS_WSL2 -eq 1 ] && [ "${REMOTE_DEV_SERVER_ALLOW_IPV6_ON_WSL2:-}" != "true" ]; then + echo "-Djava.net.preferIPv4Stack=true" >>"$TEMP_REMOTE_DEV_VM_OPTIONS" + fi diff --git a/nixos/overlays/customize-gajim/00-hide-moderated.patch b/nixos/overlays/customize-gajim/00-hide-moderated.patch new file mode 100644 index 0000000..67917c0 --- /dev/null +++ b/nixos/overlays/customize-gajim/00-hide-moderated.patch @@ -0,0 +1,23 @@ +diff --git a/gajim/gtk/conversation/view.py b/gajim/gtk/conversation/view.py +index 0aa4dda..45c8325 100644 +--- a/gajim/gtk/conversation/view.py ++++ b/gajim/gtk/conversation/view.py +@@ -516,6 +516,9 @@ class ConversationView(Gtk.ScrolledWindow): + self._insert_message(command_output_row) + + def add_message_from_db(self, message: Message) -> None: ++ if message.moderation is not None: ++ return ++ + message_row = MessageRow.from_db_row(self.contact, message) + message_row.connect( + 'state-flags-changed', self._on_message_row_state_flags_changed) +@@ -826,7 +829,7 @@ class ConversationView(Gtk.ScrolledWindow): + def show_message_moderation(self, stanza_id: str, text: str) -> None: + message_row = self._get_row_by_stanza_id(stanza_id) + if message_row is not None: +- message_row.set_moderated(text) ++ message_row.destroy() + + def update_message_reactions(self, reaction_id: str) -> None: + if isinstance(self._contact, GroupchatContact): diff --git a/nixos/overlays/customize-gajim/default.nix b/nixos/overlays/customize-gajim/default.nix new file mode 100644 index 0000000..d729329 --- /dev/null +++ b/nixos/overlays/customize-gajim/default.nix @@ -0,0 +1,20 @@ +# +# Customizes Gajim to e.g. hide moderated messages. +# +{ ... }: +let + overlay = final': prev': { + gajim = prev'.gajim.overrideAttrs ( + final: prev: { + + patches = [ + ./00-hide-moderated.patch + ]; + + } + ); + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/fix-pcscd.nix b/nixos/overlays/fix-pcscd.nix new file mode 100644 index 0000000..252536e --- /dev/null +++ b/nixos/overlays/fix-pcscd.nix @@ -0,0 +1,29 @@ +# +# Fixes an issue where pcsclite doesn't +# +# vim: et:ts=2:sw=2: +# +{ ... }: +let + overlay = final': prev': { + pcsclite = prev'.pcsclite.overrideAttrs ( + final: prev: { + + postInstall = '' + # pcsc-spy is a debugging utility and it drags python into the closure + moveToOutput bin/pcsc-spy "$dev" + + # libpcsclite loads its delegate (libpcsclite_real) dynamically. + # To avoid downstream wrapping/patching, we add libpcsclite_real to the lib + # Relevant code: https://salsa.debian.org/rousseau/PCSC/-/blob/773be65d160da07de2fc34616af475e06dbaa343/src/libredirect.c#L128 + patchelf $lib/lib/libpcsclite.so.1 \ + --add-needed libpcsclite_real.so.1 + ''; + + } + ); + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/fixup-armcord.nix b/nixos/overlays/fixup-armcord.nix new file mode 100644 index 0000000..0a85d2b --- /dev/null +++ b/nixos/overlays/fixup-armcord.nix @@ -0,0 +1,39 @@ +# +# Fixes armcord to work on wayland. +# +# vim: et:ts=2:sw=2: +# +{ ... }: +let + overlay = final': prev': { + armcord = prev'.armcord.overrideAttrs (prev: { + + installPhase = '' + runHook preInstall + + mkdir -p "$out/bin" + cp -R "opt" "$out" + cp -R "usr/share" "$out/share" + chmod -R g-w "$out" + + # Wrap the startup command + makeWrapper $out/opt/ArmCord/armcord $out/bin/armcord \ + "''${gappsWrapperArgs[@]}" \ + --prefix XDG_DATA_DIRS : "${prev'.gtk3}/share/gsettings-schemas/${prev'.gtk3.name}/" \ + --add-flags "--ozone-platform=wayland --enable-features=WebRTCPipeWireCapturer" \ + --prefix LD_LIBRARY_PATH : "${prev'.lib.makeLibraryPath prev.buildInputs}" \ + --suffix PATH : ${prev'.lib.makeBinPath [ prev'.xdg-utils ]} + + # Fix desktop link + substituteInPlace $out/share/applications/armcord.desktop \ + --replace /opt/ArmCord/ $out/bin/ + + runHook postInstall + ''; + }); + + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/fixup-canon.nix b/nixos/overlays/fixup-canon.nix new file mode 100644 index 0000000..5bf138e --- /dev/null +++ b/nixos/overlays/fixup-canon.nix @@ -0,0 +1,19 @@ +# +# Try to make Canon printer. +# +# vim: et:ts=2:sw=2: +# +{ ... }: +let + overlay = final': prev': { + canon-cups-ufr2 = prev'.canon-cups-ufr2.overrideAttrs (prev: rec { + + installPhase = final'.lib.replaceStrings [ "/usr/bin/cnjbigufr2=$out/bin/cnjbigufr2" ] [ + "/usr/bin/cnjbigufr2=$out/bin/cnjbigufr2:/usr/share/cnpkbidir=$out/share/cnpkbidir" + ] prev.installPhase; + }); + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/fixup-imhex.nix b/nixos/overlays/fixup-imhex.nix new file mode 100644 index 0000000..2ceb86a --- /dev/null +++ b/nixos/overlays/fixup-imhex.nix @@ -0,0 +1,71 @@ +# +# Make imghex start up on wayland. +# From: https://github.com/WerWolv/ImHex/issues/1788 +# +{ ... }: +let + + overlay = ( + self: super: { + + # Fixup glfw. + glfw = super.glfw.overrideAttrs ( + finalAttrs: previousAttrs: with super; { + postPatch = lib.optionalString stdenv.isLinux '' + substituteInPlace src/wl_init.c \ + --replace-fail "libxkbcommon.so.0" "${lib.getLib libxkbcommon}/lib/libxkbcommon.so.0" \ + --replace-fail "libdecor-0.so.0" "${lib.getLib libdecor}/lib/libdecor-0.so.0" \ + --replace-fail "libwayland-client.so.0" "${lib.getLib wayland}/lib/libwayland-client.so.0" \ + --replace-fail "libwayland-cursor.so.0" "${lib.getLib wayland}/lib/libwayland-cursor.so.0" \ + --replace-fail "libwayland-egl.so.1" "${lib.getLib wayland}/lib/libwayland-egl.so.1" + ''; + } + ); + + # Fixup imghex. + imhex = super.imhex.overrideAttrs ( + finalAttrs: previousAttrs: + let + patterns_version = "1.35.3"; + patterns_src = super.fetchFromGitHub { + owner = "WerWolv"; + repo = "ImHex-Patterns"; + rev = "ImHex-v${patterns_version}"; + hash = "sha256-h86qoFMSP9ehsXJXOccUK9Mfqe+DVObfSRT4TCtK0rY="; + }; + in + rec { + version = "1.35.3"; + src = super.fetchFromGitHub { + fetchSubmodules = true; + owner = "WerWolv"; + repo = previousAttrs.pname; + rev = "v${version}"; + hash = "sha256-8vhOOHfg4D9B9yYgnGZBpcjAjuL4M4oHHax9ad5PJtA="; + }; + nativeBuildInputs = with super; [ + autoPatchelfHook + cmake + llvm + python3 + perl + pkg-config + rsync + ]; + autoPatchelfIgnoreMissingDeps = [ "*.hexpluglib" ]; + appendRunpaths = [ + (super.lib.makeLibraryPath [ super.libGL ]) + "${placeholder "out"}/lib/imhex/plugins" + ]; + postInstall = '' + mkdir -p $out/share/imhex + rsync -av --exclude="*_schema.json" ${patterns_src}/{constants,encodings,includes,magic,patterns} $out/share/imhex + ''; + } + ); + } + ); +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/fixup-mattermost.nix b/nixos/overlays/fixup-mattermost.nix new file mode 100644 index 0000000..76e0fce --- /dev/null +++ b/nixos/overlays/fixup-mattermost.nix @@ -0,0 +1,25 @@ +# +# Fixes mattermost's wrapper so one can log in. +# +# vim: et:ts=2:sw=2: +# +{ ... }: +let + overlay = final': prev': { + mattermost-desktop = prev'.mattermost-desktop.overrideAttrs ( + final: prev: { + + postInstall = '' + makeWrapper '${prev'.lib.getExe prev'.electron_28}' $out/bin/${prev.pname} \ + --set-default ELECTRON_IS_DEV 0 \ + --add-flags $out/share/${prev.pname}/app.asar \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" + ''; + + } + ); + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/fixup-nheko/default.nix b/nixos/overlays/fixup-nheko/default.nix new file mode 100644 index 0000000..aa1a636 --- /dev/null +++ b/nixos/overlays/fixup-nheko/default.nix @@ -0,0 +1,24 @@ +# +# Forces nheko to use Xorg instead of wayland. +# +# vim: et:ts=2:sw=2: +# +{ ... }: +let + overlay = final': prev': { + nheko = prev'.nheko.overrideAttrs ( + final: prev: { + + # Patches from pennae ^-^ + patches = prev.patches ++ [ + ./nheko-del.patch + ./nheko-search.patch + ./timeline-read-color.patch + ]; + } + ); + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/fixup-nheko/nheko-del.patch b/nixos/overlays/fixup-nheko/nheko-del.patch new file mode 100644 index 0000000..a760804 --- /dev/null +++ b/nixos/overlays/fixup-nheko/nheko-del.patch @@ -0,0 +1,13 @@ +diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml +index 156f6ad1..b678f9e2 100644 +--- a/resources/qml/delegates/TextMessage.qml ++++ b/resources/qml/delegates/TextMessage.qml +@@ -41,7 +41,7 @@ MatrixText { + background-color: " + Nheko.colors.text + "; + }" : "") + // TODO(Nico): Figure out how to support mobile + " +- " + formatted.replace(//g, "").replace(/<\/del>/g, "").replace(//g, "").replace(/<\/strike>/g, "") ++ " + formatted.replace(//g, "").replace(/<\/del>/g, "").replace(//g, "").replace(/<\/strike>/g, "") + width: parent.width + height: !keepFullText ? Math.round(Math.min(timelineView.height / 8, implicitHeight)) : implicitHeight + clip: !keepFullText diff --git a/nixos/overlays/fixup-nheko/nheko-search.patch b/nixos/overlays/fixup-nheko/nheko-search.patch new file mode 100644 index 0000000..563c875 --- /dev/null +++ b/nixos/overlays/fixup-nheko/nheko-search.patch @@ -0,0 +1,277 @@ +commit 3fffaa1927db2bde91cde273377628c3b81430c8 +Author: feathers <> +Date: Sun Oct 8 18:32:35 2023 +0200 + + search using levenshtein distance + +diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml +index 59b19d4d..298a5697 100644 +--- a/resources/qml/MessageInput.qml ++++ b/resources/qml/MessageInput.qml +@@ -129,7 +129,7 @@ Rectangle { + completerTriggeredAt = pos; + completer.completerName = type; + popup.open(); +- completer.completer.setSearchString(messageInput.getText(completerTriggeredAt, cursorPosition)+messageInput.preeditText); ++ completer.completer.setSearchString(messageInput.getText(completerTriggeredAt+1, cursorPosition)+messageInput.preeditText); + } + + function positionCursorAtEnd() { +@@ -182,12 +182,12 @@ Rectangle { + popup.close(); + + if (popup.opened) +- completer.completer.setSearchString(messageInput.getText(completerTriggeredAt, cursorPosition)+messageInput.preeditText); ++ completer.completer.setSearchString(messageInput.getText(completerTriggeredAt+1, cursorPosition)+messageInput.preeditText); + + } + onPreeditTextChanged: { + if (popup.opened) +- completer.completer.setSearchString(messageInput.getText(completerTriggeredAt, cursorPosition)+messageInput.preeditText); ++ completer.completer.setSearchString(messageInput.getText(completerTriggeredAt+1, cursorPosition)+messageInput.preeditText); + } + onSelectionStartChanged: room.input.updateState(selectionStart, selectionEnd, cursorPosition, text) + onSelectionEndChanged: room.input.updateState(selectionStart, selectionEnd, cursorPosition, text) +diff --git a/src/CompletionProxyModel.h b/src/CompletionProxyModel.h +index 4d9c9f0e..24767a2a 100644 +--- a/src/CompletionProxyModel.h ++++ b/src/CompletionProxyModel.h +@@ -8,6 +8,8 @@ + + // Class for showing a limited amount of completions at a time + ++#include ++ + #include + + enum class ElementRank +@@ -19,140 +21,126 @@ enum class ElementRank + template + struct trie + { +- std::vector values; +- std::map next; ++ struct entry { ++ QVector key; ++ Value value; ++ }; ++ ++ std::vector entries; + + template + void insert(const QVector &keys, const Value &v) + { +- auto t = this; +- for (const auto k : keys) { +- t = &t->next[k]; +- } +- + if constexpr (r == ElementRank::first) { +- t->values.insert(t->values.begin(), v); ++ entries.emplace(entries.begin(), keys, v); + } else if constexpr (r == ElementRank::second) { +- t->values.push_back(v); ++ entries.emplace_back(keys, v); + } + } + +- std::vector valuesAndSubvalues(size_t limit = -1) const ++ // mostly stolen from https://nasauber.de/blog/2019/levenshtein-distance-and-longest-common-subsequence-in-qt/ ++ static size_t levenshteinDistance(const QVector &source, const QVector &target) + { +- std::vector ret; +- if (limit < 200) +- ret.reserve(limit); +- +- for (const auto &v : values) { +- if (ret.size() >= limit) +- return ret; +- else +- ret.push_back(v); ++ // Mostly stolen from https://qgis.org/api/2.14/qgsstringutils_8cpp_source.html ++ ++ if (source == target) { ++ return 0; + } + +- for (const auto &[k, t] : next) { +- (void)k; +- if (ret.size() >= limit) +- return ret; +- else { +- auto temp = t.valuesAndSubvalues(limit - ret.size()); +- for (auto &&v : temp) { +- if (ret.size() >= limit) +- return ret; +- +- if (std::find(ret.begin(), ret.end(), v) == ret.end()) { +- ret.push_back(std::move(v)); +- } +- } ++ const size_t sourceCount = source.count(); ++ const size_t targetCount = target.count(); ++ ++ if (source.isEmpty()) { ++ return targetCount; ++ } ++ ++ if (target.isEmpty()) { ++ return sourceCount; ++ } ++ ++ if (sourceCount > targetCount) { ++ return levenshteinDistance(target, source); ++ } ++ ++ QVector column; ++ column.fill(0, targetCount + 1); ++ QVector previousColumn; ++ previousColumn.reserve(targetCount + 1); ++ for (size_t i = 0; i < targetCount + 1; i++) { ++ previousColumn.append(i); ++ } ++ ++ for (size_t i = 0; i < sourceCount; i++) { ++ column[0] = i + 1; ++ for (size_t j = 0; j < targetCount; j++) { ++ column[j + 1] = std::min({ ++ 1 + column.at(j), ++ 1 + previousColumn.at(1 + j), ++ previousColumn.at(j) + ((source.at(i) == target.at(j)) ? 0 : 1) ++ }); + } ++ column.swap(previousColumn); + } + +- return ret; ++ return previousColumn.at(targetCount); + } + +- std::vector search(const QVector &keys, //< TODO(Nico): replace this with a span ++ std::vector search(QVector keys, //< TODO(Nico): replace this with a span + size_t result_count_limit, + size_t max_edit_distance_ = 2) const + { + std::vector ret; ++ std::set seen; ++ // mapping -> ++ std::vector> matches(max_edit_distance_ + 1); + if (!result_count_limit) +- return ret; ++ goto done; + +- if (keys.isEmpty()) +- return valuesAndSubvalues(result_count_limit); +- +- auto append = [&ret, result_count_limit](std::vector &&in) { +- for (auto &&v : in) { +- if (ret.size() >= result_count_limit) +- return; +- +- if (std::find(ret.begin(), ret.end(), v) == ret.end()) { +- ret.push_back(std::move(v)); +- } ++ if (keys.isEmpty()) { ++ for (size_t i = 0; i < result_count_limit; i++) { ++ ret.push_back(entries[i].value); + } +- }; +- +- auto limit = [&ret, result_count_limit] { +- return std::min(result_count_limit, (result_count_limit - ret.size()) * 2); +- }; +- +- // Try first exact matches, then with maximum errors +- for (size_t max_edit_distance = 0; +- max_edit_distance <= max_edit_distance_ && ret.size() < result_count_limit; +- max_edit_distance += 1) { +- if (max_edit_distance && ret.size() < result_count_limit) { +- max_edit_distance -= 1; +- +- // swap chars case +- if (keys.size() >= 2) { +- auto t = this; +- for (int i = 1; i >= 0; i--) { +- if (auto e = t->next.find(keys[i]); e != t->next.end()) { +- t = &e->second; +- } else { +- t = nullptr; +- break; +- } +- } +- +- if (t) { +- append(t->search(keys.mid(2), limit(), max_edit_distance)); +- } +- } +- +- // insert case +- for (const auto &[k, t] : this->next) { +- if (k == keys[0]) +- continue; +- if (ret.size() >= limit()) +- break; +- +- // insert +- append(t.search(keys, limit(), max_edit_distance)); +- } +- +- // delete character case +- append(this->search(keys.mid(1), limit(), max_edit_distance)); +- +- // substitute case +- for (const auto &[k, t] : this->next) { +- if (k == keys[0]) +- continue; +- if (ret.size() >= limit()) +- break; ++ goto done; ++ } + +- // substitute +- append(t.search(keys.mid(1), limit(), max_edit_distance)); +- } ++ // search for perfect infixes and order them early. this is an imperfect heuristic, ++ // but Works For Us™ ++ for (const auto& entry : entries) { ++ if (std::search(entry.key.begin(), entry.key.end(), keys.begin(), keys.end()) ++ != entry.key.end()) { ++ matches.at(0).insert(entry.value); ++ } ++ } + +- max_edit_distance += 1; ++ // find all matches. we truncate the entry we're matching with to it's longer than ++ // the search key + edit distance to allow prefix searches ++ for (const auto& entry : entries) { ++ auto truncated_key = entry.key; ++ if (truncated_key.size() > keys.count() + max_edit_distance_) { ++ truncated_key.resize(keys.count() + max_edit_distance_); ++ } ++ const auto distance = levenshteinDistance(keys, truncated_key); ++ if (distance <= max_edit_distance_) { ++ matches.at(distance).insert(entry.value); + } ++ } + +- if (auto e = this->next.find(keys[0]); e != this->next.end()) { +- append(e->second.search(keys.mid(1), limit(), max_edit_distance)); ++ for (const auto& match_set : matches) { ++ for (const auto match : match_set) { ++ if (seen.insert(match).second) { ++ ret.push_back(match); ++ if (ret.size() >= result_count_limit) ++ goto done; ++ } + } + } + ++ done: ++ // ugly hack because nheko currently sometimes just hangs if the completion list ++ // empties and refills multiple times during typing. shows as `(undefined)`, which ++ // is good enough. ++ if (ret.empty()) ++ ret.push_back(-1); + return ret; + } + }; diff --git a/nixos/overlays/fixup-nheko/timeline-read-color.patch b/nixos/overlays/fixup-nheko/timeline-read-color.patch new file mode 100644 index 0000000..8ac8035 --- /dev/null +++ b/nixos/overlays/fixup-nheko/timeline-read-color.patch @@ -0,0 +1,12 @@ +diff --git a/resources/qml/StatusIndicator.qml b/resources/qml/StatusIndicator.qml +index 2276de11..d503112f 100644 +--- a/resources/qml/StatusIndicator.qml ++++ b/resources/qml/StatusIndicator.qml +@@ -18,6 +18,7 @@ ImageButton { + height: 16 + hoverEnabled: true + changeColorOnHover: (status == MtxEvent.Read) ++ buttonTextColor: (status == MtxEvent.Read) ? Nheko.colors.highlight : Nheko.colors.buttonText + cursor: (status == MtxEvent.Read) ? Qt.PointingHandCursor : Qt.ArrowCursor + ToolTip.visible: hovered && status != MtxEvent.Empty + ToolTip.text: { diff --git a/nixos/overlays/fixup-signal/01-show-window.patch b/nixos/overlays/fixup-signal/01-show-window.patch new file mode 100644 index 0000000..cf971b1 --- /dev/null +++ b/nixos/overlays/fixup-signal/01-show-window.patch @@ -0,0 +1,13 @@ +diff --git a/app/main.js b/app/main.js +index 4c33932..59a9cff 100644 +--- a/app/main.js ++++ b/app/main.js +@@ -488,7 +488,7 @@ __name(safeLoadURL, "safeLoadURL"); + async function createWindow() { + const usePreloadBundle = !(0, import_environment.isTestEnvironment)((0, import_environment.getEnvironment)()) || forcePreloadBundle; + const windowOptions = { +- show: false, ++ show: true, + width: DEFAULT_WIDTH, + height: DEFAULT_HEIGHT, + minWidth: MIN_WIDTH, diff --git a/nixos/overlays/fixup-signal/default.nix b/nixos/overlays/fixup-signal/default.nix new file mode 100644 index 0000000..beac4ec --- /dev/null +++ b/nixos/overlays/fixup-signal/default.nix @@ -0,0 +1,47 @@ +# +# Fix a bug that makes signal not start on wayland. +# +# vim: et:ts=2:sw=2: +# +{ ... }: +let + overlay = final': prev': { + signal-desktop = prev'.signal-desktop.overrideAttrs ( + final: prev: rec { + + # We'll need to patch the ASAR in order to apply our fix. + nativeBuildInputs = prev.nativeBuildInputs ++ [ + prev'.asar + ]; + + # Fix things to the version that our patch applies to. + version = "7.18.0"; + src = prev'.fetchurl { + url = "https://updates.signal.org/desktop/apt/pool/s/signal-desktop/signal-desktop_${version}_amd64.deb"; + hash = "sha256-xI3GCs9ZekENktuSf9NNxoOOGuYtKrOV8Ng3eFy493M="; + }; + + # Do terrible, terrible things. + preFixup = + prev.preFixup + + '' + # Fix up the main.js in the app to actually show the window. + pushd $out/lib/Signal/resources/ + + asar extract app.asar app-unpacked + + pushd app-unpacked + patch -p1 < ${./01-show-window.patch} + popd + + asar pack app-unpacked app.asar + popd + ''; + + } + ); + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/fixup-signald/default.nix b/nixos/overlays/fixup-signald/default.nix new file mode 100644 index 0000000..384c14f --- /dev/null +++ b/nixos/overlays/fixup-signald/default.nix @@ -0,0 +1,83 @@ +# +# Fixes signald to work with new Signal API changes. +# +# vim: et:ts=2:sw=2: +# +{ ... }: +let + overlay = final': prev': { + signald = prev'.signald.overrideAttrs (prev: rec { + + # Use a date, since we're building off git. + version = "2024-06-12"; + + # Use a WIP version with current fixes. + src = prev'.fetchgit { + rev = "7863854ec8d8dcaa8b2b79e4ed2867a9ee43ca82"; + url = "https://gitlab.com/signald/signald.git"; + hash = "sha256-nZo0pjgbaKLLUPekdoKXpFgvB7ZM2CJgeA85xXaC3LA="; + + # Leave enough git info for their local script to `git describe`. + deepClone = true; + }; + + # fake build to pre-download deps into fixed-output derivation + gradleWithJdk = prev'.gradle.override { java = prev'.jdk17_headless; }; + deps = prev'.stdenv.mkDerivation { + pname = "${prev.pname}-deps"; + inherit src version; + + nativeBuildInputs = with prev'; [ + git + gradleWithJdk + perl + ]; + + patches = [ ./0001-fetch-buildconfig-during-gradle-build-inside-nix-fod.patch ]; + buildphase = '' + export GRADLE_USER_HOME=$(mktemp -d) + gradle --no-daemon build + ''; + installPhase = '' + find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \ + | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \ + | sh -x + + # WARNING: don't try this at home and wear safety-goggles while working with this! + # We patch around in the dependency tree to resolve some spurious dependency resolution errors. + # Whenever this package gets updated, please check if some of these hacks are obsolete! + + # Mimic existence of okio-3.2.0.jar. Originally known as okio-jvm-3.2.0 (and renamed), + # but gradle doesn't detect such renames, only fetches the latter and then fails + # in `signald.buildPhase` because it cannot find `okio-3.2.0.jar`. + pushd $out/com/squareup/okio/okio/3.2.0 &>/dev/null + cp -v ../../okio-jvm/3.2.0/okio-jvm-3.2.0.jar okio-3.2.0.jar + popd &>/dev/null + + # For some reason gradle fetches 2.14.1 instead of 2.14.0 here even though 2.14.0 is required + # according to `./gradlew -q dependencies`, so we pretend to have 2.14.0 available here. + # According to the diff in https://github.com/FasterXML/jackson-dataformats-text/compare/jackson-dataformats-text-2.14.0...jackson-dataformats-text-2.14.1 + # the only relevant change is in the code itself (and in the tests/docs), so this seems + # binary-compatible. + cp -v \ + $out/com/fasterxml/jackson/dataformat/jackson-dataformat-toml/2.14.1/jackson-dataformat-toml-2.14.1.jar \ + $out/com/fasterxml/jackson/dataformat/jackson-dataformat-toml/2.14.0/jackson-dataformat-toml-2.14.0.jar + ''; + # Don't move info to share/ + forceShare = [ "dummy" ]; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + # Downloaded jars differ by platform + outputHash = + { + x86_64-linux = "sha256-9DHykkvazVBN2kfw1Pbejizk/R18v5w8lRBHZ4aXL5Q="; + aarch64-linux = "sha256-RgAiRbUojBc+9RN/HpAzzpTjkjZ6q+jebDsqvah5XBw="; + } + .${prev'.stdenv.system} or (throw "Unsupported system: ${prev'.stdenv.system}"); + }; + }); + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/jd-gui-wayland.nix b/nixos/overlays/jd-gui-wayland.nix new file mode 100644 index 0000000..ab9e051 --- /dev/null +++ b/nixos/overlays/jd-gui-wayland.nix @@ -0,0 +1,24 @@ +# +# Hacks to make jd-gui run on wayland. +# +{ ... }: +let + package = "jd-gui"; + + overlay = final': prev': { + + ${package} = prev'.${package}.overrideAttrs ( + final: prev: { + + # Patch the installed binary to be nice. + installPhase = builtins.replaceStrings [ "export" ] [ + "export _JAVA_AWT_WM_NONREPARENTING=1; export" + ] prev.installPhase; + + } + ); + }; +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/sddm-no-vnc.nix b/nixos/overlays/sddm-no-vnc.nix new file mode 100644 index 0000000..303839e --- /dev/null +++ b/nixos/overlays/sddm-no-vnc.nix @@ -0,0 +1,15 @@ +# +# Hacks to make sddm require VNC (via tweaking weston). +# +{ ... }: +let + package = "weston"; + + overlay = final': prev': { + ${package} = prev'.${package}.override { vncSupport = false; }; + }; + +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/overlays/yubikey-touch-shitpost/00-puckify.patch b/nixos/overlays/yubikey-touch-shitpost/00-puckify.patch new file mode 100644 index 0000000..3f017ed --- /dev/null +++ b/nixos/overlays/yubikey-touch-shitpost/00-puckify.patch @@ -0,0 +1,13 @@ +diff --git a/notifier/libnotify.go b/notifier/libnotify.go +index b75cef6..447f6a6 100644 +--- a/notifier/libnotify.go ++++ b/notifier/libnotify.go +@@ -34,7 +34,7 @@ func SetupLibnotifyNotifier(notifiers *sync.Map) { + notification := notify.Notification{ + AppName: "yubikey-touch-detector", + AppIcon: "yubikey-touch-detector", +- Summary: "YubiKey is waiting for a touch", ++ Summary: "uwubikey is w-waiting to be touched 👉🥺👈", + } + + reset := func(msg *notify.NotificationClosedSignal) { diff --git a/nixos/overlays/yubikey-touch-shitpost/default.nix b/nixos/overlays/yubikey-touch-shitpost/default.nix new file mode 100644 index 0000000..0b61740 --- /dev/null +++ b/nixos/overlays/yubikey-touch-shitpost/default.nix @@ -0,0 +1,22 @@ +# +# Be gay. Do puck(ification). +# +{ ... }: +let + + overlay = ( + self: super: { + + # UwU. + yubikey-touch-detector = super.yubikey-touch-detector.overrideAttrs ( + finalAttrs: previousAttrs: { + patches = [ ./00-puckify.patch ]; + } + ); + + } + ); +in +{ + nixpkgs.overlays = [ overlay ]; +} diff --git a/nixos/packages/appstore.nix b/nixos/packages/appstore.nix new file mode 100644 index 0000000..4b1a896 --- /dev/null +++ b/nixos/packages/appstore.nix @@ -0,0 +1,48 @@ +# +# Mac app store packages for our Darwin nix installs. +# +# vim: et:ts=2:sw=2: +# +{ + config, + pkgs, + lib, + ... +}: +{ + + homebrew = { + + # IDs are the important thing, here. + # Find them using "mas search". + masApps = { + # Core apps. + "Fantastical" = 975937182; + "Magnet" = 441258766; + + # Reading and writing. + "Airmail" = 918858936; + "Pocket" = 568494494; + "iA Writer" = 775737590; + + # Work stuffs. + "Singlebox" = 1551183766; + + # Utilities. + "Jayson" = 1468691718; + "UTM" = 1538878817; + "Webcam Settings" = 533696630; + "Microsoft Remote Desktop" = 1295203466; + + # Safari extensions. + "1Blocker" = 1365531024; + "Bitwarden" = 1352778147; + "Noir" = 1592917505; + "Save to Pocket" = 1477385213; + "Tamperish" = 1516885392; + + }; + + }; + +} diff --git a/nixos/packages/default.nix b/nixos/packages/default.nix new file mode 100644 index 0000000..c09792f --- /dev/null +++ b/nixos/packages/default.nix @@ -0,0 +1,14 @@ +# Package we want in our environment. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }@specialArgs: +{ + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # + # Systemwide environment packages. + # + environment.systemPackages = (import ./default.pkgs.nix) specialArgs; +} diff --git a/nixos/packages/default.pkgs.nix b/nixos/packages/default.pkgs.nix new file mode 100644 index 0000000..5cc6544 --- /dev/null +++ b/nixos/packages/default.pkgs.nix @@ -0,0 +1,247 @@ +# +# Packages we want in our environment. +# +# vim: et:ts=2:sw=2: +# +{ + deprekages, + pkgs, + agenix, + nil, + attic, + is-hm-standalone, + is-droid, + ... +}: +with pkgs; +[ + + # Core. + (if is-droid then coreutils else coreutils-full) + neovim + nix-index + rsync + tree-sitter + deprekages.kak-tree-sitter + tmux + deprekages._7zz + + # Backup things. + keepassxc + + # Task & time management. + khal + vit + tasksh + taskwarrior-tui + taskwarrior3 + taskjuggler + deprekages.hrvst-cli + + # Always keep sqlite around, since it's necessary to fix our DB sometimes. + sqlite + + # Nix enhancements. + nurl + nix-init + nix-index + nix-diff + nix-direnv + nix-direnv-flakes + nix-info + nix-query-tree-viewer + nix-update + patchelf + niv + + # Utils. + _1password + age + agenix.agenix + atool + bat + bitwarden-cli + bzip2 + cardpeek + cpio + cyberchef + dasel + delta + dmidecode + dterm + edir + editorconfig-core-c + editorconfig-checker + efibootmgr + eza + fd + ffmpeg-full + file + findutils + gettext + ghostscript + git + git-lfs + grc + hexyl + htop + imagemagick + jq + jre + jmtpfs + killall + deprekages.age-plugin-yubikey + deprekages.avbroot + libimobiledevice + libsecret + lz4 + minipro + moreutils + mosquitto + mpc-cli + nmap + jmtpfs + netcat + nil.nil + nixfmt-rfc-style + ntfsprogs + openocd + openssl + openssh + python3 + python3Packages.matplotlib + pv + qpdf + rclone + ripgrep + unzip + unar + unrar + wget + zstd + zip + + # Scripting languages + (ruby.withPackages ( + pkgs: with pkgs // deprekages.rubyPackages; [ + pry + sinatra + nokogiri + chronic + ] + )) + + # Office. + sc-im + + # For editors. + fish + lazygit + lua-language-server + stylua + solargraph + (aspellWithDicts ( + dicts: with dicts; [ + de + en + en-computers + en-science + nl + ] + )) + + # Reversing. + binwalk + + # Development. + #colmena + rustfmt + cargo + clang + clang-tools + rust-analyzer + flatbuffers + nextpnr + yosys + trellis + poetry + maven + xxd + + # Typesetting. + typst + tinymist + + # USB hub control. + deprekages.ykush + + # Temporary, until we pull CoC into our config? + nodejs + yarn +] + +# Linux-only packages. +++ ( + if pkgs.stdenv.isLinux then + [ + # Core + pciutils + usbutils + linuxPackages.usbip + deprekages.oxfs + + # Utilities. + wev + i2c-tools + pcsc-tools + davfs2 + + ] + else + [ ] +) + +# Mac-only packages. +++ ( + if pkgs.stdenv.isDarwin then + [ + + # Utils + mas + plistwatch + + # Development. + libiconv # Required for Rust on mac. + + ] + else + [ ] +) + +# x86_64 only packages +++ ( + if pkgs.stdenv.isx86_64 then + [ + + # Utils. + dig + magic-wormhole + + jadx + + steam-run + attic.attic + + ] + else + [ ] +) + +++ ( + if (!is-hm-standalone && !is-droid) then + [ + kakoune + ] + else + [ ] +) diff --git a/nixos/packages/droid.nix b/nixos/packages/droid.nix new file mode 100644 index 0000000..07963e7 --- /dev/null +++ b/nixos/packages/droid.nix @@ -0,0 +1,14 @@ +# Package we want in our environment. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }@specialArgs: +{ + # Allow unfree packages + #nixpkgs.config.allowUnfree = true; + + # + # Systemwide environment packages. + # + environment.packages = (import ./default.pkgs.nix) specialArgs; +} diff --git a/nixos/packages/flatpak.nix b/nixos/packages/flatpak.nix new file mode 100644 index 0000000..7398a7f --- /dev/null +++ b/nixos/packages/flatpak.nix @@ -0,0 +1,13 @@ +# +# Flatpak programs; as a method of last resort. +# +{ ... }: +{ + + services.flatpak.packages = [ + { + appId = "org.kde.kitinerary-workbench"; + origin = "kitinerary"; + } + ]; +} diff --git a/nixos/packages/gui-heavy.nix b/nixos/packages/gui-heavy.nix new file mode 100644 index 0000000..0520572 --- /dev/null +++ b/nixos/packages/gui-heavy.nix @@ -0,0 +1,59 @@ +# +# GUI packages we want in our environment, but which require building. +# For machines that have GUI support and can reasonably build things. +# +# vim: et:ts=2:sw=2: +# +{ + config, + deprekages, + pkgs, + ... +}: +{ + # + # Systemwide environment packages, for GUI. + # + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = + with pkgs; + [ + ] + + # Linux-only packages. + ++ ( + if pkgs.stdenv.isLinux then + [ + + # Lab equipment control. + deprekages.scopehal-apps + deprekages.scopehal-sigrok-bridge + vulkan-tools + ] + else + [ ] + ) + + # Mac-only packages. + ++ ( + if pkgs.stdenv.isDarwin then + [ + + ] + else + [ ] + ) + + # x86_64 only packages + ++ ( + if pkgs.stdenv.isx86_64 then + [ + + ] + else + [ ] + ); + +} diff --git a/nixos/packages/gui-offline.nix b/nixos/packages/gui-offline.nix new file mode 100644 index 0000000..f2181fa --- /dev/null +++ b/nixos/packages/gui-offline.nix @@ -0,0 +1,63 @@ +# +# Large GUI packages we want in our environment. +# For machines that have GUI support, enough space, and which +# will are likely to be used offline. +# +# vim: et:ts=2:sw=2: +# +{ + config, + deprekages, + pkgs, + ... +}: +{ + # + # Systemwide environment packages, for GUI. + # + + # Support files for the packages below. + home-manager.users.deprekated = { + home.file.".navit/navit.xml".source = ../../navit/navit.xml; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = + with pkgs; + [ + ] + + # Linux-only packages. + ++ ( + if pkgs.stdenv.isLinux then + [ + # GPS support. + deprekages.navit + espeak + ] + else + [ ] + ) + + # Mac-only packages. + ++ ( + if pkgs.stdenv.isDarwin then + [ + + ] + else + [ ] + ) + + # x86_64 only packages + ++ ( + if pkgs.stdenv.isx86_64 then + [ + + ] + else + [ ] + ); + +} diff --git a/nixos/packages/gui.droid.nix b/nixos/packages/gui.droid.nix new file mode 100644 index 0000000..c95a2e9 --- /dev/null +++ b/nixos/packages/gui.droid.nix @@ -0,0 +1,20 @@ +# +# GUI packages we want in our environment. +# For machines that have GUI support. +# +# vim: et:ts=2:sw=2: +# +{ + pkgs, + deprekages, + niri, + config, + ... +}@args: +{ + # + # Systemwide environment packages, for GUI. + # + nixpkgs.config.android_sdk.accept_license = true; + environment.systemPackages = (import ./gui.pkgs.nix) args; +} diff --git a/nixos/packages/gui.nix b/nixos/packages/gui.nix new file mode 100644 index 0000000..80fb25b --- /dev/null +++ b/nixos/packages/gui.nix @@ -0,0 +1,39 @@ +# +# GUI packages we want in our environment. +# For machines that have GUI support. +# +# vim: et:ts=2:sw=2: +# +{ + pkgs, + deprekages, + niri, + config, + ... +}@args: +{ + # + # Systemwide environment packages, for GUI. + # + nixpkgs.config.android_sdk.accept_license = true; + environment.systemPackages = (import ./gui.pkgs.nix) args; + + # Enable tridactyl and firefox-webserial on NixOS. + programs.firefox.enable = true; + programs.firefox.nativeMessagingHosts.packages = [ + pkgs.tridactyl-native + deprekages.firefox-webserial + ]; + + home-manager.users.deprekated = { + home.file.".mozilla/native-messaging-hosts" = { + recursive = true; + source = pkgs.runCommandLocal "native-messaging-hosts" { } '' + mkdir $out + for ext in ${toString config.programs.firefox.nativeMessagingHosts.packages}; do + ln -sLt $out $ext/lib/mozilla/native-messaging-hosts/* + done + ''; + }; + }; +} diff --git a/nixos/packages/gui.pkgs.nix b/nixos/packages/gui.pkgs.nix new file mode 100644 index 0000000..bc53b4b --- /dev/null +++ b/nixos/packages/gui.pkgs.nix @@ -0,0 +1,170 @@ +# +# GUI packages we want in our environment. +# For machines that have GUI support. +# +# vim: et:ts=2:sw=2: +# +{ + pkgs, + deprekages, + niri, + ... +}: +with pkgs; +[ + wezterm + _1password-gui + + # Comms. + dino + gajim + vesktop + mqtt-explorer + nheko + + (pkgs.weechat.override { + configure = + { availablePlugins, ... }: + { + + # Load our plugins on startup, and set up our color theme. + init = '' + /set weechat.bar.status.color_bg 0 + /set weechat.bar.title.color_bg 0 + /set weechat.color.chat_nick_colors 1,2,3,4,5,6 + /set buffers.color.hotlist_message_fg 7 + /set weechat.bar.buffers.position top + /set buflist.format.buffer "\''${format_number}\''${indent}\''${cut:20,...,\''${format_nick_prefix}\''${format_name}}" + /set buflist.look.sort active + /remote add deprekages https://irc.ktemk.in:8001 + /set relay.remote.deprekages.password "\''${sec.data.remote}" + /remote connect deprekages + ''; + + }; + }) + + # Office. + thunderbird + libreoffice + drawio + zoom-us + krita + xournalpp + kdePackages.itinerary + deprekages.notion-app + + # PDFs. + (zathuraPkgs.override { useMupdf = false; }).zathuraWrapper + masterpdfeditor + + # Task management. + deprekages.todoist-electron + + # Dev + bytecode-viewer + # Poking our phone. + android-studio + + # Backup + kitty + + # Media + calibre + pavucontrol + deprekages.argos + tidal-hifi + #steam + vlc +] + +# Linux-only packages. +++ ( + if pkgs.stdenv.isLinux then + [ + appimage-run + arduino + ghidra + #kicad-small + obsidian + onboard + + # Xwayland support. + xwayland + cage + gamescope + openbox + + # Utilities. + libinput-gestures + wl-clipboard + xclip + + # Extra icon themes that often seem needed despite lack of dependencies. + adwaita-icon-theme + gnome-icon-theme + hicolor-icon-theme + + # Comms. + #mattermost-desktop + #nheko + signal-desktop + signal-export + slack + zulip + obs-studio + obs-studio-plugins.wlrobs + + # Browsers. + firefox + chromium # (for webusb) + falkon + + # Tools. + deprekages.home-assistant-desktop + inkscape + p3x-onenote + virt-manager + imhex + gimp + deluge + + # System utilities. + nemo-with-extensions + gvfs + + # Music stuffs. + ardour + bitwig-studio + linvstmanager + + # 3D stuffs. + freecad + #sweethome3d.application # currently makes flatpak segfault; what + ] + else + [ ] +) + +# Mac-only packages. +++ ( + if pkgs.stdenv.isDarwin then + [ + + ] + else + [ ] +) + +# x86_64 only packages +++ ( + if pkgs.stdenv.isx86_64 then + [ + + jupyter # For now. + (wineWowPackages.unstableFull.override { waylandSupport = true; }) + winetricks + ] + else + [ ] +) diff --git a/nixos/packages/heavy.nix b/nixos/packages/heavy.nix new file mode 100644 index 0000000..37ff0b1 --- /dev/null +++ b/nixos/packages/heavy.nix @@ -0,0 +1,26 @@ +# +# Package we want in our environment. +# +# vim: et:ts=2:sw=2: +# +{ + config, + deprekages, + pkgs, + lib, + ... +}: +{ + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # + # Systemwide environment packages. + # + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + sage + ]; +} diff --git a/nixos/packages/hm.nix b/nixos/packages/hm.nix new file mode 100644 index 0000000..c55b770 --- /dev/null +++ b/nixos/packages/hm.nix @@ -0,0 +1,5 @@ +{ ... }@specialArgs: +{ + nixpkgs.config.allowUnfree = true; + home.packages = (import ./default.pkgs.nix) specialArgs; +} diff --git a/nixos/packages/homebrew.nix b/nixos/packages/homebrew.nix new file mode 100644 index 0000000..77c7340 --- /dev/null +++ b/nixos/packages/homebrew.nix @@ -0,0 +1,97 @@ +# +# Homebrew package for our Darwin nix installs. +# +# vim: et:ts=2:sw=2: +# +{ + config, + pkgs, + lib, + ... +}: + +with lib; +{ + homebrew = { + enable = true; + + # The packages we want directly from Homebrew, instead of nixpkgs. + brews = [ + # Currently broken on Nix for Darwin. + "magic-wormhole" + + # Needs to be in macOS locations for pyusb to find it. + "libusb" + + # Not provided by Nix. + "usbutils" + "mingw-w64" + + # For OpenHantek. We're going to regret this. + "libusb" + "fftw" + "qt5" + "cmake" + "binutils" + "create-dmg" + + # For GLScopeClient. We're going to regret this. + "pkg-config" + "gtk+3" + "gtkmm3" + "glfw" + "cmake" + "yaml-cpp" + "glew" + "catch2" + "libomp" + ]; + + # The Mac apps we want installed for us. + casks = [ + "010-editor" + "audio-hijack" + "bartender" + "bettertouchtool" + "bitwarden" + "calibre" + "chromium" + #"dash" + "discord" + "firefox" + "gcc-aarch64-embedded" + "ghidra" + "google-drive" + "gpg-suite-no-mail" + "gtkwave" + "iexplorer" + "irccloud" + "little-snitch" + "loopback" + "nordvpn" + "nvidia-geforce-now" + "obs-virtualcam" + "obs" + "obsidian" + #"omnigraffle" + "onedrive" + "sengi" + "owncloud" + "raycast" + "snagit" + "soundsource" + "steam" + "trailer" + "vlc" + "xquartz" + "karabiner-elements" + #"kicad" + "keka" + "android-studio" + "arduino" + "bitwig-studio" + "wezterm" + "sweet-home3d" + ]; + }; +} diff --git a/nixos/packages/offline.droid.nix b/nixos/packages/offline.droid.nix new file mode 100644 index 0000000..0574c94 --- /dev/null +++ b/nixos/packages/offline.droid.nix @@ -0,0 +1,18 @@ +# +# A list of packages we want around for machines we expect +# to sometimes be offline; even if they'd normally be intantiated +# via a nix shell expression. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }@specialArgs: +{ + # + # Systemwide environment packages. + # + + # List packages installed in system profile. To search, run: + # $ nix search nixpkgs wget + environment.packages = (import ./offline.pkgs.nix) specialArgs; + +} diff --git a/nixos/packages/offline.hm.nix b/nixos/packages/offline.hm.nix new file mode 100644 index 0000000..05ea3cc --- /dev/null +++ b/nixos/packages/offline.hm.nix @@ -0,0 +1,8 @@ +# +# A list of packages we want around for machines we expect +# to sometimes be offline; even if they'd normally be intantiated +# via a nix shell expression. +# +specialArgs: { + home.packages = (import ./offline.pkgs.nix) specialArgs; +} diff --git a/nixos/packages/offline.nix b/nixos/packages/offline.nix new file mode 100644 index 0000000..59d2f32 --- /dev/null +++ b/nixos/packages/offline.nix @@ -0,0 +1,18 @@ +# +# A list of packages we want around for machines we expect +# to sometimes be offline; even if they'd normally be intantiated +# via a nix shell expression. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }@specialArgs: +{ + # + # Systemwide environment packages. + # + + # List packages installed in system profile. To search, run: + # $ nix search nixpkgs wget + environment.systemPackages = (import ./offline.pkgs.nix) specialArgs; + +} diff --git a/nixos/packages/offline.pkgs.nix b/nixos/packages/offline.pkgs.nix new file mode 100644 index 0000000..e782929 --- /dev/null +++ b/nixos/packages/offline.pkgs.nix @@ -0,0 +1,90 @@ +{ + pkgs, + esp-dev, + is-hm-standalone, + ... +}: +with pkgs; +[ + + # Utilities. + dos2unix + socat + yt-dlp + fontpreview + + # Development. + act + go + rustc + cargo + bundix + typescript + clang + clang-analyzer + clangStdenv + autoconf + automake + octave + yosys + android-tools + python3 + cfr + procyon + + # Build systems. + cmake + gnumake + meson + ninja +] + +# Linux-only packages. +++ ( + if pkgs.stdenv.isLinux then + [ + # Nix enhancements. + nix-ld + + # Development. + #swift # Not necessary on Darwin. :) + gdb # Temporary here due to a conflict with the ARM version. + ] + else + [ ] +) + +# x86_64 only packages +++ ( + if pkgs.stdenv.isx86_64 then + [ + + clang_multi + gcc_multi + + ] + else + [ ] +) + +# Mac-only packages. +++ ( + if pkgs.stdenv.isDarwin then + [ + + ] + else + [ ] +) + +# NixOS-only packages. +++ ( + if pkgs.stdenv.isDarwin then + [ + + esp-dev.esp-idf-full + + ] + else + [ ] +) diff --git a/nixos/packages/proprietary.nix b/nixos/packages/proprietary.nix new file mode 100644 index 0000000..009e574 --- /dev/null +++ b/nixos/packages/proprietary.nix @@ -0,0 +1,63 @@ +# +# GUI packages we want in our environment. +# For machines that have GUI support. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, deprekages, ... }: +let + proprietaryPopulated = builtins.pathExists ../../proprietary/README.md; + installProprietaryLinux = pkgs.stdenv.isLinux && proprietaryPopulated; + installProprietaryMac = pkgs.stdenv.isDarwin && installProprietaryMac; + installProprietaryx86_64 = pkgs.stdenv.isLinux && proprietaryPopulated; + installProprietaryaarch64 = pkgs.stdenv.isDarwin && installProprietaryMac; +in +{ + # + # Proprietary packages. + # Skipped if proprietary is not cloned. + # + + environment.systemPackages = + with pkgs; + [ ] + + # Linux-only packages. + ++ ( + if installProprietaryLinux then + [ + deprekages.binary-ninja + deprekages.flexbv + ] + else + [ ] + ) + + # Mac-only packages. + ++ ( + if installProprietaryMac then + [ + ] + else + [ ] + ) + + # x86_64 only packages + ++ ( + if installProprietaryx86_64 then + [ + ] + else + [ ] + ) + + # aarch64 only packages + ++ ( + if installProprietaryaarch64 then + [ + ] + else + [ ] + ); + +} diff --git a/nixos/packages/wine.nix b/nixos/packages/wine.nix new file mode 100644 index 0000000..655f89d --- /dev/null +++ b/nixos/packages/wine.nix @@ -0,0 +1,47 @@ +# +# Wine packages for installing certain tools. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +{ + # + # Systemwide environment packages, for GUI. + # + environment.systemPackages = + with pkgs; + [ + winetricks + ] + + # Linux-only packages. + ++ ( + if pkgs.stdenv.isLinux then + [ + + ] + else + [ ] + ) + + # Mac-only packages. + ++ ( + if pkgs.stdenv.isDarwin then + [ + + ] + else + [ ] + ) + + # x86_64 only packages + ++ ( + if pkgs.stdenv.isx86_64 then + [ + + ] + else + [ ] + ); + +} diff --git a/nixos/services/clipboard-sync.nix b/nixos/services/clipboard-sync.nix new file mode 100644 index 0000000..0607dfb --- /dev/null +++ b/nixos/services/clipboard-sync.nix @@ -0,0 +1,21 @@ +# +# XWayland/wayland multi-session clipboard sync service. +# +# vim: et:ts=2:sw=2: +# +{ deprekages, ... }: +{ + systemd.user.services.clipboard-sync = { + after = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + wantedBy = [ "graphical-session.target" ]; + requisite = [ "graphical-session.target" ]; + + description = "clipboard sync for old and new wayland clients"; + + serviceConfig = { + ExecStart = "${deprekages.clipboard-sync}/bin/clipboard-sync --hide-timestamp --log-level debug"; + Restart = "on-failure"; + }; + }; +} diff --git a/nixos/services/tailscale.nix b/nixos/services/tailscale.nix new file mode 100644 index 0000000..0f903ff --- /dev/null +++ b/nixos/services/tailscale.nix @@ -0,0 +1,10 @@ +# +# Tailscale service configuration. +# +# vim: et:ts=2:sw=2: +# +{ pkgs, ... }: +{ + services.tailscale.enable = true; + environment.systemPackages = [ pkgs.tailscale ]; +} diff --git a/nixos/services/taskwarrior.nix b/nixos/services/taskwarrior.nix new file mode 100644 index 0000000..d6ccaba --- /dev/null +++ b/nixos/services/taskwarrior.nix @@ -0,0 +1,26 @@ +# +# Taskwarrior automatic syncing. +# +{ pkgs, ... }: +{ + + # Set up a timer to run sync every 5 minutes... + systemd.timers."taskwarrior-sync" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = "5m"; + OnUnitActiveSec = "5m"; + Unit = "taskwarrior-sync.service"; + }; + }; + + # ... which just runs the "task sync" task, if we can. + systemd.services."taskwarrior-sync" = { + script = "${pkgs.taskwarrior3}/bin/task sync"; + serviceConfig = { + Type = "oneshot"; + User = "deprekated"; + }; + }; + +} diff --git a/nvim/.gitignore b/nvim/.gitignore new file mode 100644 index 0000000..cc5457a --- /dev/null +++ b/nvim/.gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/nvim/.neoconf.json b/nvim/.neoconf.json new file mode 100644 index 0000000..7c48087 --- /dev/null +++ b/nvim/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..55b8979 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1 @@ +require("config.lazy") diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..27e9e06 --- /dev/null +++ b/nvim/lua/config/autocmds.lua @@ -0,0 +1,3 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- Add any additional autocmds here diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..2c134f7 --- /dev/null +++ b/nvim/lua/config/keymaps.lua @@ -0,0 +1,3 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..fd269d7 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,47 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + +if not (vim.uv or vim.loop).fs_stat(lazypath) then + -- bootstrap lazy.nvim + -- stylua: ignore + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +end +vim.opt.rtp:prepend(vim.env.LAZY or lazypath) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import any extras modules here + -- { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.json" }, + -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "tokyonight", "habamax" } }, + checker = { enabled = true }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua new file mode 100644 index 0000000..6c80eed --- /dev/null +++ b/nvim/lua/config/options.lua @@ -0,0 +1,87 @@ +vim.cmd([[ + syntax on + filetype plugin indent on + + let mapleader="," + + """ Options + set number " Show line numbers. + set modeline " Allow vim commands in text file comments. + set undofile " Persistent undo tree. + set incsearch " Incremental search. + set tabstop=4 " Number of visual spaces to be displayed per HT. + set expandtab " Expand tabs to spaces by default. + set shiftwidth=0 " Use tabstop value for indenting. + set scrolloff=2 " Keep 2 lines between the end of the buffer and the cursor. + set sidescrolloff=2 " Keep 2 characters between the current column and the screen edge. + set mouse=n " Enable the mouse in normal mode. + set colorcolumn=120 + set wildmenu " Tab-complete command menu. + set wildmode=longest:full,full " Most bash-like way. + set wildignorecase " Ignore case when completing. + set splitright " Make :vsplit put the new window on the right. + set splitbelow " Make :split put the new window on the bottom. + set foldlevel=5 " Don't fold almost anything by default. + set hidden " Allow for hidden, modified but not written buffers. + set bufhidden=hide " Hide buffers instead of deleting or unloading them. + set ignorecase + set smartcase + set gdefault + set cindent " A good basis/default for many languages, though this is usually overridden by the filetype plugin. + set cinoptions=l1,j1 " Indent case blocks correct, and indent Java anonymous classes correctly. + " Autowrap comments using textwidth, inserting the comment leader, + " and remove the comment leader when joining lines when it makes sense. + set formatoptions=cj + " Don't display . on folds. + set fillchars=fold:\ + set diffopt=algorithm:patience + set fsync " Syncs the filesystem after :write. + set nowrap + + set updatetime=1000 "Lets languageservers update faster, and shortens the time for CursorHold. + set noshowmode " We're using lualine, so showing the mode in the command line is redundant. + + " Have the visual-selection indent commands re-highlight the last visual selection after indenting. + vnoremap > >gv + vnoremap < + + " Leader Q should banish the current window. + map q :only \| :q + + " Leader W should save and then banish the current window. + map q :only \| :wq + + " Fold augroups, functions, Lua, and Python + let g:vimsyn_folding = 'aflP' + + " Support embedded Lua and Python. + let g:vimsyn_embed = 'lP' + + " Highlight whitespace errors. + let g:c_space_errors = 1 + let g:python_space_error_highlight = 1 + + let g:python_highlight_builtins = 1 + let g:python_highlight_builtin_funcs = 1 + let g:python_highlight_builtin_types = 1 + let g:python_highlight_exceptions = 1 + let g:python_highlight_string_formatting = 1 + let g:python_highlight_string_format = 1 + let g:python_highlight_indent_errors = 1 + let g:python_highlight_space_errors = 1 + let g:python_highlight_class_vars = 1 + + let g:xsh_highlight_all = v:true + + let g:NERDCustomDelimiters = { 'dosini': { 'left': '#' }, 'xonsh': { 'left': '#' } } + + " Use truecolor. + set termguicolors + + " Disable relative numbering, if anything turns it on. + set nornu! +]]) diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua new file mode 100644 index 0000000..b8dbece --- /dev/null +++ b/nvim/lua/plugins/completion.lua @@ -0,0 +1,44 @@ +return { + { + "hrsh7th/nvim-cmp", + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 + and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + -- You could replace select_next_item() with confirm({ select = true }) to get VS Code autocompletion behavior + cmp.select_next_item() + elseif vim.snippet.active({ direction = 1 }) then + vim.schedule(function() + vim.snippet.jump(1) + end) + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif vim.snippet.active({ direction = -1 }) then + vim.schedule(function() + vim.snippet.jump(-1) + end) + else + fallback() + end + end, { "i", "s" }), + }) + end, + }, +} diff --git a/nvim/lua/plugins/core.lua b/nvim/lua/plugins/core.lua new file mode 100644 index 0000000..af4fa0b --- /dev/null +++ b/nvim/lua/plugins/core.lua @@ -0,0 +1,121 @@ +return { + { + "LazyVim/LazyVim", + opts = { + colorscheme = function() end, + + defaults = { + autocmds = true, + keymaps = true, + }, + + news = { + lazyvim = false, + neovim = false, + }, + + -- icons used by other plugins + -- stylua: ignore + icons = { + misc = { + dots = "󰇘", + }, + dap = { + Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" }, + Breakpoint = " ", + BreakpointCondition = " ", + BreakpointRejected = { " ", "DiagnosticError" }, + LogPoint = ".>", + }, + diagnostics = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " ", + }, + git = { + added = " ", + modified = " ", + removed = " ", + }, + kinds = { + Array = " ", + Boolean = "󰨙 ", + Class = " ", + Codeium = "󰘦 ", + Color = " ", + Control = " ", + Collapsed = " ", + Constant = "󰏿 ", + Constructor = " ", + Copilot = " ", + Enum = " ", + EnumMember = " ", + Event = " ", + Field = " ", + File = " ", + Folder = " ", + Function = "󰊕 ", + Interface = " ", + Key = " ", + Keyword = " ", + Method = "󰊕 ", + Module = " ", + Namespace = "󰦮 ", + Null = " ", + Number = "󰎠 ", + Object = " ", + Operator = " ", + Package = " ", + Property = " ", + Reference = " ", + Snippet = " ", + String = " ", + Struct = "󰆼 ", + TabNine = "󰏚 ", + Text = " ", + TypeParameter = " ", + Unit = " ", + Value = " ", + Variable = "󰀫 ", + }, + }, + ---@type table? + kind_filter = { + default = { + "Class", + "Constructor", + "Enum", + "Field", + "Function", + "Interface", + "Method", + "Module", + "Namespace", + "Package", + "Property", + "Struct", + "Trait", + }, + markdown = false, + help = false, + -- you can specify a different filter for each filetype + lua = { + "Class", + "Constructor", + "Enum", + "Field", + "Function", + "Interface", + "Method", + "Module", + "Namespace", + -- "Package", -- remove package since luals uses it for control flow structures + "Property", + "Struct", + "Trait", + }, + }, + }, + }, +} diff --git a/nvim/lua/plugins/dashboard.lua b/nvim/lua/plugins/dashboard.lua new file mode 100644 index 0000000..20be583 --- /dev/null +++ b/nvim/lua/plugins/dashboard.lua @@ -0,0 +1,37 @@ +return { + "nvimdev/dashboard-nvim", + opts = function() + local logo = [[ + ░ ░░░░ ░░ ░░ ░░ ░░░░ ░░ ░░░░ ░░ ░░░░ ░░ ░░ ░░░░ ░ + ▒ ▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒▒▒▒ ▒▒ ▒▒ ▒▒▒ ▒▒▒ ▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒ ▒▒ ▒ + ▓ ▓▓▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓ ▓▓ ▓▓▓▓▓▓ ▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▓ + █ ███ ██████ █████ ████████ █ █ ██ ███ █████ ███████ █████ █ █ █ + █ ████ █████ █████ ██ ████ ██ ████ █████ █████ ██ ████ █ + ]] + logo = "\n\n" .. logo + + return { + change_to_vcs_root = true, + + config = { + header = vim.split(logo, "\n"), + footer = { + "", + "You are accessing a Tactile Metrology LLC information system, which includes: ", + "(1) this computer, (2) this computer network, (3) all computers connected to this ", + "network, and (4) all devices and storage media attached to this network or to a ", + "computer on this network. ", + "", + "This information system is provided so that you may be gay, and do crime. ", + "", + "Unauthorized or improper use of this system had better be pretty frickin' awesome.", + }, + shortcut = { + { desc = "[ deprekated]", group = "DashboardShortCut" }, + { desc = "[ Kate Adkins]", group = "DashboardShortCut" }, + { desc = "[󱄅 powered by Lix]", group = "DashboardShortCut" }, + }, + }, + } + end, +} diff --git a/nvim/lua/plugins/example.lua b/nvim/lua/plugins/example.lua new file mode 100644 index 0000000..8b7eabc --- /dev/null +++ b/nvim/lua/plugins/example.lua @@ -0,0 +1,238 @@ +-- since this is just an example spec, don't actually load anything here and return an empty spec +-- stylua: ignore +if true then return {} end + +-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim +-- +-- In your plugin files, you can: +-- * add extra plugins +-- * disable/enabled LazyVim plugins +-- * override the configuration of LazyVim plugins +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, + + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, + + -- disable trouble + { "folke/trouble.nvim", enabled = false }, + + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + table.insert(opts.sources, { name = "emoji" }) + end, + }, + + -- change some telescope options and a keymap to browse plugin files + { + "nvim-telescope/telescope.nvim", + keys = { + -- add a keymap to browse plugin files + -- stylua: ignore + { + "fp", + function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + desc = "Find Plugin File", + }, + }, + -- change some options + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { prompt_position = "top" }, + sorting_strategy = "ascending", + winblend = 0, + }, + }, + }, + + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").lsp.on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) + end, + }, + + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, "😄") + end, + }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, + + -- Use for completion and snippets (supertab) + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-emoji", + }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif vim.snippet.active({ direction = 1 }) then + vim.schedule(function() + vim.snippet.jump(1) + end) + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif vim.snippet.active({ direction = -1 }) then + vim.schedule(function() + vim.snippet.jump(-1) + end) + else + fallback() + end + end, { "i", "s" }), + }) + end, + }, +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..950573b --- /dev/null +++ b/nvim/lua/plugins/lsp.lua @@ -0,0 +1,11 @@ +return { + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "nil", + "pyright", + }, + }, + }, +} diff --git a/nvim/lua/plugins/regular-ui.lua b/nvim/lua/plugins/regular-ui.lua new file mode 100644 index 0000000..a8b97bd --- /dev/null +++ b/nvim/lua/plugins/regular-ui.lua @@ -0,0 +1,4 @@ +return { + -- disable the weird UI provided by noice.nvim + { "folke/noice.nvim", enabled = false }, +} diff --git a/nvim/lua/plugins/theme.lua b/nvim/lua/plugins/theme.lua new file mode 100644 index 0000000..a22b501 --- /dev/null +++ b/nvim/lua/plugins/theme.lua @@ -0,0 +1,16 @@ +return { + { + "lifepillar/vim-solarized8", + lazy = false, + priority = 1000, + config = function() + vim.cmd([[ + colorscheme solarized8 + + " Make Solaried8 a biiiit darker. + highlight Normal guibg=#001E27 + highlight LineNR ctermfg=11 guibg=#0B262D + ]]) + end, + }, +} diff --git a/openocd/tigard-jtag.cfg b/openocd/tigard-jtag.cfg new file mode 100644 index 0000000..4ac70e2 --- /dev/null +++ b/openocd/tigard-jtag.cfg @@ -0,0 +1,8 @@ +interface ftdi +ftdi_vid_pid 0x0403 0x6010 +ftdi_channel 1 +adapter_khz 2000 +ftdi_layout_init 0x0038 0x003b +ftdi_layout_signal nTRST -data 0x0010 +ftdi_layout_signal nSRST -data 0x0020 +transport select jtag diff --git a/packages/age-plugin-yubikey.nix b/packages/age-plugin-yubikey.nix new file mode 100644 index 0000000..49ef289 --- /dev/null +++ b/packages/age-plugin-yubikey.nix @@ -0,0 +1,48 @@ +{ lib +, stdenv +, rustPlatform +, fetchFromGitHub +, pkg-config +, openssl +, pcsclite +, PCSC ? null +, Foundation ? null +, IOKit ? null +}: + +rustPlatform.buildRustPackage rec { + pname = "age-plugin-yubikey"; + version = "0.5.0"; + + src = fetchFromGitHub { + owner = "str4d"; + repo = "age-plugin-yubikey"; + rev = "ca1cd587ff289ee1b9d8f72120e5a2acfb9560ae"; + hash = "sha256-9ghnPe83K+qixaFKCdM2FCPoENTNJnZA+OmmpD0E5LE="; + }; + + cargoHash = "sha256-8petNuCJ1qS6XKt+24Lg/bZh96yj9oO6fu/z65Xhi4k="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + openssl + ] + ++ lib.optional stdenv.isLinux pcsclite + ++ lib.optionals stdenv.isDarwin [ + IOKit + Foundation + PCSC + ]; + + meta = with lib; { + description = "YubiKey plugin for age"; + mainProgram = "age-plugin-yubikey"; + homepage = "https://github.com/str4d/age-plugin-yubikey"; + changelog = "https://github.com/str4d/age-plugin-yubikey/blob/${src.rev}/CHANGELOG.md"; + license = with licenses; [ mit asl20 ]; + maintainers = with maintainers; [ kranzes vtuan10 ]; + }; +} diff --git a/packages/argos.nix b/packages/argos.nix new file mode 100644 index 0000000..7956241 --- /dev/null +++ b/packages/argos.nix @@ -0,0 +1,78 @@ +# +# Argos standalone MPD client. +# +# vim: et:ts=2:sw=2: +{ + lib, + pkgs, + meson, + fetchFromGitHub, + pkg-config, + glib, + gobject-introspection, + python3, + ninja, + wrapGAppsHook, + kdePackages, + ... +}: +let + pythonWithPackages = python3.withPackages ( + pkgs: with pkgs; [ + pyxdg + aiohttp + pygobject3 + ] + ); +in +pkgs.stdenv.mkDerivation rec { + pname = "argos"; + version = "1.13.0"; + + nativeBuildInputs = [ + meson + ninja + pkg-config + wrapGAppsHook + ]; + + buildInputs = [ + glib + gobject-introspection + pythonWithPackages + kdePackages.breeze-icons + ]; + + # The post-install script assumes that package managers are here to + # package up their e.g. gschemas; and thus won't do it if DESTDIR + # is set. We just patch out the post-install script and do it ourselves. + postPatch = '' + substituteInPlace meson.build \ + --replace-fail \ + "meson.add_install_script('build-aux/meson/postinstall.py')" \ + "" + ''; + + preFixup = '' + # Compile our gschema... + ${glib.dev}/bin/glib-compile-schemas $out/share/gsettings-schemas/argos-1.13.0/glib-2.0/schemas + + # ... and add known-good icons, since this will fail if there's any icons missing. + gappsWrapperArgs+=( + --prefix XDG_DATA_DIRS : "${kdePackages.breeze-icons}/share" + ) + ''; + + src = fetchFromGitHub { + owner = "orontee"; + repo = "argos"; + rev = "v${version}"; + hash = "sha256-LzSGTqsqe07FO+gH2aWgFSicubfNopPy+Os3bPWIR2c="; + }; + + meta = { + description = "Standalone Mopidy client."; + homepage = "https://github.com/Yepkit/ykush"; + license = lib.licenses.gpl3; + }; +} diff --git a/packages/avbroot/avbroot b/packages/avbroot/avbroot new file mode 100755 index 0000000..18fa8f1 Binary files /dev/null and b/packages/avbroot/avbroot differ diff --git a/packages/avbroot/default.nix b/packages/avbroot/default.nix new file mode 100644 index 0000000..c5ebb26 --- /dev/null +++ b/packages/avbroot/default.nix @@ -0,0 +1,17 @@ +{ stdenv, ... }: +stdenv.mkDerivation { + name = "avbroot"; + version = "2024-10-04"; + + src = ./avbroot; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + installPhase = '' + mkdir -p $out/bin + cp -r $src $out/bin/avbroot + ''; + +} diff --git a/packages/binary-ninja.nix b/packages/binary-ninja.nix new file mode 100644 index 0000000..2470991 --- /dev/null +++ b/packages/binary-ninja.nix @@ -0,0 +1,84 @@ +# +# Binary ninja. +# +# vim: et:ts=2:sw=2: +# +{ + stdenv, + autoPatchelfHook, + makeWrapper, + writeText, + unzip, + libGL, + xorg, + glib, + fontconfig, + dbus, + xkeyboard_config, + libxkbcommon, + wayland, + qt6, +}: +let + desktopFile = writeText "binary-ninja.desktop" '' + [Desktop Entry] + Type=Application + Name=Binary Ninja + Exec=/run/current-system/sw/bin/binaryninja + Icon=/run/current-system/sw/share/icons/binary-ninja.png + Categories=Development; + ''; + + binary-ninja = stdenv.mkDerivation { + pname = "binary-ninja"; + version = "4.0.4958"; + + buildInputs = [ + autoPatchelfHook + qt6.wrapQtAppsHook + makeWrapper + unzip + libGL + stdenv.cc.cc.lib + glib + libxkbcommon + fontconfig + xorg.libXi + xorg.libXrender + xorg.libxcb + xorg.xcbutil + xorg.xcbutilwm + xorg.xcbutilimage + xorg.xcbutilkeysyms + xorg.xcbutilrenderutil + qt6.qtdeclarative + wayland + dbus + ]; + + # Use our local zip directly. + dontBuild = true; + src = ../proprietary/binja/binaryninja_personal_linux.zip; + + installPhase = '' + mkdir -p $out/opt + cp -r * $out/opt + chmod +x $out/opt/binaryninja + + # Icons. + mkdir -p $out/share/icons + cp -r docs/img/logo.png $out/share/icons/binary-ninja.png + + # Application file. + mkdir -p $out/share/applications + cp ${desktopFile} $out/share/applications/binary-ninja.desktop + + mkdir -p $out/bin + makeWrapper $out/opt/binaryninja \ + $out/bin/binaryninja \ + --prefix "QT_XKB_CONFIG_ROOT" ":" "${xkeyboard_config}/share/X11/xkb" + ln -s $out/bin/binaryninja $out/bin/binary-ninja + ''; + }; +in +binary-ninja diff --git a/packages/clipboard-sync.nix b/packages/clipboard-sync.nix new file mode 100644 index 0000000..747858c --- /dev/null +++ b/packages/clipboard-sync.nix @@ -0,0 +1,31 @@ +# +# Clipboard sync utility. +# +# vim: et:ts=2:sw=2: +# +{ + rustPlatform, + fetchFromGitHub, + xorg +}: +rustPlatform.buildRustPackage rec { + pname = "clipboard-sync"; + version = "0.2.0"; + + buildInputs = [ + xorg.libxcb + ]; + + src = fetchFromGitHub { + owner = "dnut"; + repo = pname; + rev = version; + hash = "sha256-gme5pwQrwQbk8MroF/mGYqlY6hcjM5cHKHL7Y3nlW9k="; + }; + + cargoHash = "sha256-/LGRgml+iNwoMrMCmDesCpXA1qgWKauuqM540SZMS3Y="; + + meta = { + description = "Wayland and X multi-instance clipboard syncing"; + }; +} diff --git a/packages/dell/bios-fan-control.nix b/packages/dell/bios-fan-control.nix new file mode 100644 index 0000000..779c953 --- /dev/null +++ b/packages/dell/bios-fan-control.nix @@ -0,0 +1,23 @@ +{ stdenv, lib, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "dell-bios-fan-control"; + src = fetchFromGitHub { + owner = "TomFreudenberg"; + repo = "dell-bios-fan-control"; + rev = "27006106595bccd6c309da4d1499f93d38903f9a"; + hash = "sha256-3ihzvwL86c9VJDfGpbWpkOwZ7qU0E5U2UuOeCwPMR1s="; + }; + + installPhase = '' + mkdir -p $out/bin + cp dell-bios-fan-control $out/bin + ''; + + meta = with lib; { + description = "Take control of fans on Dell"; + homepage = "https://github.com/TomFreudenberg/dell-bios-fan-control"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/packages/dell/default.nix b/packages/dell/default.nix new file mode 100644 index 0000000..feb1cf9 --- /dev/null +++ b/packages/dell/default.nix @@ -0,0 +1,6 @@ +{ callPackage }: +{ + i8k = callPackage ./i8k.nix { }; + fan = callPackage ./fan.nix { }; + bios-fan-control = callPackage ./bios-fan-control.nix { }; +} diff --git a/packages/dell/fan.nix b/packages/dell/fan.nix new file mode 100644 index 0000000..cd2dcf8 --- /dev/null +++ b/packages/dell/fan.nix @@ -0,0 +1,28 @@ +{ stdenv, lib, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "dellfan"; + src = fetchFromGitHub { + owner = "clopez"; + repo = "dellfan"; + rev = "43439951144b0feb6019e1901e53d60a619a7c6c"; + hash = "sha256-L3HjXnkBKxdwqJarsOIFNyZYr+u9bjMiezDS12Dh2sg="; + }; + + postUnpack = '' + sed -i -e '173d' source/dellfan.c + sed -i 's/0x0001/0x3000/g' source/dellfan.c + ''; + + installPhase = '' + mkdir -p $out/bin + cp dellfan $out/bin + ''; + + meta = with lib; { + description = "Take control of fans on Dell"; + homepage = "https://github.com/clopez/dellfan"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/packages/dell/i8k.nix b/packages/dell/i8k.nix new file mode 100644 index 0000000..16507d1 --- /dev/null +++ b/packages/dell/i8k.nix @@ -0,0 +1,39 @@ +{ stdenv, lib, fetchFromGitHub, pkgs, tcl, tcllib }: + +stdenv.mkDerivation rec { + name = "i8kutils-${version}"; + version = "1.6"; + + src = fetchFromGitHub { + owner = "Wer-Wolf"; + repo = "i8kutils"; + rev = "58ced78ab04d7d46ff2447c19f1cfd935ad2fa75"; + hash = "sha256-Tx3sOIbGi+wLsAq7eTM+UXgHKhbRzYM7xrin+g7ivrc="; + }; + + mesonFlags = [ + "-Dmoduledir=${placeholder "out"}/lib" + ]; + + postUnpack = '' + sed -i '/etc/d' source/meson.build + ''; + + nativeBuildInputs = with pkgs; [ meson ninja ]; + buildInputs = with pkgs; [ pkg-config cmake systemd makeWrapper ]; + + postInstall = '' + wrapProgram "$out/bin/i8kmon" \ + --set PATH ${lib.makeBinPath [ tcl ]} \ + --set TCL8_6_TM_PATH "$out/lib" \ + --set TCLLIBPATH "${tcl}/lib ${tcllib}/lib" + wrapProgram "$out/bin/i8kctl" --set TCL8_6_TM_PATH "$out/lib" + ''; + + meta = with lib; { + description = "A kernel module to control fans on Dell"; + homepage = "https://github.com/Wer-Wolf/i8kutils"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/packages/dreamsource-udev-rules/60-dreamsourcelab.rules b/packages/dreamsource-udev-rules/60-dreamsourcelab.rules new file mode 100644 index 0000000..05f68ba --- /dev/null +++ b/packages/dreamsource-udev-rules/60-dreamsourcelab.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usb", ATTRS{idVendor}=="2a0e", MODE="0666" diff --git a/packages/dreamsource-udev-rules/default.nix b/packages/dreamsource-udev-rules/default.nix new file mode 100644 index 0000000..09f3ef5 --- /dev/null +++ b/packages/dreamsource-udev-rules/default.nix @@ -0,0 +1,19 @@ +# +# udev rules for Tilt Five devices +# +{ pkgs }: +pkgs.stdenv.mkDerivation rec { + pname = "dreamsourcelab-udev-rules"; + meta.description = "udev rules for DreamSourceLab devices"; + version = "0.0.1"; + + dontBuild = true; + dontConfigure = true; + + src = ./.; + + installPhase = '' + mkdir -p $out/lib/udev/rules.d + cp $src/60-dreamsourcelab.rules $out/lib/udev/rules.d/60-dreamsourcelab.rules + ''; +} diff --git a/packages/firefox-webserial/default.nix b/packages/firefox-webserial/default.nix new file mode 100644 index 0000000..a95c58a --- /dev/null +++ b/packages/firefox-webserial/default.nix @@ -0,0 +1,69 @@ +# +# Webserial for firefox. +# +{ lib +, stdenv +, fetchFromGitHub +, ws-server +, cjson +, libserialport +, linuxHeaders +, glibc +}: +stdenv.mkDerivation rec { + pname = "firefox-webserial"; + version = "0.3.2"; + + src = fetchFromGitHub { + owner = "kuba2k2"; + repo = "firefox-webserial"; + rev = "v${version}"; + hash = "sha256-ML5AtkR2GGZ99wuE+GiZA5Vb9pZG62AjRwV5sL5dK/U="; + }; + + # Things that need to be copied into our build. + extra_src= ./extra_src; + + buildInputs = [ + linuxHeaders + libserialport + ws-server + cjson + glibc + ]; + + # Build it ourselves, since its build system is _wonk_. + buildPhase = '' + cp -r $src/native/src/* . + cp ${extra_src}/* . + + gcc -o ${meta.mainProgram} *.c -pthread \ + ${ws-server}/lib/libws.a \ + ${cjson}/lib/libcjson.so \ + -DSP_PRIV="" \ + -I${cjson}/include/cjson \ + -I${ws-server}/include/wsserver \ + -I. \ + ''; + + installPhase = '' + mkdir -p $out/bin + + # Copy our main program... + cp ${meta.mainProgram} $out/bin/ + + # ... and the config for it. + mkdir -p "$out/lib/mozilla/native-messaging-hosts" + sed -i -e "s|REPLACE_ME_WITH_SED|$out/bin/${meta.mainProgram}|" "webserial.json" + cp webserial.json "$out/lib/mozilla/native-messaging-hosts/io.github.kuba2k2.webserial.json" + ''; + + meta = with lib; { + description = "WebSerial API Polyfill for Mozilla Firefox browser"; + homepage = "https://github.com/kuba2k2/firefox-webserial/releases/download/v0.3.2/firefox-webserial-linux-x86-64"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + mainProgram = pname; + platforms = platforms.all; + }; +} diff --git a/packages/firefox-webserial/extra_src/config.h b/packages/firefox-webserial/extra_src/config.h new file mode 100644 index 0000000..e7ce516 --- /dev/null +++ b/packages/firefox-webserial/extra_src/config.h @@ -0,0 +1,5 @@ +#pragma once + +// Default values from autoconf +#define SP_API __attribute__((visibility("default"))) +#define SP_PRIV __attribute__((visibility("hidden"))) diff --git a/packages/firefox-webserial/extra_src/libserialport.h b/packages/firefox-webserial/extra_src/libserialport.h new file mode 100644 index 0000000..7467f74 --- /dev/null +++ b/packages/firefox-webserial/extra_src/libserialport.h @@ -0,0 +1,1827 @@ +/* + * This file is part of the libserialport project. + * + * Copyright (C) 2013, 2015 Martin Ling + * Copyright (C) 2014 Uwe Hermann + * Copyright (C) 2014 Aurelien Jacobs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @mainpage libserialport API + * + * Introduction + * ============ + * + * libserialport is a minimal library written in C that is intended to take + * care of the OS-specific details when writing software that uses serial ports. + * + * By writing your serial code to use libserialport, you enable it to work + * transparently on any platform supported by the library. + * + * libserialport is an open source project released under the LGPL3+ license. + * + * The library is maintained by the [sigrok](http://sigrok.org/) project. See + * the [libserialport homepage](http://sigrok.org/wiki/Libserialport) for the + * latest information. + * + * Source code is maintained in git at + * [git://sigrok.org/libserialport](http://sigrok.org/gitweb/?p=libserialport.git). + * + * Bugs are tracked at http://sigrok.org/bugzilla/. + * + * The library was conceived and designed by Martin Ling, is maintained by + * Uwe Hermann, and has received contributions from several other developers. + * See the git history for full credits. + * + * API information + * =============== + * + * The API has been designed from scratch. It does not exactly resemble the + * serial API of any particular operating system. Instead it aims to provide + * a set of functions that can reliably be implemented across all operating + * systems. These form a sufficient basis for higher level behaviour to + * be implemented in a platform independent manner. + * + * If you are porting code written for a particular OS, you may find you need + * to restructure things somewhat, or do without some specialised features. + * For particular notes on porting existing code, see @ref Porting. + * + * Examples + * -------- + * + * Some simple example programs using libserialport are included in the + * @c examples directory in the source package: + * + * - @ref list_ports.c - Getting a list of ports present on the system. + * - @ref port_info.c - Getting information on a particular serial port. + * - @ref port_config.c - Accessing configuration settings of a port. + * - @ref send_receive.c - Sending and receiving data. + * - @ref await_events.c - Awaiting events on multiple ports. + * - @ref handle_errors.c - Handling errors returned from the library. + * + * These examples are linked with the API documentation. Each function + * in the API reference includes links to where it is used in an example + * program, and each appearance of a function in the examples links + * to that function's entry in the API reference. + * + * Headers + * ------- + * + * To use libserialport functions in your code, you should include the + * libserialport.h header, i.e. + * @code + * #include + * @endcode + * + * Namespace + * --------- + * + * All identifiers defined by the public libserialport headers use the prefix + * @c sp_ (for functions and data types) or @c SP_ (for macros and constants). + * + * Functions + * --------- + * + * The functions provided by the library are documented in detail in + * the following sections: + * + * - @ref Enumeration (obtaining a list of serial ports on the system) + * - @ref Ports (opening, closing and getting information about ports) + * - @ref Configuration (baud rate, parity, etc.) + * - @ref Signals (modem control lines, breaks, etc.) + * - @ref Data (reading and writing data, and buffer management) + * - @ref Waiting (waiting for ports to be ready, integrating with event loops) + * - @ref Errors (getting error and debugging information) + * + * Data structures + * --------------- + * + * The library defines three data structures: + * + * - @ref sp_port, which represents a serial port. + * See @ref Enumeration. + * - @ref sp_port_config, which represents a port configuration. + * See @ref Configuration. + * - @ref sp_event_set, which represents a set of events. + * See @ref Waiting. + * + * All these structures are allocated and freed by library functions. It is + * the caller's responsibility to ensure that the correct calls are made to + * free allocated structures after use. + * + * Return codes and error handling + * ------------------------------- + * + * Most functions have return type @ref sp_return and can return only four + * possible error values: + * + * - @ref SP_ERR_ARG means that a function was called with invalid + * arguments. This implies a bug in the caller. The arguments passed would + * be invalid regardless of the underlying OS or serial device involved. + * + * - @ref SP_ERR_FAIL means that the OS reported a failure. The error code or + * message provided by the OS can be obtained by calling sp_last_error_code() + * or sp_last_error_message(). + * + * - @ref SP_ERR_SUPP indicates that there is no support for the requested + * operation in the current OS, driver or device. No error message is + * available from the OS in this case. There is either no way to request + * the operation in the first place, or libserialport does not know how to + * do so in the current version. + * + * - @ref SP_ERR_MEM indicates that a memory allocation failed. + * + * All of these error values are negative. + * + * Calls that succeed return @ref SP_OK, which is equal to zero. Some functions + * declared @ref sp_return can also return a positive value for a successful + * numeric result, e.g. sp_blocking_read() or sp_blocking_write(). + * + * An error message is only available via sp_last_error_message() in the case + * where @ref SP_ERR_FAIL was returned by the previous function call. The error + * message returned is that provided by the OS, using the current language + * settings. It is an error to call sp_last_error_code() or + * sp_last_error_message() except after a previous function call returned + * @ref SP_ERR_FAIL. The library does not define its own error codes or + * messages to accompany other return codes. + * + * Thread safety + * ------------- + * + * Certain combinations of calls can be made concurrently, as follows. + * + * - Calls using different ports may always be made concurrently, i.e. + * it is safe for separate threads to handle their own ports. + * + * - Calls using the same port may be made concurrently when one call + * is a read operation and one call is a write operation, i.e. it is safe + * to use separate "reader" and "writer" threads for the same port. See + * below for which operations meet these definitions. + * + * Read operations: + * + * - sp_blocking_read() + * - sp_blocking_read_next() + * - sp_nonblocking_read() + * - sp_input_waiting() + * - sp_flush() with @ref SP_BUF_INPUT only. + * - sp_wait() with @ref SP_EVENT_RX_READY only. + * + * Write operations: + * + * - sp_blocking_write() + * - sp_nonblocking_write() + * - sp_output_waiting() + * - sp_drain() + * - sp_flush() with @ref SP_BUF_OUTPUT only. + * - sp_wait() with @ref SP_EVENT_TX_READY only. + * + * If two calls, on the same port, do not fit into one of these categories + * each, then they may not be made concurrently. + * + * Debugging + * --------- + * + * The library can output extensive tracing and debugging information. The + * simplest way to use this is to set the environment variable + * @c LIBSERIALPORT_DEBUG to any value; messages will then be output to the + * standard error stream. + * + * This behaviour is implemented by a default debug message handling + * callback. An alternative callback can be set using sp_set_debug_handler(), + * in order to e.g. redirect the output elsewhere or filter it. + * + * No guarantees are made about the content of the debug output; it is chosen + * to suit the needs of the developers and may change between releases. + * + * @anchor Porting + * Porting + * ------- + * + * The following guidelines may help when porting existing OS-specific code + * to use libserialport. + * + * ### Porting from Unix-like systems ### + * + * There are two main differences to note when porting code written for Unix. + * + * The first is that Unix traditionally provides a wide range of functionality + * for dealing with serial devices at the OS level; this is exposed through the + * termios API and dates to the days when serial terminals were common. If your + * code relies on many of these facilities you will need to adapt it, because + * libserialport provides only a raw binary channel with no special handling. + * + * The second relates to blocking versus non-blocking I/O behaviour. In + * Unix-like systems this is normally specified by setting the @c O_NONBLOCK + * flag on the file descriptor, affecting the semantics of subsequent @c read() + * and @c write() calls. + * + * In libserialport, blocking and nonblocking operations are both available at + * any time. If your existing code ѕets @c O_NONBLOCK, you should use + * sp_nonblocking_read() and sp_nonblocking_write() to get the same behaviour + * as your existing @c read() and @c write() calls. If it does not, you should + * use sp_blocking_read() and sp_blocking_write() instead. You may also find + * sp_blocking_read_next() useful, which reproduces the semantics of a blocking + * read() with @c VTIME=0 and @c VMIN=1 set in termios. + * + * Finally, you should take care if your program uses custom signal handlers. + * The blocking calls provided by libserialport will restart system calls that + * return with @c EINTR, so you will need to make your own arrangements if you + * need to interrupt blocking operations when your signal handlers are called. + * This is not an issue if you only use the default handlers. + * + * ### Porting from Windows ### + * + * The main consideration when porting from Windows is that there is no + * direct equivalent for overlapped I/O operations. + * + * If your program does not use overlapped I/O, you can simply use + * sp_blocking_read() and sp_blocking_write() as direct equivalents for + * @c ReadFile() and @c WriteFile(). You may also find sp_blocking_read_next() + * useful, which reproduces the special semantics of @c ReadFile() with + * @c ReadIntervalTimeout and @c ReadTotalTimeoutMultiplier set to @c MAXDWORD + * and @c ReadTotalTimeoutConstant set to between @c 1 and @c MAXDWORD-1 . + * + * If your program makes use of overlapped I/O to continue work while a serial + * operation is in progress, then you can achieve the same results using + * sp_nonblocking_read() and sp_nonblocking_write(). + * + * Generally, overlapped I/O is combined with either waiting for completion + * once there is no more background work to do (using @c WaitForSingleObject() + * or @c WaitForMultipleObjects()), or periodically checking for completion + * with @c GetOverlappedResult(). If the aim is to start a new operation for + * further data once the previous one has completed, you can instead simply + * call the nonblocking functions again with the next data. If you need to + * wait for completion, use sp_wait() to determine when the port is ready to + * send or receive further data. + */ + +#ifndef LIBSERIALPORT_LIBSERIALPORT_H +#define LIBSERIALPORT_LIBSERIALPORT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** @cond */ +#ifdef _MSC_VER +/* Microsoft Visual C/C++ compiler in use */ +#ifdef LIBSERIALPORT_MSBUILD +/* Building the library - need to export DLL symbols */ +#define SP_API __declspec(dllexport) +#else +/* Using the library - need to import DLL symbols */ +#define SP_API __declspec(dllimport) +#endif +#else +/* Some other compiler in use */ +#ifndef LIBSERIALPORT_ATBUILD +/* Not building the library itself - don't need any special prefixes. */ +#define SP_API +#endif +#endif +/** @endcond */ + +/** Return values. */ +enum sp_return { + /** Operation completed successfully. */ + SP_OK = 0, + /** Invalid arguments were passed to the function. */ + SP_ERR_ARG = -1, + /** A system error occurred while executing the operation. */ + SP_ERR_FAIL = -2, + /** A memory allocation failed while executing the operation. */ + SP_ERR_MEM = -3, + /** The requested operation is not supported by this system or device. */ + SP_ERR_SUPP = -4 +}; + +/** Port access modes. */ +enum sp_mode { + /** Open port for read access. */ + SP_MODE_READ = 1, + /** Open port for write access. */ + SP_MODE_WRITE = 2, + /** Open port for read and write access. @since 0.1.1 */ + SP_MODE_READ_WRITE = 3 +}; + +/** Port events. */ +enum sp_event { + /** Data received and ready to read. */ + SP_EVENT_RX_READY = 1, + /** Ready to transmit new data. */ + SP_EVENT_TX_READY = 2, + /** Error occurred. */ + SP_EVENT_ERROR = 4 +}; + +/** Buffer selection. */ +enum sp_buffer { + /** Input buffer. */ + SP_BUF_INPUT = 1, + /** Output buffer. */ + SP_BUF_OUTPUT = 2, + /** Both buffers. */ + SP_BUF_BOTH = 3 +}; + +/** Parity settings. */ +enum sp_parity { + /** Special value to indicate setting should be left alone. */ + SP_PARITY_INVALID = -1, + /** No parity. */ + SP_PARITY_NONE = 0, + /** Odd parity. */ + SP_PARITY_ODD = 1, + /** Even parity. */ + SP_PARITY_EVEN = 2, + /** Mark parity. */ + SP_PARITY_MARK = 3, + /** Space parity. */ + SP_PARITY_SPACE = 4 +}; + +/** RTS pin behaviour. */ +enum sp_rts { + /** Special value to indicate setting should be left alone. */ + SP_RTS_INVALID = -1, + /** RTS off. */ + SP_RTS_OFF = 0, + /** RTS on. */ + SP_RTS_ON = 1, + /** RTS used for flow control. */ + SP_RTS_FLOW_CONTROL = 2 +}; + +/** CTS pin behaviour. */ +enum sp_cts { + /** Special value to indicate setting should be left alone. */ + SP_CTS_INVALID = -1, + /** CTS ignored. */ + SP_CTS_IGNORE = 0, + /** CTS used for flow control. */ + SP_CTS_FLOW_CONTROL = 1 +}; + +/** DTR pin behaviour. */ +enum sp_dtr { + /** Special value to indicate setting should be left alone. */ + SP_DTR_INVALID = -1, + /** DTR off. */ + SP_DTR_OFF = 0, + /** DTR on. */ + SP_DTR_ON = 1, + /** DTR used for flow control. */ + SP_DTR_FLOW_CONTROL = 2 +}; + +/** DSR pin behaviour. */ +enum sp_dsr { + /** Special value to indicate setting should be left alone. */ + SP_DSR_INVALID = -1, + /** DSR ignored. */ + SP_DSR_IGNORE = 0, + /** DSR used for flow control. */ + SP_DSR_FLOW_CONTROL = 1 +}; + +/** XON/XOFF flow control behaviour. */ +enum sp_xonxoff { + /** Special value to indicate setting should be left alone. */ + SP_XONXOFF_INVALID = -1, + /** XON/XOFF disabled. */ + SP_XONXOFF_DISABLED = 0, + /** XON/XOFF enabled for input only. */ + SP_XONXOFF_IN = 1, + /** XON/XOFF enabled for output only. */ + SP_XONXOFF_OUT = 2, + /** XON/XOFF enabled for input and output. */ + SP_XONXOFF_INOUT = 3 +}; + +/** Standard flow control combinations. */ +enum sp_flowcontrol { + /** No flow control. */ + SP_FLOWCONTROL_NONE = 0, + /** Software flow control using XON/XOFF characters. */ + SP_FLOWCONTROL_XONXOFF = 1, + /** Hardware flow control using RTS/CTS signals. */ + SP_FLOWCONTROL_RTSCTS = 2, + /** Hardware flow control using DTR/DSR signals. */ + SP_FLOWCONTROL_DTRDSR = 3 +}; + +/** Input signals. */ +enum sp_signal { + /** Clear to send. */ + SP_SIG_CTS = 1, + /** Data set ready. */ + SP_SIG_DSR = 2, + /** Data carrier detect. */ + SP_SIG_DCD = 4, + /** Ring indicator. */ + SP_SIG_RI = 8 +}; + +/** + * Transport types. + * + * @since 0.1.1 + */ +enum sp_transport { + /** Native platform serial port. @since 0.1.1 */ + SP_TRANSPORT_NATIVE, + /** USB serial port adapter. @since 0.1.1 */ + SP_TRANSPORT_USB, + /** Bluetooth serial port adapter. @since 0.1.1 */ + SP_TRANSPORT_BLUETOOTH +}; + +/** + * @struct sp_port + * An opaque structure representing a serial port. + */ +struct sp_port; + +/** + * @struct sp_port_config + * An opaque structure representing the configuration for a serial port. + */ +struct sp_port_config; + +/** + * @struct sp_event_set + * A set of handles to wait on for events. + */ +struct sp_event_set { + /** Array of OS-specific handles. */ + void *handles; + /** Array of bitmasks indicating which events apply for each handle. */ + enum sp_event *masks; + /** Number of handles. */ + unsigned int count; +}; + +/** + * @defgroup Enumeration Port enumeration + * + * Enumerating the serial ports of a system. + * + * See @ref list_ports.c for a working example of port enumeration. + * + * @{ + */ + +/** + * Obtain a pointer to a new sp_port structure representing the named port. + * + * The user should allocate a variable of type "struct sp_port *" and pass a + * pointer to this to receive the result. + * + * The result should be freed after use by calling sp_free_port(). + * + * @param[in] portname The OS-specific name of a serial port. Must not be NULL. + * @param[out] port_ptr If any error is returned, the variable pointed to by + * port_ptr will be set to NULL. Otherwise, it will be set + * to point to the newly allocated port. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_port_by_name(const char *portname, struct sp_port **port_ptr); + +/** + * Free a port structure obtained from sp_get_port_by_name() or sp_copy_port(). + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @since 0.1.0 + */ +SP_API void sp_free_port(struct sp_port *port); + +/** + * List the serial ports available on the system. + * + * The result obtained is an array of pointers to sp_port structures, + * terminated by a NULL. The user should allocate a variable of type + * "struct sp_port **" and pass a pointer to this to receive the result. + * + * The result should be freed after use by calling sp_free_port_list(). + * If a port from the list is to be used after freeing the list, it must be + * copied first using sp_copy_port(). + * + * @param[out] list_ptr If any error is returned, the variable pointed to by + * list_ptr will be set to NULL. Otherwise, it will be set + * to point to the newly allocated array. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_list_ports(struct sp_port ***list_ptr); + +/** + * Make a new copy of an sp_port structure. + * + * The user should allocate a variable of type "struct sp_port *" and pass a + * pointer to this to receive the result. + * + * The copy should be freed after use by calling sp_free_port(). + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[out] copy_ptr If any error is returned, the variable pointed to by + * copy_ptr will be set to NULL. Otherwise, it will be set + * to point to the newly allocated copy. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_copy_port(const struct sp_port *port, struct sp_port **copy_ptr); + +/** + * Free a port list obtained from sp_list_ports(). + * + * This will also free all the sp_port structures referred to from the list; + * any that are to be retained must be copied first using sp_copy_port(). + * + * @param[in] ports Pointer to a list of port structures. Must not be NULL. + * + * @since 0.1.0 + */ +SP_API void sp_free_port_list(struct sp_port **ports); + +/** + * @} + * @defgroup Ports Port handling + * + * Opening, closing and querying ports. + * + * See @ref port_info.c for a working example of getting port information. + * + * @{ + */ + +/** + * Open the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] flags Flags to use when opening the serial port. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_open(struct sp_port *port, enum sp_mode flags); + +/** + * Close the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_close(struct sp_port *port); + +/** + * Get the name of a port. + * + * The name returned is whatever is normally used to refer to a port on the + * current operating system; e.g. for Windows it will usually be a "COMn" + * device name, and for Unix it will be a device path beginning with "/dev/". + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return The port name, or NULL if an invalid port is passed. The name + * string is part of the port structure and may not be used after + * the port structure has been freed. + * + * @since 0.1.0 + */ +SP_API char *sp_get_port_name(const struct sp_port *port); + +/** + * Get a description for a port, to present to end user. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return The port description, or NULL if an invalid port is passed. + * The description string is part of the port structure and may not + * be used after the port structure has been freed. + * + * @since 0.1.1 + */ +SP_API char *sp_get_port_description(const struct sp_port *port); + +/** + * Get the transport type used by a port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return The port transport type. + * + * @since 0.1.1 + */ +SP_API enum sp_transport sp_get_port_transport(const struct sp_port *port); + +/** + * Get the USB bus number and address on bus of a USB serial adapter port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[out] usb_bus Pointer to a variable to store the USB bus. + * Can be NULL (in that case it will be ignored). + * @param[out] usb_address Pointer to a variable to store the USB address. + * Can be NULL (in that case it will be ignored). + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.1 + */ +SP_API enum sp_return sp_get_port_usb_bus_address(const struct sp_port *port, + int *usb_bus, int *usb_address); + +/** + * Get the USB Vendor ID and Product ID of a USB serial adapter port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[out] usb_vid Pointer to a variable to store the USB VID. + * Can be NULL (in that case it will be ignored). + * @param[out] usb_pid Pointer to a variable to store the USB PID. + * Can be NULL (in that case it will be ignored). + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.1 + */ +SP_API enum sp_return sp_get_port_usb_vid_pid(const struct sp_port *port, int *usb_vid, int *usb_pid); + +/** + * Get the USB manufacturer string of a USB serial adapter port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return The port manufacturer string, or NULL if an invalid port is passed. + * The manufacturer string is part of the port structure and may not + * be used after the port structure has been freed. + * + * @since 0.1.1 + */ +SP_API char *sp_get_port_usb_manufacturer(const struct sp_port *port); + +/** + * Get the USB product string of a USB serial adapter port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return The port product string, or NULL if an invalid port is passed. + * The product string is part of the port structure and may not be + * used after the port structure has been freed. + * + * @since 0.1.1 + */ +SP_API char *sp_get_port_usb_product(const struct sp_port *port); + +/** + * Get the USB serial number string of a USB serial adapter port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return The port serial number, or NULL if an invalid port is passed. + * The serial number string is part of the port structure and may + * not be used after the port structure has been freed. + * + * @since 0.1.1 + */ +SP_API char *sp_get_port_usb_serial(const struct sp_port *port); + +/** + * Get the MAC address of a Bluetooth serial adapter port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return The port MAC address, or NULL if an invalid port is passed. + * The MAC address string is part of the port structure and may not + * be used after the port structure has been freed. + * + * @since 0.1.1 + */ +SP_API char *sp_get_port_bluetooth_address(const struct sp_port *port); + +/** + * Get the operating system handle for a port. + * + * The type of the handle depends on the operating system. On Unix based + * systems, the handle is a file descriptor of type "int". On Windows, the + * handle is of type "HANDLE". The user should allocate a variable of the + * appropriate type and pass a pointer to this to receive the result. + * + * To obtain a valid handle, the port must first be opened by calling + * sp_open() using the same port structure. + * + * After the port is closed or the port structure freed, the handle may + * no longer be valid. + * + * @warning This feature is provided so that programs may make use of + * OS-specific functionality where desired. Doing so obviously + * comes at a cost in portability. It also cannot be guaranteed + * that direct usage of the OS handle will not conflict with the + * library's own usage of the port. Be careful. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[out] result_ptr If any error is returned, the variable pointed to by + * result_ptr will have unknown contents and should not + * be used. Otherwise, it will be set to point to the + * OS handle. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_port_handle(const struct sp_port *port, void *result_ptr); + +/** + * @} + * + * @defgroup Configuration Configuration + * + * Setting and querying serial port parameters. + * + * See @ref port_config.c for a working example of port configuration. + * + * You should always configure all settings before using a port. + * There are no default settings applied by libserialport. + * When you open a port it may have default settings from the OS or + * driver, or the settings left over by the last program to use it. + * + * You should always set baud rate, data bits, parity and stop bits. + * + * You should normally also set one of the preset @ref sp_flowcontrol + * flow control modes, which will set up the RTS, CTS, DTR and DSR pin + * behaviours and enable or disable XON/XOFF. If you need an unusual + * configuration not covered by the preset flow control modes, you + * will need to configure these settings individually, and avoid + * calling sp_set_flowcontrol() or sp_set_config_flowcontrol() which + * will overwrite these settings. + * + * A port must be opened before you can change its settings. + * + * There are two ways of accessing port settings: + * + * Configuration structures + * ------------------------ + * + * You can read and write a whole configuration (all settings at once) + * using sp_get_config() and sp_set_config(). This is handy if you want + * to change between some preset combinations, or save and restore an + * existing configuration. It also ensures the changes are made + * together, via an efficient set of calls into the OS - in some cases + * a single system call can be used. + * + * Use accessor functions like sp_get_config_baudrate() and + * sp_set_config_baudrate() to get and set individual settings + * from a configuration. + * + * For each setting in a port configuration, a special value of -1 can + * be used, which will cause that setting to be left alone when the + * configuration is applied by sp_set_config(). + * + * This value is also be used by sp_get_config() for any settings + * which are unconfigured at the OS level, or in a state that is + * not representable within the libserialport API. + * + * Configurations are allocated using sp_new_config() and freed + * with sp_free_config(). You need to manage them yourself. When + * a new configuration is allocated by sp_new_config(), all of + * its settings are initially set to the special -1 value. + * + * Direct functions for changing port settings + * ------------------------------------------- + * + * As a shortcut, you can set individual settings on a port directly + * by calling functions like sp_set_baudrate() and sp_set_parity(). + * This saves you the work of allocating a temporary config, setting it + * up, applying it to a port and then freeing it. + * + * @{ + */ + +/** + * Allocate a port configuration structure. + * + * The user should allocate a variable of type "struct sp_port_config *" and + * pass a pointer to this to receive the result. The variable will be updated + * to point to the new configuration structure. The structure is opaque and + * must be accessed via the functions provided. + * + * All parameters in the structure will be initialised to special values which + * are ignored by sp_set_config(). + * + * The structure should be freed after use by calling sp_free_config(). + * + * @param[out] config_ptr If any error is returned, the variable pointed to by + * config_ptr will be set to NULL. Otherwise, it will + * be set to point to the allocated config structure. + * Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_new_config(struct sp_port_config **config_ptr); + +/** + * Free a port configuration structure. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * + * @since 0.1.0 + */ +SP_API void sp_free_config(struct sp_port_config *config); + +/** + * Get the current configuration of the specified serial port. + * + * The user should allocate a configuration structure using sp_new_config() + * and pass this as the config parameter. The configuration structure will + * be updated with the port configuration. + * + * Any parameters that are configured with settings not recognised or + * supported by libserialport, will be set to special values that are + * ignored by sp_set_config(). + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[out] config Pointer to a configuration structure that will hold + * the result. Upon errors the contents of the config + * struct will not be changed. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config(struct sp_port *port, struct sp_port_config *config); + +/** + * Set the configuration for the specified serial port. + * + * For each parameter in the configuration, there is a special value (usually + * -1, but see the documentation for each field). These values will be ignored + * and the corresponding setting left unchanged on the port. + * + * Upon errors, the configuration of the serial port is unknown since + * partial/incomplete config updates may have happened. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config(struct sp_port *port, const struct sp_port_config *config); + +/** + * Set the baud rate for the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] baudrate Baud rate in bits per second. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_baudrate(struct sp_port *port, int baudrate); + +/** + * Get the baud rate from a port configuration. + * + * The user should allocate a variable of type int and + * pass a pointer to this to receive the result. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[out] baudrate_ptr Pointer to a variable to store the result. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config_baudrate(const struct sp_port_config *config, int *baudrate_ptr); + +/** + * Set the baud rate in a port configuration. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] baudrate Baud rate in bits per second, or -1 to retain the current setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_baudrate(struct sp_port_config *config, int baudrate); + +/** + * Set the data bits for the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] bits Number of data bits. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_bits(struct sp_port *port, int bits); + +/** + * Get the data bits from a port configuration. + * + * The user should allocate a variable of type int and + * pass a pointer to this to receive the result. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[out] bits_ptr Pointer to a variable to store the result. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config_bits(const struct sp_port_config *config, int *bits_ptr); + +/** + * Set the data bits in a port configuration. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] bits Number of data bits, or -1 to retain the current setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_bits(struct sp_port_config *config, int bits); + +/** + * Set the parity setting for the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] parity Parity setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_parity(struct sp_port *port, enum sp_parity parity); + +/** + * Get the parity setting from a port configuration. + * + * The user should allocate a variable of type enum sp_parity and + * pass a pointer to this to receive the result. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[out] parity_ptr Pointer to a variable to store the result. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config_parity(const struct sp_port_config *config, enum sp_parity *parity_ptr); + +/** + * Set the parity setting in a port configuration. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] parity Parity setting, or -1 to retain the current setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_parity(struct sp_port_config *config, enum sp_parity parity); + +/** + * Set the stop bits for the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] stopbits Number of stop bits. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_stopbits(struct sp_port *port, int stopbits); + +/** + * Get the stop bits from a port configuration. + * + * The user should allocate a variable of type int and + * pass a pointer to this to receive the result. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[out] stopbits_ptr Pointer to a variable to store the result. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config_stopbits(const struct sp_port_config *config, int *stopbits_ptr); + +/** + * Set the stop bits in a port configuration. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] stopbits Number of stop bits, or -1 to retain the current setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_stopbits(struct sp_port_config *config, int stopbits); + +/** + * Set the RTS pin behaviour for the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] rts RTS pin mode. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_rts(struct sp_port *port, enum sp_rts rts); + +/** + * Get the RTS pin behaviour from a port configuration. + * + * The user should allocate a variable of type enum sp_rts and + * pass a pointer to this to receive the result. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[out] rts_ptr Pointer to a variable to store the result. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config_rts(const struct sp_port_config *config, enum sp_rts *rts_ptr); + +/** + * Set the RTS pin behaviour in a port configuration. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] rts RTS pin mode, or -1 to retain the current setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_rts(struct sp_port_config *config, enum sp_rts rts); + +/** + * Set the CTS pin behaviour for the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] cts CTS pin mode. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_cts(struct sp_port *port, enum sp_cts cts); + +/** + * Get the CTS pin behaviour from a port configuration. + * + * The user should allocate a variable of type enum sp_cts and + * pass a pointer to this to receive the result. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[out] cts_ptr Pointer to a variable to store the result. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config_cts(const struct sp_port_config *config, enum sp_cts *cts_ptr); + +/** + * Set the CTS pin behaviour in a port configuration. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] cts CTS pin mode, or -1 to retain the current setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_cts(struct sp_port_config *config, enum sp_cts cts); + +/** + * Set the DTR pin behaviour for the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] dtr DTR pin mode. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_dtr(struct sp_port *port, enum sp_dtr dtr); + +/** + * Get the DTR pin behaviour from a port configuration. + * + * The user should allocate a variable of type enum sp_dtr and + * pass a pointer to this to receive the result. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[out] dtr_ptr Pointer to a variable to store the result. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config_dtr(const struct sp_port_config *config, enum sp_dtr *dtr_ptr); + +/** + * Set the DTR pin behaviour in a port configuration. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] dtr DTR pin mode, or -1 to retain the current setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_dtr(struct sp_port_config *config, enum sp_dtr dtr); + +/** + * Set the DSR pin behaviour for the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] dsr DSR pin mode. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_dsr(struct sp_port *port, enum sp_dsr dsr); + +/** + * Get the DSR pin behaviour from a port configuration. + * + * The user should allocate a variable of type enum sp_dsr and + * pass a pointer to this to receive the result. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[out] dsr_ptr Pointer to a variable to store the result. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config_dsr(const struct sp_port_config *config, enum sp_dsr *dsr_ptr); + +/** + * Set the DSR pin behaviour in a port configuration. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] dsr DSR pin mode, or -1 to retain the current setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_dsr(struct sp_port_config *config, enum sp_dsr dsr); + +/** + * Set the XON/XOFF configuration for the specified serial port. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] xon_xoff XON/XOFF mode. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_xon_xoff(struct sp_port *port, enum sp_xonxoff xon_xoff); + +/** + * Get the XON/XOFF configuration from a port configuration. + * + * The user should allocate a variable of type enum sp_xonxoff and + * pass a pointer to this to receive the result. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[out] xon_xoff_ptr Pointer to a variable to store the result. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_config_xon_xoff(const struct sp_port_config *config, enum sp_xonxoff *xon_xoff_ptr); + +/** + * Set the XON/XOFF configuration in a port configuration. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] xon_xoff XON/XOFF mode, or -1 to retain the current setting. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_xon_xoff(struct sp_port_config *config, enum sp_xonxoff xon_xoff); + +/** + * Set the flow control type in a port configuration. + * + * This function is a wrapper that sets the RTS, CTS, DTR, DSR and + * XON/XOFF settings as necessary for the specified flow control + * type. For more fine-grained control of these settings, use their + * individual configuration functions. + * + * @param[in] config Pointer to a configuration structure. Must not be NULL. + * @param[in] flowcontrol Flow control setting to use. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_config_flowcontrol(struct sp_port_config *config, enum sp_flowcontrol flowcontrol); + +/** + * Set the flow control type for the specified serial port. + * + * This function is a wrapper that sets the RTS, CTS, DTR, DSR and + * XON/XOFF settings as necessary for the specified flow control + * type. For more fine-grained control of these settings, use their + * individual configuration functions. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] flowcontrol Flow control setting to use. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_set_flowcontrol(struct sp_port *port, enum sp_flowcontrol flowcontrol); + +/** + * @} + * + * @defgroup Data Data handling + * + * Reading, writing, and flushing data. + * + * See @ref send_receive.c for an example of sending and receiving data. + * + * @{ + */ + +/** + * Read bytes from the specified serial port, blocking until complete. + * + * @warning If your program runs on Unix, defines its own signal handlers, and + * needs to abort blocking reads when these are called, then you + * should not use this function. It repeats system calls that return + * with EINTR. To be able to abort a read from a signal handler, you + * should implement your own blocking read using sp_nonblocking_read() + * together with a blocking method that makes sense for your program. + * E.g. you can obtain the file descriptor for an open port using + * sp_get_port_handle() and use this to call select() or pselect(), + * with appropriate arrangements to return if a signal is received. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[out] buf Buffer in which to store the bytes read. Must not be NULL. + * @param[in] count Requested number of bytes to read. + * @param[in] timeout_ms Timeout in milliseconds, or zero to wait indefinitely. + * + * @return The number of bytes read on success, or a negative error code. If + * the number of bytes returned is less than that requested, the + * timeout was reached before the requested number of bytes was + * available. If timeout is zero, the function will always return + * either the requested number of bytes or a negative error code. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf, size_t count, unsigned int timeout_ms); + +/** + * Read bytes from the specified serial port, returning as soon as any data is + * available. + * + * @warning If your program runs on Unix, defines its own signal handlers, and + * needs to abort blocking reads when these are called, then you + * should not use this function. It repeats system calls that return + * with EINTR. To be able to abort a read from a signal handler, you + * should implement your own blocking read using sp_nonblocking_read() + * together with a blocking method that makes sense for your program. + * E.g. you can obtain the file descriptor for an open port using + * sp_get_port_handle() and use this to call select() or pselect(), + * with appropriate arrangements to return if a signal is received. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[out] buf Buffer in which to store the bytes read. Must not be NULL. + * @param[in] count Maximum number of bytes to read. Must not be zero. + * @param[in] timeout_ms Timeout in milliseconds, or zero to wait indefinitely. + * + * @return The number of bytes read on success, or a negative error code. If + * the result is zero, the timeout was reached before any bytes were + * available. If timeout_ms is zero, the function will always return + * either at least one byte, or a negative error code. + * + * @since 0.1.1 + */ +SP_API enum sp_return sp_blocking_read_next(struct sp_port *port, void *buf, size_t count, unsigned int timeout_ms); + +/** + * Read bytes from the specified serial port, without blocking. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[out] buf Buffer in which to store the bytes read. Must not be NULL. + * @param[in] count Maximum number of bytes to read. + * + * @return The number of bytes read on success, or a negative error code. The + * number of bytes returned may be any number from zero to the maximum + * that was requested. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_nonblocking_read(struct sp_port *port, void *buf, size_t count); + +/** + * Write bytes to the specified serial port, blocking until complete. + * + * Note that this function only ensures that the accepted bytes have been + * written to the OS; they may be held in driver or hardware buffers and not + * yet physically transmitted. To check whether all written bytes have actually + * been transmitted, use the sp_output_waiting() function. To wait until all + * written bytes have actually been transmitted, use the sp_drain() function. + * + * @warning If your program runs on Unix, defines its own signal handlers, and + * needs to abort blocking writes when these are called, then you + * should not use this function. It repeats system calls that return + * with EINTR. To be able to abort a write from a signal handler, you + * should implement your own blocking write using sp_nonblocking_write() + * together with a blocking method that makes sense for your program. + * E.g. you can obtain the file descriptor for an open port using + * sp_get_port_handle() and use this to call select() or pselect(), + * with appropriate arrangements to return if a signal is received. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] buf Buffer containing the bytes to write. Must not be NULL. + * @param[in] count Requested number of bytes to write. + * @param[in] timeout_ms Timeout in milliseconds, or zero to wait indefinitely. + * + * @return The number of bytes written on success, or a negative error code. + * If the number of bytes returned is less than that requested, the + * timeout was reached before the requested number of bytes was + * written. If timeout is zero, the function will always return + * either the requested number of bytes or a negative error code. In + * the event of an error there is no way to determine how many bytes + * were sent before the error occurred. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_blocking_write(struct sp_port *port, const void *buf, size_t count, unsigned int timeout_ms); + +/** + * Write bytes to the specified serial port, without blocking. + * + * Note that this function only ensures that the accepted bytes have been + * written to the OS; they may be held in driver or hardware buffers and not + * yet physically transmitted. To check whether all written bytes have actually + * been transmitted, use the sp_output_waiting() function. To wait until all + * written bytes have actually been transmitted, use the sp_drain() function. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] buf Buffer containing the bytes to write. Must not be NULL. + * @param[in] count Maximum number of bytes to write. + * + * @return The number of bytes written on success, or a negative error code. + * The number of bytes returned may be any number from zero to the + * maximum that was requested. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_nonblocking_write(struct sp_port *port, const void *buf, size_t count); + +/** + * Gets the number of bytes waiting in the input buffer. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return Number of bytes waiting on success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_input_waiting(struct sp_port *port); + +/** + * Gets the number of bytes waiting in the output buffer. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return Number of bytes waiting on success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_output_waiting(struct sp_port *port); + +/** + * Flush serial port buffers. Data in the selected buffer(s) is discarded. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] buffers Which buffer(s) to flush. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_flush(struct sp_port *port, enum sp_buffer buffers); + +/** + * Wait for buffered data to be transmitted. + * + * @warning If your program runs on Unix, defines its own signal handlers, and + * needs to abort draining the output buffer when when these are + * called, then you should not use this function. It repeats system + * calls that return with EINTR. To be able to abort a drain from a + * signal handler, you would need to implement your own blocking + * drain by polling the result of sp_output_waiting(). + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_drain(struct sp_port *port); + +/** + * @} + * + * @defgroup Waiting Waiting + * + * Waiting for events and timeout handling. + * + * See @ref await_events.c for an example of awaiting events on multiple ports. + * + * @{ + */ + +/** + * Allocate storage for a set of events. + * + * The user should allocate a variable of type struct sp_event_set *, + * then pass a pointer to this variable to receive the result. + * + * The result should be freed after use by calling sp_free_event_set(). + * + * @param[out] result_ptr If any error is returned, the variable pointed to by + * result_ptr will be set to NULL. Otherwise, it will + * be set to point to the event set. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_new_event_set(struct sp_event_set **result_ptr); + +/** + * Add events to a struct sp_event_set for a given port. + * + * The port must first be opened by calling sp_open() using the same port + * structure. + * + * After the port is closed or the port structure freed, the results may + * no longer be valid. + * + * @param[in,out] event_set Event set to update. Must not be NULL. + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[in] mask Bitmask of events to be waited for. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_add_port_events(struct sp_event_set *event_set, + const struct sp_port *port, enum sp_event mask); + +/** + * Wait for any of a set of events to occur. + * + * @param[in] event_set Event set to wait on. Must not be NULL. + * @param[in] timeout_ms Timeout in milliseconds, or zero to wait indefinitely. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_wait(struct sp_event_set *event_set, unsigned int timeout_ms); + +/** + * Free a structure allocated by sp_new_event_set(). + * + * @param[in] event_set Event set to free. Must not be NULL. + * + * @since 0.1.0 + */ +SP_API void sp_free_event_set(struct sp_event_set *event_set); + +/** + * @} + * + * @defgroup Signals Signals + * + * Port signalling operations. + * + * @{ + */ + +/** + * Gets the status of the control signals for the specified port. + * + * The user should allocate a variable of type "enum sp_signal" and pass a + * pointer to this variable to receive the result. The result is a bitmask + * in which individual signals can be checked by bitwise OR with values of + * the sp_signal enum. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * @param[out] signal_mask Pointer to a variable to receive the result. + * Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_get_signals(struct sp_port *port, enum sp_signal *signal_mask); + +/** + * Put the port transmit line into the break state. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_start_break(struct sp_port *port); + +/** + * Take the port transmit line out of the break state. + * + * @param[in] port Pointer to a port structure. Must not be NULL. + * + * @return SP_OK upon success, a negative error code otherwise. + * + * @since 0.1.0 + */ +SP_API enum sp_return sp_end_break(struct sp_port *port); + +/** + * @} + * + * @defgroup Errors Errors + * + * Obtaining error information. + * + * See @ref handle_errors.c for an example of error handling. + * + * @{ + */ + +/** + * Get the error code for a failed operation. + * + * In order to obtain the correct result, this function should be called + * straight after the failure, before executing any other system operations. + * The result is thread-specific, and only valid when called immediately + * after a previous call returning SP_ERR_FAIL. + * + * @return The system's numeric code for the error that caused the last + * operation to fail. + * + * @since 0.1.0 + */ +SP_API int sp_last_error_code(void); + +/** + * Get the error message for a failed operation. + * + * In order to obtain the correct result, this function should be called + * straight after the failure, before executing other system operations. + * The result is thread-specific, and only valid when called immediately + * after a previous call returning SP_ERR_FAIL. + * + * @return The system's message for the error that caused the last + * operation to fail. This string may be allocated by the function, + * and should be freed after use by calling sp_free_error_message(). + * + * @since 0.1.0 + */ +SP_API char *sp_last_error_message(void); + +/** + * Free an error message returned by sp_last_error_message(). + * + * @param[in] message The error message string to free. Must not be NULL. + * + * @since 0.1.0 + */ +SP_API void sp_free_error_message(char *message); + +/** + * Set the handler function for library debugging messages. + * + * Debugging messages are generated by the library during each operation, + * to help in diagnosing problems. The handler will be called for each + * message. The handler can be set to NULL to ignore all debug messages. + * + * The handler function should accept a format string and variable length + * argument list, in the same manner as e.g. printf(). + * + * The default handler is sp_default_debug_handler(). + * + * @param[in] handler The handler function to use. Can be NULL (in that case + * all debug messages will be ignored). + * + * @since 0.1.0 + */ +SP_API void sp_set_debug_handler(void (*handler)(const char *format, ...)); + +/** + * Default handler function for library debugging messages. + * + * This function prints debug messages to the standard error stream if the + * environment variable LIBSERIALPORT_DEBUG is set. Otherwise, they are + * ignored. + * + * @param[in] format The format string to use. Must not be NULL. + * @param[in] ... The variable length argument list to use. + * + * @since 0.1.0 + */ +SP_API void sp_default_debug_handler(const char *format, ...); + +/** @} */ + +/** + * @defgroup Versions Versions + * + * Version number querying functions, definitions, and macros. + * + * This set of API calls returns two different version numbers related + * to libserialport. The "package version" is the release version number of the + * libserialport tarball in the usual "major.minor.micro" format, e.g. "0.1.0". + * + * The "library version" is independent of that; it is the libtool version + * number in the "current:revision:age" format, e.g. "2:0:0". + * See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning for details. + * + * Both version numbers (and/or individual components of them) can be + * retrieved via the API calls at runtime, and/or they can be checked at + * compile/preprocessor time using the respective macros. + * + * @{ + */ + +/* + * Package version macros (can be used for conditional compilation). + */ + +/** The libserialport package 'major' version number. */ +#define SP_PACKAGE_VERSION_MAJOR 0 + +/** The libserialport package 'minor' version number. */ +#define SP_PACKAGE_VERSION_MINOR 1 + +/** The libserialport package 'micro' version number. */ +#define SP_PACKAGE_VERSION_MICRO 1 + +/** The libserialport package version ("major.minor.micro") as string. */ +#define SP_PACKAGE_VERSION_STRING "0.1.1" + +/* + * Library/libtool version macros (can be used for conditional compilation). + */ + +/** The libserialport libtool 'current' version number. */ +#define SP_LIB_VERSION_CURRENT 1 + +/** The libserialport libtool 'revision' version number. */ +#define SP_LIB_VERSION_REVISION 0 + +/** The libserialport libtool 'age' version number. */ +#define SP_LIB_VERSION_AGE 1 + +/** The libserialport libtool version ("current:revision:age") as string. */ +#define SP_LIB_VERSION_STRING "1:0:1" + +/** + * Get the major libserialport package version number. + * + * @return The major package version number. + * + * @since 0.1.0 + */ +SP_API int sp_get_major_package_version(void); + +/** + * Get the minor libserialport package version number. + * + * @return The minor package version number. + * + * @since 0.1.0 + */ +SP_API int sp_get_minor_package_version(void); + +/** + * Get the micro libserialport package version number. + * + * @return The micro package version number. + * + * @since 0.1.0 + */ +SP_API int sp_get_micro_package_version(void); + +/** + * Get the libserialport package version number as a string. + * + * @return The package version number string. The returned string is + * static and thus should NOT be free'd by the caller. + * + * @since 0.1.0 + */ +SP_API const char *sp_get_package_version_string(void); + +/** + * Get the "current" part of the libserialport library version number. + * + * @return The "current" library version number. + * + * @since 0.1.0 + */ +SP_API int sp_get_current_lib_version(void); + +/** + * Get the "revision" part of the libserialport library version number. + * + * @return The "revision" library version number. + * + * @since 0.1.0 + */ +SP_API int sp_get_revision_lib_version(void); + +/** + * Get the "age" part of the libserialport library version number. + * + * @return The "age" library version number. + * + * @since 0.1.0 + */ +SP_API int sp_get_age_lib_version(void); + +/** + * Get the libserialport library version number as a string. + * + * @return The library version number string. The returned string is + * static and thus should NOT be free'd by the caller. + * + * @since 0.1.0 + */ +SP_API const char *sp_get_lib_version_string(void); + +/** @} */ + +/** + * @example list_ports.c Getting a list of ports present on the system. + * @example port_info.c Getting information on a particular serial port. + * @example port_config.c Accessing configuration settings of a port. + * @example send_receive.c Sending and receiving data. + * @example await_events.c Awaiting events on multiple ports. + * @example handle_errors.c Handling errors returned from the library. +*/ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/packages/firefox-webserial/extra_src/libserialport_internal.h b/packages/firefox-webserial/extra_src/libserialport_internal.h new file mode 100644 index 0000000..f1d0d85 --- /dev/null +++ b/packages/firefox-webserial/extra_src/libserialport_internal.h @@ -0,0 +1,314 @@ +/* + * This file is part of the libserialport project. + * + * Copyright (C) 2014 Martin Ling + * Copyright (C) 2014 Aurelien Jacobs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef LIBSERIALPORT_LIBSERIALPORT_INTERNAL_H +#define LIBSERIALPORT_LIBSERIALPORT_INTERNAL_H + +/* These MSVC-specific defines must appear before other headers.*/ +#ifdef _MSC_VER +#define _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_SECURE_NO_WARNINGS +#endif + +/* These feature test macros must appear before other headers.*/ +#if defined(__linux__) || defined(__CYGWIN__) +/* For timeradd, timersub, timercmp, realpath. */ +#define _BSD_SOURCE 1 /* for glibc < 2.19 */ +#define _DEFAULT_SOURCE 1 /* for glibc >= 2.20 */ +/* For clock_gettime and associated types. */ +#define _POSIX_C_SOURCE 199309L +#endif + +#ifdef LIBSERIALPORT_ATBUILD +/* If building with autoconf, include the generated config.h. */ +#include +#endif + +#ifdef LIBSERIALPORT_MSBUILD +/* If building with MS tools, define necessary things that + would otherwise appear in config.h. */ +#define SP_PRIV +#endif + +#include "libserialport.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef _WIN32 +#include +#include +#include +#include +#undef DEFINE_GUID +#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + static const GUID name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } } +#include +#include +/* The largest size that can be passed to WriteFile() safely + * on any architecture. This arises from the expression: + * PAGE_SIZE * (65535 - sizeof(MDL)) / sizeof(ULONG_PTR) + * and this worst-case value is found on x64. */ +#define WRITEFILE_MAX_SIZE 33525760 +#else +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_FILE_H +#include +#endif +#endif +#ifdef __APPLE__ +#include +#include +#include +#include +#include +#include +#if MAC_OS_X_VERSION_MAX_ALLOWED < 120000 /* Before macOS 12 */ +#define kIOMainPortDefault kIOMasterPortDefault +#endif +#endif +#ifdef __linux__ +#include +/* Android only has linux/serial.h from platform 21 onwards. */ +#if !(defined(__ANDROID__) && (__ANDROID_API__ < 21)) +#include +#endif +#include "linux_termios.h" + +/* TCGETX/TCSETX is not available everywhere. */ +#if defined(TCGETX) && defined(TCSETX) && defined(HAVE_STRUCT_TERMIOX) +#define USE_TERMIOX +#endif +#endif + +/* TIOCINQ/TIOCOUTQ is not available everywhere. */ +#if !defined(TIOCINQ) && defined(FIONREAD) +#define TIOCINQ FIONREAD +#endif +#if !defined(TIOCOUTQ) && defined(FIONWRITE) +#define TIOCOUTQ FIONWRITE +#endif + +/* + * O_CLOEXEC is not available everywhere, fallback to not setting the + * flag on those systems. + */ +#ifndef _WIN32 +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif +#endif + +/* Non-standard baudrates are not available everywhere. */ +#if (defined(HAVE_TERMIOS_SPEED) || defined(HAVE_TERMIOS2_SPEED)) && HAVE_DECL_BOTHER +#define USE_TERMIOS_SPEED +#endif + +struct sp_port { + char *name; + char *description; + enum sp_transport transport; + int usb_bus; + int usb_address; + int usb_vid; + int usb_pid; + char *usb_manufacturer; + char *usb_product; + char *usb_serial; + char *bluetooth_address; +#ifdef _WIN32 + char *usb_path; + HANDLE hdl; + COMMTIMEOUTS timeouts; + OVERLAPPED write_ovl; + OVERLAPPED read_ovl; + OVERLAPPED wait_ovl; + DWORD events; + BYTE *write_buf; + DWORD write_buf_size; + BOOL writing; + BOOL wait_running; +#else + int fd; +#endif +}; + +struct sp_port_config { + int baudrate; + int bits; + enum sp_parity parity; + int stopbits; + enum sp_rts rts; + enum sp_cts cts; + enum sp_dtr dtr; + enum sp_dsr dsr; + enum sp_xonxoff xon_xoff; +}; + +struct port_data { +#ifdef _WIN32 + DCB dcb; +#else + struct termios term; + int controlbits; + int termiox_supported; + int rts_flow; + int cts_flow; + int dtr_flow; + int dsr_flow; +#endif +}; + +#ifdef _WIN32 +typedef HANDLE event_handle; +#else +typedef int event_handle; +#endif + +/* Standard baud rates. */ +#ifdef _WIN32 +#define BAUD_TYPE DWORD +#define BAUD(n) {CBR_##n, n} +#else +#define BAUD_TYPE speed_t +#define BAUD(n) {B##n, n} +#endif + +struct std_baudrate { + BAUD_TYPE index; + int value; +}; + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) + +extern void (*sp_debug_handler)(const char *format, ...); + +/* Debug output macros. */ +#define DEBUG_FMT(fmt, ...) do { \ + if (sp_debug_handler) \ + sp_debug_handler(fmt ".\n", __VA_ARGS__); \ +} while (0) +#define DEBUG(msg) DEBUG_FMT(msg, NULL) +#define DEBUG_ERROR(err, msg) DEBUG_FMT("%s returning " #err ": " msg, __func__) +#define DEBUG_FAIL(msg) do { \ + char *errmsg = sp_last_error_message(); \ + DEBUG_FMT("%s returning SP_ERR_FAIL: " msg ": %s", __func__, errmsg); \ + sp_free_error_message(errmsg); \ +} while (0); +#define RETURN() do { \ + DEBUG_FMT("%s returning", __func__); \ + return; \ +} while (0) +#define RETURN_CODE(x) do { \ + DEBUG_FMT("%s returning " #x, __func__); \ + return x; \ +} while (0) +#define RETURN_CODEVAL(x) do { \ + switch (x) { \ + case SP_OK: RETURN_CODE(SP_OK); \ + case SP_ERR_ARG: RETURN_CODE(SP_ERR_ARG); \ + case SP_ERR_FAIL: RETURN_CODE(SP_ERR_FAIL); \ + case SP_ERR_MEM: RETURN_CODE(SP_ERR_MEM); \ + case SP_ERR_SUPP: RETURN_CODE(SP_ERR_SUPP); \ + default: RETURN_CODE(SP_ERR_FAIL); \ + } \ +} while (0) +#define RETURN_OK() RETURN_CODE(SP_OK); +#define RETURN_ERROR(err, msg) do { \ + DEBUG_ERROR(err, msg); \ + return err; \ +} while (0) +#define RETURN_FAIL(msg) do { \ + DEBUG_FAIL(msg); \ + return SP_ERR_FAIL; \ +} while (0) +#define RETURN_INT(x) do { \ + int _x = x; \ + DEBUG_FMT("%s returning %d", __func__, _x); \ + return _x; \ +} while (0) +#define RETURN_STRING(x) do { \ + char *_x = x; \ + DEBUG_FMT("%s returning %s", __func__, _x); \ + return _x; \ +} while (0) +#define RETURN_POINTER(x) do { \ + void *_x = x; \ + DEBUG_FMT("%s returning %p", __func__, _x); \ + return _x; \ +} while (0) +#define SET_ERROR(val, err, msg) do { DEBUG_ERROR(err, msg); val = err; } while (0) +#define SET_FAIL(val, msg) do { DEBUG_FAIL(msg); val = SP_ERR_FAIL; } while (0) +#define TRACE(fmt, ...) DEBUG_FMT("%s(" fmt ") called", __func__, __VA_ARGS__) +#define TRACE_VOID() DEBUG_FMT("%s() called", __func__) + +#define TRY(x) do { int retval = x; if (retval != SP_OK) RETURN_CODEVAL(retval); } while (0) + +SP_PRIV struct sp_port **list_append(struct sp_port **list, const char *portname); + +/* OS-specific Helper functions. */ +SP_PRIV enum sp_return get_port_details(struct sp_port *port); +SP_PRIV enum sp_return list_ports(struct sp_port ***list); + +/* Timing abstraction */ + +struct time { +#ifdef _WIN32 + int64_t ticks; +#else + struct timeval tv; +#endif +}; + +struct timeout { + unsigned int ms, limit_ms; + struct time start, now, end, delta, delta_max; + struct timeval delta_tv; + bool calls_started, overflow; +}; + +SP_PRIV void time_get(struct time *time); +SP_PRIV void time_set_ms(struct time *time, unsigned int ms); +SP_PRIV void time_add(const struct time *a, const struct time *b, struct time *result); +SP_PRIV void time_sub(const struct time *a, const struct time *b, struct time *result); +SP_PRIV bool time_greater(const struct time *a, const struct time *b); +SP_PRIV void time_as_timeval(const struct time *time, struct timeval *tv); +SP_PRIV unsigned int time_as_ms(const struct time *time); +SP_PRIV void timeout_start(struct timeout *timeout, unsigned int timeout_ms); +SP_PRIV void timeout_limit(struct timeout *timeout, unsigned int limit_ms); +SP_PRIV bool timeout_check(struct timeout *timeout); +SP_PRIV void timeout_update(struct timeout *timeout); +SP_PRIV struct timeval *timeout_timeval(struct timeout *timeout); +SP_PRIV unsigned int timeout_remaining_ms(struct timeout *timeout); + +#endif diff --git a/packages/firefox-webserial/extra_src/linux.c b/packages/firefox-webserial/extra_src/linux.c new file mode 100644 index 0000000..8f32085 --- /dev/null +++ b/packages/firefox-webserial/extra_src/linux.c @@ -0,0 +1,259 @@ +/* + * This file is part of the libserialport project. + * + * Copyright (C) 2013 Martin Ling + * Copyright (C) 2014 Aurelien Jacobs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include "libserialport.h" +#include "libserialport_internal.h" + +/* + * The 'e' modifier for O_CLOEXEC is glibc >= 2.7 only, hence not + * portable, so provide an own wrapper for this functionality. + */ +static FILE *fopen_cloexec_rdonly(const char *pathname) +{ + int fd; + if ((fd = open(pathname, O_RDONLY | O_CLOEXEC)) < 0) + return NULL; + return fdopen(fd, "r"); +} + +SP_PRIV enum sp_return get_port_details(struct sp_port *port) +{ + /* + * Description limited to 127 char, anything longer + * would not be user friendly anyway. + */ + char description[128]; + int bus, address; + unsigned int vid, pid; + char manufacturer[128], product[128], serial[128]; + char baddr[32]; + const char dir_name[] = "/sys/class/tty/%s/device/%s%s"; + char sub_dir[32] = "", link_name[PATH_MAX], file_name[PATH_MAX]; + char *ptr, *dev = port->name + 5; + FILE *file; + int i, count; + struct stat statbuf; + + if (strncmp(port->name, "/dev/", 5)) + RETURN_ERROR(SP_ERR_ARG, "Device name not recognized"); + + snprintf(link_name, sizeof(link_name), "/sys/class/tty/%s", dev); + if (lstat(link_name, &statbuf) == -1) + RETURN_ERROR(SP_ERR_ARG, "Device not found"); + if (!S_ISLNK(statbuf.st_mode)) + snprintf(link_name, sizeof(link_name), "/sys/class/tty/%s/device", dev); + count = readlink(link_name, file_name, sizeof(file_name)); + if (count <= 0 || count >= (int)(sizeof(file_name) - 1)) + RETURN_ERROR(SP_ERR_ARG, "Device not found"); + file_name[count] = 0; + if (strstr(file_name, "bluetooth")) + port->transport = SP_TRANSPORT_BLUETOOTH; + else if (strstr(file_name, "usb")) + port->transport = SP_TRANSPORT_USB; + + if (port->transport == SP_TRANSPORT_USB) { + for (i = 0; i < 5; i++) { + strcat(sub_dir, "../"); + + snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "busnum"); + if (!(file = fopen_cloexec_rdonly(file_name))) + continue; + count = fscanf(file, "%d", &bus); + fclose(file); + if (count != 1) + continue; + + snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "devnum"); + if (!(file = fopen_cloexec_rdonly(file_name))) + continue; + count = fscanf(file, "%d", &address); + fclose(file); + if (count != 1) + continue; + + snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "idVendor"); + if (!(file = fopen_cloexec_rdonly(file_name))) + continue; + count = fscanf(file, "%4x", &vid); + fclose(file); + if (count != 1) + continue; + + snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "idProduct"); + if (!(file = fopen_cloexec_rdonly(file_name))) + continue; + count = fscanf(file, "%4x", &pid); + fclose(file); + if (count != 1) + continue; + + port->usb_bus = bus; + port->usb_address = address; + port->usb_vid = vid; + port->usb_pid = pid; + + snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "product"); + if ((file = fopen_cloexec_rdonly(file_name))) { + if ((ptr = fgets(description, sizeof(description), file))) { + ptr = description + strlen(description) - 1; + if (ptr >= description && *ptr == '\n') + *ptr = 0; + port->description = strdup(description); + } + fclose(file); + } + if (!file || !ptr) + port->description = strdup(dev); + + snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "manufacturer"); + if ((file = fopen_cloexec_rdonly(file_name))) { + if ((ptr = fgets(manufacturer, sizeof(manufacturer), file))) { + ptr = manufacturer + strlen(manufacturer) - 1; + if (ptr >= manufacturer && *ptr == '\n') + *ptr = 0; + port->usb_manufacturer = strdup(manufacturer); + } + fclose(file); + } + + snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "product"); + if ((file = fopen_cloexec_rdonly(file_name))) { + if ((ptr = fgets(product, sizeof(product), file))) { + ptr = product + strlen(product) - 1; + if (ptr >= product && *ptr == '\n') + *ptr = 0; + port->usb_product = strdup(product); + } + fclose(file); + } + + snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "serial"); + if ((file = fopen_cloexec_rdonly(file_name))) { + if ((ptr = fgets(serial, sizeof(serial), file))) { + ptr = serial + strlen(serial) - 1; + if (ptr >= serial && *ptr == '\n') + *ptr = 0; + port->usb_serial = strdup(serial); + } + fclose(file); + } + + /* If present, add serial to description for better identification. */ + if (port->usb_serial && strlen(port->usb_serial)) { + snprintf(description, sizeof(description), + "%s - %s", port->description, port->usb_serial); + if (port->description) + free(port->description); + port->description = strdup(description); + } + + break; + } + } else { + port->description = strdup(dev); + + if (port->transport == SP_TRANSPORT_BLUETOOTH) { + snprintf(file_name, sizeof(file_name), dir_name, dev, "", "address"); + if ((file = fopen_cloexec_rdonly(file_name))) { + if ((ptr = fgets(baddr, sizeof(baddr), file))) { + ptr = baddr + strlen(baddr) - 1; + if (ptr >= baddr && *ptr == '\n') + *ptr = 0; + port->bluetooth_address = strdup(baddr); + } + fclose(file); + } + } + } + + RETURN_OK(); +} + +SP_PRIV enum sp_return list_ports(struct sp_port ***list) +{ + char name[PATH_MAX], target[PATH_MAX]; + struct dirent *entry; +#ifdef HAVE_STRUCT_SERIAL_STRUCT + struct serial_struct serial_info; + int ioctl_result; +#endif + char buf[sizeof(entry->d_name) + 23]; + int len, fd; + DIR *dir; + int ret = SP_OK; + struct stat statbuf; + + DEBUG("Enumerating tty devices"); + if (!(dir = opendir("/sys/class/tty"))) + RETURN_FAIL("Could not open /sys/class/tty"); + + DEBUG("Iterating over results"); + while ((entry = readdir(dir))) { + snprintf(buf, sizeof(buf), "/sys/class/tty/%s", entry->d_name); + if (lstat(buf, &statbuf) == -1) + continue; + if (!S_ISLNK(statbuf.st_mode)) + snprintf(buf, sizeof(buf), "/sys/class/tty/%s/device", entry->d_name); + len = readlink(buf, target, sizeof(target)); + if (len <= 0 || len >= (int)(sizeof(target) - 1)) + continue; + target[len] = 0; + if (strstr(target, "virtual")) + continue; + snprintf(name, sizeof(name), "/dev/%s", entry->d_name); + DEBUG_FMT("Found device %s", name); + if (strstr(target, "serial8250")) { + /* + * The serial8250 driver has a hardcoded number of ports. + * The only way to tell which actually exist on a given system + * is to try to open them and make an ioctl call. + */ + DEBUG("serial8250 device, attempting to open"); + if ((fd = open(name, O_RDWR | O_NONBLOCK | O_NOCTTY | O_CLOEXEC)) < 0) { + DEBUG("Open failed, skipping"); + continue; + } +#ifdef HAVE_STRUCT_SERIAL_STRUCT + ioctl_result = ioctl(fd, TIOCGSERIAL, &serial_info); +#endif + close(fd); +#ifdef HAVE_STRUCT_SERIAL_STRUCT + if (ioctl_result != 0) { + DEBUG("ioctl failed, skipping"); + continue; + } + if (serial_info.type == PORT_UNKNOWN) { + DEBUG("Port type is unknown, skipping"); + continue; + } +#endif + } + DEBUG_FMT("Found port %s", name); + *list = list_append(*list, name); + if (!*list) { + SET_ERROR(ret, SP_ERR_MEM, "List append failed"); + break; + } + } + closedir(dir); + + return ret; +} diff --git a/packages/firefox-webserial/extra_src/linux_termios.c b/packages/firefox-webserial/extra_src/linux_termios.c new file mode 100644 index 0000000..3630e57 --- /dev/null +++ b/packages/firefox-webserial/extra_src/linux_termios.c @@ -0,0 +1,129 @@ +/* + * This file is part of the libserialport project. + * + * Copyright (C) 2013 Martin Ling + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/* + * At the time of writing, glibc does not support the Linux kernel interfaces + * for setting non-standard baud rates and flow control. We therefore have to + * prepare the correct ioctls ourselves, for which we need the declarations in + * linux/termios.h. + * + * We can't include linux/termios.h in serialport.c however, because its + * contents conflict with the termios.h provided by glibc. So this file exists + * to isolate the bits of code which use the kernel termios declarations. + * + * The details vary by architecture. Some architectures have c_ispeed/c_ospeed + * in struct termios, accessed with TCSETS/TCGETS. Others have these fields in + * struct termios2, accessed with TCSETS2/TCGETS2. Some architectures have the + * TCSETX/TCGETX ioctls used with struct termiox, others do not. + */ + +#include +#include +#include +#include "linux_termios.h" + +SP_PRIV unsigned long get_termios_get_ioctl(void) +{ +#ifdef HAVE_STRUCT_TERMIOS2 + return TCGETS2; +#else + return TCGETS; +#endif +} + +SP_PRIV unsigned long get_termios_set_ioctl(void) +{ +#ifdef HAVE_STRUCT_TERMIOS2 + return TCSETS2; +#else + return TCSETS; +#endif +} + +SP_PRIV size_t get_termios_size(void) +{ +#ifdef HAVE_STRUCT_TERMIOS2 + return sizeof(struct termios2); +#else + return sizeof(struct termios); +#endif +} + +#if (defined(HAVE_TERMIOS_SPEED) || defined(HAVE_TERMIOS2_SPEED)) && HAVE_DECL_BOTHER +SP_PRIV int get_termios_speed(void *data) +{ +#ifdef HAVE_STRUCT_TERMIOS2 + struct termios2 *term = (struct termios2 *) data; +#else + struct termios *term = (struct termios *) data; +#endif + if (term->c_ispeed != term->c_ospeed) + return -1; + else + return term->c_ispeed; +} + +SP_PRIV void set_termios_speed(void *data, int speed) +{ +#ifdef HAVE_STRUCT_TERMIOS2 + struct termios2 *term = (struct termios2 *) data; +#else + struct termios *term = (struct termios *) data; +#endif + term->c_cflag &= ~CBAUD; + term->c_cflag |= BOTHER; + term->c_ispeed = term->c_ospeed = speed; +} +#endif + +#ifdef HAVE_STRUCT_TERMIOX +SP_PRIV size_t get_termiox_size(void) +{ + return sizeof(struct termiox); +} + +SP_PRIV int get_termiox_flow(void *data, int *rts, int *cts, int *dtr, int *dsr) +{ + struct termiox *termx = (struct termiox *) data; + int flags = 0; + + *rts = (termx->x_cflag & RTSXOFF); + *cts = (termx->x_cflag & CTSXON); + *dtr = (termx->x_cflag & DTRXOFF); + *dsr = (termx->x_cflag & DSRXON); + + return flags; +} + +SP_PRIV void set_termiox_flow(void *data, int rts, int cts, int dtr, int dsr) +{ + struct termiox *termx = (struct termiox *) data; + + termx->x_cflag &= ~(RTSXOFF | CTSXON | DTRXOFF | DSRXON); + + if (rts) + termx->x_cflag |= RTSXOFF; + if (cts) + termx->x_cflag |= CTSXON; + if (dtr) + termx->x_cflag |= DTRXOFF; + if (dsr) + termx->x_cflag |= DSRXON; +} +#endif diff --git a/packages/firefox-webserial/extra_src/linux_termios.h b/packages/firefox-webserial/extra_src/linux_termios.h new file mode 100644 index 0000000..e7c86e7 --- /dev/null +++ b/packages/firefox-webserial/extra_src/linux_termios.h @@ -0,0 +1,34 @@ +/* + * This file is part of the libserialport project. + * + * Copyright (C) 2013 Martin Ling + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef LIBSERIALPORT_LINUX_TERMIOS_H +#define LIBSERIALPORT_LINUX_TERMIOS_H + +#include + +SP_PRIV unsigned long get_termios_get_ioctl(void); +SP_PRIV unsigned long get_termios_set_ioctl(void); +SP_PRIV size_t get_termios_size(void); +SP_PRIV int get_termios_speed(void *data); +SP_PRIV void set_termios_speed(void *data, int speed); +SP_PRIV size_t get_termiox_size(void); +SP_PRIV int get_termiox_flow(void *data, int *rts, int *cts, int *dtr, int *dsr); +SP_PRIV void set_termiox_flow(void *data, int rts, int cts, int dtr, int dsr); + +#endif diff --git a/packages/firefox-webserial/extra_src/serialport.c b/packages/firefox-webserial/extra_src/serialport.c new file mode 100644 index 0000000..1b5a95e --- /dev/null +++ b/packages/firefox-webserial/extra_src/serialport.c @@ -0,0 +1,2624 @@ +/* + * This file is part of the libserialport project. + * + * Copyright (C) 2010-2012 Bert Vermeulen + * Copyright (C) 2010-2015 Uwe Hermann + * Copyright (C) 2013-2015 Martin Ling + * Copyright (C) 2013 Matthias Heidbrink + * Copyright (C) 2014 Aurelien Jacobs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include "libserialport_internal.h" + +static const struct std_baudrate std_baudrates[] = { +#ifdef _WIN32 + /* + * The baudrates 50/75/134/150/200/1800/230400/460800 do not seem to + * have documented CBR_* macros. + */ + BAUD(110), BAUD(300), BAUD(600), BAUD(1200), BAUD(2400), BAUD(4800), + BAUD(9600), BAUD(14400), BAUD(19200), BAUD(38400), BAUD(57600), + BAUD(115200), BAUD(128000), BAUD(256000), +#else + BAUD(50), BAUD(75), BAUD(110), BAUD(134), BAUD(150), BAUD(200), + BAUD(300), BAUD(600), BAUD(1200), BAUD(1800), BAUD(2400), BAUD(4800), + BAUD(9600), BAUD(19200), BAUD(38400), BAUD(57600), BAUD(115200), + BAUD(230400), +#if !defined(__APPLE__) && !defined(__OpenBSD__) + BAUD(460800), +#endif +#endif +}; + +#define NUM_STD_BAUDRATES ARRAY_SIZE(std_baudrates) + +void (*sp_debug_handler)(const char *format, ...) = sp_default_debug_handler; + +static enum sp_return get_config(struct sp_port *port, struct port_data *data, + struct sp_port_config *config); + +static enum sp_return set_config(struct sp_port *port, struct port_data *data, + const struct sp_port_config *config); + +SP_API enum sp_return sp_get_port_by_name(const char *portname, struct sp_port **port_ptr) +{ + struct sp_port *port; +#ifndef NO_PORT_METADATA + enum sp_return ret; +#endif + size_t len; + + TRACE("%s, %p", portname, port_ptr); + + if (!port_ptr) + RETURN_ERROR(SP_ERR_ARG, "Null result pointer"); + + *port_ptr = NULL; + + if (!portname) + RETURN_ERROR(SP_ERR_ARG, "Null port name"); + + DEBUG_FMT("Building structure for port %s", portname); + +#if !defined(_WIN32) && defined(HAVE_REALPATH) + /* + * get_port_details() below tries to be too smart and figure out + * some transport properties from the port name which breaks with + * symlinks. Therefore we canonicalize the portname first. + */ + char pathbuf[PATH_MAX + 1]; + char *res = realpath(portname, pathbuf); + if (!res) + RETURN_ERROR(SP_ERR_ARG, "Could not retrieve realpath behind port name"); + + portname = pathbuf; +#endif + + if (!(port = malloc(sizeof(struct sp_port)))) + RETURN_ERROR(SP_ERR_MEM, "Port structure malloc failed"); + + len = strlen(portname) + 1; + + if (!(port->name = malloc(len))) { + free(port); + RETURN_ERROR(SP_ERR_MEM, "Port name malloc failed"); + } + + memcpy(port->name, portname, len); + +#ifdef _WIN32 + port->usb_path = NULL; + port->hdl = INVALID_HANDLE_VALUE; + port->write_buf = NULL; + port->write_buf_size = 0; +#else + port->fd = -1; +#endif + + port->description = NULL; + port->transport = SP_TRANSPORT_NATIVE; + port->usb_bus = -1; + port->usb_address = -1; + port->usb_vid = -1; + port->usb_pid = -1; + port->usb_manufacturer = NULL; + port->usb_product = NULL; + port->usb_serial = NULL; + port->bluetooth_address = NULL; + +#ifndef NO_PORT_METADATA + if ((ret = get_port_details(port)) != SP_OK) { + sp_free_port(port); + return ret; + } +#endif + + *port_ptr = port; + + RETURN_OK(); +} + +SP_API char *sp_get_port_name(const struct sp_port *port) +{ + TRACE("%p", port); + + if (!port) + return NULL; + + RETURN_STRING(port->name); +} + +SP_API char *sp_get_port_description(const struct sp_port *port) +{ + TRACE("%p", port); + + if (!port || !port->description) + return NULL; + + RETURN_STRING(port->description); +} + +SP_API enum sp_transport sp_get_port_transport(const struct sp_port *port) +{ + TRACE("%p", port); + + RETURN_INT(port ? port->transport : SP_TRANSPORT_NATIVE); +} + +SP_API enum sp_return sp_get_port_usb_bus_address(const struct sp_port *port, + int *usb_bus,int *usb_address) +{ + TRACE("%p", port); + + if (!port) + RETURN_ERROR(SP_ERR_ARG, "Null port"); + if (port->transport != SP_TRANSPORT_USB) + RETURN_ERROR(SP_ERR_ARG, "Port does not use USB transport"); + if (port->usb_bus < 0 || port->usb_address < 0) + RETURN_ERROR(SP_ERR_SUPP, "Bus and address values are not available"); + + if (usb_bus) + *usb_bus = port->usb_bus; + if (usb_address) + *usb_address = port->usb_address; + + RETURN_OK(); +} + +SP_API enum sp_return sp_get_port_usb_vid_pid(const struct sp_port *port, + int *usb_vid, int *usb_pid) +{ + TRACE("%p", port); + + if (!port) + RETURN_ERROR(SP_ERR_ARG, "Null port"); + if (port->transport != SP_TRANSPORT_USB) + RETURN_ERROR(SP_ERR_ARG, "Port does not use USB transport"); + if (port->usb_vid < 0 || port->usb_pid < 0) + RETURN_ERROR(SP_ERR_SUPP, "VID:PID values are not available"); + + if (usb_vid) + *usb_vid = port->usb_vid; + if (usb_pid) + *usb_pid = port->usb_pid; + + RETURN_OK(); +} + +SP_API char *sp_get_port_usb_manufacturer(const struct sp_port *port) +{ + TRACE("%p", port); + + if (!port || port->transport != SP_TRANSPORT_USB || !port->usb_manufacturer) + return NULL; + + RETURN_STRING(port->usb_manufacturer); +} + +SP_API char *sp_get_port_usb_product(const struct sp_port *port) +{ + TRACE("%p", port); + + if (!port || port->transport != SP_TRANSPORT_USB || !port->usb_product) + return NULL; + + RETURN_STRING(port->usb_product); +} + +SP_API char *sp_get_port_usb_serial(const struct sp_port *port) +{ + TRACE("%p", port); + + if (!port || port->transport != SP_TRANSPORT_USB || !port->usb_serial) + return NULL; + + RETURN_STRING(port->usb_serial); +} + +SP_API char *sp_get_port_bluetooth_address(const struct sp_port *port) +{ + TRACE("%p", port); + + if (!port || port->transport != SP_TRANSPORT_BLUETOOTH + || !port->bluetooth_address) + return NULL; + + RETURN_STRING(port->bluetooth_address); +} + +SP_API enum sp_return sp_get_port_handle(const struct sp_port *port, + void *result_ptr) +{ + TRACE("%p, %p", port, result_ptr); + + if (!port) + RETURN_ERROR(SP_ERR_ARG, "Null port"); + if (!result_ptr) + RETURN_ERROR(SP_ERR_ARG, "Null result pointer"); + +#ifdef _WIN32 + HANDLE *handle_ptr = result_ptr; + *handle_ptr = port->hdl; +#else + int *fd_ptr = result_ptr; + *fd_ptr = port->fd; +#endif + + RETURN_OK(); +} + +SP_API enum sp_return sp_copy_port(const struct sp_port *port, + struct sp_port **copy_ptr) +{ + TRACE("%p, %p", port, copy_ptr); + + if (!copy_ptr) + RETURN_ERROR(SP_ERR_ARG, "Null result pointer"); + + *copy_ptr = NULL; + + if (!port) + RETURN_ERROR(SP_ERR_ARG, "Null port"); + + if (!port->name) + RETURN_ERROR(SP_ERR_ARG, "Null port name"); + + DEBUG("Copying port structure"); + + RETURN_INT(sp_get_port_by_name(port->name, copy_ptr)); +} + +SP_API void sp_free_port(struct sp_port *port) +{ + TRACE("%p", port); + + if (!port) { + DEBUG("Null port"); + RETURN(); + } + + DEBUG("Freeing port structure"); + + if (port->name) + free(port->name); + if (port->description) + free(port->description); + if (port->usb_manufacturer) + free(port->usb_manufacturer); + if (port->usb_product) + free(port->usb_product); + if (port->usb_serial) + free(port->usb_serial); + if (port->bluetooth_address) + free(port->bluetooth_address); +#ifdef _WIN32 + if (port->usb_path) + free(port->usb_path); + if (port->write_buf) + free(port->write_buf); +#endif + + free(port); + + RETURN(); +} + +SP_PRIV struct sp_port **list_append(struct sp_port **list, + const char *portname) +{ + void *tmp; + size_t count; + + for (count = 0; list[count]; count++) + ; + if (!(tmp = realloc(list, sizeof(struct sp_port *) * (count + 2)))) + goto fail; + list = tmp; + if (sp_get_port_by_name(portname, &list[count]) != SP_OK) + goto fail; + list[count + 1] = NULL; + return list; + +fail: + sp_free_port_list(list); + return NULL; +} + +SP_API enum sp_return sp_list_ports(struct sp_port ***list_ptr) +{ +#ifndef NO_ENUMERATION + struct sp_port **list; + int ret; +#endif + + TRACE("%p", list_ptr); + + if (!list_ptr) + RETURN_ERROR(SP_ERR_ARG, "Null result pointer"); + + *list_ptr = NULL; + +#ifdef NO_ENUMERATION + RETURN_ERROR(SP_ERR_SUPP, "Enumeration not supported on this platform"); +#else + DEBUG("Enumerating ports"); + + if (!(list = malloc(sizeof(struct sp_port *)))) + RETURN_ERROR(SP_ERR_MEM, "Port list malloc failed"); + + list[0] = NULL; + + ret = list_ports(&list); + + if (ret == SP_OK) { + *list_ptr = list; + } else { + sp_free_port_list(list); + *list_ptr = NULL; + } + + RETURN_CODEVAL(ret); +#endif +} + +SP_API void sp_free_port_list(struct sp_port **list) +{ + unsigned int i; + + TRACE("%p", list); + + if (!list) { + DEBUG("Null list"); + RETURN(); + } + + DEBUG("Freeing port list"); + + for (i = 0; list[i]; i++) + sp_free_port(list[i]); + free(list); + + RETURN(); +} + +#define CHECK_PORT() do { \ + if (!port) \ + RETURN_ERROR(SP_ERR_ARG, "Null port"); \ + if (!port->name) \ + RETURN_ERROR(SP_ERR_ARG, "Null port name"); \ +} while (0) +#ifdef _WIN32 +#define CHECK_PORT_HANDLE() do { \ + if (port->hdl == INVALID_HANDLE_VALUE) \ + RETURN_ERROR(SP_ERR_ARG, "Port not open"); \ +} while (0) +#else +#define CHECK_PORT_HANDLE() do { \ + if (port->fd < 0) \ + RETURN_ERROR(SP_ERR_ARG, "Port not open"); \ +} while (0) +#endif +#define CHECK_OPEN_PORT() do { \ + CHECK_PORT(); \ + CHECK_PORT_HANDLE(); \ +} while (0) + +#ifdef WIN32 +/** To be called after port receive buffer is emptied. */ +static enum sp_return restart_wait(struct sp_port *port) +{ + DWORD wait_result; + + if (port->wait_running) { + /* Check status of running wait operation. */ + if (GetOverlappedResult(port->hdl, &port->wait_ovl, + &wait_result, FALSE)) { + DEBUG("Previous wait completed"); + port->wait_running = FALSE; + } else if (GetLastError() == ERROR_IO_INCOMPLETE) { + DEBUG("Previous wait still running"); + RETURN_OK(); + } else { + RETURN_FAIL("GetOverlappedResult() failed"); + } + } + + if (!port->wait_running) { + /* Start new wait operation. */ + if (WaitCommEvent(port->hdl, &port->events, + &port->wait_ovl)) { + DEBUG("New wait returned, events already pending"); + } else if (GetLastError() == ERROR_IO_PENDING) { + DEBUG("New wait running in background"); + port->wait_running = TRUE; + } else { + RETURN_FAIL("WaitCommEvent() failed"); + } + } + + RETURN_OK(); +} +#endif + +SP_API enum sp_return sp_open(struct sp_port *port, enum sp_mode flags) +{ + struct port_data data; + struct sp_port_config config; + enum sp_return ret; + + TRACE("%p, 0x%x", port, flags); + + CHECK_PORT(); + + if (flags > SP_MODE_READ_WRITE) + RETURN_ERROR(SP_ERR_ARG, "Invalid flags"); + + DEBUG_FMT("Opening port %s", port->name); + +#ifdef _WIN32 + DWORD desired_access = 0, flags_and_attributes = 0, errors; + char *escaped_port_name; + COMSTAT status; + + /* Prefix port name with '\\.\' to work with ports above COM9. */ + if (!(escaped_port_name = malloc(strlen(port->name) + 5))) + RETURN_ERROR(SP_ERR_MEM, "Escaped port name malloc failed"); + sprintf(escaped_port_name, "\\\\.\\%s", port->name); + + /* Map 'flags' to the OS-specific settings. */ + flags_and_attributes = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED; + if (flags & SP_MODE_READ) + desired_access |= GENERIC_READ; + if (flags & SP_MODE_WRITE) + desired_access |= GENERIC_WRITE; + + port->hdl = CreateFileA(escaped_port_name, desired_access, 0, 0, + OPEN_EXISTING, flags_and_attributes, 0); + + free(escaped_port_name); + + if (port->hdl == INVALID_HANDLE_VALUE) + RETURN_FAIL("Port CreateFile() failed"); + + /* All timeouts initially disabled. */ + port->timeouts.ReadIntervalTimeout = 0; + port->timeouts.ReadTotalTimeoutMultiplier = 0; + port->timeouts.ReadTotalTimeoutConstant = 0; + port->timeouts.WriteTotalTimeoutMultiplier = 0; + port->timeouts.WriteTotalTimeoutConstant = 0; + + if (SetCommTimeouts(port->hdl, &port->timeouts) == 0) { + sp_close(port); + RETURN_FAIL("SetCommTimeouts() failed"); + } + + /* Prepare OVERLAPPED structures. */ +#define INIT_OVERLAPPED(ovl) do { \ + memset(&port->ovl, 0, sizeof(port->ovl)); \ + port->ovl.hEvent = INVALID_HANDLE_VALUE; \ + if ((port->ovl.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL)) \ + == INVALID_HANDLE_VALUE) { \ + sp_close(port); \ + RETURN_FAIL(#ovl "CreateEvent() failed"); \ + } \ +} while (0) + + INIT_OVERLAPPED(read_ovl); + INIT_OVERLAPPED(write_ovl); + INIT_OVERLAPPED(wait_ovl); + + /* Set event mask for RX and error events. */ + if (SetCommMask(port->hdl, EV_RXCHAR | EV_ERR) == 0) { + sp_close(port); + RETURN_FAIL("SetCommMask() failed"); + } + + port->writing = FALSE; + port->wait_running = FALSE; + + ret = restart_wait(port); + + if (ret < 0) { + sp_close(port); + RETURN_CODEVAL(ret); + } +#else + int flags_local = O_NONBLOCK | O_NOCTTY | O_CLOEXEC; + + /* Map 'flags' to the OS-specific settings. */ + if ((flags & SP_MODE_READ_WRITE) == SP_MODE_READ_WRITE) + flags_local |= O_RDWR; + else if (flags & SP_MODE_READ) + flags_local |= O_RDONLY; + else if (flags & SP_MODE_WRITE) + flags_local |= O_WRONLY; + + if ((port->fd = open(port->name, flags_local)) < 0) + RETURN_FAIL("open() failed"); + + /* + * On POSIX in the default case the file descriptor of a serial port + * is not opened exclusively. Therefore the settings of a port are + * overwritten if the serial port is opened a second time. Windows + * opens all serial ports exclusively. + * So the idea is to open the serial ports alike in the exclusive mode. + * + * ioctl(*, TIOCEXCL) defines the file descriptor as exclusive. So all + * further open calls on the serial port will fail. + * + * There is a race condition if two processes open the same serial + * port. None of the processes will notice the exclusive ownership of + * the other process because ioctl() doesn't return an error code if + * the file descriptor is already marked as exclusive. + * This can be solved with flock(). It returns an error if the file + * descriptor is already locked by another process. + */ +#ifdef HAVE_FLOCK + if (flock(port->fd, LOCK_EX | LOCK_NB) < 0) + RETURN_FAIL("flock() failed"); +#endif + +#ifdef TIOCEXCL + /* + * Before Linux 3.8 ioctl(*, TIOCEXCL) was not implemented and could + * lead to EINVAL or ENOTTY. + * These errors aren't fatal and can be ignored. + */ + if (ioctl(port->fd, TIOCEXCL) < 0 && errno != EINVAL && errno != ENOTTY) + RETURN_FAIL("ioctl() failed"); +#endif + +#endif + + ret = get_config(port, &data, &config); + + if (ret < 0) { + sp_close(port); + RETURN_CODEVAL(ret); + } + + /* + * Assume a default baudrate if the OS does not provide one. + * Cannot assign -1 here since Windows holds the baudrate in + * the DCB and does not configure the rate individually. + */ + if (config.baudrate == 0) { + config.baudrate = 9600; + } + + /* Set sane port settings. */ +#ifdef _WIN32 + data.dcb.fBinary = TRUE; + data.dcb.fDsrSensitivity = FALSE; + data.dcb.fErrorChar = FALSE; + data.dcb.fNull = FALSE; + data.dcb.fAbortOnError = FALSE; +#else + /* Turn off all fancy termios tricks, give us a raw channel. */ + data.term.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IMAXBEL); +#ifdef IUCLC + data.term.c_iflag &= ~IUCLC; +#endif + data.term.c_oflag &= ~(OPOST | ONLCR | OCRNL | ONOCR | ONLRET); +#ifdef OLCUC + data.term.c_oflag &= ~OLCUC; +#endif +#ifdef NLDLY + data.term.c_oflag &= ~NLDLY; +#endif +#ifdef CRDLY + data.term.c_oflag &= ~CRDLY; +#endif +#ifdef TABDLY + data.term.c_oflag &= ~TABDLY; +#endif +#ifdef BSDLY + data.term.c_oflag &= ~BSDLY; +#endif +#ifdef VTDLY + data.term.c_oflag &= ~VTDLY; +#endif +#ifdef FFDLY + data.term.c_oflag &= ~FFDLY; +#endif +#ifdef OFILL + data.term.c_oflag &= ~OFILL; +#endif + data.term.c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN); + data.term.c_cc[VMIN] = 0; + data.term.c_cc[VTIME] = 0; + + /* Ignore modem status lines; enable receiver; leave control lines alone on close. */ + data.term.c_cflag |= (CLOCAL | CREAD); + data.term.c_cflag &= ~(HUPCL); +#endif + +#ifdef _WIN32 + if (ClearCommError(port->hdl, &errors, &status) == 0) + RETURN_FAIL("ClearCommError() failed"); +#endif + + ret = set_config(port, &data, &config); + + if (ret < 0) { + sp_close(port); + RETURN_CODEVAL(ret); + } + + RETURN_OK(); +} + +SP_API enum sp_return sp_close(struct sp_port *port) +{ + TRACE("%p", port); + + CHECK_OPEN_PORT(); + + DEBUG_FMT("Closing port %s", port->name); + +#ifdef _WIN32 + /* Returns non-zero upon success, 0 upon failure. */ + if (CloseHandle(port->hdl) == 0) + RETURN_FAIL("Port CloseHandle() failed"); + port->hdl = INVALID_HANDLE_VALUE; + + /* Close event handles for overlapped structures. */ +#define CLOSE_OVERLAPPED(ovl) do { \ + if (port->ovl.hEvent != INVALID_HANDLE_VALUE && \ + CloseHandle(port->ovl.hEvent) == 0) \ + RETURN_FAIL(# ovl "event CloseHandle() failed"); \ +} while (0) + CLOSE_OVERLAPPED(read_ovl); + CLOSE_OVERLAPPED(write_ovl); + CLOSE_OVERLAPPED(wait_ovl); + + if (port->write_buf) { + free(port->write_buf); + port->write_buf = NULL; + } +#else + /* Returns 0 upon success, -1 upon failure. */ + if (close(port->fd) == -1) + RETURN_FAIL("close() failed"); + port->fd = -1; +#endif + + RETURN_OK(); +} + +SP_API enum sp_return sp_flush(struct sp_port *port, enum sp_buffer buffers) +{ + TRACE("%p, 0x%x", port, buffers); + + CHECK_OPEN_PORT(); + + if (buffers > SP_BUF_BOTH) + RETURN_ERROR(SP_ERR_ARG, "Invalid buffer selection"); + + const char *buffer_names[] = {"no", "input", "output", "both"}; + + DEBUG_FMT("Flushing %s buffers on port %s", + buffer_names[buffers], port->name); + +#ifdef _WIN32 + DWORD flags = 0; + if (buffers & SP_BUF_INPUT) + flags |= PURGE_RXCLEAR; + if (buffers & SP_BUF_OUTPUT) + flags |= PURGE_TXCLEAR; + + /* Returns non-zero upon success, 0 upon failure. */ + if (PurgeComm(port->hdl, flags) == 0) + RETURN_FAIL("PurgeComm() failed"); + + if (buffers & SP_BUF_INPUT) + TRY(restart_wait(port)); +#else + int flags = 0; + if (buffers == SP_BUF_BOTH) + flags = TCIOFLUSH; + else if (buffers == SP_BUF_INPUT) + flags = TCIFLUSH; + else if (buffers == SP_BUF_OUTPUT) + flags = TCOFLUSH; + + /* Returns 0 upon success, -1 upon failure. */ + if (tcflush(port->fd, flags) < 0) + RETURN_FAIL("tcflush() failed"); +#endif + RETURN_OK(); +} + +SP_API enum sp_return sp_drain(struct sp_port *port) +{ + TRACE("%p", port); + + CHECK_OPEN_PORT(); + + DEBUG_FMT("Draining port %s", port->name); + +#ifdef _WIN32 + /* Returns non-zero upon success, 0 upon failure. */ + if (FlushFileBuffers(port->hdl) == 0) + RETURN_FAIL("FlushFileBuffers() failed"); + RETURN_OK(); +#else + int result; + while (1) { +#if defined(__ANDROID__) && (__ANDROID_API__ < 21) + /* Android only has tcdrain from platform 21 onwards. + * On previous API versions, use the ioctl directly. */ + int arg = 1; + result = ioctl(port->fd, TCSBRK, &arg); +#else + result = tcdrain(port->fd); +#endif + if (result < 0) { + if (errno == EINTR) { + DEBUG("tcdrain() was interrupted"); + continue; + } else { + RETURN_FAIL("tcdrain() failed"); + } + } else { + RETURN_OK(); + } + } +#endif +} + +#ifdef _WIN32 +static enum sp_return await_write_completion(struct sp_port *port) +{ + TRACE("%p", port); + DWORD bytes_written; + BOOL result; + + /* Wait for previous non-blocking write to complete, if any. */ + if (port->writing) { + DEBUG("Waiting for previous write to complete"); + result = GetOverlappedResult(port->hdl, &port->write_ovl, &bytes_written, TRUE); + port->writing = 0; + if (!result) + RETURN_FAIL("Previous write failed to complete"); + DEBUG("Previous write completed"); + } + + RETURN_OK(); +} +#endif + +SP_API enum sp_return sp_blocking_write(struct sp_port *port, const void *buf, + size_t count, unsigned int timeout_ms) +{ + TRACE("%p, %p, %d, %d", port, buf, count, timeout_ms); + + CHECK_OPEN_PORT(); + + if (!buf) + RETURN_ERROR(SP_ERR_ARG, "Null buffer"); + + if (timeout_ms) + DEBUG_FMT("Writing %d bytes to port %s, timeout %d ms", + count, port->name, timeout_ms); + else + DEBUG_FMT("Writing %d bytes to port %s, no timeout", + count, port->name); + + if (count == 0) + RETURN_INT(0); + +#ifdef _WIN32 + DWORD remaining_ms, write_size, bytes_written; + size_t remaining_bytes, total_bytes_written = 0; + const uint8_t *write_ptr = (uint8_t *) buf; + bool result; + struct timeout timeout; + + timeout_start(&timeout, timeout_ms); + + TRY(await_write_completion(port)); + + while (total_bytes_written < count) { + + if (timeout_check(&timeout)) + break; + + remaining_ms = timeout_remaining_ms(&timeout); + + if (port->timeouts.WriteTotalTimeoutConstant != remaining_ms) { + port->timeouts.WriteTotalTimeoutConstant = remaining_ms; + if (SetCommTimeouts(port->hdl, &port->timeouts) == 0) + RETURN_FAIL("SetCommTimeouts() failed"); + } + + /* Reduce write size if it exceeds the WriteFile limit. */ + remaining_bytes = count - total_bytes_written; + if (remaining_bytes > WRITEFILE_MAX_SIZE) + write_size = WRITEFILE_MAX_SIZE; + else + write_size = (DWORD) remaining_bytes; + + /* Start write. */ + + result = WriteFile(port->hdl, write_ptr, write_size, NULL, &port->write_ovl); + + timeout_update(&timeout); + + if (result) { + DEBUG("Write completed immediately"); + bytes_written = write_size; + } else if (GetLastError() == ERROR_IO_PENDING) { + DEBUG("Waiting for write to complete"); + if (GetOverlappedResult(port->hdl, &port->write_ovl, &bytes_written, TRUE) == 0) { + if (GetLastError() == ERROR_SEM_TIMEOUT) { + DEBUG("Write timed out"); + break; + } else { + RETURN_FAIL("GetOverlappedResult() failed"); + } + } + DEBUG_FMT("Write completed, %d/%d bytes written", bytes_written, write_size); + } else { + RETURN_FAIL("WriteFile() failed"); + } + + write_ptr += bytes_written; + total_bytes_written += bytes_written; + } + + RETURN_INT((int) total_bytes_written); +#else + size_t bytes_written = 0; + unsigned char *ptr = (unsigned char *) buf; + struct timeout timeout; + fd_set fds; + ssize_t result; + + timeout_start(&timeout, timeout_ms); + + FD_ZERO(&fds); + FD_SET(port->fd, &fds); + + /* Loop until we have written the requested number of bytes. */ + while (bytes_written < count) { + + if (timeout_check(&timeout)) + break; + + result = select(port->fd + 1, NULL, &fds, NULL, timeout_timeval(&timeout)); + + timeout_update(&timeout); + + if (result < 0) { + if (errno == EINTR) { + DEBUG("select() call was interrupted, repeating"); + continue; + } else { + RETURN_FAIL("select() failed"); + } + } else if (result == 0) { + /* Timeout has expired. */ + break; + } + + /* Do write. */ + result = write(port->fd, ptr, count - bytes_written); + + if (result < 0) { + if (errno == EAGAIN) + /* This shouldn't happen because we did a select() first, but handle anyway. */ + continue; + else + /* This is an actual failure. */ + RETURN_FAIL("write() failed"); + } + + bytes_written += result; + ptr += result; + } + + if (bytes_written < count) + DEBUG("Write timed out"); + + RETURN_INT(bytes_written); +#endif +} + +SP_API enum sp_return sp_nonblocking_write(struct sp_port *port, + const void *buf, size_t count) +{ + TRACE("%p, %p, %d", port, buf, count); + + CHECK_OPEN_PORT(); + + if (!buf) + RETURN_ERROR(SP_ERR_ARG, "Null buffer"); + + DEBUG_FMT("Writing up to %d bytes to port %s", count, port->name); + + if (count == 0) + RETURN_INT(0); + +#ifdef _WIN32 + size_t buf_bytes; + + /* Check whether previous write is complete. */ + if (port->writing) { + if (HasOverlappedIoCompleted(&port->write_ovl)) { + DEBUG("Previous write completed"); + port->writing = 0; + } else { + DEBUG("Previous write not complete"); + /* Can't take a new write until the previous one finishes. */ + RETURN_INT(0); + } + } + + /* Set timeout. */ + if (port->timeouts.WriteTotalTimeoutConstant != 0) { + port->timeouts.WriteTotalTimeoutConstant = 0; + if (SetCommTimeouts(port->hdl, &port->timeouts) == 0) + RETURN_FAIL("SetCommTimeouts() failed"); + } + + /* Reduce count if it exceeds the WriteFile limit. */ + if (count > WRITEFILE_MAX_SIZE) + count = WRITEFILE_MAX_SIZE; + + /* Copy data to our write buffer. */ + buf_bytes = min(port->write_buf_size, count); + memcpy(port->write_buf, buf, buf_bytes); + + /* Start asynchronous write. */ + if (WriteFile(port->hdl, port->write_buf, (DWORD) buf_bytes, NULL, &port->write_ovl) == 0) { + if (GetLastError() == ERROR_IO_PENDING) { + if ((port->writing = !HasOverlappedIoCompleted(&port->write_ovl))) + DEBUG("Asynchronous write completed immediately"); + else + DEBUG("Asynchronous write running"); + } else { + /* Actual failure of some kind. */ + RETURN_FAIL("WriteFile() failed"); + } + } + + DEBUG("All bytes written immediately"); + + RETURN_INT((int) buf_bytes); +#else + /* Returns the number of bytes written, or -1 upon failure. */ + ssize_t written = write(port->fd, buf, count); + + if (written < 0) { + if (errno == EAGAIN) + // Buffer is full, no bytes written. + RETURN_INT(0); + else + RETURN_FAIL("write() failed"); + } else { + RETURN_INT(written); + } +#endif +} + +#ifdef _WIN32 +/* Restart wait operation if buffer was emptied. */ +static enum sp_return restart_wait_if_needed(struct sp_port *port, unsigned int bytes_read) +{ + DWORD errors; + COMSTAT comstat; + + if (bytes_read == 0) + RETURN_OK(); + + if (ClearCommError(port->hdl, &errors, &comstat) == 0) + RETURN_FAIL("ClearCommError() failed"); + + if (comstat.cbInQue == 0) + TRY(restart_wait(port)); + + RETURN_OK(); +} +#endif + +SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf, + size_t count, unsigned int timeout_ms) +{ + TRACE("%p, %p, %d, %d", port, buf, count, timeout_ms); + + CHECK_OPEN_PORT(); + + if (!buf) + RETURN_ERROR(SP_ERR_ARG, "Null buffer"); + + if (timeout_ms) + DEBUG_FMT("Reading %d bytes from port %s, timeout %d ms", + count, port->name, timeout_ms); + else + DEBUG_FMT("Reading %d bytes from port %s, no timeout", + count, port->name); + + if (count == 0) + RETURN_INT(0); + +#ifdef _WIN32 + DWORD bytes_read; + + /* Set timeout. */ + if (port->timeouts.ReadIntervalTimeout != 0 || + port->timeouts.ReadTotalTimeoutMultiplier != 0 || + port->timeouts.ReadTotalTimeoutConstant != timeout_ms) { + port->timeouts.ReadIntervalTimeout = 0; + port->timeouts.ReadTotalTimeoutMultiplier = 0; + port->timeouts.ReadTotalTimeoutConstant = timeout_ms; + if (SetCommTimeouts(port->hdl, &port->timeouts) == 0) + RETURN_FAIL("SetCommTimeouts() failed"); + } + + /* Start read. */ + if (ReadFile(port->hdl, buf, (DWORD) count, NULL, &port->read_ovl)) { + DEBUG("Read completed immediately"); + bytes_read = (DWORD) count; + } else if (GetLastError() == ERROR_IO_PENDING) { + DEBUG("Waiting for read to complete"); + if (GetOverlappedResult(port->hdl, &port->read_ovl, &bytes_read, TRUE) == 0) + RETURN_FAIL("GetOverlappedResult() failed"); + DEBUG_FMT("Read completed, %d/%d bytes read", bytes_read, count); + } else { + RETURN_FAIL("ReadFile() failed"); + } + + TRY(restart_wait_if_needed(port, bytes_read)); + + RETURN_INT((int) bytes_read); + +#else + size_t bytes_read = 0; + unsigned char *ptr = (unsigned char *) buf; + struct timeout timeout; + fd_set fds; + ssize_t result; + + timeout_start(&timeout, timeout_ms); + + FD_ZERO(&fds); + FD_SET(port->fd, &fds); + + /* Loop until we have the requested number of bytes. */ + while (bytes_read < count) { + + if (timeout_check(&timeout)) + /* Timeout has expired. */ + break; + + result = select(port->fd + 1, &fds, NULL, NULL, timeout_timeval(&timeout)); + + timeout_update(&timeout); + + if (result < 0) { + if (errno == EINTR) { + DEBUG("select() call was interrupted, repeating"); + continue; + } else { + RETURN_FAIL("select() failed"); + } + } else if (result == 0) { + /* Timeout has expired. */ + break; + } + + /* Do read. */ + result = read(port->fd, ptr, count - bytes_read); + + if (result < 0) { + if (errno == EAGAIN) + /* + * This shouldn't happen because we did a + * select() first, but handle anyway. + */ + continue; + else + /* This is an actual failure. */ + RETURN_FAIL("read() failed"); + } + + bytes_read += result; + ptr += result; + } + + if (bytes_read < count) + DEBUG("Read timed out"); + + RETURN_INT(bytes_read); +#endif +} + +SP_API enum sp_return sp_blocking_read_next(struct sp_port *port, void *buf, + size_t count, unsigned int timeout_ms) +{ + TRACE("%p, %p, %d, %d", port, buf, count, timeout_ms); + + CHECK_OPEN_PORT(); + + if (!buf) + RETURN_ERROR(SP_ERR_ARG, "Null buffer"); + + if (count == 0) + RETURN_ERROR(SP_ERR_ARG, "Zero count"); + + if (timeout_ms) + DEBUG_FMT("Reading next max %d bytes from port %s, timeout %d ms", + count, port->name, timeout_ms); + else + DEBUG_FMT("Reading next max %d bytes from port %s, no timeout", + count, port->name); + +#ifdef _WIN32 + DWORD bytes_read = 0; + + /* If timeout_ms == 0, set maximum timeout. */ + DWORD timeout_val = (timeout_ms == 0 ? MAXDWORD - 1 : timeout_ms); + + /* Set timeout. */ + if (port->timeouts.ReadIntervalTimeout != MAXDWORD || + port->timeouts.ReadTotalTimeoutMultiplier != MAXDWORD || + port->timeouts.ReadTotalTimeoutConstant != timeout_val) { + port->timeouts.ReadIntervalTimeout = MAXDWORD; + port->timeouts.ReadTotalTimeoutMultiplier = MAXDWORD; + port->timeouts.ReadTotalTimeoutConstant = timeout_val; + if (SetCommTimeouts(port->hdl, &port->timeouts) == 0) + RETURN_FAIL("SetCommTimeouts() failed"); + } + + /* Loop until we have at least one byte, or timeout is reached. */ + while (bytes_read == 0) { + /* Start read. */ + if (ReadFile(port->hdl, buf, (DWORD) count, &bytes_read, &port->read_ovl)) { + DEBUG("Read completed immediately"); + } else if (GetLastError() == ERROR_IO_PENDING) { + DEBUG("Waiting for read to complete"); + if (GetOverlappedResult(port->hdl, &port->read_ovl, &bytes_read, TRUE) == 0) + RETURN_FAIL("GetOverlappedResult() failed"); + if (bytes_read > 0) { + DEBUG("Read completed"); + } else if (timeout_ms > 0) { + DEBUG("Read timed out"); + break; + } else { + DEBUG("Restarting read"); + } + } else { + RETURN_FAIL("ReadFile() failed"); + } + } + + TRY(restart_wait_if_needed(port, bytes_read)); + + RETURN_INT(bytes_read); + +#else + size_t bytes_read = 0; + struct timeout timeout; + fd_set fds; + ssize_t result; + + timeout_start(&timeout, timeout_ms); + + FD_ZERO(&fds); + FD_SET(port->fd, &fds); + + /* Loop until we have at least one byte, or timeout is reached. */ + while (bytes_read == 0) { + + if (timeout_check(&timeout)) + /* Timeout has expired. */ + break; + + result = select(port->fd + 1, &fds, NULL, NULL, timeout_timeval(&timeout)); + + timeout_update(&timeout); + + if (result < 0) { + if (errno == EINTR) { + DEBUG("select() call was interrupted, repeating"); + continue; + } else { + RETURN_FAIL("select() failed"); + } + } else if (result == 0) { + /* Timeout has expired. */ + break; + } + + /* Do read. */ + result = read(port->fd, buf, count); + + if (result < 0) { + if (errno == EAGAIN) + /* This shouldn't happen because we did a select() first, but handle anyway. */ + continue; + else + /* This is an actual failure. */ + RETURN_FAIL("read() failed"); + } + + bytes_read = result; + } + + if (bytes_read == 0) + DEBUG("Read timed out"); + + RETURN_INT(bytes_read); +#endif +} + +SP_API enum sp_return sp_nonblocking_read(struct sp_port *port, void *buf, + size_t count) +{ + TRACE("%p, %p, %d", port, buf, count); + + CHECK_OPEN_PORT(); + + if (!buf) + RETURN_ERROR(SP_ERR_ARG, "Null buffer"); + + DEBUG_FMT("Reading up to %d bytes from port %s", count, port->name); + +#ifdef _WIN32 + DWORD bytes_read; + + /* Set timeout. */ + if (port->timeouts.ReadIntervalTimeout != MAXDWORD || + port->timeouts.ReadTotalTimeoutMultiplier != 0 || + port->timeouts.ReadTotalTimeoutConstant != 0) { + port->timeouts.ReadIntervalTimeout = MAXDWORD; + port->timeouts.ReadTotalTimeoutMultiplier = 0; + port->timeouts.ReadTotalTimeoutConstant = 0; + if (SetCommTimeouts(port->hdl, &port->timeouts) == 0) + RETURN_FAIL("SetCommTimeouts() failed"); + } + + /* Do read. */ + if (ReadFile(port->hdl, buf, (DWORD) count, NULL, &port->read_ovl) == 0) + if (GetLastError() != ERROR_IO_PENDING) + RETURN_FAIL("ReadFile() failed"); + + /* Get number of bytes read. */ + if (GetOverlappedResult(port->hdl, &port->read_ovl, &bytes_read, FALSE) == 0) + RETURN_FAIL("GetOverlappedResult() failed"); + + TRY(restart_wait_if_needed(port, bytes_read)); + + RETURN_INT(bytes_read); +#else + ssize_t bytes_read; + + /* Returns the number of bytes read, or -1 upon failure. */ + if ((bytes_read = read(port->fd, buf, count)) < 0) { + if (errno == EAGAIN) + /* No bytes available. */ + bytes_read = 0; + else + /* This is an actual failure. */ + RETURN_FAIL("read() failed"); + } + RETURN_INT(bytes_read); +#endif +} + +SP_API enum sp_return sp_input_waiting(struct sp_port *port) +{ + TRACE("%p", port); + + CHECK_OPEN_PORT(); + + DEBUG_FMT("Checking input bytes waiting on port %s", port->name); + +#ifdef _WIN32 + DWORD errors; + COMSTAT comstat; + + if (ClearCommError(port->hdl, &errors, &comstat) == 0) + RETURN_FAIL("ClearCommError() failed"); + RETURN_INT(comstat.cbInQue); +#else + int bytes_waiting; + if (ioctl(port->fd, TIOCINQ, &bytes_waiting) < 0) + RETURN_FAIL("TIOCINQ ioctl failed"); + RETURN_INT(bytes_waiting); +#endif +} + +SP_API enum sp_return sp_output_waiting(struct sp_port *port) +{ + TRACE("%p", port); + +#ifdef __CYGWIN__ + /* TIOCOUTQ is not defined in Cygwin headers */ + RETURN_ERROR(SP_ERR_SUPP, + "Getting output bytes waiting is not supported on Cygwin"); +#else + CHECK_OPEN_PORT(); + + DEBUG_FMT("Checking output bytes waiting on port %s", port->name); + +#ifdef _WIN32 + DWORD errors; + COMSTAT comstat; + + if (ClearCommError(port->hdl, &errors, &comstat) == 0) + RETURN_FAIL("ClearCommError() failed"); + RETURN_INT(comstat.cbOutQue); +#else + int bytes_waiting; + if (ioctl(port->fd, TIOCOUTQ, &bytes_waiting) < 0) + RETURN_FAIL("TIOCOUTQ ioctl failed"); + RETURN_INT(bytes_waiting); +#endif +#endif +} + +SP_API enum sp_return sp_new_event_set(struct sp_event_set **result_ptr) +{ + struct sp_event_set *result; + + TRACE("%p", result_ptr); + + if (!result_ptr) + RETURN_ERROR(SP_ERR_ARG, "Null result"); + + *result_ptr = NULL; + + if (!(result = malloc(sizeof(struct sp_event_set)))) + RETURN_ERROR(SP_ERR_MEM, "sp_event_set malloc() failed"); + + memset(result, 0, sizeof(struct sp_event_set)); + + *result_ptr = result; + + RETURN_OK(); +} + +static enum sp_return add_handle(struct sp_event_set *event_set, + event_handle handle, enum sp_event mask) +{ + void *new_handles; + enum sp_event *new_masks; + + TRACE("%p, %d, %d", event_set, handle, mask); + + if (!(new_handles = realloc(event_set->handles, + sizeof(event_handle) * (event_set->count + 1)))) + RETURN_ERROR(SP_ERR_MEM, "Handle array realloc() failed"); + + event_set->handles = new_handles; + + if (!(new_masks = realloc(event_set->masks, + sizeof(enum sp_event) * (event_set->count + 1)))) + RETURN_ERROR(SP_ERR_MEM, "Mask array realloc() failed"); + + event_set->masks = new_masks; + + ((event_handle *) event_set->handles)[event_set->count] = handle; + event_set->masks[event_set->count] = mask; + + event_set->count++; + + RETURN_OK(); +} + +SP_API enum sp_return sp_add_port_events(struct sp_event_set *event_set, + const struct sp_port *port, enum sp_event mask) +{ + TRACE("%p, %p, %d", event_set, port, mask); + + if (!event_set) + RETURN_ERROR(SP_ERR_ARG, "Null event set"); + + if (!port) + RETURN_ERROR(SP_ERR_ARG, "Null port"); + + if (mask > (SP_EVENT_RX_READY | SP_EVENT_TX_READY | SP_EVENT_ERROR)) + RETURN_ERROR(SP_ERR_ARG, "Invalid event mask"); + + if (!mask) + RETURN_OK(); + +#ifdef _WIN32 + enum sp_event handle_mask; + if ((handle_mask = mask & SP_EVENT_TX_READY)) + TRY(add_handle(event_set, port->write_ovl.hEvent, handle_mask)); + if ((handle_mask = mask & (SP_EVENT_RX_READY | SP_EVENT_ERROR))) + TRY(add_handle(event_set, port->wait_ovl.hEvent, handle_mask)); +#else + TRY(add_handle(event_set, port->fd, mask)); +#endif + + RETURN_OK(); +} + +SP_API void sp_free_event_set(struct sp_event_set *event_set) +{ + TRACE("%p", event_set); + + if (!event_set) { + DEBUG("Null event set"); + RETURN(); + } + + DEBUG("Freeing event set"); + + if (event_set->handles) + free(event_set->handles); + if (event_set->masks) + free(event_set->masks); + + free(event_set); + + RETURN(); +} + +SP_API enum sp_return sp_wait(struct sp_event_set *event_set, + unsigned int timeout_ms) +{ + TRACE("%p, %d", event_set, timeout_ms); + + if (!event_set) + RETURN_ERROR(SP_ERR_ARG, "Null event set"); + +#ifdef _WIN32 + if (WaitForMultipleObjects(event_set->count, event_set->handles, FALSE, + timeout_ms ? timeout_ms : INFINITE) == WAIT_FAILED) + RETURN_FAIL("WaitForMultipleObjects() failed"); + + RETURN_OK(); +#else + struct timeout timeout; + int poll_timeout; + int result; + struct pollfd *pollfds; + unsigned int i; + + if (!(pollfds = malloc(sizeof(struct pollfd) * event_set->count))) + RETURN_ERROR(SP_ERR_MEM, "pollfds malloc() failed"); + + for (i = 0; i < event_set->count; i++) { + pollfds[i].fd = ((int *)event_set->handles)[i]; + pollfds[i].events = 0; + pollfds[i].revents = 0; + if (event_set->masks[i] & SP_EVENT_RX_READY) + pollfds[i].events |= POLLIN; + if (event_set->masks[i] & SP_EVENT_TX_READY) + pollfds[i].events |= POLLOUT; + if (event_set->masks[i] & SP_EVENT_ERROR) + pollfds[i].events |= POLLERR; + } + + timeout_start(&timeout, timeout_ms); + timeout_limit(&timeout, INT_MAX); + + /* Loop until an event occurs. */ + while (1) { + + if (timeout_check(&timeout)) { + DEBUG("Wait timed out"); + break; + } + + poll_timeout = (int) timeout_remaining_ms(&timeout); + if (poll_timeout == 0) + poll_timeout = -1; + + result = poll(pollfds, event_set->count, poll_timeout); + + timeout_update(&timeout); + + if (result < 0) { + if (errno == EINTR) { + DEBUG("poll() call was interrupted, repeating"); + continue; + } else { + free(pollfds); + RETURN_FAIL("poll() failed"); + } + } else if (result == 0) { + DEBUG("poll() timed out"); + if (!timeout.overflow) + break; + } else { + DEBUG("poll() completed"); + break; + } + } + + free(pollfds); + RETURN_OK(); +#endif +} + +#ifdef USE_TERMIOS_SPEED +static enum sp_return get_baudrate(int fd, int *baudrate) +{ + void *data; + + TRACE("%d, %p", fd, baudrate); + + DEBUG("Getting baud rate"); + + if (!(data = malloc(get_termios_size()))) + RETURN_ERROR(SP_ERR_MEM, "termios malloc failed"); + + if (ioctl(fd, get_termios_get_ioctl(), data) < 0) { + free(data); + RETURN_FAIL("Getting termios failed"); + } + + *baudrate = get_termios_speed(data); + + free(data); + + RETURN_OK(); +} + +static enum sp_return set_baudrate(int fd, int baudrate) +{ + void *data; + + TRACE("%d, %d", fd, baudrate); + + DEBUG("Getting baud rate"); + + if (!(data = malloc(get_termios_size()))) + RETURN_ERROR(SP_ERR_MEM, "termios malloc failed"); + + if (ioctl(fd, get_termios_get_ioctl(), data) < 0) { + free(data); + RETURN_FAIL("Getting termios failed"); + } + + DEBUG("Setting baud rate"); + + set_termios_speed(data, baudrate); + + if (ioctl(fd, get_termios_set_ioctl(), data) < 0) { + free(data); + RETURN_FAIL("Setting termios failed"); + } + + free(data); + + RETURN_OK(); +} +#endif /* USE_TERMIOS_SPEED */ + +#ifdef USE_TERMIOX +static enum sp_return get_flow(int fd, struct port_data *data) +{ + void *termx; + + TRACE("%d, %p", fd, data); + + DEBUG("Getting advanced flow control"); + + if (!(termx = malloc(get_termiox_size()))) + RETURN_ERROR(SP_ERR_MEM, "termiox malloc failed"); + + if (ioctl(fd, TCGETX, termx) < 0) { + free(termx); + RETURN_FAIL("Getting termiox failed"); + } + + get_termiox_flow(termx, &data->rts_flow, &data->cts_flow, + &data->dtr_flow, &data->dsr_flow); + + free(termx); + + RETURN_OK(); +} + +static enum sp_return set_flow(int fd, struct port_data *data) +{ + void *termx; + + TRACE("%d, %p", fd, data); + + DEBUG("Getting advanced flow control"); + + if (!(termx = malloc(get_termiox_size()))) + RETURN_ERROR(SP_ERR_MEM, "termiox malloc failed"); + + if (ioctl(fd, TCGETX, termx) < 0) { + free(termx); + RETURN_FAIL("Getting termiox failed"); + } + + DEBUG("Setting advanced flow control"); + + set_termiox_flow(termx, data->rts_flow, data->cts_flow, + data->dtr_flow, data->dsr_flow); + + if (ioctl(fd, TCSETX, termx) < 0) { + free(termx); + RETURN_FAIL("Setting termiox failed"); + } + + free(termx); + + RETURN_OK(); +} +#endif /* USE_TERMIOX */ + +static enum sp_return get_config(struct sp_port *port, struct port_data *data, + struct sp_port_config *config) +{ + unsigned int i; + + TRACE("%p, %p, %p", port, data, config); + + DEBUG_FMT("Getting configuration for port %s", port->name); + +#ifdef _WIN32 + if (!GetCommState(port->hdl, &data->dcb)) + RETURN_FAIL("GetCommState() failed"); + + for (i = 0; i < NUM_STD_BAUDRATES; i++) { + if (data->dcb.BaudRate == std_baudrates[i].index) { + config->baudrate = std_baudrates[i].value; + break; + } + } + + if (i == NUM_STD_BAUDRATES) + /* BaudRate field can be either an index or a custom baud rate. */ + config->baudrate = data->dcb.BaudRate; + + config->bits = data->dcb.ByteSize; + + switch (data->dcb.Parity) { + case NOPARITY: + config->parity = SP_PARITY_NONE; + break; + case ODDPARITY: + config->parity = SP_PARITY_ODD; + break; + case EVENPARITY: + config->parity = SP_PARITY_EVEN; + break; + case MARKPARITY: + config->parity = SP_PARITY_MARK; + break; + case SPACEPARITY: + config->parity = SP_PARITY_SPACE; + break; + default: + config->parity = -1; + } + + switch (data->dcb.StopBits) { + case ONESTOPBIT: + config->stopbits = 1; + break; + case TWOSTOPBITS: + config->stopbits = 2; + break; + default: + config->stopbits = -1; + } + + switch (data->dcb.fRtsControl) { + case RTS_CONTROL_DISABLE: + config->rts = SP_RTS_OFF; + break; + case RTS_CONTROL_ENABLE: + config->rts = SP_RTS_ON; + break; + case RTS_CONTROL_HANDSHAKE: + config->rts = SP_RTS_FLOW_CONTROL; + break; + default: + config->rts = -1; + } + + config->cts = data->dcb.fOutxCtsFlow ? SP_CTS_FLOW_CONTROL : SP_CTS_IGNORE; + + switch (data->dcb.fDtrControl) { + case DTR_CONTROL_DISABLE: + config->dtr = SP_DTR_OFF; + break; + case DTR_CONTROL_ENABLE: + config->dtr = SP_DTR_ON; + break; + case DTR_CONTROL_HANDSHAKE: + config->dtr = SP_DTR_FLOW_CONTROL; + break; + default: + config->dtr = -1; + } + + config->dsr = data->dcb.fOutxDsrFlow ? SP_DSR_FLOW_CONTROL : SP_DSR_IGNORE; + + if (data->dcb.fInX) { + if (data->dcb.fOutX) + config->xon_xoff = SP_XONXOFF_INOUT; + else + config->xon_xoff = SP_XONXOFF_IN; + } else { + if (data->dcb.fOutX) + config->xon_xoff = SP_XONXOFF_OUT; + else + config->xon_xoff = SP_XONXOFF_DISABLED; + } + +#else // !_WIN32 + + if (tcgetattr(port->fd, &data->term) < 0) + RETURN_FAIL("tcgetattr() failed"); + + if (ioctl(port->fd, TIOCMGET, &data->controlbits) < 0) + RETURN_FAIL("TIOCMGET ioctl failed"); + +#ifdef USE_TERMIOX + int ret = get_flow(port->fd, data); + + if (ret == SP_ERR_FAIL && errno == EINVAL) + data->termiox_supported = 0; + else if (ret < 0) + RETURN_CODEVAL(ret); + else + data->termiox_supported = 1; +#else + data->termiox_supported = 0; +#endif + + for (i = 0; i < NUM_STD_BAUDRATES; i++) { + if (cfgetispeed(&data->term) == std_baudrates[i].index) { + config->baudrate = std_baudrates[i].value; + break; + } + } + + if (i == NUM_STD_BAUDRATES) { +#ifdef __APPLE__ + config->baudrate = (int)data->term.c_ispeed; +#elif defined(USE_TERMIOS_SPEED) + TRY(get_baudrate(port->fd, &config->baudrate)); +#else + config->baudrate = -1; +#endif + } + + switch (data->term.c_cflag & CSIZE) { + case CS8: + config->bits = 8; + break; + case CS7: + config->bits = 7; + break; + case CS6: + config->bits = 6; + break; + case CS5: + config->bits = 5; + break; + default: + config->bits = -1; + } + + if (!(data->term.c_cflag & PARENB) && (data->term.c_iflag & IGNPAR)) + config->parity = SP_PARITY_NONE; + else if (!(data->term.c_cflag & PARENB) || (data->term.c_iflag & IGNPAR)) + config->parity = -1; +#ifdef CMSPAR + else if (data->term.c_cflag & CMSPAR) + config->parity = (data->term.c_cflag & PARODD) ? SP_PARITY_MARK : SP_PARITY_SPACE; +#endif + else + config->parity = (data->term.c_cflag & PARODD) ? SP_PARITY_ODD : SP_PARITY_EVEN; + + config->stopbits = (data->term.c_cflag & CSTOPB) ? 2 : 1; + + if (data->term.c_cflag & CRTSCTS) { + config->rts = SP_RTS_FLOW_CONTROL; + config->cts = SP_CTS_FLOW_CONTROL; + } else { + if (data->termiox_supported && data->rts_flow) + config->rts = SP_RTS_FLOW_CONTROL; + else + config->rts = (data->controlbits & TIOCM_RTS) ? SP_RTS_ON : SP_RTS_OFF; + + config->cts = (data->termiox_supported && data->cts_flow) ? + SP_CTS_FLOW_CONTROL : SP_CTS_IGNORE; + } + + if (data->termiox_supported && data->dtr_flow) + config->dtr = SP_DTR_FLOW_CONTROL; + else + config->dtr = (data->controlbits & TIOCM_DTR) ? SP_DTR_ON : SP_DTR_OFF; + + config->dsr = (data->termiox_supported && data->dsr_flow) ? + SP_DSR_FLOW_CONTROL : SP_DSR_IGNORE; + + if (data->term.c_iflag & IXOFF) { + if (data->term.c_iflag & IXON) + config->xon_xoff = SP_XONXOFF_INOUT; + else + config->xon_xoff = SP_XONXOFF_IN; + } else { + if (data->term.c_iflag & IXON) + config->xon_xoff = SP_XONXOFF_OUT; + else + config->xon_xoff = SP_XONXOFF_DISABLED; + } +#endif + + RETURN_OK(); +} + +static enum sp_return set_config(struct sp_port *port, struct port_data *data, + const struct sp_port_config *config) +{ + unsigned int i; +#ifdef __APPLE__ + BAUD_TYPE baud_nonstd; + + baud_nonstd = B0; +#endif +#ifdef USE_TERMIOS_SPEED + int baud_nonstd = 0; +#endif + + TRACE("%p, %p, %p", port, data, config); + + DEBUG_FMT("Setting configuration for port %s", port->name); + +#ifdef _WIN32 + BYTE* new_buf; + + TRY(await_write_completion(port)); + + if (config->baudrate >= 0) { + for (i = 0; i < NUM_STD_BAUDRATES; i++) { + if (config->baudrate == std_baudrates[i].value) { + data->dcb.BaudRate = std_baudrates[i].index; + break; + } + } + + if (i == NUM_STD_BAUDRATES) + data->dcb.BaudRate = config->baudrate; + + /* Allocate write buffer for 50ms of data at baud rate. */ + port->write_buf_size = max(config->baudrate / (8 * 20), 1); + new_buf = realloc(port->write_buf, port->write_buf_size); + if (!new_buf) + RETURN_ERROR(SP_ERR_MEM, "Allocating write buffer failed"); + port->write_buf = new_buf; + } + + if (config->bits >= 0) + data->dcb.ByteSize = config->bits; + + if (config->parity >= 0) { + switch (config->parity) { + case SP_PARITY_NONE: + data->dcb.Parity = NOPARITY; + break; + case SP_PARITY_ODD: + data->dcb.Parity = ODDPARITY; + break; + case SP_PARITY_EVEN: + data->dcb.Parity = EVENPARITY; + break; + case SP_PARITY_MARK: + data->dcb.Parity = MARKPARITY; + break; + case SP_PARITY_SPACE: + data->dcb.Parity = SPACEPARITY; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid parity setting"); + } + } + + if (config->stopbits >= 0) { + switch (config->stopbits) { + /* Note: There's also ONE5STOPBITS == 1.5 (unneeded so far). */ + case 1: + data->dcb.StopBits = ONESTOPBIT; + break; + case 2: + data->dcb.StopBits = TWOSTOPBITS; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid stop bit setting"); + } + } + + if (config->rts >= 0) { + switch (config->rts) { + case SP_RTS_OFF: + data->dcb.fRtsControl = RTS_CONTROL_DISABLE; + break; + case SP_RTS_ON: + data->dcb.fRtsControl = RTS_CONTROL_ENABLE; + break; + case SP_RTS_FLOW_CONTROL: + data->dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid RTS setting"); + } + } + + if (config->cts >= 0) { + switch (config->cts) { + case SP_CTS_IGNORE: + data->dcb.fOutxCtsFlow = FALSE; + break; + case SP_CTS_FLOW_CONTROL: + data->dcb.fOutxCtsFlow = TRUE; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid CTS setting"); + } + } + + if (config->dtr >= 0) { + switch (config->dtr) { + case SP_DTR_OFF: + data->dcb.fDtrControl = DTR_CONTROL_DISABLE; + break; + case SP_DTR_ON: + data->dcb.fDtrControl = DTR_CONTROL_ENABLE; + break; + case SP_DTR_FLOW_CONTROL: + data->dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid DTR setting"); + } + } + + if (config->dsr >= 0) { + switch (config->dsr) { + case SP_DSR_IGNORE: + data->dcb.fOutxDsrFlow = FALSE; + break; + case SP_DSR_FLOW_CONTROL: + data->dcb.fOutxDsrFlow = TRUE; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid DSR setting"); + } + } + + if (config->xon_xoff >= 0) { + switch (config->xon_xoff) { + case SP_XONXOFF_DISABLED: + data->dcb.fInX = FALSE; + data->dcb.fOutX = FALSE; + break; + case SP_XONXOFF_IN: + data->dcb.fInX = TRUE; + data->dcb.fOutX = FALSE; + break; + case SP_XONXOFF_OUT: + data->dcb.fInX = FALSE; + data->dcb.fOutX = TRUE; + break; + case SP_XONXOFF_INOUT: + data->dcb.fInX = TRUE; + data->dcb.fOutX = TRUE; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid XON/XOFF setting"); + } + } + + if (!SetCommState(port->hdl, &data->dcb)) + RETURN_FAIL("SetCommState() failed"); + +#else /* !_WIN32 */ + + int controlbits; + + if (config->baudrate >= 0) { + for (i = 0; i < NUM_STD_BAUDRATES; i++) { + if (config->baudrate == std_baudrates[i].value) { + if (cfsetospeed(&data->term, std_baudrates[i].index) < 0) + RETURN_FAIL("cfsetospeed() failed"); + + if (cfsetispeed(&data->term, std_baudrates[i].index) < 0) + RETURN_FAIL("cfsetispeed() failed"); + break; + } + } + + /* Non-standard baud rate */ + if (i == NUM_STD_BAUDRATES) { +#ifdef __APPLE__ + /* Set "dummy" baud rate. */ + if (cfsetspeed(&data->term, B9600) < 0) + RETURN_FAIL("cfsetspeed() failed"); + baud_nonstd = config->baudrate; +#elif defined(USE_TERMIOS_SPEED) + baud_nonstd = 1; +#else + RETURN_ERROR(SP_ERR_SUPP, "Non-standard baudrate not supported"); +#endif + } + } + + if (config->bits >= 0) { + data->term.c_cflag &= ~CSIZE; + switch (config->bits) { + case 8: + data->term.c_cflag |= CS8; + break; + case 7: + data->term.c_cflag |= CS7; + break; + case 6: + data->term.c_cflag |= CS6; + break; + case 5: + data->term.c_cflag |= CS5; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid data bits setting"); + } + } + + if (config->parity >= 0) { + data->term.c_iflag &= ~IGNPAR; + data->term.c_cflag &= ~(PARENB | PARODD); +#ifdef CMSPAR + data->term.c_cflag &= ~CMSPAR; +#endif + switch (config->parity) { + case SP_PARITY_NONE: + data->term.c_iflag |= IGNPAR; + break; + case SP_PARITY_EVEN: + data->term.c_cflag |= PARENB; + break; + case SP_PARITY_ODD: + data->term.c_cflag |= PARENB | PARODD; + break; +#ifdef CMSPAR + case SP_PARITY_MARK: + data->term.c_cflag |= PARENB | PARODD; + data->term.c_cflag |= CMSPAR; + break; + case SP_PARITY_SPACE: + data->term.c_cflag |= PARENB; + data->term.c_cflag |= CMSPAR; + break; +#else + case SP_PARITY_MARK: + case SP_PARITY_SPACE: + RETURN_ERROR(SP_ERR_SUPP, "Mark/space parity not supported"); +#endif + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid parity setting"); + } + } + + if (config->stopbits >= 0) { + data->term.c_cflag &= ~CSTOPB; + switch (config->stopbits) { + case 1: + data->term.c_cflag &= ~CSTOPB; + break; + case 2: + data->term.c_cflag |= CSTOPB; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid stop bits setting"); + } + } + + if (config->rts >= 0 || config->cts >= 0) { + if (data->termiox_supported) { + data->rts_flow = data->cts_flow = 0; + switch (config->rts) { + case SP_RTS_OFF: + case SP_RTS_ON: + controlbits = TIOCM_RTS; + if (ioctl(port->fd, config->rts == SP_RTS_ON ? TIOCMBIS : TIOCMBIC, &controlbits) < 0) + RETURN_FAIL("Setting RTS signal level failed"); + break; + case SP_RTS_FLOW_CONTROL: + data->rts_flow = 1; + break; + default: + break; + } + if (config->cts == SP_CTS_FLOW_CONTROL) + data->cts_flow = 1; + + if (data->rts_flow && data->cts_flow) + data->term.c_iflag |= CRTSCTS; + else + data->term.c_iflag &= ~CRTSCTS; + } else { + /* Asymmetric use of RTS/CTS not supported. */ + if (data->term.c_iflag & CRTSCTS) { + /* Flow control can only be disabled for both RTS & CTS together. */ + if (config->rts >= 0 && config->rts != SP_RTS_FLOW_CONTROL) { + if (config->cts != SP_CTS_IGNORE) + RETURN_ERROR(SP_ERR_SUPP, "RTS & CTS flow control must be disabled together"); + } + if (config->cts >= 0 && config->cts != SP_CTS_FLOW_CONTROL) { + if (config->rts <= 0 || config->rts == SP_RTS_FLOW_CONTROL) + RETURN_ERROR(SP_ERR_SUPP, "RTS & CTS flow control must be disabled together"); + } + } else { + /* Flow control can only be enabled for both RTS & CTS together. */ + if (((config->rts == SP_RTS_FLOW_CONTROL) && (config->cts != SP_CTS_FLOW_CONTROL)) || + ((config->cts == SP_CTS_FLOW_CONTROL) && (config->rts != SP_RTS_FLOW_CONTROL))) + RETURN_ERROR(SP_ERR_SUPP, "RTS & CTS flow control must be enabled together"); + } + + if (config->rts >= 0) { + if (config->rts == SP_RTS_FLOW_CONTROL) { + data->term.c_iflag |= CRTSCTS; + } else { + controlbits = TIOCM_RTS; + if (ioctl(port->fd, config->rts == SP_RTS_ON ? TIOCMBIS : TIOCMBIC, + &controlbits) < 0) + RETURN_FAIL("Setting RTS signal level failed"); + } + } + } + } + + if (config->dtr >= 0 || config->dsr >= 0) { + if (data->termiox_supported) { + data->dtr_flow = data->dsr_flow = 0; + switch (config->dtr) { + case SP_DTR_OFF: + case SP_DTR_ON: + controlbits = TIOCM_DTR; + if (ioctl(port->fd, config->dtr == SP_DTR_ON ? TIOCMBIS : TIOCMBIC, &controlbits) < 0) + RETURN_FAIL("Setting DTR signal level failed"); + break; + case SP_DTR_FLOW_CONTROL: + data->dtr_flow = 1; + break; + default: + break; + } + if (config->dsr == SP_DSR_FLOW_CONTROL) + data->dsr_flow = 1; + } else { + /* DTR/DSR flow control not supported. */ + if (config->dtr == SP_DTR_FLOW_CONTROL || config->dsr == SP_DSR_FLOW_CONTROL) + RETURN_ERROR(SP_ERR_SUPP, "DTR/DSR flow control not supported"); + + if (config->dtr >= 0) { + controlbits = TIOCM_DTR; + if (ioctl(port->fd, config->dtr == SP_DTR_ON ? TIOCMBIS : TIOCMBIC, + &controlbits) < 0) + RETURN_FAIL("Setting DTR signal level failed"); + } + } + } + + if (config->xon_xoff >= 0) { + data->term.c_iflag &= ~(IXON | IXOFF | IXANY); + switch (config->xon_xoff) { + case SP_XONXOFF_DISABLED: + break; + case SP_XONXOFF_IN: + data->term.c_iflag |= IXOFF; + break; + case SP_XONXOFF_OUT: + data->term.c_iflag |= IXON | IXANY; + break; + case SP_XONXOFF_INOUT: + data->term.c_iflag |= IXON | IXOFF | IXANY; + break; + default: + RETURN_ERROR(SP_ERR_ARG, "Invalid XON/XOFF setting"); + } + } + + if (tcsetattr(port->fd, TCSANOW, &data->term) < 0) + RETURN_FAIL("tcsetattr() failed"); + +#ifdef __APPLE__ + if (baud_nonstd != B0) { + if (ioctl(port->fd, IOSSIOSPEED, &baud_nonstd) == -1) + RETURN_FAIL("IOSSIOSPEED ioctl failed"); + /* + * Set baud rates in data->term to correct, but incompatible + * with tcsetattr() value, same as delivered by tcgetattr(). + */ + if (cfsetspeed(&data->term, baud_nonstd) < 0) + RETURN_FAIL("cfsetspeed() failed"); + } +#elif defined(__linux__) +#ifdef USE_TERMIOS_SPEED + if (baud_nonstd) + TRY(set_baudrate(port->fd, config->baudrate)); +#endif +#ifdef USE_TERMIOX + if (data->termiox_supported) + TRY(set_flow(port->fd, data)); +#endif +#endif + +#endif /* !_WIN32 */ + + RETURN_OK(); +} + +SP_API enum sp_return sp_new_config(struct sp_port_config **config_ptr) +{ + struct sp_port_config *config; + + TRACE("%p", config_ptr); + + if (!config_ptr) + RETURN_ERROR(SP_ERR_ARG, "Null result pointer"); + + *config_ptr = NULL; + + if (!(config = malloc(sizeof(struct sp_port_config)))) + RETURN_ERROR(SP_ERR_MEM, "Config malloc failed"); + + config->baudrate = -1; + config->bits = -1; + config->parity = -1; + config->stopbits = -1; + config->rts = -1; + config->cts = -1; + config->dtr = -1; + config->dsr = -1; + + *config_ptr = config; + + RETURN_OK(); +} + +SP_API void sp_free_config(struct sp_port_config *config) +{ + TRACE("%p", config); + + if (!config) + DEBUG("Null config"); + else + free(config); + + RETURN(); +} + +SP_API enum sp_return sp_get_config(struct sp_port *port, + struct sp_port_config *config) +{ + struct port_data data; + + TRACE("%p, %p", port, config); + + CHECK_OPEN_PORT(); + + if (!config) + RETURN_ERROR(SP_ERR_ARG, "Null config"); + + TRY(get_config(port, &data, config)); + + RETURN_OK(); +} + +SP_API enum sp_return sp_set_config(struct sp_port *port, + const struct sp_port_config *config) +{ + struct port_data data; + struct sp_port_config prev_config; + + TRACE("%p, %p", port, config); + + CHECK_OPEN_PORT(); + + if (!config) + RETURN_ERROR(SP_ERR_ARG, "Null config"); + + TRY(get_config(port, &data, &prev_config)); + TRY(set_config(port, &data, config)); + + RETURN_OK(); +} + +#define CREATE_ACCESSORS(x, type) \ +SP_API enum sp_return sp_set_##x(struct sp_port *port, type x) { \ + struct port_data data; \ + struct sp_port_config config; \ + TRACE("%p, %d", port, x); \ + CHECK_OPEN_PORT(); \ + TRY(get_config(port, &data, &config)); \ + config.x = x; \ + TRY(set_config(port, &data, &config)); \ + RETURN_OK(); \ +} \ +SP_API enum sp_return sp_get_config_##x(const struct sp_port_config *config, \ + type *x) { \ + TRACE("%p, %p", config, x); \ + if (!x) \ + RETURN_ERROR(SP_ERR_ARG, "Null result pointer"); \ + if (!config) \ + RETURN_ERROR(SP_ERR_ARG, "Null config"); \ + *x = config->x; \ + RETURN_OK(); \ +} \ +SP_API enum sp_return sp_set_config_##x(struct sp_port_config *config, \ + type x) { \ + TRACE("%p, %d", config, x); \ + if (!config) \ + RETURN_ERROR(SP_ERR_ARG, "Null config"); \ + config->x = x; \ + RETURN_OK(); \ +} + +CREATE_ACCESSORS(baudrate, int) +CREATE_ACCESSORS(bits, int) +CREATE_ACCESSORS(parity, enum sp_parity) +CREATE_ACCESSORS(stopbits, int) +CREATE_ACCESSORS(rts, enum sp_rts) +CREATE_ACCESSORS(cts, enum sp_cts) +CREATE_ACCESSORS(dtr, enum sp_dtr) +CREATE_ACCESSORS(dsr, enum sp_dsr) +CREATE_ACCESSORS(xon_xoff, enum sp_xonxoff) + +SP_API enum sp_return sp_set_config_flowcontrol(struct sp_port_config *config, + enum sp_flowcontrol flowcontrol) +{ + if (!config) + RETURN_ERROR(SP_ERR_ARG, "Null configuration"); + + if (flowcontrol > SP_FLOWCONTROL_DTRDSR) + RETURN_ERROR(SP_ERR_ARG, "Invalid flow control setting"); + + if (flowcontrol == SP_FLOWCONTROL_XONXOFF) + config->xon_xoff = SP_XONXOFF_INOUT; + else + config->xon_xoff = SP_XONXOFF_DISABLED; + + if (flowcontrol == SP_FLOWCONTROL_RTSCTS) { + config->rts = SP_RTS_FLOW_CONTROL; + config->cts = SP_CTS_FLOW_CONTROL; + } else { + if (config->rts == SP_RTS_FLOW_CONTROL) + config->rts = SP_RTS_ON; + config->cts = SP_CTS_IGNORE; + } + + if (flowcontrol == SP_FLOWCONTROL_DTRDSR) { + config->dtr = SP_DTR_FLOW_CONTROL; + config->dsr = SP_DSR_FLOW_CONTROL; + } else { + if (config->dtr == SP_DTR_FLOW_CONTROL) + config->dtr = SP_DTR_ON; + config->dsr = SP_DSR_IGNORE; + } + + RETURN_OK(); +} + +SP_API enum sp_return sp_set_flowcontrol(struct sp_port *port, + enum sp_flowcontrol flowcontrol) +{ + struct port_data data; + struct sp_port_config config; + + TRACE("%p, %d", port, flowcontrol); + + CHECK_OPEN_PORT(); + + TRY(get_config(port, &data, &config)); + + TRY(sp_set_config_flowcontrol(&config, flowcontrol)); + + TRY(set_config(port, &data, &config)); + + RETURN_OK(); +} + +SP_API enum sp_return sp_get_signals(struct sp_port *port, + enum sp_signal *signals) +{ + TRACE("%p, %p", port, signals); + + CHECK_OPEN_PORT(); + + if (!signals) + RETURN_ERROR(SP_ERR_ARG, "Null result pointer"); + + DEBUG_FMT("Getting control signals for port %s", port->name); + + *signals = 0; +#ifdef _WIN32 + DWORD bits; + if (GetCommModemStatus(port->hdl, &bits) == 0) + RETURN_FAIL("GetCommModemStatus() failed"); + if (bits & MS_CTS_ON) + *signals |= SP_SIG_CTS; + if (bits & MS_DSR_ON) + *signals |= SP_SIG_DSR; + if (bits & MS_RLSD_ON) + *signals |= SP_SIG_DCD; + if (bits & MS_RING_ON) + *signals |= SP_SIG_RI; +#else + int bits; + if (ioctl(port->fd, TIOCMGET, &bits) < 0) + RETURN_FAIL("TIOCMGET ioctl failed"); + if (bits & TIOCM_CTS) + *signals |= SP_SIG_CTS; + if (bits & TIOCM_DSR) + *signals |= SP_SIG_DSR; + if (bits & TIOCM_CAR) + *signals |= SP_SIG_DCD; + if (bits & TIOCM_RNG) + *signals |= SP_SIG_RI; +#endif + RETURN_OK(); +} + +SP_API enum sp_return sp_start_break(struct sp_port *port) +{ + TRACE("%p", port); + + CHECK_OPEN_PORT(); +#ifdef _WIN32 + if (SetCommBreak(port->hdl) == 0) + RETURN_FAIL("SetCommBreak() failed"); +#else + if (ioctl(port->fd, TIOCSBRK, 1) < 0) + RETURN_FAIL("TIOCSBRK ioctl failed"); +#endif + + RETURN_OK(); +} + +SP_API enum sp_return sp_end_break(struct sp_port *port) +{ + TRACE("%p", port); + + CHECK_OPEN_PORT(); +#ifdef _WIN32 + if (ClearCommBreak(port->hdl) == 0) + RETURN_FAIL("ClearCommBreak() failed"); +#else + if (ioctl(port->fd, TIOCCBRK, 1) < 0) + RETURN_FAIL("TIOCCBRK ioctl failed"); +#endif + + RETURN_OK(); +} + +SP_API int sp_last_error_code(void) +{ + TRACE_VOID(); +#ifdef _WIN32 + RETURN_INT(GetLastError()); +#else + RETURN_INT(errno); +#endif +} + +SP_API char *sp_last_error_message(void) +{ + TRACE_VOID(); + +#ifdef _WIN32 + char *message; + DWORD error = GetLastError(); + + DWORD length = FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + error, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR) &message, + 0, NULL ); + + if (length >= 2 && message[length - 2] == '\r') + message[length - 2] = '\0'; + + RETURN_STRING(message); +#else + RETURN_STRING(strerror(errno)); +#endif +} + +SP_API void sp_free_error_message(char *message) +{ + TRACE("%s", message); + +#ifdef _WIN32 + LocalFree(message); +#else + (void)message; +#endif + + RETURN(); +} + +SP_API void sp_set_debug_handler(void (*handler)(const char *format, ...)) +{ + TRACE("%p", handler); + + sp_debug_handler = handler; + + RETURN(); +} + +SP_API void sp_default_debug_handler(const char *format, ...) +{ + va_list args; + va_start(args, format); + if (getenv("LIBSERIALPORT_DEBUG")) { + fputs("sp: ", stderr); + vfprintf(stderr, format, args); + } + va_end(args); +} + +SP_API int sp_get_major_package_version(void) +{ + return SP_PACKAGE_VERSION_MAJOR; +} + +SP_API int sp_get_minor_package_version(void) +{ + return SP_PACKAGE_VERSION_MINOR; +} + +SP_API int sp_get_micro_package_version(void) +{ + return SP_PACKAGE_VERSION_MICRO; +} + +SP_API const char *sp_get_package_version_string(void) +{ + return SP_PACKAGE_VERSION_STRING; +} + +SP_API int sp_get_current_lib_version(void) +{ + return SP_LIB_VERSION_CURRENT; +} + +SP_API int sp_get_revision_lib_version(void) +{ + return SP_LIB_VERSION_REVISION; +} + +SP_API int sp_get_age_lib_version(void) +{ + return SP_LIB_VERSION_AGE; +} + +SP_API const char *sp_get_lib_version_string(void) +{ + return SP_LIB_VERSION_STRING; +} + +/** @} */ diff --git a/packages/firefox-webserial/extra_src/timing.c b/packages/firefox-webserial/extra_src/timing.c new file mode 100644 index 0000000..25876d6 --- /dev/null +++ b/packages/firefox-webserial/extra_src/timing.c @@ -0,0 +1,174 @@ +/* + * This file is part of the libserialport project. + * + * Copyright (C) 2019 Martin Ling + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include "libserialport_internal.h" + +SP_PRIV void time_get(struct time *time) +{ +#ifdef _WIN32 + LARGE_INTEGER count; + QueryPerformanceCounter(&count); + time->ticks = count.QuadPart; +#elif defined(HAVE_CLOCK_GETTIME) + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) + clock_gettime(CLOCK_REALTIME, &ts); + time->tv.tv_sec = ts.tv_sec; + time->tv.tv_usec = ts.tv_nsec / 1000; +#elif defined(__APPLE__) + mach_timebase_info_data_t info; + mach_timebase_info(&info); + uint64_t ticks = mach_absolute_time(); + uint64_t ns = (ticks * info.numer) / info.denom; + time->tv.tv_sec = ns / 1000000000; + time->tv.tv_usec = (ns % 1000000000) / 1000; +#else + gettimeofday(&time->tv, NULL); +#endif +} + +SP_PRIV void time_set_ms(struct time *time, unsigned int ms) +{ +#ifdef _WIN32 + LARGE_INTEGER frequency; + QueryPerformanceFrequency(&frequency); + time->ticks = ms * (frequency.QuadPart / 1000); +#else + time->tv.tv_sec = ms / 1000; + time->tv.tv_usec = (ms % 1000) * 1000; +#endif +} + +SP_PRIV void time_add(const struct time *a, + const struct time *b, struct time *result) +{ +#ifdef _WIN32 + result->ticks = a->ticks + b->ticks; +#else + timeradd(&a->tv, &b->tv, &result->tv); +#endif +} + +SP_PRIV void time_sub(const struct time *a, + const struct time *b, struct time *result) +{ +#ifdef _WIN32 + result->ticks = a->ticks - b->ticks; +#else + timersub(&a->tv, &b->tv, &result->tv); +#endif +} + +SP_PRIV bool time_greater(const struct time *a, const struct time *b) +{ +#ifdef _WIN32 + return (a->ticks > b->ticks); +#else + return timercmp(&a->tv, &b->tv, >); +#endif +} + +SP_PRIV void time_as_timeval(const struct time *time, struct timeval *tv) +{ +#ifdef _WIN32 + LARGE_INTEGER frequency; + QueryPerformanceFrequency(&frequency); + tv->tv_sec = (long) (time->ticks / frequency.QuadPart); + tv->tv_usec = (long) ((time->ticks % frequency.QuadPart) / + (frequency.QuadPart / 1000000)); +#else + *tv = time->tv; +#endif +} + +SP_PRIV unsigned int time_as_ms(const struct time *time) +{ +#ifdef _WIN32 + LARGE_INTEGER frequency; + QueryPerformanceFrequency(&frequency); + return (unsigned int) (time->ticks / (frequency.QuadPart / 1000)); +#else + return time->tv.tv_sec * 1000 + time->tv.tv_usec / 1000; +#endif +} + +SP_PRIV void timeout_start(struct timeout *timeout, unsigned int timeout_ms) +{ + timeout->ms = timeout_ms; + + /* Get time at start of operation. */ + time_get(&timeout->start); + /* Define duration of timeout. */ + time_set_ms(&timeout->delta, timeout_ms); + /* Calculate time at which we should give up. */ + time_add(&timeout->start, &timeout->delta, &timeout->end); + /* Disable limit unless timeout_limit() called. */ + timeout->limit_ms = 0; + /* First blocking call has not yet been made. */ + timeout->calls_started = false; +} + +SP_PRIV void timeout_limit(struct timeout *timeout, unsigned int limit_ms) +{ + timeout->limit_ms = limit_ms; + timeout->overflow = (timeout->ms > timeout->limit_ms); + time_set_ms(&timeout->delta_max, timeout->limit_ms); +} + +SP_PRIV bool timeout_check(struct timeout *timeout) +{ + if (!timeout->calls_started) + return false; + + if (timeout->ms == 0) + return false; + + time_get(&timeout->now); + time_sub(&timeout->end, &timeout->now, &timeout->delta); + if (timeout->limit_ms) + if ((timeout->overflow = time_greater(&timeout->delta, &timeout->delta_max))) + timeout->delta = timeout->delta_max; + + return time_greater(&timeout->now, &timeout->end); +} + +SP_PRIV void timeout_update(struct timeout *timeout) +{ + timeout->calls_started = true; +} + +#ifndef _WIN32 +SP_PRIV struct timeval *timeout_timeval(struct timeout *timeout) +{ + if (timeout->ms == 0) + return NULL; + + time_as_timeval(&timeout->delta, &timeout->delta_tv); + + return &timeout->delta_tv; +} +#endif + +SP_PRIV unsigned int timeout_remaining_ms(struct timeout *timeout) +{ + if (timeout->limit_ms && timeout->overflow) + return timeout->limit_ms; + else + return time_as_ms(&timeout->delta); +} diff --git a/packages/firefox-webserial/extra_src/uuid4.c b/packages/firefox-webserial/extra_src/uuid4.c new file mode 100644 index 0000000..eb07912 --- /dev/null +++ b/packages/firefox-webserial/extra_src/uuid4.c @@ -0,0 +1,358 @@ +// (‑●‑●)> dual licensed under the WTFPL v2 and MIT licenses +// without any warranty. +// by Gregory Pakosz (@gpakosz) +// https://github.com/gpakosz/uuid4 + +#if defined(__linux__) + #if !defined(_GNU_SOURCE) + #define _GNU_SOURCE + #endif +#endif + +// in case you want to #include "uuid4.c" in a larger compilation unit +#if !defined(UUID_4H) +#include +#endif + +#if !defined(UUID4_ASSERT) +#include +#define UUID4_ASSERT(expression) assert(expression) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +// ————————————————————————————————————————————————————————————————————————————— + +// http://xoshiro.di.unimi.it/splitmix64.c +// Written in 2015 by Sebastiano Vigna (vigna@acm.org) +/* + This is a fixed-increment version of Java 8's SplittableRandom generator + See http://dx.doi.org/10.1145/2714064.2660195 and + http://docs.oracle.com/javase/8/docs/api/java/util/SplittableRandom.html + + It is a very fast generator passing BigCrush. +*/ +static inline uint64_t UUID4_PREFIX(splitmix64)(uint64_t* state) +{ + uint64_t z = (*state += 0x9E3779B97F4A7C15u); + z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9u; + z = (z ^ (z >> 27)) * 0x94D049BB133111EBu; + return z ^ (z >> 31); +} + +// http://www.pcg-random.org/posts/developing-a-seed_seq-alternative.html +// Written in 2015 by Melissa O'Neil (oneill@pcg-random.org) +static inline uint32_t UUID4_PREFIX(hash)(uint32_t value) +{ + static uint32_t multiplier = 0x43b0d7e5u; + + value ^= multiplier; + multiplier *= 0x931e8875u; + value *= multiplier; + value ^= value >> 16; + + return value; +} + +static inline uint32_t UUID4_PREFIX(mix)(uint32_t x, uint32_t y) +{ + uint32_t result = 0xca01f9ddu * x - 0x4973f715u * y; + result ^= result >> 16; + return result; +} + + +// ————————————————————————————————————————————————————————————————————————————— + +#if defined(_WIN32) + +#define WIN32_LEAN_AND_MEAN +#include + +UUID4_FUNCSPEC +void UUID4_PREFIX(seed)(uint64_t* state) +{ + static uint64_t state0 = 0; + + LARGE_INTEGER time; + BOOL ok = QueryPerformanceCounter(&time); + UUID4_ASSERT(ok); + + *state = state0++ + ((uintptr_t)&time ^ (uint64_t)time.QuadPart); + + uint32_t pid = (uint32_t)GetCurrentProcessId(); + uint32_t tid = (uint32_t)GetCurrentThreadId(); + + *state = *state * 6364136223846793005u + ((uint64_t)(UUID4_PREFIX(mix)(UUID4_PREFIX(hash)(pid), UUID4_PREFIX(hash)(tid))) << 32); + *state = *state * 6364136223846793005u + (uintptr_t)GetCurrentProcessId; + *state = *state * 6364136223846793005u + (uintptr_t)UUID4_PREFIX(gen); +} + +#elif defined(__linux__) + +#if !defined(UUID4_CLOCK_ID) + #define UUID4_CLOCK_ID CLOCK_MONOTONIC_RAW +#endif + +#include +#include +#include + +UUID4_FUNCSPEC +void UUID4_PREFIX(seed)(uint64_t* state) +{ + static uint64_t state0 = 0; + + struct timespec time; + bool ok = clock_gettime(UUID4_CLOCK_ID, &time) == 0; + UUID4_ASSERT(ok); + + *state = state0++ + ((uintptr_t)&time ^ (uint64_t)(time.tv_sec * 1000000000 + time.tv_nsec)); + + uint32_t pid = (uint32_t)getpid(); + uint32_t tid = (uint32_t)syscall(SYS_gettid); + *state = *state * 6364136223846793005u + ((uint64_t)(UUID4_PREFIX(mix)(UUID4_PREFIX(hash)(pid), UUID4_PREFIX(hash)(tid))) << 32); + *state = *state * 6364136223846793005u + (uintptr_t)getpid; + *state = *state * 6364136223846793005u + (uintptr_t)UUID4_PREFIX(gen); +} + +#elif defined(__APPLE__) + +#include +#include +#include + +UUID4_FUNCSPEC +void UUID4_PREFIX(seed)(uint64_t* state) +{ + static uint64_t state0 = 0; + + uint64_t time = mach_absolute_time(); + + *state = state0++ + time; + + uint32_t pid = (uint32_t)getpid(); + uint64_t tid; + pthread_threadid_np(NULL, &tid); + *state = *state * 6364136223846793005u + ((uint64_t)(UUID4_PREFIX(mix)(UUID4_PREFIX(hash)(pid), UUID4_PREFIX(hash)((uint32_t)tid))) << 32); + *state = *state * 6364136223846793005u + (uintptr_t)getpid; + *state = *state * 6364136223846793005u + (uintptr_t)UUID4_PREFIX(gen); +} + +#else + +#error unsupported platform + +#endif + +#include +#include + +static void UUID4_PREFIX(randomize)(UUID4_STATE_T* state, UUID4_T* out) +{ + out->qwords[0] = UUID4_PREFIX(splitmix64)(state); + out->qwords[1] = UUID4_PREFIX(splitmix64)(state); +} + +UUID4_FUNCSPEC +void UUID4_PREFIX(gen)(UUID4_STATE_T* state, UUID4_T* out) +{ + UUID4_PREFIX(randomize)(state, out); + + out->bytes[6] = (out->bytes[6] & 0xf) | 0x40; + out->bytes[8] = (out->bytes[8] & 0x3f) | 0x80; +} + +UUID4_FUNCSPEC +bool UUID4_PREFIX(to_s)(const UUID4_T uuid, char* out, int capacity) +{ + static const char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + static const int groups[] = { 8, 4, 4, 4, 12 }; + int b = 0; + + if (capacity < UUID4_STR_BUFFER_SIZE) + return false; + + for (int i = 0; i < (int)(sizeof(groups) / sizeof(groups[0])); ++i) + { + for (int j = 0; j < groups[i]; j += 2) + { + uint8_t byte = uuid.bytes[b++]; + + *out++ = hex[byte >> 4]; + *out++ = hex[byte & 0xf]; + } + *out++ = '-'; + } + + *--out = 0; + + return true; +} + +#if defined (UUID4_PRACTRAND_TEST) + +// $ gcc -O2 -Wall -Werror -DUUID4_PRACTPRAND_TEST -o uuid4_practrand_test uuid.c + +#include +#include + +#ifdef _WIN32 +#include +#include +#else +#include +#endif + +int main() +{ + if (isatty(fileno(stdout))) + { + fprintf(stderr, "usage: uuid4_practrand_test | RNG_test stdin64\n"); + exit(EXIT_FAILURE); + } + +#ifdef _WIN32 + _setmode(fileno(stdout), _O_BINARY); +#endif + + UUID4_STATE_T state; + UUID4_PREFIX(seed)(&state); + + while (true) + { + UUID4_T uuid[1024]; + for (size_t i = 0; i < sizeof(uuid) / sizeof(uuid[0]); ++i) + UUID4_PREFIX(randomize)(&state, &uuid[i]); + + fwrite(uuid, sizeof(uuid), 1, stdout); + } + + return 0; +} + +#elif defined(UUID4_TESTU01_TEST) + +#include +#include + +static inline uint32_t rev32(uint32_t v) +{ + // https://graphics.stanford.edu/~seander/bithacks.html + // swap odd and even bits + v = ((v >> 1) & 0x55555555) | ((v & 0x55555555) << 1); + // swap consecutive pairs + v = ((v >> 2) & 0x33333333) | ((v & 0x33333333) << 2); + // swap nibbles ... + v = ((v >> 4) & 0x0F0F0F0F) | ((v & 0x0F0F0F0F) << 4); + // swap bytes + v = ((v >> 8) & 0x00FF00FF) | ((v & 0x00FF00FF) << 8); + // swap 2-byte-long pairs + v = ( v >> 16 ) | ( v << 16); + return v; +} + +static UUID4_STATE_T state; + +static unsigned int gen_uuid_0() +{ + UUID4_T uuid; + UUID4_PREFIX(randomize)(&state, &uuid); + + return uuid.dwords[0]; +} + +static unsigned int gen_uuid_0_rev() +{ + return rev32(gen_uuid_0()); +} + +static unsigned int gen_uuid_1() +{ + UUID4_T uuid; + UUID4_PREFIX(randomize)(&state, &uuid); + + return uuid.dwords[1]; +} + +static unsigned int gen_uuid_1_rev() +{ + return rev32(gen_uuid_1()); +} + +static unsigned int gen_uuid_2() +{ + UUID4_T uuid; + UUID4_PREFIX(randomize)(&state, &uuid); + + return uuid.dwords[2]; +} + +static unsigned int gen_uuid_2_rev() +{ + return rev32(gen_uuid_2()); +} + +static unsigned int gen_uuid_3() +{ + UUID4_T uuid; + UUID4_PREFIX(randomize)(&state, &uuid); + + return uuid.dwords[3]; +} + +static unsigned int gen_uuid_3_rev() +{ + return rev32(gen_uuid_3()); +} + +int main(int argc, char* argv[]) +{ + swrite_Basic = FALSE; + + UUID4_PREFIX(seed)(&state); + + struct + { + const char* name; + unsigned int (*gen)(); + } gens[] = + { + {"uuid4.dwords[0]", gen_uuid_0}, {"uuid4.dwords[0] (reversed)", gen_uuid_0_rev}, + {"uuid4.dwords[1]", gen_uuid_1}, {"uuid4.dwords[1] (reversed)", gen_uuid_1_rev}, + {"uuid4.dwords[2]", gen_uuid_2}, {"uuid4.dwords[2] (reversed)", gen_uuid_2_rev}, + {"uuid4.dwords[3]", gen_uuid_3}, {"uuid4.dwords[3] (reversed)", gen_uuid_3_rev} + }; + + for (size_t i = 0; i < sizeof(gens) / sizeof(gens[0]); ++i) + { + unif01_Gen* gen = unif01_CreateExternGenBits((char*)gens[i].name, gens[i].gen); + bbattery_SmallCrush(gen); + unif01_DeleteExternGenBits(gen); + } + + for (size_t i = 0; i < sizeof(gens) / sizeof(gens[0]); ++i) + { + unif01_Gen* gen = unif01_CreateExternGenBits((char*)gens[i].name, gens[i].gen); + bbattery_Crush(gen); + unif01_DeleteExternGenBits(gen); + } + + for (size_t i = 0; i < sizeof(gens) / sizeof(gens[0]); ++i) + { + unif01_Gen* gen = unif01_CreateExternGenBits((char*)gens[i].name, gens[i].gen); + bbattery_BigCrush(gen); + unif01_DeleteExternGenBits(gen); + } + + return 0; +} + +#endif + +#ifdef __cplusplus +} +#endif diff --git a/packages/firefox-webserial/extra_src/uuid4.h b/packages/firefox-webserial/extra_src/uuid4.h new file mode 100644 index 0000000..4a21863 --- /dev/null +++ b/packages/firefox-webserial/extra_src/uuid4.h @@ -0,0 +1,74 @@ +// (‑●‑●)> dual licensed under the WTFPL v2 and MIT licenses +// without any warranty. +// by Gregory Pakosz (@gpakosz) +// https://github.com/gpakosz/uuid4 + +#ifndef UUID4_H +#define UUID4_H + +#ifdef __cplusplus +#include +extern "C" { +#else +#include +#include +#endif + +#ifndef UUID4_FUNCSPEC + #define UUID4_FUNCSPEC +#endif +#ifndef UUID4_PREFIX + #define UUID4_PREFIX(x) uuid4_##x +#endif + +#ifndef UUID4_STR_BUFFER_SIZE + #define UUID4_STR_BUFFER_SIZE (int)sizeof("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx") // y is either 8, 9, a or b +#endif + +typedef uint64_t UUID4_PREFIX(state_t); +#define UUID4_STATE_T UUID4_PREFIX(state_t) + +typedef union +{ + uint8_t bytes[16]; + uint32_t dwords[4]; + uint64_t qwords[2]; +} UUID4_PREFIX(t); +#define UUID4_T UUID4_PREFIX(t) + +/** + * Seeds the state of the PRNG used to generate version 4 UUIDs. + * + * @param a pointer to a variable holding the state. + * + * @return `true` on success, otherwise `false`. + */ +UUID4_FUNCSPEC +void UUID4_PREFIX(seed)(UUID4_STATE_T* seed); + +/** + * Generates a version 4 UUID, see https://tools.ietf.org/html/rfc4122. + * + * @param state the state of the PRNG used to generate version 4 UUIDs. + * @param out the recipient for the UUID. + */ +UUID4_FUNCSPEC +void UUID4_PREFIX(gen)(UUID4_STATE_T* state, UUID4_T* out); + +/** + * Converts a UUID to a a `NUL` terminated string. + * + * @param out destination buffer + * @param capacity destination buffer capacity, must be greater or equal to + * `UUID4_STR_BUFFER_SIZE`. + * + * @return `true` on success, otherwise `false`. + */ +UUID4_FUNCSPEC +bool UUID4_PREFIX(to_s)(const UUID4_T uuid, char* out, int capacity); + +#ifdef __cplusplus +} +#endif + +#endif // #ifndef UUID4_H diff --git a/packages/firefox-webserial/extra_src/webserial.json b/packages/firefox-webserial/extra_src/webserial.json new file mode 100644 index 0000000..91ffded --- /dev/null +++ b/packages/firefox-webserial/extra_src/webserial.json @@ -0,0 +1,7 @@ +{ + "name": "io.github.kuba2k2.webserial", + "description": "WebSerial for Firefox", + "path": "REPLACE_ME_WITH_SED", + "type": "stdio", + "allowed_extensions": ["webserial@kuba2k2.github.io"] +} diff --git a/packages/flexbv.nix b/packages/flexbv.nix new file mode 100644 index 0000000..68a2987 --- /dev/null +++ b/packages/flexbv.nix @@ -0,0 +1,55 @@ +# +# flexbv board viewer +# +{ + stdenv, + libGL, + SDL2, + makeWrapper, + buildFHSEnv, + libz, + fontconfig +}: +let + + # + # The FlexBV provided binaries are static and self-unpacking, with a hardcoded next-stage + # dynamic loader path; and the format is an atypical variant of UPX. + # + # We'll create an inner package, and wrap it in an FHSEnv so we don't have to deal + # with patching the interpreter. + # + flexbv = stdenv.mkDerivation { + pname = "flexbv-unwrapped"; + version = "5.0345"; + + src = ../proprietary/flexbv5/FlexBV-5.0345-linux-3N5871753H701314U.tgz; + + dontBuild = true; + dontConfigure = true; + + nativeBuildInputs = [ + makeWrapper + ]; + + buildInputs = [ + libGL + SDL2 + libz + fontconfig + ]; + + # Set up the env with our binaries. + installPhase = '' + mkdir -p $out/bin + cp * $out/bin + ''; + }; + +in buildFHSEnv { + name = "flexbv"; + targetPkgs = (pkgs: flexbv.buildInputs ++ [ flexbv ]); + runScript = '' + flexbv "$@" + ''; +} diff --git a/packages/hantek-udev-rules/90-Hantek.rules b/packages/hantek-udev-rules/90-Hantek.rules new file mode 100644 index 0000000..6364820 --- /dev/null +++ b/packages/hantek-udev-rules/90-Hantek.rules @@ -0,0 +1,6 @@ +# Hantek Hantek6082BE +ATTRS{idVendor}=="04b5", ATTRS{idProduct}=="520a", MODE="0660", GROUP="plugdev" +ATTRS{idVendor}=="04b5", ATTRS{idProduct}=="6081", MODE="0660", GROUP="plugdev" + +# Hantek Hantek6074BD +ATTRS{idVendor}=="04b5", ATTRS{idProduct}=="6cde", MODE="0660", GROUP="plugdev" diff --git a/packages/hantek-udev-rules/default.nix b/packages/hantek-udev-rules/default.nix new file mode 100644 index 0000000..8bc0975 --- /dev/null +++ b/packages/hantek-udev-rules/default.nix @@ -0,0 +1,19 @@ +# +# udev rules for Tilt Five devices +# +{ pkgs }: +pkgs.stdenv.mkDerivation rec { + pname = "hantek-udev-rules"; + meta.description = "udev rules for Hantek devices"; + version = "0.0.1"; + + dontBuild = true; + dontConfigure = true; + + src = ./.; + + installPhase = '' + mkdir -p $out/lib/udev/rules.d + cp $src/90-Hantek.rules $out/lib/udev/rules.d/90-Hantek.rules + ''; +} diff --git a/packages/home-assistant-desktop/x86_64-linux.nix b/packages/home-assistant-desktop/x86_64-linux.nix new file mode 100644 index 0000000..767eec5 --- /dev/null +++ b/packages/home-assistant-desktop/x86_64-linux.nix @@ -0,0 +1,34 @@ +# +# Home assistant desktop app. +# +# vim: et:ts=2:sw=2: +{ + lib, + appimageTools, + fetchurl, +}: +let + pname = "home-assistant-desktop"; + version = "1.5.3"; + + src = fetchurl { + url = "https://github.com/iprodanovbg/homeassistant-desktop/releases/download/v1.5.3/Home-Assistant-Desktop-v1.5.3-linux-x86_64.AppImage"; + hash = "sha256-0N4xXbqQP1ybkTdzRceyYjgda09U8Dp7eIG22cXWRwE="; + }; + + appImageContent = appimageTools.extractType2 { inherit pname version src; }; +in +appimageTools.wrapType2 { + inherit pname version src; + + runScript = "appimage-exec.sh -w ${appImageContent} -- \${NIXOS_OZONE_WL:+\${WAYLAND_DISPLAY:+--ozone-platform-hint=auto}} --disable-sandbox"; + extraPkgs = + { pkgs, ... }@args: [ pkgs.libappindicator ] ++ appimageTools.defaultFhsEnvArgs.multiPkgs args; + + meta = { + homepage = "https://github.com/iprodanovbg/homeassistant-desktop"; + description = "HomeAssistant UI for the desktop"; + platforms = [ "x86_64-linux" ]; + license = lib.licenses.asl20; + }; +} diff --git a/packages/hrvst-cli/default.nix b/packages/hrvst-cli/default.nix new file mode 100644 index 0000000..d352aa0 --- /dev/null +++ b/packages/hrvst-cli/default.nix @@ -0,0 +1,28 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, +}: + +buildNpmPackage rec { + pname = "hrvst-cli"; + version = "2.0.1"; + + src = fetchFromGitHub { + owner = "kgajera"; + repo = "hrvst-cli"; + rev = "v${version}"; + hash = "sha256-Xq0q5K0BniVv4AGcEGMFG/rAhvdMy1+to1+9gow2MaA="; + }; + + npmDepsHash = "sha256-Grx3szP5oFpMCr+dWFPmo0V7RRFrltjxGtbz7CAxUEo="; + + meta = { + description = "Harvest CLI that contains all features available in Harvest's REST API V2 and more"; + homepage = "https://github.com/kgajera/hrvst-cli"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ]; + mainProgram = "hrvst-cli"; + platforms = lib.platforms.all; + }; +} diff --git a/packages/humanfx/default.nix b/packages/humanfx/default.nix new file mode 100644 index 0000000..8101c4f --- /dev/null +++ b/packages/humanfx/default.nix @@ -0,0 +1,30 @@ +# +# Alienware x14 (r2) light controller. +# +# vim: et:ts=2:sw=2: +{ + lib, + libusb1, + stdenv, + ... +}: +stdenv.mkDerivation rec { + pname = "humanfx"; + version = "3024-03-24"; + + src = ./src; + + buildInputs = [ + libusb1 + ]; + + buildPhase = '' + gcc -Wall -Wextra -o ${pname} main.c ${pname}.c -lusb-1.0 -I${libusb1.dev}/include -L${libusb1}/lib + ''; + + installPhase = '' + install -D ${pname} $out/bin/ledctl + install -D $src/60-alienware-elc.rules $out/lib/udev/rules.d/60-alienware-elc.rules + ''; + +} diff --git a/packages/humanfx/src/60-alienware-elc.rules b/packages/humanfx/src/60-alienware-elc.rules new file mode 100644 index 0000000..7fd572f --- /dev/null +++ b/packages/humanfx/src/60-alienware-elc.rules @@ -0,0 +1 @@ +SUBSYSTEMS=="usb", ATTRS{idVendor}=="187c", ATTRS{idProduct}=="0551", GROUP="plugdev", TAG+="uaccess" diff --git a/packages/humanfx/src/humanfx.c b/packages/humanfx/src/humanfx.c new file mode 100644 index 0000000..1f6635b --- /dev/null +++ b/packages/humanfx/src/humanfx.c @@ -0,0 +1,263 @@ +#include +#include +#include +#include +#include +#include + +#include "humanfx.h" + +// Logging +static void log_fatal(const char* msg) { + fprintf(stderr, "fatal: %s\n", msg); + exit(1); +} + +static void log_error(const char* msg) { + fprintf(stderr, "error: %s\n", msg); +} + +// Device +static libusb_context* context = NULL; +static libusb_device_handle* handle = NULL; +static bool acquired = false; + +void device_open(void) { + if (context) + log_fatal("libusb already initialized"); + if (handle) + log_fatal("device already opened"); + + libusb_init(&context); + libusb_set_option(context, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_WARNING); + + libusb_device** devices; + ssize_t count = libusb_get_device_list(context, &devices); + if (count < 0) + log_fatal("get device list"); + + libusb_device* device = NULL; + for (ssize_t i = 0; i < count; i++) { + struct libusb_device_descriptor descriptor = { 0 }; + if (libusb_get_device_descriptor(devices[i], &descriptor) != 0) + log_fatal("get device descriptor"); + if (descriptor.idVendor == 0x187c && descriptor.idProduct == 0x0551) { + device = devices[i]; + break; + } + } + libusb_free_device_list(devices, 1); + if (device == NULL) + log_fatal("find device"); + + if (libusb_open(device, &handle) != 0) + log_fatal("open device"); +} + +void device_acquire(void) { + if (!handle) + log_fatal("device not opened"); + if (acquired) + return; + if (libusb_kernel_driver_active(handle, 0)) + if (libusb_detach_kernel_driver(handle, 0) != 0) + log_fatal("detach kernel driver"); + if (libusb_claim_interface(handle, 0) != 0) + log_fatal("claim interface"); + acquired = true; +} + +void device_release(void) { + if (!handle) + log_fatal("device not opened"); + if (!acquired) + return; + libusb_release_interface(handle, 0); + libusb_attach_kernel_driver(handle, 0); + acquired = false; +} + +void device_close(void) { + if (!handle) + log_fatal("device not opened"); + if (acquired) + device_release(); + libusb_close(handle); + handle = NULL; + libusb_exit(context); + context = NULL; +} + +void device_send(const uint8_t data[], uint16_t length) { + if (!acquired) + log_fatal("device not acquired"); + unsigned char buffer[33]; + memset(buffer, 0, sizeof(buffer)); + memcpy(buffer, data, length); + if (libusb_control_transfer(handle, 0x21, 9, 0x202, 0, buffer, 33, 0) != 33) + log_error("could't write full packet"); +} + +void device_receive(uint8_t data[], uint16_t length) { + if (!acquired) + log_fatal("device not acquired"); + unsigned char buffer[33]; + if (libusb_control_transfer(handle, 0xA1, 1, 0x101, 0, buffer, 33, 0) != 33) + log_error("could't read full packet"); + memcpy(data, buffer, length > 33 ? 33 : length); +} + +// Interface +void send_request_firmware_version(void) { + device_send((uint8_t[]) { + PREAMBLE, + REQUEST, + REQUEST_FIRMWARE_VERSION, + }, 3); +} + +void send_request_status(void) { + device_send((uint8_t[]) { + PREAMBLE, + REQUEST, + REQUEST_STATUS, + }, 3); +} + +void send_request_elc_config(void) { + device_send((uint8_t[]) { + PREAMBLE, + REQUEST, + REQUEST_ELC_CONFIG, + }, 3); +} + +void send_request_animation_count(void) { + device_send((uint8_t[]) { + PREAMBLE, + REQUEST, + REQUEST_ANIMATION_COUNT, + }, 3); +} + +void send_animation_config_start(uint16_t animation_id) { + device_send((uint8_t[]) { + PREAMBLE, + ANIMATION, + (ANIMATION_CONFIG_START >> 8) & 0xFF, + (ANIMATION_CONFIG_START) & 0xFF, + (animation_id >> 8) & 0xFF, + (animation_id) & 0xFF, + }, 6); +} + +void send_animation_config_play(uint16_t animation_id) { + device_send((uint8_t[]) { + PREAMBLE, + ANIMATION, + (ANIMATION_CONFIG_PLAY >> 8) & 0xFF, + (ANIMATION_CONFIG_PLAY) & 0xFF, + (animation_id >> 8) & 0xFF, + (animation_id) & 0xFF, + }, 6); +} + +void send_animation_config_save(uint16_t animation_id) { + device_send((uint8_t[]) { + PREAMBLE, + ANIMATION, + (ANIMATION_CONFIG_SAVE >> 8) & 0xFF, + (ANIMATION_CONFIG_SAVE) & 0xFF, + (animation_id >> 8) & 0xFF, + (animation_id) & 0xFF, + }, 6); +} + +void send_animation_remove(uint16_t animation_id) { + device_send((uint8_t[]) { + PREAMBLE, + ANIMATION, + (ANIMATION_REMOVE >> 8) & 0xFF, + (ANIMATION_REMOVE) & 0xFF, + (animation_id >> 8) & 0xFF, + (animation_id) & 0xFF, + }, 6); +} + +void send_animation_play(uint16_t animation_id) { + device_send((uint8_t[]) { + PREAMBLE, + ANIMATION, + (ANIMATION_PLAY >> 8) & 0xFF, + (ANIMATION_PLAY) & 0xFF, + (animation_id >> 8) & 0xFF, + (animation_id) & 0xFF, + }, 6); +} + +void send_animation_set_default(uint16_t animation_id) { + device_send((uint8_t[]) { + PREAMBLE, + ANIMATION, + (ANIMATION_SET_DEFAULT >> 8) & 0xFF, + (ANIMATION_SET_DEFAULT) & 0xFF, + (animation_id >> 8) & 0xFF, + (animation_id) & 0xFF, + }, 6); +} + +void send_animation_set_startup(uint16_t animation_id) { + device_send((uint8_t[]) { + PREAMBLE, + ANIMATION, + (ANIMATION_SET_STARTUP >> 8) & 0xFF, + (ANIMATION_SET_STARTUP) & 0xFF, + (animation_id >> 8) & 0xFF, + (animation_id) & 0xFF, + }, 6); +} + +void send_zone_select(uint8_t loop, uint16_t zone_count, ...) { + va_list args; + va_start(args, zone_count); + uint8_t packet[5 + zone_count]; + packet[0] = PREAMBLE; + packet[1] = ZONE_SELECT; + packet[2] = loop; + packet[3] = (zone_count >> 8) & 0xFF; + packet[4] = (zone_count) & 0xFF; + for (uint16_t i = 0; i < zone_count; i++) + packet[5 + i] = (uint8_t) va_arg(args, int); + device_send(packet, sizeof(packet)); + va_end(args); +} + +void send_add_action(uint16_t action, uint16_t duration, uint16_t tempo, uint32_t color) { + device_send((uint8_t[]) { + PREAMBLE, + ADD_ACTION, + action, + (duration >> 8) & 0xFF, + (duration) & 0xFF, + (tempo >> 8) & 0xFF, + (tempo) & 0xFF, + (color >> 16) & 0xFF, + (color >> 8 & 0xFF), + (color) & 0xFF, + }, 10); +} + +void send_set_dim(uint8_t dim, uint16_t zone_count, ...) { + va_list args; + va_start(args, zone_count); + uint8_t packet[5 + zone_count]; + packet[0] = PREAMBLE; + packet[1] = SET_DIM; + packet[2] = dim; + packet[3] = (zone_count >> 8) & 0xFF; + packet[4] = (zone_count) & 0xFF; + for (uint16_t i = 0; i < zone_count; i++) + packet[5 + i] = (uint8_t) va_arg(args, int); + device_send(packet, sizeof(packet)); + va_end(args); +} diff --git a/packages/humanfx/src/humanfx.h b/packages/humanfx/src/humanfx.h new file mode 100644 index 0000000..42fefa9 --- /dev/null +++ b/packages/humanfx/src/humanfx.h @@ -0,0 +1,60 @@ +#pragma once + +#include + +// Device +void device_open(void); +void device_acquire(void); +void device_release(void); +void device_close(void); +void device_send(const uint8_t data[], uint16_t length); +void device_receive(uint8_t data[], uint16_t length); + +// Interface +#define PREAMBLE 0x03 +#define ZONE_LEFT 0x00 +#define ZONE_MIDDLE_LEFT 0x01 +#define ZONE_MIDDLE_RIGHT 0x02 +#define ZONE_RIGHT 0x03 +#define ZONE_ALL ZONE_LEFT, ZONE_MIDDLE_LEFT, ZONE_MIDDLE_RIGHT, ZONE_RIGHT + +#define REQUEST 0x20 +#define REQUEST_FIRMWARE_VERSION 0x00 +#define REQUEST_STATUS 0x01 +#define REQUEST_ELC_CONFIG 0x02 +#define REQUEST_ANIMATION_COUNT 0x03 +void send_request_firmware_version(void); +void send_request_status(void); +void send_request_elc_config(void); +void send_request_animation_count(void); + +#define ANIMATION 0x21 +#define ANIMATION_CONFIG_START 0x0001 +#define ANIMATION_CONFIG_SAVE 0x0002 +#define ANIMATION_CONFIG_PLAY 0x0003 +#define ANIMATION_REMOVE 0x0004 +#define ANIMATION_PLAY 0x0005 +#define ANIMATION_SET_DEFAULT 0x0006 +#define ANIMATION_SET_STARTUP 0x0007 +void send_animation_config_start(uint16_t animation_id); +void send_animation_config_play(uint16_t animation_id); +void send_animation_config_save(uint16_t animation_id); +void send_animation_remove(uint16_t animation_id); +void send_animation_play(uint16_t animation_id); +void send_animation_set_default(uint16_t animation_id); +void send_animation_set_startup(uint16_t animation_id); + +#define ZONE_SELECT 0x23 +void send_zone_select(uint8_t loop, uint16_t zone_count, ...); + +#define ADD_ACTION 0x24 +#define ACTION_COLOR 0x00 +#define ACTION_PULSE 0x01 +#define ACTION_MORPH 0x02 +void send_add_action(uint16_t action, uint16_t duration, uint16_t tempo, uint32_t color); + +#define SET_DIM 0x26 +#define BRIGHTNESS_OFF 0x64 +#define BRIGHTNESS_DIM 0x32 +#define BRIGHTNESS_FULL 0x00 +void send_set_dim(uint8_t dim, uint16_t zone_count, ...); \ No newline at end of file diff --git a/packages/humanfx/src/main.c b/packages/humanfx/src/main.c new file mode 100644 index 0000000..7fe278e --- /dev/null +++ b/packages/humanfx/src/main.c @@ -0,0 +1,280 @@ +#include "humanfx.h" + +#include +#include +#include + +void example_wave(uint32_t color) { + device_acquire(); + send_animation_config_start(0); + + send_zone_select(1, 1, ZONE_LEFT); + send_add_action(ACTION_MORPH, 500, 64, color); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + + send_zone_select(1, 1, ZONE_MIDDLE_LEFT); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, color); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + + send_zone_select(1, 1, ZONE_MIDDLE_RIGHT); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, color); + send_add_action(ACTION_MORPH, 500, 64, 0); + + send_zone_select(1, 1, ZONE_RIGHT); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, color); + + send_animation_config_play(0); + device_release(); +} + +void example_rainbow(uint16_t duration) { + device_acquire(); + send_animation_config_start(0); + + send_zone_select(1, 1, ZONE_LEFT); + send_add_action(ACTION_MORPH, duration, 64, 0xFF0000); + send_add_action(ACTION_MORPH, duration, 64, 0xFFa500); + send_add_action(ACTION_MORPH, duration, 64, 0xFFFF00); + send_add_action(ACTION_MORPH, duration, 64, 0x008000); + send_add_action(ACTION_MORPH, duration, 64, 0x00BFFF); + send_add_action(ACTION_MORPH, duration, 64, 0x0000FF); + send_add_action(ACTION_MORPH, duration, 64, 0x800080); + + send_zone_select(1, 1, ZONE_MIDDLE_LEFT); + send_add_action(ACTION_MORPH, duration, 64, 0x800080); + send_add_action(ACTION_MORPH, duration, 64, 0xFF0000); + send_add_action(ACTION_MORPH, duration, 64, 0xFFa500); + send_add_action(ACTION_MORPH, duration, 64, 0xFFFF00); + send_add_action(ACTION_MORPH, duration, 64, 0x008000); + send_add_action(ACTION_MORPH, duration, 64, 0x00BFFF); + send_add_action(ACTION_MORPH, duration, 64, 0x0000FF); + + send_zone_select(1, 1, ZONE_MIDDLE_RIGHT); + send_add_action(ACTION_MORPH, duration, 64, 0x0000FF); + send_add_action(ACTION_MORPH, duration, 64, 0x800080); + send_add_action(ACTION_MORPH, duration, 64, 0xFF0000); + send_add_action(ACTION_MORPH, duration, 64, 0xFFa500); + send_add_action(ACTION_MORPH, duration, 64, 0xFFFF00); + send_add_action(ACTION_MORPH, duration, 64, 0x008000); + send_add_action(ACTION_MORPH, duration, 64, 0x00BFFF); + + send_zone_select(1, 1, ZONE_RIGHT); + send_add_action(ACTION_MORPH, duration, 64, 0x00BFFF); + send_add_action(ACTION_MORPH, duration, 64, 0x0000FF); + send_add_action(ACTION_MORPH, duration, 64, 0x800080); + send_add_action(ACTION_MORPH, duration, 64, 0xFF0000); + send_add_action(ACTION_MORPH, duration, 64, 0xFFa500); + send_add_action(ACTION_MORPH, duration, 64, 0xFFFF00); + send_add_action(ACTION_MORPH, duration, 64, 0x008000); + + send_animation_config_play(0); + device_release(); +} + +void example_back_and_forth(uint32_t color) { + device_acquire(); + send_animation_config_start(0); + + send_zone_select(1, 1, ZONE_LEFT); + send_add_action(ACTION_MORPH, 500, 64, color); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + + send_zone_select(1, 1, ZONE_MIDDLE_LEFT); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, color); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, color); + + send_zone_select(1, 1, ZONE_MIDDLE_RIGHT); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, color); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, color); + send_add_action(ACTION_MORPH, 500, 64, 0); + + send_zone_select(1, 1, ZONE_RIGHT); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, color); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 500, 64, 0); + + send_animation_config_play(0); + device_release(); +} + +void example_spectrum(uint16_t duration) { + device_acquire(); + send_animation_config_start(0); + send_zone_select(1, 4, ZONE_ALL); + send_add_action(ACTION_MORPH, duration, 64, 0xFF0000); + send_add_action(ACTION_MORPH, duration, 64, 0xFFa500); + send_add_action(ACTION_MORPH, duration, 64, 0xFFFF00); + send_add_action(ACTION_MORPH, duration, 64, 0x008000); + send_add_action(ACTION_MORPH, duration, 64, 0x00BFFF); + send_add_action(ACTION_MORPH, duration, 64, 0x0000FF); + send_add_action(ACTION_MORPH, duration, 64, 0x800080); + send_animation_config_play(0); + device_release(); +} + +void example_static(uint32_t color) { + device_acquire(); + send_animation_config_start(0); + send_zone_select(1, 4, ZONE_ALL); + send_add_action(ACTION_COLOR, 1, 2, color); + send_animation_config_play(0); + device_release(); +} + +void example_breathe(uint16_t duration, uint32_t color) { + device_acquire(); + send_animation_config_start(0); + send_zone_select(1, 4, ZONE_ALL); + send_add_action(ACTION_MORPH, duration, 64, color); + send_add_action(ACTION_MORPH, duration, 64, 0); + send_animation_config_play(0); + device_release(); +} + +void print_usage(void) { + printf("Usage: humanfx [command] [arguments]...\n"); + printf("Alienware 187c:0550 controller\n"); + printf("\n"); + printf(" brightness \tSet brightness\n"); + printf(" static \tStatic color\n"); + printf(" breathe \tIt lives and breathes!\n"); + printf(" spectrum \tCycles through all colors\n"); + printf("\n"); +} + +int main(int argc, char** argv) { + device_open(); + + if (argc > 2) { + if (!strcmp(argv[1], "brightness")) { + uint8_t value = 100 - atoi(argv[2]); + if (value > 100) { + fprintf(stderr, "error: brightness value must be between 0 and 100\n"); + device_close(); + return 1; + } + device_acquire(); + send_set_dim(value, 4, ZONE_ALL); + device_release(); + } else if (!strcmp(argv[1], "static")) { + uint32_t color = strtol(argv[2], NULL, 16); + if (color == 0) { + fprintf(stderr, "error: invalid color %s\n", argv[2]); + device_close(); + return 1; + } + device_acquire(); + send_animation_remove(1); + send_animation_config_start(1); + send_zone_select(1, 4, ZONE_ALL); + send_add_action(ACTION_COLOR, 1, 2, color); + send_animation_config_save(1); + send_animation_set_default(1); + device_release(); + } else if (!strcmp(argv[1], "spectrum")) { + uint16_t duration = strtol(argv[2], NULL, 10); + if (duration == 0) { + fprintf(stderr, "error: invalid duration %s\n", argv[2]); + device_close(); + return 1; + } + device_acquire(); + send_animation_remove(1); + send_animation_config_start(1); + send_zone_select(1, 4, ZONE_ALL); + send_add_action(ACTION_MORPH, duration, 64, 0xFF0000); + send_add_action(ACTION_MORPH, duration, 64, 0xFFa500); + send_add_action(ACTION_MORPH, duration, 64, 0xFFFF00); + send_add_action(ACTION_MORPH, duration, 64, 0x008000); + send_add_action(ACTION_MORPH, duration, 64, 0x00BFFF); + send_add_action(ACTION_MORPH, duration, 64, 0x0000FF); + send_add_action(ACTION_MORPH, duration, 64, 0x800080); + send_animation_config_save(1); + send_animation_set_default(1); + device_release(); + } else if (!strcmp(argv[1], "breathe")) { + uint32_t color = strtol(argv[2], NULL, 16); + if (color == 0) { + fprintf(stderr, "error: invalid color %s\n", argv[2]); + device_close(); + return 1; + } + device_acquire(); + send_animation_remove(1); + send_animation_config_start(1); + send_zone_select(1, 4, ZONE_ALL); + send_add_action(ACTION_MORPH, 500, 64, color); + send_add_action(ACTION_MORPH, 2000, 64, color); + send_add_action(ACTION_MORPH, 500, 64, 0); + send_add_action(ACTION_MORPH, 2000, 64, 0); + send_animation_config_play(0); + send_animation_config_save(1); + send_animation_set_default(1); + device_release(); + } else { + print_usage(); + } + } else { + print_usage(); + } + + // Example temporary effects + // example_wave(0xFFFFFF); + // example_rainbow(500); + // example_back_and_forth(0xFFFFFF); + // example_spectrum(1000); + // example_static(0xFF00FF); + // example_breathe(2500, 0xFFFFFF); + + // Example setting as default + // device_acquire(); + // send_animation_remove(1); + // send_animation_config_start(1); + // send_zone_select(1, 4, ZONE_ALL); + // send_add_action(ACTION_COLOR, 1, 2, 0xFFFFFF); + // send_animation_config_save(1); + // send_animation_set_default(1); + // device_release(); + + // Example of reading data from device + // device_acquire(); + // send_request_animation_count(); + // uint8_t ret[33] = {0}; + // device_receive(ret, sizeof(ret)); + // printf("[ "); + // for (uint16_t i = 0; i < sizeof(ret); i++) + // printf("%02x ", ret[i]); + // printf("]\n"); + // device_release(); + + // Set brightness + // device_acquire(); + // send_set_dim(BRIGHTNESS_FULL, 4, ZONE_ALL); + // device_release(); + + device_close(); + return 0; +} \ No newline at end of file diff --git a/packages/i915-sriov/.gitignore b/packages/i915-sriov/.gitignore new file mode 100644 index 0000000..d9a77f3 --- /dev/null +++ b/packages/i915-sriov/.gitignore @@ -0,0 +1 @@ +*.hdrtest diff --git a/packages/i915-sriov/default.nix b/packages/i915-sriov/default.nix new file mode 100644 index 0000000..0e7b17e --- /dev/null +++ b/packages/i915-sriov/default.nix @@ -0,0 +1,52 @@ +# +# Kernel module for i915 sr-iov support. +# +# vim: et:ts=2:sw=2: +# +{ + stdenv, + lib, + nukeReferences, + fetchFromGitHub, + linuxPackages, +}: +let + kernel = linuxPackages.kernel; +in +stdenv.mkDerivation rec { + name = "i915-sriov-${version}-${kernel.version}"; + version = "2024-05-07"; + + src = fetchFromGitHub { + owner = "strongtz"; + repo = "i915-sriov-dkms"; + rev = "3d7a1b3fa4706d8da316d8e794d54db96856a2b9"; + hash = "sha256-TJk0zmXA2sUhbDu0jsA/1kFeIba8ZIZ0a4joPK4v8Ck="; + }; + + kernelVersion = kernel.version; + nativeBuildInputs = kernel.moduleBuildDependencies ++ [ nukeReferences ]; + + postUnpack = '' + cp -r $src/drivers/gpu/drm/i915/* . + ls -lah + ''; + + buildPhase = '' + make -j$(nproc) -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build M=$(pwd) KVER=${kernel.modDirVersion} + ''; + + installPhase = '' + mkdir -p $out/lib/modules/$kernelVersion/misc + for x in $(find . -name '*.ko'); do + nuke-refs $x + cp $x $out/lib/modules/$kernelVersion/misc/ + done + ''; + + meta = with lib; { + description = "A kernel module to enable SR-IOV on modern intel devices"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/packages/i915-sriov/kernel.nix b/packages/i915-sriov/kernel.nix new file mode 100644 index 0000000..8669998 --- /dev/null +++ b/packages/i915-sriov/kernel.nix @@ -0,0 +1,18 @@ +# +# Kernel built for i915 sr-iov support. +# +# vim: et:ts=2:sw=2: +# +{ linuxPackages, linuxPackagesFor, ... }: +linuxPackagesFor (linuxPackages.kernel.override { + + kernelPatches = [ { + name = "disable-pxp-for-i915-sriov"; + patch = null; + extraConfig = '' + INTEL_MEI_PXP m + DRM_I915_PXP y + ''; + } ]; + +}) diff --git a/packages/jadx/default.nix b/packages/jadx/default.nix new file mode 100644 index 0000000..26c3fa6 --- /dev/null +++ b/packages/jadx/default.nix @@ -0,0 +1,100 @@ +{ + lib, + stdenv, + fetchFromGitHub, + gradle, + jdk, + quark-engine, + makeWrapper, + imagemagick, + makeDesktopItem, + copyDesktopItems, + desktopToDarwinBundle, +}: +let self = stdenv.mkDerivation (finalAttrs: { + pname = "jadx"; + version = "1.5.0"; + + src = fetchFromGitHub { + owner = "skylot"; + repo = "jadx"; + rev = "v${finalAttrs.version}"; + hash = "sha256-+F+PHAd1+FmdAlQkjYDBsUYCUzKXG19ZUEorfvBUEg0="; + }; + + nativeBuildInputs = [ + gradle + jdk + imagemagick + makeWrapper + copyDesktopItems + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + + # Otherwise, Gradle fails with `java.net.SocketException: Operation not permitted` + __darwinAllowLocalNetworking = true; + + mitmCache = gradle.fetchDeps { + pkg = self; + data = ./deps.json; + }; + + preBuild = "export JADX_VERSION=${finalAttrs.version}"; + + gradleBuildTask = "pack"; + + installPhase = '' + runHook preInstall + + mkdir $out $out/bin + cp -R build/jadx/lib $out + for prog in jadx jadx-gui; do + cp build/jadx/bin/$prog $out/bin + wrapProgram $out/bin/$prog \ + --set JAVA_HOME ${jdk.home} \ + --prefix PATH : "${lib.makeBinPath [ quark-engine ]}" + done + + for size in 16 32 48; do + install -Dm444 \ + jadx-gui/src/main/resources/logos/jadx-logo-"$size"px.png \ + $out/share/icons/hicolor/"$size"x"$size"/apps/jadx.png + done + for size in 64 128 256; do + mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps + convert -resize "$size"x"$size" jadx-gui/src/main/resources/logos/jadx-logo.png $out/share/icons/hicolor/"$size"x"$size"/apps/jadx.png + done + + runHook postInstall + ''; + + desktopItems = [ + (makeDesktopItem { + name = "jadx"; + desktopName = "JADX"; + exec = "jadx-gui"; + icon = "jadx"; + comment = finalAttrs.meta.description; + categories = [ + "Development" + "Utility" + ]; + }) + ]; + + meta = with lib; { + description = "Dex to Java decompiler"; + longDescription = '' + Command line and GUI tools for produce Java source code from Android Dex + and Apk files. + ''; + sourceProvenance = with sourceTypes; [ + fromSource + binaryBytecode # deps + ]; + license = licenses.asl20; + platforms = platforms.unix; + mainProgram = "jadx-gui"; + maintainers = with maintainers; [ emilytrau ]; + }; +}); +in self diff --git a/packages/jadx/deps.json b/packages/jadx/deps.json new file mode 100644 index 0000000..ff69e3a --- /dev/null +++ b/packages/jadx/deps.json @@ -0,0 +1,1522 @@ +{ + "!comment": "This is a nixpkgs Gradle dependency lockfile. For more details, refer to the Gradle section in the nixpkgs manual.", + "!version": 1, + "https://dl.google.com/dl/android/maven2/com/android": { + "tools#r8/8.3.37": { + "jar": "sha256-WXU+cKdPkYOJzIfxt9ZrXAhikyVZFnQlcI3tFZ495Dk=", + "pom": "sha256-d6TAZPkYOrtfhr4g6uYTGICen8MvQaXDY4dp72hQ5T4=" + }, + "tools/build#aapt2-proto/8.3.2-10880808": { + "jar": "sha256-3iKdOHj8HSnfyghsigs3FNhY9wS7ifl/F/ZN2n8aEuI=", + "module": "sha256-ERjGfn1J9h/AsfZLVbSrHqVfi5zGPoeaDmbS6eAcKTw=", + "pom": "sha256-A4Lzmo++ffYXuIO/f53Rxg0i7kMp3/0iDhMoi6yZM4w=" + }, + "tools/build#apksig/8.3.2": { + "jar": "sha256-Ro7hhS+hJGHGYpYI/ke+cOUPYL58R0S7f2LKSOhcCmw=", + "pom": "sha256-2MOEEEQeeDYadm+kHqunUfrEH60WcbrNfqS7abiKKCE=" + }, + "tools/smali#smali-baksmali/3.0.5": { + "jar": "sha256-iZSrXXrULWJCu00p+o3IGhG511roC3jJnvY9B3k3+jo=", + "module": "sha256-5EA3mfVRU9YZIRr/lO5mqxX/SrSfXWUHV9LrraJt7lc=", + "pom": "sha256-shudIzWeaZizhVDoGbbDmukFdGRUapUDkoBOzq+omWo=" + }, + "tools/smali#smali-dexlib2/3.0.5": { + "jar": "sha256-j2seZoneVWYbd7wo641xBe6N8mFHktby5Qhm1Y0A3WI=", + "module": "sha256-zY7utICIrsZsSPv4g9qD+LhxYIAZqqRYSCK9s0zvge8=", + "pom": "sha256-nErnF9igv3TjT7iIbd6tQi885vi4SU3iDz5dtubUbD0=" + }, + "tools/smali#smali-util/3.0.5": { + "jar": "sha256-gX2qXYe/ejne1ZeIubZ5P49e32pPSrAiYJgAiSHpqws=", + "module": "sha256-VPXL9pRllG21X3f7mSADg+uvTKFOnrMNhgKWqxIuLXY=", + "pom": "sha256-AGspI+VNhCw80NB5AejYtvODplboeiSZwBMKa1TI0hA=" + }, + "tools/smali#smali/3.0.5": { + "jar": "sha256-mi8PtL9o18ISBsImnaMLjckpcdGE6Dshpk+4X95anUo=", + "module": "sha256-MLc8dXT76IQo+olKXTqAKqsI3qREr1Lje/A7Jn1bOc8=", + "pom": "sha256-/dFrTiATTBzK1fz+w5ROrTk4sUZKT7nzv3scnQUUYy0=" + } + }, + "https://plugins.gradle.org/m2": { + "com/diffplug/durian#durian-collect/1.2.0": { + "jar": "sha256-sZTAuIAhzBFsIcHcdvScLB/hda9by3TIume527+aSMw=", + "pom": "sha256-i7diCGoKT9KmRzu/kFx0R2OvodWaVjD3O7BLeHLAn/M=" + }, + "com/diffplug/durian#durian-core/1.2.0": { + "jar": "sha256-F+0KrLOjwWMjMyFou96thpTzKACytH1p1KTEmxFNXa4=", + "pom": "sha256-hwMg6QdVNxsBeW/oG6Ul/R3ui3A0b1VFUe7dQonwtmI=" + }, + "com/diffplug/durian#durian-io/1.2.0": { + "jar": "sha256-CV/R3HeIjAc/C+OaAYFW7lJnInmLCd6eKF7yE14W6sQ=", + "pom": "sha256-NQkZQkMk4nUKPdwvobzmqQrIziklaYpgqbTR1uSSL/4=" + }, + "com/diffplug/durian#durian-swt.os/4.2.2": { + "jar": "sha256-a1Mca0vlgaizLq2GHdwVwsk7IMZl+00z4DgUg8JERfQ=", + "module": "sha256-rVlQLGknZu48M0vkliigDctNka4aSPJjLitxUStDXPk=", + "pom": "sha256-GzxJFP1eLM4pZq1wdWY5ZBFFwdNCB3CTV4Py3yY2kIU=" + }, + "com/diffplug/spotless#com.diffplug.spotless.gradle.plugin/6.25.0": { + "pom": "sha256-9FyCsS+qzYWs1HTrppkyL6XeqIQIskfQ5L3pQSkIIjo=" + }, + "com/diffplug/spotless#spotless-lib-extra/2.45.0": { + "jar": "sha256-YCy7zTgo7pz7LjCn+bMDNcaScTB3FBTUzdKU0h/ly2c=", + "module": "sha256-9pnkNfTlzgPbYJpHaO6wNj1uB8ZfvPrx/GKcTnbuf7A=", + "pom": "sha256-5x2LkRDdSNLn9KVLi/uozlWpbmteu9T0OpJGZJz1b7A=" + }, + "com/diffplug/spotless#spotless-lib/2.45.0": { + "jar": "sha256-sllply4dmAKAyirlKRl+2bMWCq5ItQbPGTXwG9Exhmc=", + "module": "sha256-+x+8+TUAczrHWcp99E8P9mVTEze0LaAS4on/CINNiQ8=", + "pom": "sha256-WKd8IsQLIc8m29tCEwFu9HrM9bBwchfHkyqQ9D+PMNw=" + }, + "com/diffplug/spotless#spotless-plugin-gradle/6.25.0": { + "jar": "sha256-9euQikxdpGKZ51Q/qtoEAtLEt31Yx7Qy1Lblk0mygKM=", + "module": "sha256-RoHRe/PJIF2DeOynBcAAywzJjcx40DATy2iJjGvSx0Q=", + "pom": "sha256-q1ZuPYS2w/rHqPySXy279TzZdZywOvPAfQ3EN9OXqNo=" + }, + "com/fasterxml#oss-parent/48": { + "pom": "sha256-EbuiLYYxgW4JtiOiAHR0U9ZJGmbqyPXAicc9ordJAU8=" + }, + "com/fasterxml/jackson#jackson-bom/2.14.1": { + "pom": "sha256-eP35nlBQ/EhfQRfauMzL+2+mxoOF6184oJtlU3HUpsw=" + }, + "com/fasterxml/jackson#jackson-parent/2.14": { + "pom": "sha256-CQat2FWuOfkjV9Y/SFiJsI/KTEOl/kM1ItdTROB1exk=" + }, + "com/github/ben-manes#gradle-versions-plugin/0.51.0": { + "jar": "sha256-hDFJ4yuRdmIcz38dtEOECMWp+bWM1XIQU32bc4BUAh4=", + "module": "sha256-vUrCdcs524F7R32ZqxzkZ+BGdOdck8bWiScY1L7PnG4=", + "pom": "sha256-gzhEJF79GHeytCHNoI7uv1zx5O8SBcMXEEe1QGbdkB8=" + }, + "com/github/ben-manes/versions#com.github.ben-manes.versions.gradle.plugin/0.51.0": { + "pom": "sha256-oy92kCcy9iIN27EhlfozbDMfT2190MRscHcLOu4dR0E=" + }, + "com/github/johnrengelman#shadow/8.1.1": { + "jar": "sha256-CEGXVVWQpTuyG1lQijMwVZ9TbdtEjq/R7GdfVGIDb88=", + "module": "sha256-nQ87SqpniYcj6vbF6c0nOHj5V03azWSqNwJDYgzgLko=", + "pom": "sha256-Mu55f8hDI3xM5cSeX0FSxYoIlK/OCg6SY25qLU/JjDU=" + }, + "com/github/johnrengelman/shadow#com.github.johnrengelman.shadow.gradle.plugin/8.1.1": { + "pom": "sha256-PLOIa5ffbgZvEIwxayGfJiyXw8st9tp4kn5kXetkPLA=" + }, + "com/googlecode/concurrent-trees#concurrent-trees/2.6.1": { + "jar": "sha256-BONySYTipcv1VgbPo3KlvT08XSohUzpwBOPN5Tl2H6U=", + "pom": "sha256-Q8K5sULnBV0fKlgn8QlEkl0idH2XVrMlDAeqtHU4qXE=" + }, + "com/googlecode/javaewah#JavaEWAH/1.2.3": { + "jar": "sha256-1lImlJcTxMYaeE9BxRFn57Axb5N2Q5jrup5DNrPZVMI=", + "pom": "sha256-5O1sZpYgNm+ZOSBln+CsfLyD11PbwNwOseUplzr5byM=" + }, + "com/squareup/moshi#moshi-kotlin/1.12.0": { + "jar": "sha256-HENsB8FZzRrwMrt5NRpIqY5/eBrIB8/4tXEamZtWZt8=", + "module": "sha256-KnvKZtbM8WhVy1oKp8lRWPaIklomPv5MIEsjclSGH6E=", + "pom": "sha256-gwdSmAK8nLCHd24CabvdaSBG+kpz8ZDVgUpaj5JmJ24=" + }, + "com/squareup/moshi#moshi/1.12.0": { + "jar": "sha256-7pCR4dGlkm+ptN8mQsH7e7lq7Ahjm2IZwZ4LhyTUJHU=", + "module": "sha256-uGqTFURxITGVpEL4XKBG55oAHG1EbEHU0WiTbahW6+I=", + "pom": "sha256-YbyUJDqTc9mUini25xAAl161EPtvf0aoHq/N3TgeR3k=" + }, + "com/squareup/okhttp3#okhttp/4.11.0": { + "module": "sha256-VnwltR13eWF0Q5GE11JBK6l+2f22X8cYQNvFVjvrj6g=", + "pom": "sha256-ei1Cezixfgdtpk7o0hAuZIiNyyOK7l4tukp3UslKP94=" + }, + "com/squareup/okhttp3#okhttp/4.12.0": { + "jar": "sha256-sQUAgbFLt6On5VpNPvAbXc+rxFO0VzpPwBl2cZHV9OA=", + "module": "sha256-YH4iD/ghW5Kdgpu/VPMyiU8UWbTXlZea6vy8wc6lTPM=", + "pom": "sha256-fHNwQKlBlSLnxQzAJ0FqcP58dinlKyGZNa3mtBGcfTg=" + }, + "com/squareup/okio#okio-jvm/3.2.0": { + "module": "sha256-p3jzkIXtar/NaHESmGxjhapXrC2IQLIdlGs8IJXzDqQ=", + "pom": "sha256-XEUflKdr6oYbbvK/hOj1cgBUWWjIZVWr3+0Tx8otSJ0=" + }, + "com/squareup/okio#okio-jvm/3.6.0": { + "jar": "sha256-Z1Q/Bzb8QirpJ+0OUEuYvF4mn9oNNQBXkzfLcT2ihBI=", + "module": "sha256-scIZnhwMyWnvYcu+SvLsr5sGQRvd4By69vyRNN/gToo=", + "pom": "sha256-YbTXxRWgiU/62SX9cFJiDBQlqGQz/TURO1+rDeiQpX8=" + }, + "com/squareup/okio#okio/2.10.0": { + "module": "sha256-EcvqvDp2XJqAMkL6ICShGFPrCGXaU2xLBa/c27I0Y3A=", + "pom": "sha256-S5YGC20aK5bpDkKtcVitvjRpMWuA/qCBfGwzmT7hzHI=" + }, + "com/squareup/okio#okio/3.2.0": { + "module": "sha256-aB9c7BcN5FuVST6e5wWGjrNa34mO4G+W4i0ZclDBsQQ=", + "pom": "sha256-i0b1jZua6xF4Nh1YpoZfTa1mWTDF/3tV4LqmHvOpcqE=" + }, + "com/squareup/okio#okio/3.6.0": { + "module": "sha256-akesUDZOZZhFlAH7hvm2z832N7mzowRbHMM8v0xAghg=", + "pom": "sha256-rrO3CiTBA+0MVFQfNfXFEdJ85gyuN2pZbX1lNpf4zJU=" + }, + "com/thoughtworks/xstream#xstream-parent/1.4.20": { + "pom": "sha256-ERiJ4wIWWg9EpU3k23BSUNHeDckbp4oZih0ieDRL7uc=" + }, + "com/thoughtworks/xstream#xstream/1.4.20": { + "jar": "sha256-h98PC+V8kgN9ARD7siWjC2UXAtwnVlPSha/P7zG8LoE=", + "pom": "sha256-c9gezjnpSh0tf80BhGYqo9QQa/6XCbeTlkiS4+f0/cQ=" + }, + "commons-codec#commons-codec/1.16.0": { + "jar": "sha256-VllfsgsLhbyR0NUD2tULt/G5r8Du1d/6bLslkpAASE0=", + "pom": "sha256-bLWVeBnfOTlW/TEaOgw/XuwevEm6Wy0J8/ROYWf6PnQ=" + }, + "commons-io#commons-io/2.11.0": { + "jar": "sha256-lhsvbYfbrMXVSr9Fq3puJJX4m3VZiWLYxyPOqbwhCQg=", + "pom": "sha256-LgFv1+MkS18sIKytg02TqkeQSG7h5FZGQTYaPoMe71k=" + }, + "dev/equo/ide#solstice/1.7.5": { + "jar": "sha256-BuFLxDrMMx2ra16iAfxnNk7RI/mCyF+lEx8IF+1lrk8=", + "module": "sha256-eYp7cGdyE27iijLt2GOx6fgWE6NJhAXXS+ilyb6/9U8=", + "pom": "sha256-20U7urXn2opDE5sNzTuuZykzIfKcTZH1p5XZ/2xS3d8=" + }, + "edu/sc/seis/launch4j#edu.sc.seis.launch4j.gradle.plugin/3.0.5": { + "pom": "sha256-Nplw/agsRFMGIjSqxiwBbqw5nY8C2VKdUe28QY0fzPs=" + }, + "edu/sc/seis/launch4j#launch4j/3.0.5": { + "jar": "sha256-4x62k3vvPwCsxAPkraf7ihY4ATiQ0bNSVmiFBocx7WM=", + "module": "sha256-+hiZBJpE2pdEnjoBvCx9rC01t0npPPdsBDSuzjT9ux8=", + "pom": "sha256-UvTlC0T2dzuebNq7jmmveQc4IW+8ZxJ1G77tGKFCknk=" + }, + "io/fabric8#kubernetes-client-bom/5.12.2": { + "pom": "sha256-6qA8FpVlaNVKa6Q31J1Ay/DdjpOXf5hDGCQldrZQvDs=" + }, + "io/github/x-stream#mxparser/1.2.2": { + "jar": "sha256-ru7iOjMD2BG8qHkOp/JbU0MUhhwDz/Ntr9zCGAlp65c=", + "pom": "sha256-I1AiQk4S8zGB9iraGcxEKAGbaXZXw8OSzjVxYKQi+qg=" + }, + "io/netty#netty-bom/4.1.86.Final": { + "pom": "sha256-EnFsH+ZM9b2qcETTfROq46iIIbkdR5hCDEanR2kXiv0=" + }, + "jakarta/platform#jakarta.jakartaee-bom/9.0.0": { + "pom": "sha256-kZA9Ddh23sZ/i5I/EzK6cr8pWwa9OX0Y868ZMHzhos4=" + }, + "jakarta/platform#jakartaee-api-parent/9.0.0": { + "pom": "sha256-9l3PFLbh2RSOGYo5D6/hVfrKCTJT3ekAMH8+DqgsrTs=" + }, + "net/sf/launch4j#launch4j/3.50": { + "pom": "sha256-1716EuPm1bR/Ou0p/4g89cTKnie3GWkQZnkzH6N+xy0=" + }, + "net/sf/launch4j#launch4j/3.50/core": { + "jar": "sha256-2U8eT20fHhl9Es7vpwot75OMzxbig+mjx0Cmb/WGvW8=" + }, + "org/apache#apache/23": { + "pom": "sha256-vBBiTgYj82V3+sVjnKKTbTJA7RUvttjVM6tNJwVDSRw=" + }, + "org/apache#apache/27": { + "pom": "sha256-srD8aeIqZQw4kvHDZtdwdvKVdcZzjfTHpwpEhESEzfk=" + }, + "org/apache#apache/29": { + "pom": "sha256-PkkDcXSCC70N9jQgqXclWIY5iVTCoGKR+mH3J6w1s3c=" + }, + "org/apache/ant#ant-launcher/1.10.13": { + "jar": "sha256-zXaVs7+2lkq3G2oLMdrWAAWud/5QITI2Rnmqzwj3eXA=", + "pom": "sha256-ApkvvDgFU1bzyU0B6qJJmcsCoJuqnB/fXqx2t8MVY8o=" + }, + "org/apache/ant#ant-parent/1.10.13": { + "pom": "sha256-blv8hwgiFD8f+7LG8I7EiHctsxSlKDMC9IFLEms0aTk=" + }, + "org/apache/ant#ant/1.10.13": { + "jar": "sha256-vvv8eedE6Yks+n25bfO26C3BfSVxr0KqQnl2/CIpmDg=", + "pom": "sha256-J5NR7tkLj3QbtIyVvmHD7CRU48ipr7Q7zB0LrB3aE3o=" + }, + "org/apache/commons#commons-parent/52": { + "pom": "sha256-ddvo806Y5MP/QtquSi+etMvNO18QR9VEYKzpBtu0UC4=" + }, + "org/apache/commons#commons-parent/58": { + "pom": "sha256-LUsS4YiZBjq9fHUni1+pejcp2Ah4zuy2pA2UbpwNVZA=" + }, + "org/apache/logging#logging-parent/7": { + "pom": "sha256-5YkR3J/GsXOhDlqp7bk8eZStBmAnBd0Gftz8bh6eFys=" + }, + "org/apache/logging/log4j#log4j-api/2.20.0": { + "jar": "sha256-L0PupnnqZvFMoPE/7CqGAKwST1pSMdy034OT7dy5dVA=", + "pom": "sha256-zUWDKj1s0hlENcDWPKAV8ZSWjy++pPKRVTv3r7hOFjc=" + }, + "org/apache/logging/log4j#log4j-bom/2.20.0": { + "pom": "sha256-+LtpLpWmt72mAehxAJWOg9AGG38SMlC2gSiUOhlenaE=" + }, + "org/apache/logging/log4j#log4j-core/2.20.0": { + "jar": "sha256-YTffhIza7Z9NUHb3VRPGyF2oC5U/TnrMo4CYt3B2P1U=", + "pom": "sha256-3nGsEAVR9KB3rsrQd70VPnHfeqacMELXZRbMXM4Ice4=" + }, + "org/apache/logging/log4j#log4j/2.20.0": { + "pom": "sha256-mje0qPZ+jUG8JHNxejAhYz1qPD8xBXnbmtC+PyRlnGk=" + }, + "org/beryx#badass-runtime-plugin/1.13.1": { + "jar": "sha256-IW3RL1SacHD31B2wTupXAaF5Z0mzVerAzkMVLs0DGBc=", + "module": "sha256-Jf4I7QwECTJuc38vDJ/7BhyFQihl53ATdMOVyjpy9PA=", + "pom": "sha256-qZgenE/Me3hqUL+/IW93EBgs27ECjqsGiavMYeS37XI=" + }, + "org/beryx/runtime#org.beryx.runtime.gradle.plugin/1.13.1": { + "pom": "sha256-7SsiPX22wuiujLyvq8E96b0kKfwfNMtEFVh0jJCBu+U=" + }, + "org/codehaus/groovy#groovy-bom/3.0.14": { + "pom": "sha256-JODptzjecRjennNWD/0GA0u1zwfKE6fgNFnoi6nRric=" + }, + "org/codehaus/plexus#plexus-utils/3.5.1": { + "jar": "sha256-huAlXUyHnGG0gz7X8TEk6LtnnfR967EnMm59t91JoHs=", + "pom": "sha256-lP9o7etIIE0SyZGJx2cWTTqfd4oTctHc4RpBRi5iNvI=" + }, + "org/codehaus/plexus#plexus/10": { + "pom": "sha256-u6nFIQZLnKEyzpfMHMfrSvwtvjK8iMuHLIjpn2FiMB8=" + }, + "org/eclipse/ee4j#project/1.0.6": { + "pom": "sha256-Tn2DKdjafc8wd52CQkG+FF8nEIky9aWiTrkHZ3vI1y0=" + }, + "org/eclipse/jetty#jetty-bom/9.4.50.v20221201": { + "pom": "sha256-TN5uUz1gHq+LZazulWt3BsGBkvJ1XQI9fo0Zu31bOUM=" + }, + "org/eclipse/jgit#org.eclipse.jgit-parent/6.7.0.202309050840-r": { + "pom": "sha256-u56FQW2Y0HMfx2f41w6EaAQWAdZnKuItsqx5n3qjkR8=" + }, + "org/eclipse/jgit#org.eclipse.jgit/6.7.0.202309050840-r": { + "jar": "sha256-tWRHfQkiQaqrUMhKxd0aw3XAGCBE1+VlnTpgqQ4ugBo=", + "pom": "sha256-BNB83b8ZjfpuRIuan7lA94HAEq2T2eqCBv4KTTplwZI=" + }, + "org/eclipse/platform#org.eclipse.osgi/3.18.300": { + "jar": "sha256-urlD5Y7dFzCSOGctunpFrsni2svd24GKjPF3I+oT+iI=", + "pom": "sha256-4nl2N1mZxUJ/y8//PzvCD77a+tiqRRArN59cL5fI/rQ=" + }, + "org/gradle/kotlin#gradle-kotlin-dsl-plugins/4.3.1": { + "jar": "sha256-j8X5xgrEWoeaQXdoEbWf0s5cWtXkJW8S18i+rFCkHcg=", + "module": "sha256-k+eJyXjl4QG8QXfLsnmFQSvMtpNtsA7MQeYoG4QD/F4=", + "pom": "sha256-Fr3gZfWofPRP3FD5xbYNMS9xOgwbyq4AixJItHhojAo=" + }, + "org/gradle/kotlin/kotlin-dsl#org.gradle.kotlin.kotlin-dsl.gradle.plugin/4.3.1": { + "pom": "sha256-Oispc8Afy2j0kx8ZbNeLAzctoWrBYmqOPWMYVkNqlOc=" + }, + "org/jdom#jdom2/2.0.6.1": { + "jar": "sha256-CyD0XjoP2PDRLNxTFrBndukCsTZdsAEYh2+RdcYPMCw=", + "pom": "sha256-VXleEBi4rmR7k3lnz4EKmbCFgsI3TnhzwShzTIyRS/M=" + }, + "org/jetbrains#annotations/13.0": { + "jar": "sha256-rOKhDcji1f00kl7KwD5JiLLA+FFlDJS4zvSbob0RFHg=", + "pom": "sha256-llrrK+3/NpgZvd4b96CzuJuCR91pyIuGN112Fju4w5c=" + }, + "org/jetbrains/intellij/deps#trove4j/1.0.20200330": { + "jar": "sha256-xf1yW/+rUYRr88d9sTg8YKquv+G3/i8A0j/ht98KQ50=", + "pom": "sha256-h3IcuqZaPJfYsbqdIHhA8WTJ/jh1n8nqEP/iZWX40+k=" + }, + "org/jetbrains/kotlin#kotlin-android-extensions/1.9.22": { + "jar": "sha256-Hl6IFkKpnduPbRPmmVoIwZK8OEGHOWZj2ER8CB2H4k8=", + "pom": "sha256-lEt8+zPgpvtoRVkEjwKMuWMmyTKiRdXLAhQ7zSwDEVk=" + }, + "org/jetbrains/kotlin#kotlin-android-extensions/1.9.23": { + "jar": "sha256-Yf12SPkx/06b2/9JvwmHcFdj+7qce7ALJkgRo20RGsE=", + "pom": "sha256-0+vFk7FzrT4tHiVgtpwzFKRpDI2jJ0ch6DqWrtwWEaA=" + }, + "org/jetbrains/kotlin#kotlin-assignment-compiler-plugin-embeddable/1.9.22": { + "jar": "sha256-KmHdIZ/tvlMYo7HiPA9zm0XtG1sksLZzdRm3hF6Alfg=", + "pom": "sha256-nbJr6D8/Y8Uf972pHjpqQNTDTaAj5ilsAQW7SqZvzJI=" + }, + "org/jetbrains/kotlin#kotlin-assignment/1.9.22": { + "module": "sha256-bxIe+E4ozzMG/eTDHVXC2D14RPJLDnslZfh7Apn7sx0=", + "pom": "sha256-9kQYoM3bm9hQ96/CasjyPon7ptlgSNqnNZVWJ5AgbwA=" + }, + "org/jetbrains/kotlin#kotlin-assignment/1.9.22/gradle82": { + "jar": "sha256-SbgHX6DiGLoRuhim9yUE38XwOZQovs8Ta9yHHceBgMU=" + }, + "org/jetbrains/kotlin#kotlin-build-tools-api/1.9.22": { + "jar": "sha256-3UnLfij08zgvUlDPsFyGT9XwqW0yZbspPHezCtzJP/Y=", + "pom": "sha256-DFZLu4fcXs32Q005buob886Xar8IgYCN0Wb6SbBGSfs=" + }, + "org/jetbrains/kotlin#kotlin-build-tools-api/1.9.23": { + "jar": "sha256-gvhH4lRXtGSDfv7x2oUC7JJTLedAbnkgUWbODs9PxSE=", + "pom": "sha256-CWkjtiXJfGZzZ5ZsxM6Sv5TE6f98U8sdOEhgEax1DVg=" + }, + "org/jetbrains/kotlin#kotlin-compiler-embeddable/1.9.22": { + "jar": "sha256-K/6t7lmrGYjDNtvW5l2ZH3Zq4d2Gg/Km3tX6oCefDKA=", + "pom": "sha256-s9o0u29ClqzzoPRDRm8FBsbJnaXNliTW4LdFsiKHhOs=" + }, + "org/jetbrains/kotlin#kotlin-compiler-embeddable/1.9.23": { + "jar": "sha256-zJQGSXS/nr9ZlF4xIXzy0WoM66rySH6wdI/By9F4eUM=", + "pom": "sha256-WLI81NgtWqkWpcnMmbMhjuxVaWBoova3C+3fbDaR/RU=" + }, + "org/jetbrains/kotlin#kotlin-compiler-runner/1.9.22": { + "jar": "sha256-c+x1u5nr/6iySiSjuFPz9mCWvEapNRrw2sk967acFes=", + "pom": "sha256-pO6KZ8HW8lODjAAnKAvLgFCsDc3MrZdIlhOKaaAX6wE=" + }, + "org/jetbrains/kotlin#kotlin-compiler-runner/1.9.23": { + "jar": "sha256-yFlaPhcRx0U8f5YKrxKhcNtL2j1vy6Sf/I4yy/0ADKE=", + "pom": "sha256-KebjEpGbdf6aOHjflRHPQhDcJuWTQcsu4iSDt7Tgcv4=" + }, + "org/jetbrains/kotlin#kotlin-daemon-client/1.9.22": { + "jar": "sha256-XXPhgVsRZ+Sv4gjwCyp1wIC8WoEHhsqtuOFHh1k6k7k=", + "pom": "sha256-YsRKZZ2lXbb7El4pKbmNUEow4fSvgU4I5JIUJqpST4o=" + }, + "org/jetbrains/kotlin#kotlin-daemon-client/1.9.23": { + "jar": "sha256-5jFUJUkZ/XBv6ZN8SNuTfqkGimMfht5lWlFLwWIPmI0=", + "pom": "sha256-X70GastuQIU5gCdsaDUWmSj2Zqt8RlEsJvJMnQMIF9M=" + }, + "org/jetbrains/kotlin#kotlin-daemon-embeddable/1.9.22": { + "jar": "sha256-kqV4ExcUR9U0Rh+hP+N9yM07f4bYPpsfe7GwvjBUH4s=", + "pom": "sha256-9uo9z2v7Og0GmER8SKa88I2Oqs+D/JX+nUGBpeXjwrE=" + }, + "org/jetbrains/kotlin#kotlin-daemon-embeddable/1.9.23": { + "jar": "sha256-bztmG5gmetJOL4+3rV0Gvn0u1hpdBcJn9OTKp433g9k=", + "pom": "sha256-WFRgOL5Go4NmOFPRMd12xPsnQ4MLqXt0sno1zxAtPQI=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-annotations/1.9.22": { + "jar": "sha256-lnaDy5jZkQFFYH+/W0VilbQ/Cq+Tsbunv2mS5zHLJOw=", + "pom": "sha256-Y7por+B4/3D3CPnpecaTxFv+iQQfeWQbC4H2tKEm7rs=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-annotations/1.9.23": { + "jar": "sha256-HaitBgpbw4KwTxVycdPNrWgwcUovTfSvfEAIjUuSIWQ=", + "pom": "sha256-69aRc06Qr9Wj6PoqkTrw+Q6YL4a6IYWhcDIqGwiQpgU=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-api/1.9.22": { + "jar": "sha256-7P9nVGBlxg4JX7k7P4i5uS7R7cN+P+u8b57TVCL6QSs=", + "module": "sha256-H0SJxTBPmlEqVof/zAqvCTCvydcgUdOpBfrAcANi+3s=", + "pom": "sha256-ZAFewaGutVCqGCjCQuIoODDFD2g2TkCDH+FYj9wEEfU=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-api/1.9.22/gradle82": { + "jar": "sha256-7P9nVGBlxg4JX7k7P4i5uS7R7cN+P+u8b57TVCL6QSs=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-api/1.9.23": { + "jar": "sha256-WTzAhC1fwJe5XgpgK/+Mekifc3Q7hzywuO7JL86KQVs=", + "module": "sha256-zmi7IanW8gt7DnKf4y+aVHu2SyXjEPD14vcMUJ1n7cQ=", + "pom": "sha256-WMjnhsjGUvTpgqQlh5FZTL4L+JKiaGCVTKa1Ue7mN+8=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-idea-proto/1.9.22": { + "jar": "sha256-9dgu5hlmotmK364Z8k1hcwIsFUBIls3yNjQANe5owPU=", + "pom": "sha256-huMsqCkn2ogKHPNDpA7MIJgHXm/XInOzTVDfpUTzRjs=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-idea-proto/1.9.23": { + "jar": "sha256-i7/a0U08PFCzK/a/4PHHAnvlQoXEba95gnz5O1y0PX8=", + "pom": "sha256-x0cp9NYFkAEhZptBEO1FuvVeB1q1O2OmQrkLOv95NCI=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-idea/1.9.22": { + "jar": "sha256-jRr4djLZUUjxIqn6CuKQPBnub6t9AeAX924NLJoCLCA=", + "module": "sha256-z+LCbjMPaAMsAD+lJMAx5aYPzo2Jn/8uQjFBKL60QCs=", + "pom": "sha256-3BSjKHVDun5QRs1OCVAtJ4hMqYfshwb1+xid54luOsw=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-idea/1.9.23": { + "jar": "sha256-jRr4djLZUUjxIqn6CuKQPBnub6t9AeAX924NLJoCLCA=", + "module": "sha256-G+uiuitRE94FM+UV4X9W1TZOm1QiX/MftNj+yfcV2Cw=", + "pom": "sha256-KemtQ1rc9Q/ljTiQ65lePyuNdQEZqaEsIfwwo2DNCOA=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-model/1.9.22": { + "jar": "sha256-UQj61b4UmCXs46ABA8PCHPGv6VS7ZLhweJVyk511OMs=", + "module": "sha256-L/MBPfK6epteiwBOhIF1DI0PqVOtAHoZbYXSY2cdvq4=", + "pom": "sha256-gfUmlHml2X7oeSpITIMr495DgggSZxlhUAHKyI5C9qg=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin-model/1.9.23": { + "jar": "sha256-Pljfrl5D/Ig2X1LfOjRCCMAQDJdacqlKLEoJ9mHTIxc=", + "module": "sha256-Evmlol5YCDEXnl2jBJoBMRi9B2zeCkUuZo8qsWCaz70=", + "pom": "sha256-sh8qITWUXCtLatLIi+Dnl1WH9HVgiTnn23sG2CfQNXg=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin/1.9.22": { + "module": "sha256-pPRqwMq9jVzbaJ0tN9GdWFhPcIv59k/+TpgKL/dTS7U=", + "pom": "sha256-A3750tSupA9JKdglE1g+STwOBRVuDaix1/Ujurhobyc=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin/1.9.22/gradle82": { + "jar": "sha256-1OcY3V8wxrqTLZPM/FswFendPkQUOgUrh3Ao8frlQtw=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin/1.9.23": { + "module": "sha256-YL2BUHBNWByO6tTBlAh26LAor+ixS0lAEMUJIEclRKc=", + "pom": "sha256-TgznuA0cN7kRzb/kFf77ZdzvGCalGLF3vWAvlaloqMU=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugin/1.9.23/gradle82": { + "jar": "sha256-vMdKB8ad0RyUsmCx7ophiWlinMrqwubqCnedo8P37D8=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugins-bom/1.9.22": { + "module": "sha256-Qj401h0iCxoN3BgUCGqM6rTa2ed5ArDOjLRyG789xu0=", + "pom": "sha256-da2/XHjOJHwiuvNijQs/8c9+19N9YB66cwTXerdb3Z8=" + }, + "org/jetbrains/kotlin#kotlin-gradle-plugins-bom/1.9.23": { + "module": "sha256-1yNF4lW/IKOperXQEIa2CMXX0M8/Z3inHoXKy61BQlo=", + "pom": "sha256-2Ive7tm5RMrHGM3PKUD4FdgiXuzNIb7KB93QgfDSQow=" + }, + "org/jetbrains/kotlin#kotlin-klib-commonizer-api/1.9.22": { + "jar": "sha256-jC9lQpwYLi5KLgnLkQ5iuW227tKFWUuPga+CO35ZROI=", + "pom": "sha256-EMrJcNMAo0icM/CzBBVv8DLZWVm+WqrDuIAoKtWGIv4=" + }, + "org/jetbrains/kotlin#kotlin-klib-commonizer-api/1.9.23": { + "jar": "sha256-XfEWTbHDRdhtChqkFJCeNnr7l4L+P7yvDir3qL9iuDk=", + "pom": "sha256-sSWp19ccGThHr5KiJxxlUbPSl1VFSxyF03SySudVwz4=" + }, + "org/jetbrains/kotlin#kotlin-native-utils/1.9.22": { + "jar": "sha256-eGwSfdVTXbLDmuWXzQsMrZ6RS4PiNvHbAlEjXMnGUqw=", + "pom": "sha256-EcUUwF7qOuno4Wq0l5bxEd9DxzSCMeNfr0xCjMT3Q+o=" + }, + "org/jetbrains/kotlin#kotlin-native-utils/1.9.23": { + "jar": "sha256-X9AUhb1z5he+VWv/SZL/ASquufDZwAhPN8tdiKO8rYQ=", + "pom": "sha256-eCaL6luL9QqV7nYxKuNjzAvWqt1d9HQwrBNaIG7467Y=" + }, + "org/jetbrains/kotlin#kotlin-project-model/1.9.22": { + "jar": "sha256-zBHVwLGQnFsKCP0l7w51T/0r9Wyu9mX7eFEiI15UKhg=", + "pom": "sha256-659KFngb/ADM7IAw++XuIo5vKydxxQwmezIY/rAGW0A=" + }, + "org/jetbrains/kotlin#kotlin-project-model/1.9.23": { + "jar": "sha256-j8s85RKrtFLX1DHbssMS1cRQXRdiSTtRsQavwUfZk2c=", + "pom": "sha256-nvSy89nZ9Zqwwr9+uO92MgUUmTjg540qIxxHiSHHl0U=" + }, + "org/jetbrains/kotlin#kotlin-reflect/1.6.10": { + "jar": "sha256-MnesECrheq0QpVq+x1/1aWyNEJeQOWQ0tJbnUIeFQgM=", + "pom": "sha256-V5BVJCdKAK4CiqzMJyg/a8WSWpNKBGwcxdBsjuTW1ak=" + }, + "org/jetbrains/kotlin#kotlin-reflect/1.9.22": { + "jar": "sha256-d/MRyhOEgR1Rn9o4n8sSaL2qBY1gUEbg7edsA7DfPpc=", + "pom": "sha256-xxLjWN97kxi2j1RjlxsIhnODf8DKQoXRw4LIEC7da18=" + }, + "org/jetbrains/kotlin#kotlin-sam-with-receiver-compiler-plugin-embeddable/1.9.22": { + "jar": "sha256-jqUUoRQABsxXoHMVsVoTaI7W/qFwfzrJjpzoCVu2z38=", + "pom": "sha256-MM9L0JPCbn/Ryt/F1Qop5q60WXUSeia84rEJUfJPgqo=" + }, + "org/jetbrains/kotlin#kotlin-sam-with-receiver/1.9.22": { + "module": "sha256-7rpm+YBjiXkSCkm5/aW4YeEHLWCQIzi1NyYH8kljDC0=", + "pom": "sha256-AD+clOG/rX8ZDm70F+kTOhCjH3hRMBPlkHS2DzZZLCY=" + }, + "org/jetbrains/kotlin#kotlin-sam-with-receiver/1.9.22/gradle82": { + "jar": "sha256-cvvN3L25ZaQ9uWfLKjGaXXp3NttQrCA8lrmatVc5wkE=" + }, + "org/jetbrains/kotlin#kotlin-script-runtime/1.9.22": { + "jar": "sha256-uAZwV59/ktRz2NWDTwsST3dVxFmP6UskQYOwKDSDRXQ=", + "pom": "sha256-/ra0ns9pEG1MEoXnH5ob2noSfO9oMC4+n9yCmKTjR5U=" + }, + "org/jetbrains/kotlin#kotlin-scripting-common/1.9.22": { + "jar": "sha256-+lAMvwNJQ++BJvPT3GWvCf+Z3//kTFCZtPwu1b8vXcc=", + "pom": "sha256-ROURI7DCfm/ZM/wma00Nrw8GhKYq7Z/mhC6Noz8qKz8=" + }, + "org/jetbrains/kotlin#kotlin-scripting-common/1.9.23": { + "jar": "sha256-ii5Wfz2/Nz5hwBrNeIRjHshThGWrjul4rGMpb4zJr0Y=", + "pom": "sha256-/CiXW5TcQMDZD9EXXiKxtka60sY368+fT2qy1Oe8XdU=" + }, + "org/jetbrains/kotlin#kotlin-scripting-compiler-embeddable/1.9.22": { + "jar": "sha256-Ij/shIMCNEmc1MeiPqHJLroSfEGzXZux1LYdJBVa6zU=", + "pom": "sha256-wWCPP7yyqfdSPq0zWZwurc5MgSFhqeBmufSwBa97Qxw=" + }, + "org/jetbrains/kotlin#kotlin-scripting-compiler-embeddable/1.9.23": { + "jar": "sha256-e4A5/wt3nVVs7QCSMDWr0TNPDl8qiHlhgtArpF+SbSA=", + "pom": "sha256-7Y6//r5Ume1iSG+oGBJ7td1QHXTEq5XFfnwB7z+NuWg=" + }, + "org/jetbrains/kotlin#kotlin-scripting-compiler-impl-embeddable/1.9.22": { + "jar": "sha256-OJkYFqKH/3YkHxp35/ERZIHU6To9tjJZplfd4g5tD2U=", + "pom": "sha256-gmccM6lXsuKoINZqaSwvzmPjvwR/HLJeb7A5HF3c8uc=" + }, + "org/jetbrains/kotlin#kotlin-scripting-compiler-impl-embeddable/1.9.23": { + "jar": "sha256-kOU90S9i3NgjQ8EsDLMUrc/wy8OYjtsRjR5miZYOnWM=", + "pom": "sha256-923kmO12xGroZlZnmAf3J2EiPD+hChExgyAGpKs5Xe0=" + }, + "org/jetbrains/kotlin#kotlin-scripting-jvm/1.9.22": { + "jar": "sha256-jRJ9dvz6BRfDbB6g4ijs4D1aRoJkKgH2R5prvccxKik=", + "pom": "sha256-cBJS6huo/4f8M0dqYePVxtnS3aQbqpiZTdaYDuE/vG0=" + }, + "org/jetbrains/kotlin#kotlin-scripting-jvm/1.9.23": { + "jar": "sha256-0/yn7JUf94Jvl6dZifjcr/YM+eHna73CIO33eDdqbmQ=", + "pom": "sha256-4u8r+y628hp7croS7cWaFQx/IXbCssVP4uhg7oAjDYc=" + }, + "org/jetbrains/kotlin#kotlin-stdlib-common/1.9.22": { + "module": "sha256-+Tyemr+NUtjo/Y6FGqgC7OxVEyFhxK7ufTzZJL95QkY=", + "pom": "sha256-10k21oh1ZK63EOhCmLVCB/U+m88jpSrSv6IsIIZ3V2c=" + }, + "org/jetbrains/kotlin#kotlin-stdlib-jdk7/1.8.21": { + "pom": "sha256-m7EH1dXjkwvFl38AekPNILfSTZGxweUo6m7g8kjxTTY=" + }, + "org/jetbrains/kotlin#kotlin-stdlib-jdk7/1.9.10": { + "jar": "sha256-rGNhv5rR7TgsIQPZcSxHzewWYjK0kD7VluiHawaBybc=", + "pom": "sha256-x/pnx5YTILidhaPKWaLhjCxlhQhFWV3K5LRq9pRe3NU=" + }, + "org/jetbrains/kotlin#kotlin-stdlib-jdk8/1.8.21": { + "pom": "sha256-ODnXKNfDCaXDaLAnC0S08ceHj/XKXTKpogT6o0kUWdg=" + }, + "org/jetbrains/kotlin#kotlin-stdlib-jdk8/1.9.10": { + "jar": "sha256-pMdNlNZM4avlN2D+A4ndlB9vxVjQ2rNeR8CFoR7IDyg=", + "pom": "sha256-X0uU3TBlp3ZMN/oV3irW2B9A1Z+Msz8X0YHGOE+3py4=" + }, + "org/jetbrains/kotlin#kotlin-stdlib/1.9.22": { + "jar": "sha256-ar4UbCeGQTi4dMzM/l9TTj65I8maG3tdRUlO5WlPPgo=", + "module": "sha256-9IIxS1B5wUVfb7DUJXp0XRAcYSTOlhUiuob53JCQHkc=", + "pom": "sha256-zOLxUoXsgHijd0a1cwigVAQt1cwlQgxD9zt4V8JGjwM=" + }, + "org/jetbrains/kotlin#kotlin-tooling-core/1.9.22": { + "jar": "sha256-iTjrl+NjINqj5vsqYP0qBbIy/0pVcXPFAZ8EW4gy2fQ=", + "pom": "sha256-FPx/NcY15fzRvqU3q0+kQxLoQyUtUzNRnjaxJeoImyE=" + }, + "org/jetbrains/kotlin#kotlin-tooling-core/1.9.23": { + "jar": "sha256-iTjrl+NjINqj5vsqYP0qBbIy/0pVcXPFAZ8EW4gy2fQ=", + "pom": "sha256-fiA0VIj7v1uf6ZeHNgvT7HRKb+qRppm9EbVhwygbB9g=" + }, + "org/jetbrains/kotlin#kotlin-util-io/1.9.22": { + "jar": "sha256-9telhJGjeLCDrRvq1IikheEdFgsx52wYwa1SDx0o9Gs=", + "pom": "sha256-ZP1qINbsBAE7ttdWJ/ZYC7c2QdlIkJ1cFmTi53MQbe4=" + }, + "org/jetbrains/kotlin#kotlin-util-io/1.9.23": { + "jar": "sha256-em3OQOeKy+Zvx9Z463Qch3hFo8/Rx2xNK7+OyEXS2Sk=", + "pom": "sha256-rNHyN4Ce4nWpwJ5EAt1FOdBN7DaMCQbsecP4A6vwZ8g=" + }, + "org/jetbrains/kotlin#kotlin-util-klib/1.9.22": { + "jar": "sha256-pnnuL1EPOrkmkYGN5etbCQLobYjJdnTn20TcTyJSxfk=", + "pom": "sha256-Dep9//Cit0CIrJlwQ8vCQINdK/9Zs5/MiwysbqPrNpc=" + }, + "org/jetbrains/kotlin#kotlin-util-klib/1.9.23": { + "jar": "sha256-5AGLa4+8keTQo3q4HAUKgTloaAdRCM2FCCuSXHnTvG0=", + "pom": "sha256-+z5FhH1dIS5MK120RFGQPJ4fDjL2mH4fWbnMEcTDiYo=" + }, + "org/jetbrains/kotlinx#kotlinx-coroutines-core-jvm/1.5.0": { + "jar": "sha256-eNbMcTX4TWkv83Uvz9H6G74JQNffcGUuTx6u7Ax4r7s=", + "module": "sha256-yIXdAoEHbFhDgm3jF+PLzcPYhZ2+71OuHPrNG5xg+W4=", + "pom": "sha256-U2IuA3eN+EQPwBIgGjW7S9/kAWTv7GErvvze7LL/wqs=" + }, + "org/junit#junit-bom/5.7.2": { + "module": "sha256-87zrHFndT2mT9DBN/6WAFyuN9lp2zTb6T9ksBXjSitg=", + "pom": "sha256-zRSqqGmZH4ICHFhdVw0x/zQry6WLtEIztwGTdxuWSHs=" + }, + "org/junit#junit-bom/5.9.1": { + "module": "sha256-kCbBZWaQ+hRa117Og2dCEaoSrYkwqRsQfC9c3s4vGxw=", + "pom": "sha256-sWPBz8j8H9WLRXoA1YbATEbphtdZBOnKVMA6l9ZbSWw=" + }, + "org/junit#junit-bom/5.9.3": { + "module": "sha256-tAH9JZAeWCpSSqU0PEs54ovFbiSWHBBpvytLv87ka5M=", + "pom": "sha256-TQMpzZ5y8kIOXKFXJMv+b/puX9KIg2FRYnEZD9w0Ltc=" + }, + "org/ow2#ow2/1.5.1": { + "pom": "sha256-Mh3bt+5v5PU96mtM1tt0FU1r+kI5HB92OzYbn0hazwU=" + }, + "org/ow2/asm#asm-commons/9.4": { + "jar": "sha256-DBKKnsPzPJiVknL20WzxQke1CPWJUVdLzb0rVtYyY2Q=", + "pom": "sha256-tCyiq8+IEXdqXdwCkPIQbX8xP4LHiw3czVzOTGOjUXk=" + }, + "org/ow2/asm#asm-tree/9.4": { + "jar": "sha256-xC1HnPJFZqIesgr37q7vToa9tKiGMGz3L0g7ZedbKs8=", + "pom": "sha256-x+nvk73YqzYwMs5TgvzGTQAtbFicF1IzI2zSmOUaPBY=" + }, + "org/ow2/asm#asm/9.4": { + "jar": "sha256-OdDis9xFr2Wgmwl5RXUKlKEm4FLhJPk0aEQ6HQ4V84E=", + "pom": "sha256-SDdR5I+y0fQ8Ya06sA/6Rm7cAzPY/C/bWibpXTKYI5Q=" + }, + "org/slf4j#slf4j-api/1.7.32": { + "jar": "sha256-NiT4R0wa9G11+YvAl9eGSjI8gbOAiqQ2iabhxgHAJ74=", + "pom": "sha256-ABzeWzxrqRBwQlz+ny5pXkrri8KQotTNllMRJ6skT+U=" + }, + "org/slf4j#slf4j-api/1.7.36": { + "jar": "sha256-0+9XXj5JeWeNwBvx3M5RAhSTtNEft/G+itmCh3wWocA=", + "pom": "sha256-+wRqnCKUN5KLsRwtJ8i113PriiXmDL0lPZhSEN7cJoQ=" + }, + "org/slf4j#slf4j-parent/1.7.32": { + "pom": "sha256-WrNJ0PTHvAjtDvH02ThssZQKL01vFSFQ4W277MC4PHA=" + }, + "org/slf4j#slf4j-parent/1.7.36": { + "pom": "sha256-uziNN/vN083mTDzt4hg4aTIY3EUfBAQMXfNgp47X6BI=" + }, + "org/sonatype/oss#oss-parent/5": { + "pom": "sha256-FnjUEgpYXYpjATGu7ExSTZKDmFg7fqthbufVqH9SDT0=" + }, + "org/sonatype/oss#oss-parent/7": { + "pom": "sha256-tR+IZ8kranIkmVV/w6H96ne9+e9XRyL+kM5DailVlFQ=" + }, + "org/springframework#spring-framework-bom/5.3.24": { + "module": "sha256-GZbh9hfLA/p26hGFD+Kh4gsOMKEEa6bV2zvbv0QRP84=", + "pom": "sha256-U1ITVmu77+Jjag1OjdGnOt5hLiQwyP/TENzCo7O5ukE=" + }, + "org/tukaani#xz/1.9": { + "jar": "sha256-IRswbPxE+Plt86Cj3a91uoxSie7XfWDXL4ibuFX1NeU=", + "pom": "sha256-CTvhsDMxvOKTLWglw36YJy12Ieap6fuTKJoAJRi43Vo=" + }, + "org/vafer#jdependency/2.8.0": { + "jar": "sha256-v9LMfhv8eKqDtEwKVL8s3jikOC7CRyivaD2Y3GvngZI=", + "pom": "sha256-EBhn8/npJlei74mjELYE1D0JDJuQqj4LBS3NFqO78y0=" + }, + "se/patrikerdes#gradle-use-latest-versions-plugin/0.2.18": { + "jar": "sha256-P9Qm3NYf3dX9FvhkBJyopVQtN1FAfhLNJs/FyeFay60=", + "pom": "sha256-eGyLwlKFSQhAr7YuGbnryVVpqV2Z+T4emLr7F7eAFZs=" + }, + "se/patrikerdes/use-latest-versions#se.patrikerdes.use-latest-versions.gradle.plugin/0.2.18": { + "pom": "sha256-6DCee4xZSPaNwK2dl7lOwIsfw5lm2eXsrsNOzFbMnnI=" + }, + "xmlpull#xmlpull/1.1.3.1": { + "jar": "sha256-NOCO5iEWBxy7acDtcNFaelsgjWJ5jFnyEgu4kpMky2M=", + "pom": "sha256-jxD/2N8NPpgZyMyEAnCcaySLxTqVTvbkVHDZrjpXNfs=" + } + }, + "https://repo.maven.apache.org/maven2": { + "antlr#antlr/2.7.7": { + "jar": "sha256-iPvaS5Ellrn1bo4S5YDMlUus+1F3bs/d0+GPwc9W3Ew=", + "pom": "sha256-EA95O6J/i05CBO20YXHr825U4PlM/AJSf+oHoLsfzrc=" + }, + "aopalliance#aopalliance/1.0": { + "jar": "sha256-Ct3sZw/tzT8RPFyAkdeDKA0j9146y4QbYanNsHk3agg=", + "pom": "sha256-JugjMBV9a4RLZ6gGSUXiBlgedyl3GD4+Mf7GBYqppZs=" + }, + "ch/qos/logback#logback-classic/1.5.6": { + "jar": "sha256-YRXGysXtHZ24ENFPL39N1qnyHwrLuoAW5NqsoroPXrg=", + "pom": "sha256-SysA32EjwOKmHnG1vis/AHOWeLtLBplA1cScJN9T9Zo=" + }, + "ch/qos/logback#logback-core/1.5.6": { + "jar": "sha256-iYx9EgGZ834azIEY2XqxWk0CsOcuJ7qfBYQ8s3ThYMY=", + "pom": "sha256-BpPQaN02h3R1rYCQbjHHvA1RlbgtTAB1HcGcHqUR5xE=" + }, + "ch/qos/logback#logback-parent/1.5.6": { + "pom": "sha256-e9/LJJJGgaSRRNujSpJ7i9B5INCS6sw972H55kevTeg=" + }, + "com/fifesoft#autocomplete/3.3.1": { + "jar": "sha256-C44PYoZELz7ejDWd1CAy75/fGmu6zoUSQY98ypCstck=", + "module": "sha256-L1G7pxftqDgbD+DkTUgZXiRO6lMjVNePJIhbLsicC3M=", + "pom": "sha256-+tECFvCORJesDE3pkY7IHBT7X7WiZlCd6K+G+n9cSP4=" + }, + "com/fifesoft#rsyntaxtextarea/3.4.0": { + "jar": "sha256-5ng+3vkxIHl2TTDcpgdImWaBiUYQnfMjzdB9f6+sWEw=", + "module": "sha256-04S6z91b5oIuhBFEgtlsT0htPC6fHExgK4a12kM6urk=", + "pom": "sha256-9zzLgNZ8ZouF6jFU8wQVxzKjOBNA9nMfrLRRK4Dn4gQ=" + }, + "com/formdev#flatlaf-extras/3.4.1": { + "jar": "sha256-dNrV+g2VLSxTWRHXYrC4GASAFtsI9fD+eafRzKGDBR8=", + "module": "sha256-7Ilq8ao7FDgpXP/7qonr1EDlmsPJJCeriVgf//mkrqk=", + "pom": "sha256-kTixZ2T8lnEAYetgExKlrG+RNMIxoZaEwHbAJ6r6OG8=" + }, + "com/formdev#flatlaf-intellij-themes/3.4.1": { + "jar": "sha256-VuTWi5tRVrm3B7b9cV8DoRXv5+Bi9ep54j21HjQvfVI=", + "module": "sha256-tqXOKz+zuARVMSftJdybbvb9T5Nag5DsVhdymT30DWc=", + "pom": "sha256-CR+0CuMik01CkYtivUsLMr48YE/nL4bniFAdRMkKWwA=" + }, + "com/formdev#flatlaf/3.4.1": { + "jar": "sha256-i0u9NHJ/gOdFVbK+PY3LmUQ0ZUmGxk9CmBYiR6nTX/w=", + "module": "sha256-502kfUULFIuZ6nNQZF59eq6gowVRb+S0AqKeNHLrdug=", + "pom": "sha256-/TzfkQf7kvOfkh3VrjNuddNKQiz3khC7dzX4a1coiHE=" + }, + "com/github/akarnokd#rxjava2-swing/0.3.7": { + "jar": "sha256-umWvI1GP+Ucha7S+kDC7AavSQkHOEy3oPoUdC81S7n4=", + "pom": "sha256-VCbDiy18y9Z5qiBuF6TPrxPrk3IPPnjPjdckAjfNnLE=" + }, + "com/github/javafaker#javafaker/1.0.2": { + "jar": "sha256-75WuRoCX83iIC+aajGdW+NFRgODwdUf7Cplhf/Qhsqw=", + "pom": "sha256-HMze3vRTo1W93wqsK8qr4h/2wY30uusfXWMa4sn4ZII=" + }, + "com/github/mifmif#generex/1.0.2": { + "jar": "sha256-j4ziM8M14I4ROj+Ved4QRvsZkn6CRosbvrzWy6h2C4E=", + "pom": "sha256-R2QJlPzU46EZStsn0s/kEQII7qlCwgSDTZailCVt5hQ=" + }, + "com/github/weisj#jsvg/1.4.0": { + "jar": "sha256-Lx6hn7lhHMovfQaGqbAxPLDfjNy6Bz31dLXNGmyKhqI=", + "pom": "sha256-GMmalZVvTdu7NNN5YLI7va+bbWNDWQgPVCCU7JQISPM=" + }, + "com/google#google/5": { + "pom": "sha256-4J00XnPKP7yn8+BfMN63Tp053Wt5qT/ujFEfI0F7aCg=" + }, + "com/google/code/findbugs#jsr305/3.0.2": { + "jar": "sha256-dmrSoHg/JoeWLIrXTO7MOKKLn3Ki0IXuQ4t4E+ko0Mc=", + "pom": "sha256-GYidvfGyVLJgGl7mRbgUepdGRIgil2hMeYr+XWPXjf4=" + }, + "com/google/code/gson#gson-parent/2.10.1": { + "pom": "sha256-QkjgiCQmxhUYI4XWCGw+8yYudplXGJ4pMGKAuFSCuDM=" + }, + "com/google/code/gson#gson/2.10.1": { + "jar": "sha256-QkHBSncnw0/uplB+yAExij1KkPBw5FJWgQefuU7kxZM=", + "pom": "sha256-0rEVY09cCF20ucn/wmWOieIx/b++IkISGhzZXU2Ujdc=" + }, + "com/google/errorprone#error_prone_annotations/2.26.1": { + "jar": "sha256-3iXy2aIVZSm9dl9R2O/fwN+nMB4E77nMdbfxDPXQ4Ps=", + "pom": "sha256-rqfpkeLf3LR/X71QhYdTX3gCvLni/C1Ou1C+QbaE2p8=" + }, + "com/google/errorprone#error_prone_annotations/2.7.1": { + "jar": "sha256-zVJXwIokbPhiiBeuccuCK+GS75H2iByko/z/Tx3hz/M=", + "pom": "sha256-Mahy4RScXzqLwF+03kVeXqYI7PrRryIst2N8psdi7iU=" + }, + "com/google/errorprone#error_prone_parent/2.26.1": { + "pom": "sha256-SmrQDTGwpa3Nmk9gUGXVtEX65KBMv4J+XRrBB34vgU0=" + }, + "com/google/errorprone#error_prone_parent/2.7.1": { + "pom": "sha256-Cm4kLigQToCTQFrjeWlmCkOLccTBtz/E/3FtuJ2ojeY=" + }, + "com/google/guava#failureaccess/1.0.1": { + "jar": "sha256-oXHuTHNN0tqDfksWvp30Zhr6typBra8x64Tf2vk2yiY=", + "pom": "sha256-6WBCznj+y6DaK+lkUilHyHtAopG1/TzWcqQ0kkEDxLk=" + }, + "com/google/guava#failureaccess/1.0.2": { + "jar": "sha256-io+Bz5s1nj9t+mkaHndphcBh7y8iPJssgHU+G0WOgGQ=", + "pom": "sha256-GevG9L207bs9B7bumU+Ea1TvKVWCqbVjRxn/qfMdA7I=" + }, + "com/google/guava#guava-parent/26.0-android": { + "pom": "sha256-+GmKtGypls6InBr8jKTyXrisawNNyJjUWDdCNgAWzAQ=" + }, + "com/google/guava#guava-parent/31.0.1-jre": { + "pom": "sha256-s7a2qnCZwRgXrO6FsyL9kffuMq6mn+CD7jbIc17AZ4g=" + }, + "com/google/guava#guava-parent/33.1.0-jre": { + "pom": "sha256-D73wcsyo4Fa6MVQrt18MFJCRRABYbUukIuz8fR38ecY=" + }, + "com/google/guava#guava/31.0.1-jre": { + "jar": "sha256-1b6U1l6HvSGfsxk60VF7qlWjuI/JHSHPc1gmq1rwh7k=", + "pom": "sha256-K+VmkgwhxgxcyvKCeGfK/3ZmRuIRO3/MPunCSkCy85Y=" + }, + "com/google/guava#guava/33.1.0-jre": { + "jar": "sha256-NGrsDrjImHNgyKJk5w/xDC+6dgRG6yfoqwfnjnh6df4=", + "module": "sha256-6qUNmCgORsANUYq/FUgp3pm1lm0bb+KLffHVvZB+dKg=", + "pom": "sha256-VXQa0W+Yzubm3Ard3UOAacxeP/KaJuMXXU/qKHaSVLc=" + }, + "com/google/guava#listenablefuture/9999.0-empty-to-avoid-conflict-with-guava": { + "jar": "sha256-s3KgN9QjCqV/vv/e8w/WEj+cDC24XQrO0AyRuXTzP5k=", + "pom": "sha256-GNSx2yYVPU5VB5zh92ux/gXNuGLvmVSojLzE/zi4Z5s=" + }, + "com/google/inject#guice-parent/4.2.2": { + "pom": "sha256-WnS6PSK+GsE7nngvE6fZV9sqJN7TWUgTlMnoifHAN9Y=" + }, + "com/google/inject#guice/4.2.2": { + "pom": "sha256-BvPD3a1Xswv+iGVUVqBHMeVqeK0N2QnmXHGIEAO5ZHk=" + }, + "com/google/inject#guice/4.2.2/no_aop": { + "jar": "sha256-D09fsoYJpNKzi39xKL58+bVB8lKD1xtOVgZtmWg6r/8=" + }, + "com/google/j2objc#j2objc-annotations/1.3": { + "jar": "sha256-Ia8wySJnvWEiwOC00gzMtmQaN+r5VsZUDsRx1YTmSns=", + "pom": "sha256-X6yoJLoRW+5FhzAzff2y/OpGui/XdNQwTtvzD6aj8FU=" + }, + "com/google/j2objc#j2objc-annotations/3.0.0": { + "jar": "sha256-iCQVc0Z93KRP/U10qgTCu/0Rv3wX4MNCyUyd56cKfGQ=", + "pom": "sha256-I7PQOeForYndEUaY5t1744P0osV3uId9gsc6ZRXnShc=" + }, + "com/google/protobuf#protobuf-bom/3.25.3": { + "pom": "sha256-tG4/Jv4PRz/zMHfuEkX4jUuNs1zHn1VM0P2Td2akXlg=" + }, + "com/google/protobuf#protobuf-java/3.25.3": { + "jar": "sha256-6Q2N25Y7IKlypqWbUJOt4rB8vlRsqzJ5qvQ4MmA4X1g=", + "pom": "sha256-we+sGuAPC7q2VkKOGWtjaYyRTQ3SK+EgcQvv/EgctUc=" + }, + "com/google/protobuf#protobuf-parent/3.25.3": { + "pom": "sha256-vCdEYIzqOnotTNC3Thw/iBOMZM5aphudfwr9hGiCvno=" + }, + "com/jakewharton/android/repackaged#dalvik-dx/14.0.0_r21": { + "jar": "sha256-mxO8gL+G8ZP43pyVn1Ko/4P8haHMVS9RJvEUDam4WjY=", + "module": "sha256-8Q+igZNroSWzuB8fbmJoN2l1y5JmY90lKT4zF1TiMMc=", + "pom": "sha256-73W51oRyNhwuRsFGzwTSBjeicvTKTFEGqXBIcZn3aY4=" + }, + "com/pinterest/ktlint#ktlint-cli-ruleset-core/1.2.1": { + "jar": "sha256-5O9GJ/nf6CD16tU35SVH2g5VYovaYakmdg8Mm8TqUAY=", + "module": "sha256-g3XiwjEiwLDsPtUmTSaTlX+/CGb2hpY3CWAK+gLf0m0=", + "pom": "sha256-A6DNgrSvn7+apstQemJBdvdEs6T/w7t3iisiE/aM95Q=" + }, + "com/pinterest/ktlint#ktlint-logger/1.2.1": { + "jar": "sha256-5jQ4/lurR/Gy/dmAV34yx8ANcBm1QywGoPHCzbwJa3w=", + "module": "sha256-fDiaF+bGkYRv60Rz/vwyz8Oeklk4UmkwDq3M2y8EW/A=", + "pom": "sha256-9lFUgbaf8dX/DxsAqldcN6Rvjz50k+MYHSM1pM1r42U=" + }, + "com/pinterest/ktlint#ktlint-rule-engine-core/1.2.1": { + "jar": "sha256-7v513SmnxlyZFe9WZ5w6v9MEZeqKLSg0msepyW6AIsk=", + "module": "sha256-ejPrG4FlwhAEDn/ZsFtmRGphmGY/syZ+a0Re5gfQhHU=", + "pom": "sha256-E4IT0LNF7LNQaVLkMaOGV+84bz4Ou3jZR+jcs1ZB3Nw=" + }, + "com/pinterest/ktlint#ktlint-rule-engine/1.2.1": { + "jar": "sha256-Aj/1a/e7WRYNECVrmooE8q++LcZDxA8qCZEVVKSRUrQ=", + "module": "sha256-Oxa+KQvuSddVUNz3jWWvCwm9W+LWaxh5kZSU3HH99y4=", + "pom": "sha256-iwzFIes9tn1sULMFiz1Gerket9Ko9JnfPg8iRaG8RSA=" + }, + "com/pinterest/ktlint#ktlint-ruleset-standard/1.2.1": { + "jar": "sha256-ip6NR4pSAdmxmMLpQtWgs2ck9mJsxvgHkTLeugN2DBs=", + "module": "sha256-qK8UNNcp5XrEo0u11SoLNN1nCBmovG3m8MhxTxw8D9Q=", + "pom": "sha256-wdTdk387yItHaK0Vn9PO7BU6h5RsAo8tn65nrvAYLc4=" + }, + "com/puppycrawl/tools#checkstyle/9.3": { + "jar": "sha256-BGPjBJgPVGC5ZPSBzMJaEPslO2AQDBnlD8mSiSiVl38=", + "pom": "sha256-p9y0ZmVtZ/oKUNkE/d8U/GtTmEa4FO3/djXHRdW9MDQ=" + }, + "commons-beanutils#commons-beanutils/1.9.4": { + "jar": "sha256-fZOMgXiQKARcCMBl6UvnX8KAUnYg1b1itRnVg4UyNoo=", + "pom": "sha256-w1zKe2HUZ42VeMvAuQG4cXtTmr+SVEQdp4uP5g3gZNA=" + }, + "commons-codec#commons-codec/1.11": { + "jar": "sha256-5ZnVMY6Xqkj0ITaikn5t+k6Igd/w5sjjEJ3bv/Ude30=", + "pom": "sha256-wecUDR3qj981KLwePFRErAtUEpcxH0X5gGwhPsPumhA=" + }, + "commons-collections#commons-collections/3.2.2": { + "jar": "sha256-7urpF5FxRKaKdB1MDf9mqlxcX9hVk/8he87T/Iyng7g=", + "pom": "sha256-1dgfzCiMDYxxHDAgB8raSqmiJu0aES1LqmTLHWMiFws=" + }, + "commons-io#commons-io/2.11.0": { + "jar": "sha256-lhsvbYfbrMXVSr9Fq3puJJX4m3VZiWLYxyPOqbwhCQg=", + "pom": "sha256-LgFv1+MkS18sIKytg02TqkeQSG7h5FZGQTYaPoMe71k=" + }, + "commons-io#commons-io/2.16.1": { + "jar": "sha256-9B97qs1xaJZEes6XWGIfYsHGsKkdiazuSI2ib8R3yE8=", + "pom": "sha256-V3fSkiUceJXASkxXAVaD7Ds1OhJIbJs+cXjpsLPDj/8=" + }, + "dev/dirs#directories/26": { + "jar": "sha256-bRj+Jaowt+CLkIzSEVHY+W4illxkCs13Ua3Zu/5hN9Q=", + "pom": "sha256-/I3n/GawcvT21bNv67uZx1DG75JxViX1o9hJlAWpRoI=" + }, + "dev/drewhamilton/poko#poko-annotations-jvm/0.15.2": { + "jar": "sha256-O8uWdwrFIHXEMSAeKf1eZ5JENVVd8i9eWrJgK3t3NjU=", + "module": "sha256-ZFxFBOI647Y2QStpkR6E8nK81dVDR+MStHVQPyKW/ow=", + "pom": "sha256-DoYUpIzw8+CiAxa0mUdqHrNL2j56gYMHk2NWNnf+x3E=" + }, + "dev/drewhamilton/poko#poko-annotations/0.15.2": { + "module": "sha256-uvNQLqdKKd+usAFL9ZL3zOpwdo6pl53mKwzsqlqqgdo=", + "pom": "sha256-HMwGrmeHr3B+lJIsKfUDXxWcHq/vZSlENWM/gktbqs0=" + }, + "dk/brics/automaton#automaton/1.11-8": { + "jar": "sha256-okR19sz+HMek/p404Fzmh7DODG6Mt4Hg7O07GGSCxh4=", + "pom": "sha256-N1e360Vz2a4E37ViqPa9WqtKZbiD31RKTzYJTXz+I78=" + }, + "hu/kazocsaba#image-viewer/1.2.3": { + "jar": "sha256-wqNLddLK8alfjMGXGam6MNEJZhi9sIez22/8ELrAUik=", + "pom": "sha256-7Wev/h7E7cGYGKhqSZqe8DfWujf3GFvTBbs62otf+qw=" + }, + "info/picocli#picocli/4.6.2": { + "jar": "sha256-R1TZbq9TFPNaKH2lxnhIsoUGeGj8ptH1Ehp09n8GW2E=", + "pom": "sha256-3q4p2lxR4/6dla9ujzkVbCvBt0niQtATbp4jIINIF5k=" + }, + "io/github/oshai#kotlin-logging-jvm/6.0.9": { + "jar": "sha256-sJ09vL00jonj5Q41QCUVmB5qeaZHsQckg272yA64sUo=", + "module": "sha256-MM7rf5aCBVhG5DxreIDTwDdSbfHg54+P5w5B0xYsiTs=", + "pom": "sha256-Iu9UimQeopwR8p66nswpXd0tcJ2UKotZuqh0meyB+QE=" + }, + "io/github/skylot#jdwp/2.0.0": { + "jar": "sha256-Z01piJwpSc+I/MIGr38ur7FTMWsy5GzO8Tz5FRw3jqw=", + "module": "sha256-0bY96BmtAR3paWge0wxaULPc3FclHTTfnEtnw+6nU3Q=", + "pom": "sha256-2tG6+z2xh4vm/awirm/tYaXN38OXwJruNuP8HKOEIMU=" + }, + "io/github/skylot#raung-asm/0.1.1": { + "jar": "sha256-nab8w4+jp8Nzu+IZ4DNX5KUbNPEL74L33Uuxk2iuKlc=", + "module": "sha256-ydk24GRnV44eAfX6tROxCmNMfbPxIgFKrOxnqeb29LU=", + "pom": "sha256-g8dbSoaStoBweNEsY86yzLFx3cO7Q4DceC0z6IU47LI=" + }, + "io/github/skylot#raung-common/0.1.1": { + "jar": "sha256-bt86NJ25/eu1+7Z1YL4fcEl2ZsNQ7D6vVNf8sA3npIE=", + "module": "sha256-iVV/T22nlSS89UFkpln1r0P/iBuVnLx98MiJ//IcX1A=", + "pom": "sha256-/N4sd1OJ5rsoiEMe+pkEaQglzBjeK1e5yZOMOheo/vI=" + }, + "io/github/skylot#raung-disasm/0.1.1": { + "jar": "sha256-8mQBvHFZwwHr/YGGmeoQTTr/unnSOX6ILQ+6Kbz70vM=", + "module": "sha256-c/sJjfFrydnSxRr6bzwZ86n6PsYbZYS49oqimBD7cuU=", + "pom": "sha256-kts/606ZJ53gDIRJPJTJhlOQMfRjdnvx63nwOymxQyM=" + }, + "io/reactivex/rxjava2#rxjava/2.2.21": { + "jar": "sha256-Wd9lQahAAY8PTImark9MH0OD9MFv61JoYV++OE0oUBw=", + "pom": "sha256-slvs5QSD3po+Hf0lARwthTMCFu+Kgbhvar69vfmw8Sc=" + }, + "javax/annotation#javax.annotation-api/1.2": { + "jar": "sha256-WQmzlso6K+ENDuoyx073jYFuG06tId4deN4fiQ0DPgQ=", + "pom": "sha256-Utc/NffmOM48tWVG+HnCDn9wGfcqogzeH6gOl4Zd/UA=" + }, + "javax/inject#javax.inject/1": { + "jar": "sha256-kcdwRKUMSBY2wy2Rb9ickRinIZU5BFLIEGUID5V95/8=", + "pom": "sha256-lD4SsQBieARjj6KFgFoKt4imgCZlMeZQkh6/5GIai/o=" + }, + "net/bytebuddy#byte-buddy-agent/1.14.12": { + "jar": "sha256-KzCakwAJLgtpb3xHH9UdmWkAHfeEyKufB5l0N9dXrW0=", + "pom": "sha256-ZpifcNNV1gD9TZJtiDXke30b7/Z47r7FnRljY7XNTCw=" + }, + "net/bytebuddy#byte-buddy-parent/1.14.12": { + "pom": "sha256-m3/SvyklMayw6XTZVeSjbKQTMt0Nr+icJNj+Q5uuV7A=" + }, + "net/bytebuddy#byte-buddy/1.14.12": { + "jar": "sha256-lwY2E01hwYOxn49Y+mMeMNLyq8o0SzeEijk8rHhj3XA=", + "pom": "sha256-XamVxw3nt/SoSKhUN8fd7oA9GrfKwtfY33GUw9XicU0=" + }, + "net/fabricmc#mapping-io/0.6.1": { + "jar": "sha256-NN1+onSH7zXXAANQnBtIh/9fi/9yCjQ5gSrhvnUl5Ts=", + "pom": "sha256-e7jCDWqclH8GcXzKVjmdHaettyb9jPOvJ7iVVnckras=" + }, + "net/java#jvnet-parent/3": { + "pom": "sha256-MPV4nvo53b+WCVqto/wSYMRWH68vcUaGcXyy3FBJR1o=" + }, + "net/sf/launch4j#launch4j/3.50": { + "pom": "sha256-1716EuPm1bR/Ou0p/4g89cTKnie3GWkQZnkzH6N+xy0=" + }, + "net/sf/launch4j#launch4j/3.50/workdir-linux64": { + "jar": "sha256-/uvoOrT+Q5F+qn3/Jy3uDvP6hUvWgzRDRDDgjjoS8zA=" + }, + "net/sf/saxon#Saxon-HE/10.6": { + "jar": "sha256-bQjfguTthrarsaAse3SiaPz8XgBOg7tP8AbsOlCb01Y=", + "pom": "sha256-otbdpDjoZKuTXzG0O1MFLE6HEalQVkJxkZBRPnb0Ekg=" + }, + "org/antlr#ST4/4.0.8": { + "jar": "sha256-WMqrxAyfdLC1mT/YaOD2SlDAdZCU5qJRqq+tmO38ejs=", + "pom": "sha256-PAiQ3scRdOs7o9QEyp40GQH/awQhgIsAcTsNuxMGwXw=" + }, + "org/antlr#antlr-master/3.5.2": { + "pom": "sha256-QtkaUx6lEA6wm1QaoALDuQjo8oK9c7bi9S83HvEzG9Y=" + }, + "org/antlr#antlr-runtime/3.5.2": { + "jar": "sha256-zj/I7LEPOemjzdy7LONQ0nLZzT0LHhjm/nPDuTichzQ=", + "pom": "sha256-RqnCIAu4sSvXEkqnpQl/9JCZkIMpyFGgTLIFFCCqfyU=" + }, + "org/antlr#antlr/3.5.2": { + "jar": "sha256-WsNsKs+woPPTfa/iC1tXDyZD4tAAxkjURQPCc4vmQ98=", + "pom": "sha256-Bl5egGYv64WHldPAH3cUJHvdMZRZcF7hOxpLGWj6IuQ=" + }, + "org/antlr#antlr4-master/4.9.3": { + "pom": "sha256-VlzAVNO631DKCgcX2uMRJootZwn93ckKxKQ8YtAZNbk=" + }, + "org/antlr#antlr4-runtime/4.9.3": { + "jar": "sha256-ExpllJabxPMh1lLqKjO8DjeMoxJoXvh3kbLGCynQHqU=", + "pom": "sha256-T35E5OoGKfo6dZsRFv65+yiBTpX3keHu7dIMEoideqQ=" + }, + "org/antlr#stringtemplate/3.2.1": { + "jar": "sha256-9mznLpZeUwHLDwIOVNK6atdv65Gzy/ww278AwGpt9tc=", + "pom": "sha256-tF6CZVqlpI8z0TpD5DRUJrFWM1s14kta6hLbWCPBahY=" + }, + "org/apache#apache/16": { + "pom": "sha256-n4X/L9fWyzCXqkf7QZ7n8OvoaRCfmKup9Oyj9J50pA4=" + }, + "org/apache#apache/18": { + "pom": "sha256-eDEwcoX9R1u8NrIK4454gvEcMVOx1ZMPhS1E7ajzPBc=" + }, + "org/apache#apache/19": { + "pom": "sha256-kfejMJbqabrCy69tAf65NMrAAsSNjIz6nCQLQPHsId8=" + }, + "org/apache#apache/21": { + "pom": "sha256-rxDBCNoBTxfK+se1KytLWjocGCZfoq+XoyXZFDU3s4A=" + }, + "org/apache#apache/23": { + "pom": "sha256-vBBiTgYj82V3+sVjnKKTbTJA7RUvttjVM6tNJwVDSRw=" + }, + "org/apache#apache/25": { + "pom": "sha256-5o/BmkjOxYKmcy/QsQ2/6f7KJQYJY974nlR/ijdZ03k=" + }, + "org/apache#apache/27": { + "pom": "sha256-srD8aeIqZQw4kvHDZtdwdvKVdcZzjfTHpwpEhESEzfk=" + }, + "org/apache#apache/30": { + "pom": "sha256-Y91KOTqcDfyzFO/oOHGkHSQ7yNIAy8fy0ZfzDaeCOdg=" + }, + "org/apache#apache/31": { + "pom": "sha256-VV0MnqppwEKv+SSSe5OB6PgXQTbTVe6tRFIkRS5ikcw=" + }, + "org/apache/commons#commons-lang3/3.12.0": { + "jar": "sha256-2RnZBEhsA3+NGTQS2gyS4iqfokIwudZ6V4VcXDHH6U4=", + "pom": "sha256-gtMfHcxFg+/9dE6XkWWxbaZL+GvKYj/F0bA+2U9FyFo=" + }, + "org/apache/commons#commons-lang3/3.14.0": { + "jar": "sha256-e5a/PuaJSau1vEZVWawnDgVRWW+jRSP934kOxBjd4Tw=", + "pom": "sha256-EQQ4hjutN8KPkGv4cBbjjHqMdYujIeCdEdxaI2Oo554=" + }, + "org/apache/commons#commons-lang3/3.5": { + "pom": "sha256-Ref7ssIx25A6XVqtr8Y2oXOk1UVg94oR/0mAKO+eNF4=" + }, + "org/apache/commons#commons-lang3/3.8.1": { + "pom": "sha256-7I4J91QRaFIFvQ2deHLMNiLmfHbfRKCiJ7J4vqBEWNU=" + }, + "org/apache/commons#commons-parent/39": { + "pom": "sha256-h80n4aAqXD622FBZzphpa7G0TCuLZQ8FZ8ht9g+mHac=" + }, + "org/apache/commons#commons-parent/41": { + "pom": "sha256-sod8gBb4sokkyOkN1a5AzRHzKNAqHemNgN4iV0qzbsc=" + }, + "org/apache/commons#commons-parent/42": { + "pom": "sha256-zTE0lMZwtIPsJWlyrxaYszDlmPgHACNU63ZUefYEsJw=" + }, + "org/apache/commons#commons-parent/47": { + "pom": "sha256-io7LVwVTv58f+uIRqNTKnuYwwXr+WSkzaPunvZtC/Lc=" + }, + "org/apache/commons#commons-parent/52": { + "pom": "sha256-ddvo806Y5MP/QtquSi+etMvNO18QR9VEYKzpBtu0UC4=" + }, + "org/apache/commons#commons-parent/64": { + "pom": "sha256-bxljiZToNXtO1zRpb5kgV++q+hI1ZzmYEzKZeY4szds=" + }, + "org/apache/commons#commons-parent/69": { + "pom": "sha256-1Q2pw5vcqCPWGNG0oDtz8ZZJf8uGFv0NpyfIYjWSqbs=" + }, + "org/apache/commons#commons-text/1.12.0": { + "jar": "sha256-3gIyV/8WYESla9GqkSToQ80F2sWAbMcFqTEfNVbVoV8=", + "pom": "sha256-stQ0HJIZgcs11VcPT8lzKgijSxUo3uhMBQfH8nGaM08=" + }, + "org/apache/httpcomponents#httpclient/4.5.14": { + "jar": "sha256-yLx+HFGm1M5y9A0uu6vxxLaL/nbnMhBLBDgbSTR46dY=", + "pom": "sha256-8YNVr0z4CopO8E69dCpH6Qp+rwgMclsgldvE/F2977c=" + }, + "org/apache/httpcomponents#httpcomponents-client/4.5.14": { + "pom": "sha256-W60d5PEBRHZZ+J0ImGjMutZKaMxQPS1lQQtR9pBKoGE=" + }, + "org/apache/httpcomponents#httpcomponents-core/4.4.16": { + "pom": "sha256-8tdaLC1COtGFOb8hZW1W+IpAkZRKZi/K8VnVrig9t/c=" + }, + "org/apache/httpcomponents#httpcomponents-parent/11": { + "pom": "sha256-qQH4exFcVQcMfuQ+//Y+IOewLTCvJEOuKSvx9OUy06o=" + }, + "org/apache/httpcomponents#httpcore/4.4.16": { + "jar": "sha256-bJs90UKgncRo4jrTmq1vdaDyuFElEERp8CblKkdORk8=", + "pom": "sha256-PLrYSbNdrP5s7DGtraLGI8AmwyYRQbDSbux+OZxs1/o=" + }, + "org/apache/maven#maven-artifact/3.8.7": { + "jar": "sha256-I+scXCbz0bRpRkewcb6r/ZYIMZGwBjlHB3U68s7Y2wE=", + "pom": "sha256-gxFk5/0k5bBbLcO4l6ylvr6TV2odk8iUXzpEHJTg7VM=" + }, + "org/apache/maven#maven-builder-support/3.8.7": { + "jar": "sha256-JrRlNUXsw/A5mCssjxO8Km4OD6E3LAQb1FGUbMN6WcE=", + "pom": "sha256-eF8rsf6hlzTjoOogfGoJa2gYgzfv3M+kdZdH8dHexcM=" + }, + "org/apache/maven#maven-core/3.8.7": { + "jar": "sha256-x2f6zVSrj27qlyzPqcHT86XaohD/M1PJitAj9SBWKUA=", + "pom": "sha256-Fapj0KvMZJA1ymqCqXHoAvKtPgLPohnhudlSDws0Edc=" + }, + "org/apache/maven#maven-model-builder/3.8.7": { + "jar": "sha256-8cR7SinTJnUyxqHkmfDM1TB7MhqX6YWvRXMTjqXN62k=", + "pom": "sha256-tjB9TvfAo4Q2ojYY5fXJ6byIjHQWeEoRrIeHprx/QYw=" + }, + "org/apache/maven#maven-model/3.8.7": { + "jar": "sha256-b8ra7iqIXEOxWPLjgz0KPsto78YuJepbEfd8wHFqey0=", + "pom": "sha256-4dR3hYwG/DpXn8LFga9XIG6xWH2MEFMHFbmJb2S3kPU=" + }, + "org/apache/maven#maven-parent/34": { + "pom": "sha256-Go+vemorhIrLJqlZlU7hFcDXnb51piBvs7jHwvRaI38=" + }, + "org/apache/maven#maven-parent/35": { + "pom": "sha256-0u3UB3wKvJzIICiDxFlQMYBCRjbLOagwMewREjlLJXY=" + }, + "org/apache/maven#maven-parent/37": { + "pom": "sha256-vPNwAwHoIh7xTaJ6Lwz/cfzQP8RSdr/YStrOQB6Ivrw=" + }, + "org/apache/maven#maven-plugin-api/3.8.7": { + "jar": "sha256-TwhLIvdvFOuKeVEB+4Nif/Ebbyx8sX9ADVQyLn0AD3Q=", + "pom": "sha256-SlHibCSg2IbD3uYyu1o3K9y5i51ExA6xL5eyTTR+YtM=" + }, + "org/apache/maven#maven-repository-metadata/3.8.7": { + "jar": "sha256-rgfBgNpa53hJFc85gOkN42HqTRvFM3uWlpT1Aznv2eE=", + "pom": "sha256-ApdQ3NGyUFtbQ2nJDiMpNfjCJB4TYCJw+PUhFHfpOVc=" + }, + "org/apache/maven#maven-resolver-provider/3.8.7": { + "jar": "sha256-mKX0OimIB4VYzCL4ZBEkx0Vy3Z5gC8fX233projMEbo=", + "pom": "sha256-l+KYz4V0qpqrMqAV8f+EGCQhxYar5F3aBL4p7LXmz+c=" + }, + "org/apache/maven#maven-settings-builder/3.8.7": { + "jar": "sha256-LNPZ0Q6EhrKdRu9Dbclru/r0NaRd0yjM+VX1r5acir4=", + "pom": "sha256-KYMgyvMQ6dhvd1H9ZJiwtCsO/VO8f6Z39e54Y+SJDTA=" + }, + "org/apache/maven#maven-settings/3.8.7": { + "jar": "sha256-AMCY0r47gdoDf6LUEXm/FJOO2xLsOtosjfZAxKZ3ELs=", + "pom": "sha256-8QndYx6IMsCi8zplYaZtV4fRpC3n/tectirzGYpK/do=" + }, + "org/apache/maven#maven/3.8.7": { + "pom": "sha256-Rz512QcJ1/0osDhELhNxzEsiA9ygKYSG/Iz6c9r6k7U=" + }, + "org/apache/maven/resolver#maven-resolver-api/1.6.3": { + "pom": "sha256-EWZ4Z526PTbXmfZywm7iRDSA76Gxu7glDwbg3VqRp5U=" + }, + "org/apache/maven/resolver#maven-resolver-api/1.9.2": { + "jar": "sha256-EponhdJmdE1jvMCy9gNMZYclsJwW6oq9tiB1++FcaVM=", + "pom": "sha256-6uSCfjoen3KyJkZ3MI3ri4lLwlBRQcQMo2DLhF5cYrs=" + }, + "org/apache/maven/resolver#maven-resolver-connector-basic/1.9.2": { + "jar": "sha256-Dp27II8dms3ER1V342+b8xDrTHAmRtb1FFsiNUQgu7c=", + "pom": "sha256-kJg8BUhLbAEIp4WnPZnsQMePvqlcA7GlWNASPmz0So4=" + }, + "org/apache/maven/resolver#maven-resolver-impl/1.9.2": { + "jar": "sha256-W7+Ig2GsjEwB7HkWkzby9fN0nuqFuz82uZwEXZdxeQk=", + "pom": "sha256-5D8kzPHEQYddzq8q27zReUNRAd2+ddcYxIAkkRDIwwg=" + }, + "org/apache/maven/resolver#maven-resolver-named-locks/1.9.2": { + "jar": "sha256-CH+Q13Vn9x6EwxUTrITYBJpghBIoO9q2DBIpggbxnsU=", + "pom": "sha256-DYWW4EC3N8qDTtljAPFU2mEMR1aA8NO4/LTFNTXvqhA=" + }, + "org/apache/maven/resolver#maven-resolver-spi/1.6.3": { + "pom": "sha256-H4lGxHHBZwPLsIBAvH0F1wcroiFQSnfWS+54Wj9T18M=" + }, + "org/apache/maven/resolver#maven-resolver-spi/1.9.2": { + "jar": "sha256-foQ7A8TtWn2sxuPlIDcRoqo9p+W5JH420Dh/6Hee4VE=", + "pom": "sha256-B0inuyAQ2gaTPTiYaRXyBRvEOUfZdCuoxApXhBcmvQU=" + }, + "org/apache/maven/resolver#maven-resolver-transport-file/1.9.2": { + "jar": "sha256-UH8quj6VSy1OwJrlQRNhpbNJ2EfFj1KlztaMm6575uY=", + "pom": "sha256-vA0UoJ1oUDOagAEwkqHq6ksp2r7X3EpnBG9/Zw2a+84=" + }, + "org/apache/maven/resolver#maven-resolver-transport-wagon/1.9.2": { + "jar": "sha256-JKrTRTrDVxlzMLS1PJHkpkxL9QZcAT7TXx9pmwF5slY=", + "pom": "sha256-xMe/JvLjG7XSpIyXiABHW9sOV8J3WoYm0mr40CZ+VCc=" + }, + "org/apache/maven/resolver#maven-resolver-util/1.6.3": { + "pom": "sha256-0cNedvQWbxOwpR1WWs+Wfpw8eeLMtpzL9PrAmOS3xGY=" + }, + "org/apache/maven/resolver#maven-resolver-util/1.9.2": { + "jar": "sha256-Rt5yjW4446EBmDZ1JEoith1NLIZqGdUCoPpncCE6K/U=", + "pom": "sha256-GPziLjKecX5/iPzIrqhCaUzwOMRkDrEVvRZEGUikTAc=" + }, + "org/apache/maven/resolver#maven-resolver/1.6.3": { + "pom": "sha256-lzl+51sTDuK7Sijg+7EllZWoNhM4q6CC+K8Uc5joo+w=" + }, + "org/apache/maven/resolver#maven-resolver/1.9.2": { + "pom": "sha256-yjWN3m5VIZS7sOXRDbHH9cYiLda1v+PSPfmNqmxusNc=" + }, + "org/apache/maven/shared#maven-shared-components/34": { + "pom": "sha256-ZNDttfIc//YAscOrfUX5dUzRi6X7+Ds9G7fEhJQ32OM=" + }, + "org/apache/maven/shared#maven-shared-utils/3.3.4": { + "jar": "sha256-eSXZxaDiBA0kuPrj9hLrOZy//lg4szujaHd9x73fbdo=", + "pom": "sha256-v4NILZb3bWNpnWPhJeZPSsc8gXiYVzNmLb1pr5xgM54=" + }, + "org/apache/maven/wagon#wagon-http-shared/3.5.3": { + "jar": "sha256-jn2nZvVRZP3od5qqoSWDJQbChIyrSHa1MFE4hz4oA38=", + "pom": "sha256-YBSx5kq/RVxoNKCRgkjhVjgFD4NdoSBR0zzafpRtiPg=" + }, + "org/apache/maven/wagon#wagon-http/3.5.3": { + "jar": "sha256-0rbkjJ/L5XnhhYxiLRRGQBH/Jl+m4o55QASmiCFUpQk=", + "pom": "sha256-k08vnIfkl8T3lb5LsFs2C4wjFGfUYBA8GQErebjAPGs=" + }, + "org/apache/maven/wagon#wagon-provider-api/3.5.3": { + "jar": "sha256-XnIAAziUXtPpb45PV40dBnLhr34ZwOkBQZeuWzGvPvQ=", + "pom": "sha256-ZNagheimvt6WB8vQKepYzRyHMEQQhiSSF0ptWbnRcUI=" + }, + "org/apache/maven/wagon#wagon-providers/3.5.3": { + "pom": "sha256-gHxR/8ze9sARMLdK7tJ4FewWK8JobAHp0p8W78UmpEo=" + }, + "org/apache/maven/wagon#wagon/3.5.3": { + "pom": "sha256-fBC4usWSaP55V/KrK1CWXZAGnr+FDHVrtV6oB85EDws=" + }, + "org/apiguardian#apiguardian-api/1.1.2": { + "jar": "sha256-tQlEisUG1gcxnxglN/CzXXEAdYLsdBgyofER5bW3Czg=", + "module": "sha256-4IAoExN1s1fR0oc06aT7QhbahLJAZByz7358fWKCI/w=", + "pom": "sha256-MjVQgdEJCVw9XTdNWkO09MG3XVSemD71ByPidy5TAqA=" + }, + "org/assertj#assertj-core/3.25.3": { + "jar": "sha256-f73/oZltQ8wI4lduAQCLB+V7utK0dBqmw6tzzoUREw4=", + "pom": "sha256-ORcjDqozvPE+oz3TN6yvqdMmxzlmC/S2/FbIjXj+ufI=" + }, + "org/checkerframework#checker-qual/3.12.0": { + "jar": "sha256-/xB4WsKjV+xd6cKTy5gqLLtgXAMJ6kzBy5ubxtvn88s=", + "module": "sha256-0EeUnBuBCRwsORN3H6wvMqL6VJuj1dVIzIwLbfpJN3c=", + "pom": "sha256-d1t6425iggs7htwao5rzfArEuF/0j3/khakionkPRrk=" + }, + "org/checkerframework#checker-qual/3.42.0": { + "jar": "sha256-zK7dM68LeJTZ8vO2RPTRnkOSjjKQLmGsTRB3eDD1qsc=", + "module": "sha256-4PpiK33mPq4RBH726RtMKtDx8OE8uQP/UggKR/V6V0Y=", + "pom": "sha256-v1/KqycvVMvPG753w72WPIIcmrrSBYcIvwvtPIdUlMo=" + }, + "org/codehaus/plexus#plexus-cipher/2.0": { + "jar": "sha256-mn8bXFqe/9Yerf2HMUUqL3ao55ER+sOR73XqgBvqIDo=", + "pom": "sha256-BIQvMxsCJbhaXiBDlxDSKOp6YwKr5tU8nJhG+8W/mf8=" + }, + "org/codehaus/plexus#plexus-classworlds/2.6.0": { + "jar": "sha256-Uvd8XsSfeHycQX6+1dbv2ZIvRKIC8hc3bk+UwNdPNUk=", + "pom": "sha256-RppsWfku/6YsB5fOfVLSwDz47hA0uSPDYN14qfUFp7o=" + }, + "org/codehaus/plexus#plexus-component-annotations/2.1.0": { + "jar": "sha256-veNhfOm1vPlYQSYEYIAEOvaks7rqQKOxU/Aue7wyrKw=", + "pom": "sha256-BnC2BSVffcmkVNqux5EpGMzxtUdcv8o3Q2O1H8/U6gA=" + }, + "org/codehaus/plexus#plexus-containers/2.1.0": { + "pom": "sha256-lNWu2zxGAjJlOWUnz4zn/JRLe9eeTrq5BzhkGOtaCNc=" + }, + "org/codehaus/plexus#plexus-interpolation/1.26": { + "jar": "sha256-s7VBLOF4iRA+pWS838+fs9+lQDRP/qxrU4pzydcYJmI=", + "pom": "sha256-4cELOmM1ZB63SmaNqp7oauSrBmEBdOWboHyMaAQjJ/c=" + }, + "org/codehaus/plexus#plexus-sec-dispatcher/2.0": { + "jar": "sha256-hzE5lgxMeAF23aWAsAOixL+CGIvc5buZI04iTves/Os=", + "pom": "sha256-myi7MHAXk4qU0GyFsrCZvEaRK4WdCE+yk+Vp9DLq23w=" + }, + "org/codehaus/plexus#plexus-utils/3.3.1": { + "pom": "sha256-Xlg4eN+QW18zojDvaQpSuPGdq5zIkr7e4Gnz2K9Olgo=" + }, + "org/codehaus/plexus#plexus-utils/3.4.1": { + "jar": "sha256-UtheBLORhyKvEdEoVbSoJX35ag52yPTjhS5vqoUfNXs=", + "pom": "sha256-sUTP+bHGJZ/sT+5b38DzYNacI6vU6m5URTOpSbaeNYI=" + }, + "org/codehaus/plexus#plexus/5.1": { + "pom": "sha256-o0PkT/V5au0OpgvhFFTJNc4gqxxfFkrMjaV0SC3Lx+k=" + }, + "org/codehaus/plexus#plexus/8": { + "pom": "sha256-/6NJ2wTnq/ZYhb3FogYvQZfA/50/H04qpXILdyM/dCw=" + }, + "org/ec4j/core#ec4j-core-parent/0.3.0": { + "pom": "sha256-kKMRBDNTwIfbP/LzSAKWc1ii5IgkXYh7OcIbZvc+3mU=" + }, + "org/ec4j/core#ec4j-core/0.3.0": { + "jar": "sha256-yt7wIHB3B0sRoSvkQviats+T+8L4SHAtk3GpYRQU1Vg=", + "pom": "sha256-/RtdTKFRGzy8nJGvde82Eii0+fsQAZLTyGVHGETdxuk=" + }, + "org/eclipse/jdt#ecj/3.33.0": { + "jar": "sha256-92hsSWDPcMLrxcUApzqM/ARUG3MMGPHFwhMpiJsTf0U=", + "pom": "sha256-JmwX1PHL0Qtxvew5Dh9krNyV5h1hjPSi6obqkDM3v4g=" + }, + "org/eclipse/jdt/ecj/maven-metadata": { + "xml": { + "groupId": "org.eclipse.jdt", + "lastUpdated": "20240611021539", + "release": "3.38.0" + } + }, + "org/eclipse/sisu#org.eclipse.sisu.inject/0.3.5": { + "jar": "sha256-xZlAELzc4dK9YDpNUMRxkd29eHXRFXsjqqJtM8gv2hM=", + "pom": "sha256-wpdpcrQkL/2GBHFthHX1Z1XaD6KGGDROxOUyeBBpbXE=" + }, + "org/eclipse/sisu#org.eclipse.sisu.plexus/0.3.5": { + "jar": "sha256-fkxhCW1wgm8g96fVXFmlUo56pa0kfuLf5UTk3SX2p4Q=", + "pom": "sha256-eGUjydeCWKdKoTRHoWdsIXKs/fQyFl162uK3h20tg9M=" + }, + "org/eclipse/sisu#sisu-inject/0.3.5": { + "pom": "sha256-XzLsq5yPbf8fnkG4U+QNjyOiUIIZFU72fMANRVb19d0=" + }, + "org/eclipse/sisu#sisu-plexus/0.3.5": { + "pom": "sha256-broJAu/Yma7A2NGaw8vFMSPNQROf4OHSnMXIdKeRud4=" + }, + "org/hamcrest#hamcrest-core/2.2": { + "jar": "sha256-CU9dkrS32ciiv1PMadNWJDronDSZRXvLS5L37Tv5WHk=", + "pom": "sha256-9/3i//UQGl/Do54ogQuRHC2iAt3CvVB2X4nnxv+M590=" + }, + "org/hamcrest#hamcrest-library/2.2": { + "jar": "sha256-OFFSOiAaDUglwlphpu3FBxKCWjm9PQM5G5jEjKPLOWw=", + "pom": "sha256-9YrYNdJCZDElnYbk/jpPUWHmcdkWxcvs81c4vN6C/P8=" + }, + "org/hamcrest#hamcrest/2.2": { + "jar": "sha256-XmKEaonwXNeM2cGlU/NA0AJFg4DDIEVd0fj8VJeoocE=", + "pom": "sha256-s2E3N2xLP8923DN+KhvFtpGirBqpZqtdJiCak4EvpX0=" + }, + "org/javassist#javassist/3.28.0-GA": { + "jar": "sha256-V9Cp6ShvgvTqqFESUYaZf4Eb784OIGD/ChWnf1qd2ac=", + "pom": "sha256-w2p8E9o6SFKqiBvfnbYLnk0a8UbsKvtTmPltWYP21d0=" + }, + "org/jcommander#jcommander/1.83": { + "jar": "sha256-5l9JwhGaGFm5B2Bh5WH7WVii+m/9tJ8FHKjVmgs/h+Q=", + "module": "sha256-4nbeXr/WJFWAgvhhhFxhYTNryhu8MNXFZIUeNR2bE0U=", + "pom": "sha256-BYh7BLFe8u4t+gZozEfCRaO4kLZzM+gjNgJEVAKLMCA=" + }, + "org/jetbrains#annotations/13.0": { + "jar": "sha256-rOKhDcji1f00kl7KwD5JiLLA+FFlDJS4zvSbob0RFHg=", + "pom": "sha256-llrrK+3/NpgZvd4b96CzuJuCR91pyIuGN112Fju4w5c=" + }, + "org/jetbrains#annotations/23.0.0": { + "jar": "sha256-ew8ZckCCy/y8ZuWr6iubySzwih6hHhkZM+1DgB6zzQU=", + "pom": "sha256-yUkPZVEyMo3yz7z990P1P8ORbWwdEENxdabKbjpndxw=" + }, + "org/jetbrains#annotations/24.1.0": { + "jar": "sha256-J6dw3HzlBQCRi7jDwGYMmCkGMOx5a1489rkPQDswM8Y=", + "pom": "sha256-Ljf9cCCkNkueXZ93xbZ0Kjvqkn3VYMoeOQ3IFcnFCCA=" + }, + "org/jetbrains/intellij/deps#trove4j/1.0.20200330": { + "jar": "sha256-xf1yW/+rUYRr88d9sTg8YKquv+G3/i8A0j/ht98KQ50=", + "pom": "sha256-h3IcuqZaPJfYsbqdIHhA8WTJ/jh1n8nqEP/iZWX40+k=" + }, + "org/jetbrains/kotlin#kotlin-build-common/1.9.23": { + "jar": "sha256-IoJaHv4VSRN9GBPtedycyvVLSoonAKSsf3CNxmAki68=", + "pom": "sha256-2ePH5h9YSUkAFP6BC/wQSp6aRNVl7RhsWGu7P0/D0/s=" + }, + "org/jetbrains/kotlin#kotlin-build-tools-api/1.9.23": { + "jar": "sha256-gvhH4lRXtGSDfv7x2oUC7JJTLedAbnkgUWbODs9PxSE=", + "pom": "sha256-CWkjtiXJfGZzZ5ZsxM6Sv5TE6f98U8sdOEhgEax1DVg=" + }, + "org/jetbrains/kotlin#kotlin-build-tools-impl/1.9.23": { + "jar": "sha256-6sLwRmWHGVWn0K5FcZad8rCOfTN7LxIhAGb9PuAfWYE=", + "pom": "sha256-/OLyPE6fBzshdovfVqMa2W0zjNwD0FoVekWl/bL/7bE=" + }, + "org/jetbrains/kotlin#kotlin-compiler-embeddable/1.9.22": { + "jar": "sha256-K/6t7lmrGYjDNtvW5l2ZH3Zq4d2Gg/Km3tX6oCefDKA=", + "pom": "sha256-s9o0u29ClqzzoPRDRm8FBsbJnaXNliTW4LdFsiKHhOs=" + }, + "org/jetbrains/kotlin#kotlin-compiler-embeddable/1.9.23": { + "jar": "sha256-zJQGSXS/nr9ZlF4xIXzy0WoM66rySH6wdI/By9F4eUM=", + "pom": "sha256-WLI81NgtWqkWpcnMmbMhjuxVaWBoova3C+3fbDaR/RU=" + }, + "org/jetbrains/kotlin#kotlin-compiler-runner/1.9.23": { + "jar": "sha256-yFlaPhcRx0U8f5YKrxKhcNtL2j1vy6Sf/I4yy/0ADKE=", + "pom": "sha256-KebjEpGbdf6aOHjflRHPQhDcJuWTQcsu4iSDt7Tgcv4=" + }, + "org/jetbrains/kotlin#kotlin-daemon-client/1.9.23": { + "jar": "sha256-5jFUJUkZ/XBv6ZN8SNuTfqkGimMfht5lWlFLwWIPmI0=", + "pom": "sha256-X70GastuQIU5gCdsaDUWmSj2Zqt8RlEsJvJMnQMIF9M=" + }, + "org/jetbrains/kotlin#kotlin-daemon-embeddable/1.9.23": { + "jar": "sha256-bztmG5gmetJOL4+3rV0Gvn0u1hpdBcJn9OTKp433g9k=", + "pom": "sha256-WFRgOL5Go4NmOFPRMd12xPsnQ4MLqXt0sno1zxAtPQI=" + }, + "org/jetbrains/kotlin#kotlin-klib-commonizer-embeddable/1.9.23": { + "jar": "sha256-uAo4tLuB+wPQ8wdHPQMtc7J3j6drA0Y4floQ3YM9co4=", + "pom": "sha256-iLBAO2Z/cVJX6gDXdiFkkzggk+727vUBslU6HVIHG2g=" + }, + "org/jetbrains/kotlin#kotlin-reflect/1.6.10": { + "jar": "sha256-MnesECrheq0QpVq+x1/1aWyNEJeQOWQ0tJbnUIeFQgM=", + "pom": "sha256-V5BVJCdKAK4CiqzMJyg/a8WSWpNKBGwcxdBsjuTW1ak=" + }, + "org/jetbrains/kotlin#kotlin-script-runtime/1.9.23": { + "jar": "sha256-dRN+QUoaW0tNCQ+BLQ416zC08MkjpT1pWFRWuyT8Hfg=", + "pom": "sha256-LWx0sGpUDpicq9BTChbnZYGQUl8vTVpDq5sa/nQU/F8=" + }, + "org/jetbrains/kotlin#kotlin-scripting-common/1.9.23": { + "jar": "sha256-ii5Wfz2/Nz5hwBrNeIRjHshThGWrjul4rGMpb4zJr0Y=", + "pom": "sha256-/CiXW5TcQMDZD9EXXiKxtka60sY368+fT2qy1Oe8XdU=" + }, + "org/jetbrains/kotlin#kotlin-scripting-compiler-embeddable/1.9.23": { + "jar": "sha256-e4A5/wt3nVVs7QCSMDWr0TNPDl8qiHlhgtArpF+SbSA=", + "pom": "sha256-7Y6//r5Ume1iSG+oGBJ7td1QHXTEq5XFfnwB7z+NuWg=" + }, + "org/jetbrains/kotlin#kotlin-scripting-compiler-impl-embeddable/1.9.23": { + "jar": "sha256-kOU90S9i3NgjQ8EsDLMUrc/wy8OYjtsRjR5miZYOnWM=", + "pom": "sha256-923kmO12xGroZlZnmAf3J2EiPD+hChExgyAGpKs5Xe0=" + }, + "org/jetbrains/kotlin#kotlin-scripting-dependencies-maven/1.9.23": { + "jar": "sha256-15BHfNrTlUm3vlMKHXBaa0RUgEFvYUMWLzIoaiqoeGI=", + "pom": "sha256-5FD5GXKvpLES34ljPbiGRj0XG01WNZx5lDT3Z5eRjb0=" + }, + "org/jetbrains/kotlin#kotlin-scripting-dependencies/1.9.23": { + "jar": "sha256-b7saKennTbMR0UVWAsWG7ySIcG4ysN966mdMb87ZC90=", + "pom": "sha256-QmyeCV1+xxiGq0Ia/keHbTXG0H2HSvMtDvEJJjR7UwM=" + }, + "org/jetbrains/kotlin#kotlin-scripting-ide-services/1.9.23": { + "jar": "sha256-NbieJKmqscF//YMTW8qrPvr2a1YIjw8UhqNV4bE/37k=", + "pom": "sha256-ZbprfsFiGKOpst4RgwSPCleY8bJKII9O/EGWBo/wViE=" + }, + "org/jetbrains/kotlin#kotlin-scripting-jvm-host/1.9.23": { + "jar": "sha256-GGE2U4yx0RFatixSOe2uz/R+ZFByPpch10z8wcvmSI8=", + "pom": "sha256-zlETvo0uISJ1iCOzwX24YciRO/ZmDkj3FY8pgT72pSo=" + }, + "org/jetbrains/kotlin#kotlin-scripting-jvm/1.9.23": { + "jar": "sha256-0/yn7JUf94Jvl6dZifjcr/YM+eHna73CIO33eDdqbmQ=", + "pom": "sha256-4u8r+y628hp7croS7cWaFQx/IXbCssVP4uhg7oAjDYc=" + }, + "org/jetbrains/kotlin#kotlin-stdlib-common/1.9.23": { + "module": "sha256-hjnwBfqZd67wjDL8jnonedoi7iYkZNcnMpiq/Ug3Fc0=", + "pom": "sha256-OuBxRYdw47aGCafTGet5emeJ9fBAyqQUQJgJmGhb5PY=" + }, + "org/jetbrains/kotlin#kotlin-stdlib/1.9.23": { + "jar": "sha256-iRDMI4gH2G71UMsfCxDdXtQLNaTsGlJSX3YK7ehOrTc=", + "module": "sha256-UZUZOzfc2touHAqw1RLEIrKtdq81V4Q6G5w0gPTnHQ4=", + "pom": "sha256-wm0n8mcQrUDiPu2f/gpkuFkejBPSI8ypDFk+5j87KKs=" + }, + "org/jetbrains/kotlin#kotlin-stdlib/1.9.23/all": { + "jar": "sha256-zsOLwzAucqiq+c3kNrWpBx7gMx4q0F6E2LuJczTX6dQ=" + }, + "org/jetbrains/kotlinx#atomicfu/0.23.1": { + "jar": "sha256-fbhmDr5LkbtHjts2FsTjpQulnAfcpRfR4ShMA/6GrFc=", + "module": "sha256-Pokf5ja1UQgZIQD884saObzRwlM+I8Ri/AdkTur8sg8=", + "pom": "sha256-aIt5ABn0F87APmldZWexc7o7skGJVBZi8U/2ZEG1Pas=" + }, + "org/jetbrains/kotlinx#kotlinx-coroutines-bom/1.8.0": { + "pom": "sha256-Ejnp2+E5fNWXE0KVayURvDrOe2QYQuQ3KgiNz6i5rVU=" + }, + "org/jetbrains/kotlinx#kotlinx-coroutines-core-jvm/1.5.0": { + "jar": "sha256-eNbMcTX4TWkv83Uvz9H6G74JQNffcGUuTx6u7Ax4r7s=", + "module": "sha256-yIXdAoEHbFhDgm3jF+PLzcPYhZ2+71OuHPrNG5xg+W4=", + "pom": "sha256-U2IuA3eN+EQPwBIgGjW7S9/kAWTv7GErvvze7LL/wqs=" + }, + "org/jetbrains/kotlinx#kotlinx-coroutines-core-jvm/1.8.0": { + "jar": "sha256-mGCQahk3SQv187BtLw4Q70UeZblbJp8i2vaKPR9QZcU=", + "module": "sha256-/2oi2kAECTh1HbCuIRd+dlF9vxJqdnlvVCZye/dsEig=", + "pom": "sha256-pWM6vVNGfOuRYi2B8umCCAh3FF4LduG3V4hxVDSIXQs=" + }, + "org/jetbrains/kotlinx#kotlinx-coroutines-core/1.8.0": { + "jar": "sha256-IKpDS2qTDqZtLmGwDe764J/qPTL5ZA0uDCcTEogOCt0=", + "module": "sha256-FE7s1TZd4+MNe0YibAWAUeOZVbXBieMfpMfP+5nWILo=", + "pom": "sha256-yglaS/iLR0+trOgzLBCXC3nLgBu/XfBHo5Ov4Ql28yE=" + }, + "org/jetbrains/kotlinx#kotlinx-metadata-jvm/0.9.0": { + "jar": "sha256-1C9LrGC4HE/c7xxmau1BgdAEAeXmluSW9Ek1/jL+pY8=", + "pom": "sha256-stGZ96s08Nie6VlCizjwl2iJfasjZno+Ou+DgaHCfwM=" + }, + "org/junit#junit-bom/5.10.0": { + "module": "sha256-6z7mEnYIAQaUqJgFbnQH0RcpYAOrpfXbgB30MLmIf88=", + "pom": "sha256-4AbdiJT5/Ht1/DK7Ev5e2L5lZn1bRU+Z4uC4xbuNMLM=" + }, + "org/junit#junit-bom/5.10.2": { + "module": "sha256-3iOxFLPkEZqP5usXvtWjhSgWaYus5nBxV51tkn67CAo=", + "pom": "sha256-Fp3ZBKSw9lIM/+ZYzGIpK/6fPBSpifqSEgckzeQ6mWg=" + }, + "org/junit#junit-bom/5.7.1": { + "module": "sha256-mFTjiU1kskhSB+AEa8oHs9QtFp54L0+oyc4imnj67gQ=", + "pom": "sha256-C5sUo9YhBvr+jGinF7h7h60YaFiZRRt1PAT6QbaFd4Q=" + }, + "org/junit#junit-bom/5.7.2": { + "module": "sha256-87zrHFndT2mT9DBN/6WAFyuN9lp2zTb6T9ksBXjSitg=", + "pom": "sha256-zRSqqGmZH4ICHFhdVw0x/zQry6WLtEIztwGTdxuWSHs=" + }, + "org/junit/jupiter#junit-jupiter-api/5.10.2": { + "jar": "sha256-r/93wYbNMXJ1gDhy+lEzqoAf1qxAvZHHimz4AJtLF8w=", + "module": "sha256-QRtKlsKm2wmY1uWOiZNn8NElQWPzBBydmOeu38o3RBk=", + "pom": "sha256-u12jBgImsbPOtUCEldxptZRlv1DX6+Y+75TyWQnPGQA=" + }, + "org/junit/jupiter#junit-jupiter-engine/5.10.2": { + "jar": "sha256-tt812nUKVGrpMjdvEbPA34QfDJDHyylEzTmttDKIbks=", + "module": "sha256-FD7yda5mlRGdeCEqkyRazrv5I1tTdbn0wdSvcy87Uwo=", + "pom": "sha256-q+csj7+anI+e55usKbpkedMrDf+quICApQKRHSTTlGM=" + }, + "org/junit/jupiter#junit-jupiter-params/5.10.2": { + "jar": "sha256-7bHkP/C4BnYm/7VeXp7sodmrJHgUGnx/JT0RWynMfPI=", + "module": "sha256-IMLmXVKjnIVJbo4XDgjG7Sk1x/NeZRAT2WTcG7dcgns=", + "pom": "sha256-8n19CW20igXW56/YQalUVEJOVcUj167RZoF4szpjy9c=" + }, + "org/junit/jupiter#junit-jupiter/5.10.2": { + "jar": "sha256-Jj5DRH9LQPEmrWsdy9ffN5RIQTve244NJAxby7p8ek8=", + "module": "sha256-cjF2bPGyuJLGehQsljkU5rc/u1BhpschROt/jnJ3DsE=", + "pom": "sha256-1bcMXC10Ui2mEM04d28iW6wDSsJZGEO+6Xl6urOIDqs=" + }, + "org/junit/platform#junit-platform-commons/1.10.2": { + "jar": "sha256-tWpewACked9Jc7GLuiTJj+Dbj6oUyJB9PvRR2Mcf2K4=", + "module": "sha256-HoFCGmL4cryk0gIgs56hniexNfNre3gXBPkvrVQxlhg=", + "pom": "sha256-8/glx8o72JcU1IlEfHfHbifqOPAoX195ahAAoX/KS+c=" + }, + "org/junit/platform#junit-platform-engine/1.10.2": { + "jar": "sha256-kFy6m0mYzMKdEjkIWn+x/g4oAk11JhUjVtgQ7ewKSaM=", + "module": "sha256-4dG63P7cJyRFQeC+XV6EtyoicNevYWhrJvEc/Edw2kI=", + "pom": "sha256-EqqGyhwNZIoiXU58aWBUwfx26IeCxcOft983muI7728=" + }, + "org/junit/platform#junit-platform-launcher/1.10.2": { + "jar": "sha256-rtT0L7kK2ps0fCMfE2VvwJEhuiDattxkamvZ1Nox5Ko=", + "module": "sha256-/1YhIQJQJSv9rbYiu+LqZuzsMahnc2zqSz1K3yGcp/8=", + "pom": "sha256-WjEXCOeQa7l0YpwayHC8EWV0ZbmJ2koHfkVBa9mHJeQ=" + }, + "org/mockito#mockito-core/5.11.0": { + "jar": "sha256-8HbJax9JuNm8QuRrCWmq9WhMQMi1tnnUAOXYgAc6DgA=", + "pom": "sha256-ugsbXXA1CUlPmo5EWCIjh54zSKTElmfwx35odG5IHHg=" + }, + "org/objenesis#objenesis-parent/3.3": { + "pom": "sha256-MFw4SqLx4cf+U6ltpBw+w1JDuX1CjSSo93mBjMEL5P8=" + }, + "org/objenesis#objenesis/3.3": { + "jar": "sha256-At/QsEOaVZHjW3CO0vVHTrCUj1Or90Y36Vm45O9pv+s=", + "pom": "sha256-ugxA2iZpoEi24k73BmpHHw+8v8xQnmo+hWyk3fphStM=" + }, + "org/opentest4j#opentest4j/1.3.0": { + "jar": "sha256-SOLfY2yrZWPO1k3N/4q7I1VifLI27wvzdZhoLd90Lxs=", + "module": "sha256-SL8dbItdyU90ZSvReQD2VN63FDUCSM9ej8onuQkMjg0=", + "pom": "sha256-m/fP/EEPPoNywlIleN+cpW2dQ72TfjCUhwbCMqlDs1U=" + }, + "org/ow2#ow2/1.5.1": { + "pom": "sha256-Mh3bt+5v5PU96mtM1tt0FU1r+kI5HB92OzYbn0hazwU=" + }, + "org/ow2/asm#asm-analysis/9.6": { + "jar": "sha256-2Sgy18N+3AfGDiVZrGEYsx1kLjN6ZnHty3up+uaO27s=", + "pom": "sha256-+j+ZUCHP9PQTkwbmz/7uoHU5EGRA0psZzAanpjahOFA=" + }, + "org/ow2/asm#asm-tree/9.6": { + "jar": "sha256-xD7PF7U5x3fhXae1uGVTs3fi05poPeYoVWfVKDiI5+8=", + "pom": "sha256-G8tIHX/Ba5VbtgygfIz6JCS87ni9xAW7oxx9b13C0RM=" + }, + "org/ow2/asm#asm-util/9.6": { + "jar": "sha256-xjWnQC9Kqb9msvQjDOpiAloP4c1j6HKa3vybGZT6xMM=", + "pom": "sha256-UsXB01dAR3nRqZtJqFv506CFAluFFstz2+93yK40AF4=" + }, + "org/ow2/asm#asm/9.6": { + "jar": "sha256-PG+sJCTbPUqFO2afTj0dnDxVIjXhmjGWc/iHCDwjA6E=", + "pom": "sha256-ku7iS8PIQ+SIHUbB3WUFRx7jFC+s+0ZrQoz+paVsa2A=" + }, + "org/ow2/asm#asm/9.7": { + "jar": "sha256-rfRtXjSUC98Ujs3Sap7o7qlElqcgNP9xQQZrPupcTp0=", + "pom": "sha256-3gARXx2E86Cy7jpLb2GS0Gb4bRhdZ7nRUi8sgP6sXwA=" + }, + "org/reactivestreams#reactive-streams/1.0.3": { + "jar": "sha256-He4EgQctGckptiPhVeFNL2CF3AEVKaCg2+/ITPVx2GU=", + "pom": "sha256-zO1GcXX0JXgz9ssHUQ/5ezx1oG4aWNiCo515hT1RxgI=" + }, + "org/reflections#reflections/0.10.2": { + "jar": "sha256-k4otCP5UBQ12ELlE2N3DoJNVcQ2ea+CqyDjbwE6aKCU=", + "pom": "sha256-tsqj6301vXVu1usKKoGGi408D29CJE/q5BdgrGYwbYc=" + }, + "org/slf4j#jcl-over-slf4j/1.7.36": { + "jar": "sha256-q1fKj9IjdywXNl0SH1npTsvwrlnQjAOjy1uBBxwBkZU=", + "pom": "sha256-vZYkPX1CGM18x9RcDjD6E0gKGk+R01bt19/pPx/7aOY=" + }, + "org/slf4j#slf4j-api/2.0.13": { + "jar": "sha256-58KkjoUVuh9J+mN9V7Ti9ZCz9b2XQHrGmcOqXvsSBKk=", + "pom": "sha256-UYBc/agMoqyCBBuQbZhl056YI+NYoO62I3nf7UdcFXE=" + }, + "org/slf4j#slf4j-bom/2.0.13": { + "pom": "sha256-evJy16c44rmHY3kf/diWBA6L6ymKiP1gYhRAeXbNMQo=" + }, + "org/slf4j#slf4j-parent/1.7.36": { + "pom": "sha256-uziNN/vN083mTDzt4hg4aTIY3EUfBAQMXfNgp47X6BI=" + }, + "org/slf4j#slf4j-parent/2.0.13": { + "pom": "sha256-Z/rP1R8Gk1zqhWFaBHddcNgL/QOtDzdnA1H5IO0LtYo=" + }, + "org/sonatype/oss#oss-parent/7": { + "pom": "sha256-tR+IZ8kranIkmVV/w6H96ne9+e9XRyL+kM5DailVlFQ=" + }, + "org/sonatype/oss#oss-parent/9": { + "pom": "sha256-+0AmX5glSCEv+C42LllzKyGH7G8NgBgohcFO8fmCgno=" + }, + "org/yaml#snakeyaml/1.23": { + "pom": "sha256-HhvrIsqQYglwASK1ys9vJxkyRTjFsePCe/kVZMjTHb0=" + }, + "org/yaml#snakeyaml/1.23/android": { + "jar": "sha256-wPepBigXKXDT/21+qnoE9ztXKQs7jbqRbIKBp28iFMo=" + }, + "tools/profiler#async-profiler/3.0": { + "jar": "sha256-j3mIYASdAfSi+FNZbSjIXSmD8MCY8WWjKQm32px0IJ8=", + "pom": "sha256-kcs0wRa8nJ0jcynAw9TJdrLcby37mv6e8uRUO5aJiVU=" + } + } +} diff --git a/packages/jetbrains-jdk.nix b/packages/jetbrains-jdk.nix new file mode 100644 index 0000000..28b0549 --- /dev/null +++ b/packages/jetbrains-jdk.nix @@ -0,0 +1,169 @@ +# +# Jetbrains JDK with wayland patches. +# +# vim: et:ts=2:sw=2: +{ lib +, stdenv +, fetchFromGitHub +, jetbrains +, openjdk21 +, openjdk17-bootstrap +, git +, autoconf +, unzip +, rsync +, debugBuild ? false +, withJcef ? true + +, libXdamage +, libXxf86vm +, libXrandr +, libXi +, libXcursor +, libXrender +, libX11 +, libXext +, libxcb +, nss +, nspr +, libdrm +, mesa +, wayland +, udev +, temurin-bin +}: + +assert debugBuild -> withJcef; + +let + arch = { + "aarch64-linux" = "aarch64"; + "x86_64-linux" = "x64"; + }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); + cpu = stdenv.hostPlatform.parsed.cpu.name; +in +openjdk21.overrideAttrs (prev: rec { + pname = "jetbrains-jdk" + lib.optionalString withJcef "-jcef"; + + # Set up the version we want to build... + + javaVersion = "21.0.3"; + build="446.1"; + # To get the new tag: + # git clone https://github.com/jetbrains/jetbrainsruntime + # cd jetbrainsruntime + # git reset --hard [revision] + # git log --simplify-by-decoration --decorate=short --pretty=short | grep "jbr-" --color=never | cut -d "(" -f2 | cut -d ")" -f1 | awk '{print $2}' | sort -t "-" -k 2 -g | tail -n 1 | tr -d "," + openjdkTag = "jbr-21.0.2+13"; + version = "${javaVersion}-b${build}"; + + src = fetchFromGitHub { + owner = "JetBrains"; + repo = "JetBrainsRuntime"; + rev = "jb${version}"; + hash = "sha256-G4OwnQ+WbMYiWLYQ6wzOLKjHzDlrH+Un1Jd1bnblZuQ="; + }; + + BOOT_JDK = openjdk17-bootstrap.home; + # run `git log -1 --pretty=%ct` in jdk repo for new value on update + SOURCE_DATE_EPOCH = 1714806653; + + patches = [ ]; + + dontConfigure = true; + + # OpenJDK requires these to be set explicitly, but these + # break the JetBrains build system. Unset them. + configurePlatforms = []; + + buildPhase = '' + runHook preBuild + + ${lib.optionalString withJcef "cp -r ${jetbrains.jcef} jcef_linux_${arch}"} + + sed \ + -e "s/OPENJDK_TAG=.*/OPENJDK_TAG=${openjdkTag}/" \ + -e "s/SOURCE_DATE_EPOCH=.*//" \ + -e "s/export SOURCE_DATE_EPOCH//" \ + -i jb/project/tools/common/scripts/common.sh + sed -i "s/STATIC_CONF_ARGS/STATIC_CONF_ARGS \$configureFlags/" jb/project/tools/linux/scripts/mkimages_${arch}.sh + sed \ + -e "s/create_image_bundle \"jb/#/" \ + -e "s/echo Creating /exit 0 #/" \ + -i jb/project/tools/linux/scripts/mkimages_${arch}.sh + + patchShebangs . + ./jb/project/tools/linux/scripts/mkimages_${arch}.sh ${build} ${if debugBuild then "fd" else (if withJcef then "jcef" else "nomod")} + + runHook postBuild + ''; + + installPhase = + let + buildType = if debugBuild then "fastdebug" else "release"; + debugSuffix = if debugBuild then "-fastdebug" else ""; + jcefSuffix = if debugBuild || !withJcef then "" else "_jcef"; + jbrsdkDir = "jbrsdk${jcefSuffix}-${javaVersion}-linux-${arch}${debugSuffix}-b${build}"; + in + '' + runHook preInstall + + mv build/linux-${cpu}-server-${buildType}/images/jdk/man build/linux-${cpu}-server-${buildType}/images/${jbrsdkDir} + rm -rf build/linux-${cpu}-server-${buildType}/images/jdk + mv build/linux-${cpu}-server-${buildType}/images/${jbrsdkDir} build/linux-${cpu}-server-${buildType}/images/jdk + '' + prev.installPhase + "runHook postInstall"; + + postInstall = lib.optionalString withJcef '' + chmod +x $out/lib/openjdk/lib/chrome-sandbox + ''; + + dontStrip = debugBuild; + + postFixup = '' + # Build the set of output library directories to rpath against + LIBDIRS="${lib.makeLibraryPath [ + libXdamage libXxf86vm libXrandr libXi libXcursor libXrender libX11 libXext libxcb + nss nspr libdrm mesa wayland udev + ]}" + for output in $outputs; do + if [ "$output" = debug ]; then continue; fi + LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort -u | tr '\n' ':'):$LIBDIRS" + done + # Add the local library paths to remove dependencies on the bootstrap + for output in $outputs; do + if [ "$output" = debug ]; then continue; fi + OUTPUTDIR=$(eval echo \$$output) + BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) + echo "$BINLIBS" | while read i; do + patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true + patchelf --shrink-rpath "$i" || true + done + done + ''; + + nativeBuildInputs = [ git autoconf unzip rsync ] ++ prev.nativeBuildInputs; + + meta = with lib; { + description = "An OpenJDK fork to better support Jetbrains's products."; + longDescription = '' + JetBrains Runtime is a runtime environment for running IntelliJ Platform + based products on Windows, Mac OS X, and Linux. JetBrains Runtime is + based on OpenJDK project with some modifications. These modifications + include: Subpixel Anti-Aliasing, enhanced font rendering on Linux, HiDPI + support, ligatures, some fixes for native crashes not presented in + official build, and other small enhancements. + JetBrains Runtime is not a certified build of OpenJDK. Please, use at + your own risk. + ''; + homepage = "https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime"; + inherit (openjdk21.meta) license platforms mainProgram; + maintainers = with maintainers; [ edwtjo ]; + + broken = stdenv.isDarwin; + }; + + passthru = prev.passthru // { + home = "${placeholder "out"}/lib/openjdk"; + }; +}) + diff --git a/packages/jetbrains.nix b/packages/jetbrains.nix new file mode 100644 index 0000000..f991d06 --- /dev/null +++ b/packages/jetbrains.nix @@ -0,0 +1,37 @@ +# +# Switches the JetBrains tools to use a Java with +# Wayland support hacked in. +# +# vim: et:ts=2:sw=2: +# +{ jdk, pkgs, ... }: +let + + # Helper that creates a modded jetbrains tool. + overrideJdk = tool: tool.override { jdk = jdk; }; + mkJetbrainsTool = tool: (overrideJdk tool).overrideAttrs (prev: { + + # HACK: add in our wayland flags + installPhase = pkgs.lib.replaceStrings + ["--set-default JDK_HOME"] + ["--add-flags '-Dawt.toolkit.name=WLToolkit' --set-default JDK_HOME"] + prev.installPhase; + + # HACK: you're not free enough, yet + meta.license.free = true; + + }); +in + with pkgs.jetbrains; + +# Note that this is very deliberately missing a bunch of tools! +# That's to make sure if we add one to our packages, it errors +# instead of giving us the unwrapped one. +{ + clion = mkJetbrainsTool clion; + idea-ultimate = mkJetbrainsTool idea-ultimate; + pycharm-professional = mkJetbrainsTool pycharm-professional; + writerside = mkJetbrainsTool writerside; + webstorm = mkJetbrainsTool webstorm; + rust-rover = mkJetbrainsTool rust-rover; +} diff --git a/packages/kak-tree-sitter/default.nix b/packages/kak-tree-sitter/default.nix new file mode 100644 index 0000000..1497789 --- /dev/null +++ b/packages/kak-tree-sitter/default.nix @@ -0,0 +1,20 @@ +{ lib +, stdenv +, rustPlatform +}: + +rustPlatform.buildRustPackage rec { + pname = "kak-tree-sitter"; + version = "1.1.2"; + + src = fetchGit { + url = "https://git.sr.ht/~hadronized/kak-tree-sitter"; + rev = "a5eea435f0f483b66d09615ece7bdea599786f26"; + }; + + cargoHash = "sha256-BrE2yDDxEVPknTN9P7l8dnJQc4KIBOWDGX+MJev4Ruk="; + + meta = { + description = "tree-sitter plugin for kakoune"; + }; +} diff --git a/packages/libnfc-nci/00_enable_debug.patch b/packages/libnfc-nci/00_enable_debug.patch new file mode 100644 index 0000000..17751b3 --- /dev/null +++ b/packages/libnfc-nci/00_enable_debug.patch @@ -0,0 +1,25 @@ +diff --git a/conf/libnfc-nxp-init.conf b/conf/libnfc-nxp-init.conf +index 9bc5824..aa2ae7a 100644 +--- a/conf/libnfc-nxp-init.conf ++++ b/conf/libnfc-nxp-init.conf +@@ -19,13 +19,13 @@ + # NXPLOG_WARN_LOGLEVEL 0x02 + # NXPLOG_ERROR_LOGLEVEL 0x01 + # NXPLOG_SILENT_LOGLEVEL 0x00 +-NXPLOG_GLOBAL_LOGLEVEL=0x00 +-NXPLOG_EXTNS_LOGLEVEL=0x00 +-NXPLOG_NCIHAL_LOGLEVEL=0x00 +-NXPLOG_NCIX_LOGLEVEL=0x00 +-NXPLOG_NCIR_LOGLEVEL=0x00 +-NXPLOG_FWDNLD_LOGLEVEL=0x00 +-NXPLOG_TML_LOGLEVEL=0x00 ++NXPLOG_GLOBAL_LOGLEVEL=0x03 ++NXPLOG_EXTNS_LOGLEVEL=0x03 ++NXPLOG_NCIHAL_LOGLEVEL=0x03 ++NXPLOG_NCIX_LOGLEVEL=0x03 ++NXPLOG_NCIR_LOGLEVEL=0x03 ++NXPLOG_FWDNLD_LOGLEVEL=0x03 ++NXPLOG_TML_LOGLEVEL=0x03 + + ############################################################################### + # NXP HW Device Node information, when pn5xx_i2c kernel driver configuration is used diff --git a/packages/libnfc-nci/01_set_port_location.patch b/packages/libnfc-nci/01_set_port_location.patch new file mode 100644 index 0000000..51a1c0a --- /dev/null +++ b/packages/libnfc-nci/01_set_port_location.patch @@ -0,0 +1,97 @@ +diff --git a/src/halimpl/pn54x/tml/i2c/phTmlNfc_alt.h b/src/halimpl/pn54x/tml/i2c/phTmlNfc_alt.h +index 7646942..a5c3c2c 100755 +--- a/src/halimpl/pn54x/tml/i2c/phTmlNfc_alt.h ++++ b/src/halimpl/pn54x/tml/i2c/phTmlNfc_alt.h +@@ -21,37 +21,8 @@ + /* Basic type definitions */ + #include "poll.h" + +-/* Describe PN71xx connection +- * 0 = Custom configuration +- * 1 = OM557x on Raspberry Pi +- * 2 = OM557x on UdooNeo +- * 3 = OM557x on BeagleBone black +- * +- */ +-#define CONFIGURATION 1 +- +-#if (CONFIGURATION == 1) +-/* OM557x on Raspberry Pi */ +- #define I2C_BUS "/dev/i2c-1" +- #define I2C_ADDRESS 0x28 +- #define PIN_INT 23 +- #define PIN_ENABLE 24 +-#elif (CONFIGURATION == 2) +-/* OM557x on UdooNeo */ +- #define I2C_BUS "/dev/i2c-1" +- #define I2C_ADDRESS 0x28 +- #define PIN_INT 105 +- #define PIN_ENABLE 149 +-#elif (CONFIGURATION == 3) +-/* OM557x on BeagleBone Black */ +- #define I2C_BUS "/dev/i2c-2" +- #define I2C_ADDRESS 0x28 +- #define PIN_INT 61 +- #define PIN_ENABLE 30 +-#else +-/* Custom configuration */ +- #define I2C_BUS "/dev/i2c-1" +- #define I2C_ADDRESS 0x28 +- #define PIN_INT 23 +- #define PIN_ENABLE 24 +-#endif ++#define I2C_BUS "/dev/i2c-2" ++#define I2C_ADDRESS 0x29 ++#define PIN_INT 833 ++#define PIN_ENABLE 837 ++#define PIN_FIRMWARE 834 +diff --git a/src/halimpl/pn54x/tml/i2c/phTmlNfc_i2c.c b/src/halimpl/pn54x/tml/i2c/phTmlNfc_i2c.c +index 6b45046..29f6b91 100755 +--- a/src/halimpl/pn54x/tml/i2c/phTmlNfc_i2c.c ++++ b/src/halimpl/pn54x/tml/i2c/phTmlNfc_i2c.c +@@ -57,6 +57,7 @@ static bool_t bFwDnldFlag = FALSE; + // ---------------------------------------------------------------------------- + static int iEnableFd = 0; + static int iInterruptFd = 0; ++static int iFirmwareFd = 0; + static int iI2CFd = 0; + static int dummyHandle = 1234; + +@@ -163,6 +164,9 @@ static int verifyPin( int pin, int isoutput, int edge ) { + + static void pnOn( void ) { + if ( iEnableFd ) write( iEnableFd, "1", 1 ); ++ ++ // Hack: prevent this from being in FW mode. ++ if ( iFirmwareFd ) write( iFirmwareFd, "1", 1 ); + } + + static void pnOff( void ) { +@@ -258,8 +262,9 @@ NFCSTATUS phTmlNfc_i2c_open_and_configure(pphTmlNfc_Config_t pConfig, void ** pL + NXPLOG_TML_D("phTmlNfc_i2c_open_and_configure Alternative NFC\n"); + NXPLOG_TML_D( "NFC - Assign IO pins\n"); + // Assign IO pins +- iInterruptFd = verifyPin( PIN_INT, 0, EDGE_RISING ); +- iEnableFd = verifyPin( PIN_ENABLE, 1, EDGE_NONE ); ++ iInterruptFd = verifyPin( PIN_INT, 0, EDGE_RISING ); ++ iEnableFd = verifyPin( PIN_ENABLE, 1, EDGE_NONE ); ++ iFirmwareFd = verifyPin( PIN_FIRMWARE, 1, EDGE_NONE ); + NXPLOG_TML_D( "NFCHW - open I2C bus - %s\n", I2C_BUS); + + // I2C bus +@@ -268,6 +273,7 @@ NFCSTATUS phTmlNfc_i2c_open_and_configure(pphTmlNfc_Config_t pConfig, void ** pL + NXPLOG_TML_E( "Could not open I2C bus '%s' (%s)", I2C_BUS, strerror(errno)); + if ( iEnableFd ) close(iEnableFd); + if ( iInterruptFd ) close(iInterruptFd); ++ if ( iFirmwareFd ) close(iFirmwareFd); + return( NFCSTATUS_INVALID_DEVICE ); + } + +@@ -278,6 +284,7 @@ NFCSTATUS phTmlNfc_i2c_open_and_configure(pphTmlNfc_Config_t pConfig, void ** pL + NXPLOG_TML_E( "Cannot select I2C address (%s)\n", strerror(errno)); + if ( iEnableFd ) close(iEnableFd); + if ( iInterruptFd ) close(iInterruptFd); ++ if ( iFirmwareFd ) close(iFirmwareFd); + close(iI2CFd); + return( NFCSTATUS_INVALID_DEVICE ); + } diff --git a/packages/libnfc-nci/default.nix b/packages/libnfc-nci/default.nix new file mode 100644 index 0000000..a17eaf3 --- /dev/null +++ b/packages/libnfc-nci/default.nix @@ -0,0 +1,54 @@ +{ + lib, + stdenv, + fetchFromGitHub, + libusb1, + libusb-compat-0_1, + pkg-config, + libtool, + autoreconfHook}: + +stdenv.mkDerivation rec { + pname = "libnfc-nci"; + version = "unstable-2024-07-15"; + + src = fetchFromGitHub { + owner = "StarGate01"; + repo = "linux_libnfc-nci"; + rev = "4fc402ffd07642b1231fb259a6b956771d524e5e"; + hash = "sha256-mrGsTikxS/oR+Wh9a4aVCszbF/nbFAVBQfYN421vqU0="; + }; + + oldsrc = fetchFromGitHub { + owner = "NXPNFCLinux"; + repo = "linux_libnfc-nci"; + rev = "449538e5e106666e5263afeaddacc5836fc23d3f"; + hash = "sha256-ngooArd2g8DBFRQ0M7BFYoJLlhWLX/R5YjuDkj6qh1Y="; + }; + + nativeBuildInputs = [ + autoreconfHook + libtool + pkg-config + ]; + + buildInputs = [ + libusb1 + libusb-compat-0_1 + ]; + + patches = [ + #./00_enable_debug.patch + #./01_set_port_location.patch + ]; + + configureFlags = [ + "--enable-i2c" + ]; + + meta = with lib; { + description = "Linux NFC stack for NCI based NXP NFC Controllers"; + homepage = "https://github.com/StarGate01/linux_libnfc-nci"; + license = licenses.asl20; + }; +} diff --git a/packages/libnfc.nix b/packages/libnfc.nix new file mode 100644 index 0000000..a973565 --- /dev/null +++ b/packages/libnfc.nix @@ -0,0 +1,46 @@ +{ lib +, stdenv +, fetchFromGitHub +, libusb-compat-0_1 +, readline +, pkg-config +, libusb1 +, autoreconfHook +, libnfc-nci +}: + +stdenv.mkDerivation rec { + pname = "libnfc"; + version = "1.8.0"; + + src = fetchFromGitHub { + owner = "nfc-tools"; + repo = pname; + rev = "libnfc-${version}"; + sha256 = "5gMv/HajPrUL/vkegEqHgN2d6Yzf01dTMrx4l34KMrQ="; + }; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + + buildInputs = [ + libusb1 + libusb-compat-0_1 + readline + libnfc-nci + ]; + + configureFlags = [ + "--with-drivers=pn71xx" + "sysconfdir=/etc" + ]; + + meta = with lib; { + description = "Library for Near Field Communication (NFC)"; + homepage = "https://github.com/nfc-tools/libnfc"; + license = licenses.lgpl3Plus; + platforms = platforms.unix; + }; +} diff --git a/packages/linux-nfc-lenovo/default.nix b/packages/linux-nfc-lenovo/default.nix new file mode 100644 index 0000000..22950ee --- /dev/null +++ b/packages/linux-nfc-lenovo/default.nix @@ -0,0 +1,33 @@ +{ stdenv, lib, fetchFromGitHub, nukeReferences, linuxPackages }: +let + kernel = linuxPackages.kernel; +in +stdenv.mkDerivation rec { + name = "linux-nfc-lenovo-${version}-${kernel.version}"; + version = "0.1"; + + src = ./src; + nativeBuildInputs = kernel.moduleBuildDependencies ++ [ nukeReferences ]; + + postUnpack = '' + cp -r $src . + ls -lah + ''; + + buildPhase = '' + make -j$(nproc) -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build M=$(pwd) + ''; + + installPhase = '' + mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc + for x in $(find . -name '*.ko'); do + nuke-refs $x + cp $x $out/lib/modules/${kernel.modDirVersion}/misc/ + done + ''; + + meta = with lib; { + description = "kernel driver for using Lenovo NFC modules with libnfc"; + platforms = platforms.linux; + }; +} diff --git a/packages/linux-nfc-lenovo/src/Kconfig b/packages/linux-nfc-lenovo/src/Kconfig new file mode 100644 index 0000000..4e77019 --- /dev/null +++ b/packages/linux-nfc-lenovo/src/Kconfig @@ -0,0 +1,12 @@ +config NFC_NXP_PN5XX + tristate "NXP PN5XX based driver" + depends on I2C + select CRC_CCITT + default n + ---help--- + NXP PN5XX driver based on I2C. + This is a driver to provides I2C access to PN5xx NFC Controller devices + + To compile this driver as a module, choose m here. The module will + be called pn5xx_i2c. + Say N if unsure. diff --git a/packages/linux-nfc-lenovo/src/LICENSE b/packages/linux-nfc-lenovo/src/LICENSE new file mode 100644 index 0000000..8cdb845 --- /dev/null +++ b/packages/linux-nfc-lenovo/src/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + diff --git a/packages/linux-nfc-lenovo/src/Makefile b/packages/linux-nfc-lenovo/src/Makefile new file mode 100644 index 0000000..79a4ef9 --- /dev/null +++ b/packages/linux-nfc-lenovo/src/Makefile @@ -0,0 +1,23 @@ +KERNELRELEASE ?= $(shell uname -r) +BUILD_KERNEL_PATH ?= /lib/modules/$(KERNELRELEASE)/build +INSTALL_MOD_PATH ?= $(INSTALL_PATH)/lib/modules/$(KERNELRELEASE) +INSTALL_PN5XX_I2C_PATH ?= $(INSTALL_MOD_PATH)/kernel/drivers/nfc + +obj-m := pn5xx_i2c.o +nxp-pn5xx-objs := pn5xx_i2c.o + +all: pn5xx_i2c.ko + +pn5xx_i2c.ko: pn5xx_i2c.c pn5xx_i2c.h + @echo "Compiling kernel module" + $(MAKE) -C $(BUILD_KERNEL_PATH) M=$(CURDIR) modules + +install: all + mkdir -p $(INSTALL_PN5XX_I2C_PATH) + install -m 644 pn5xx_i2c.ko $(INSTALL_PN5XX_I2C_PATH) + +clean: + $(MAKE) -C $(BUILD_KERNEL_PATH) M=$(CURDIR) clean + +.PHONY: all install clean +.EXPORT_ALL_VARIABLES: diff --git a/packages/linux-nfc-lenovo/src/README.md b/packages/linux-nfc-lenovo/src/README.md new file mode 100644 index 0000000..c0c8d5c --- /dev/null +++ b/packages/linux-nfc-lenovo/src/README.md @@ -0,0 +1,2 @@ +# nxp-pn5xx +NXP's NFC Open Source Kernel mode driver diff --git a/packages/linux-nfc-lenovo/src/pn5xx_i2c.c b/packages/linux-nfc-lenovo/src/pn5xx_i2c.c new file mode 100644 index 0000000..023dc45 --- /dev/null +++ b/packages/linux-nfc-lenovo/src/pn5xx_i2c.c @@ -0,0 +1,653 @@ +/* + * Copyright (C) 2010 Trusted Logic S.A. + * modifications copyright (C) 2015 NXP B.V. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pn5xx_i2c.h" +#include +#include +#include + +#define MAX_BUFFER_SIZE 512 + +#define MODE_OFF 0 +#define MODE_RUN 1 +#define MODE_FW 2 + +/* Only pn548, pn547 and pn544 are supported */ +#define CHIP "pn544" +#define DRIVER_CARD "PN54x NFC" +#define DRIVER_DESC "NFC driver for PN54x Family" + +#ifndef CONFIG_OF +#define CONFIG_OF +#endif + +struct pn54x_dev { + wait_queue_head_t read_wq; + struct mutex read_mutex; + struct i2c_client *client; + struct miscdevice pn54x_device; + int ven_gpio; + int firm_gpio; + int irq_gpio; + int clkreq_gpio; + struct regulator *pvdd_reg; + struct regulator *vbat_reg; + struct regulator *pmuvcc_reg; + struct regulator *sevdd_reg; + bool irq_enabled; + spinlock_t irq_enabled_lock; +}; + +/********************************************************** + * Interrupt control and handler + **********************************************************/ +static void pn54x_disable_irq(struct pn54x_dev *pn54x_dev) +{ + unsigned long flags; + + spin_lock_irqsave(&pn54x_dev->irq_enabled_lock, flags); + if (pn54x_dev->irq_enabled) { + disable_irq_nosync(pn54x_dev->client->irq); + pn54x_dev->irq_enabled = false; + } + spin_unlock_irqrestore(&pn54x_dev->irq_enabled_lock, flags); +} + +static irqreturn_t pn54x_dev_irq_handler(int irq, void *dev_id) +{ + struct pn54x_dev *pn54x_dev = dev_id; + + pn54x_disable_irq(pn54x_dev); + + /* Wake up waiting readers */ + wake_up(&pn54x_dev->read_wq); + + return IRQ_HANDLED; +} + +/********************************************************** + * private functions + **********************************************************/ +static int pn544_enable(struct pn54x_dev *dev, int mode) +{ + int r; + + /* turn on the regulators */ + /* -- if the regulators were specified, they're required */ + if(dev->pvdd_reg != NULL) + { + r = regulator_enable(dev->pvdd_reg); + if (r < 0){ + pr_err("%s: not able to enable pvdd\n", __func__); + return r; + } + } + if(dev->vbat_reg != NULL) + { + r = regulator_enable(dev->vbat_reg); + if (r < 0){ + pr_err("%s: not able to enable vbat\n", __func__); + goto enable_exit0; + } + } + if(dev->pmuvcc_reg != NULL) + { + r = regulator_enable(dev->pmuvcc_reg); + if (r < 0){ + pr_err("%s: not able to enable pmuvcc\n", __func__); + goto enable_exit1; + } + } + if(dev->sevdd_reg != NULL) + { + r = regulator_enable(dev->sevdd_reg); + if (r < 0){ + pr_err("%s: not able to enable sevdd\n", __func__); + goto enable_exit2; + } + } + + if (MODE_RUN == mode) { + pr_info("%s power on\n", __func__); + if (gpio_is_valid(dev->firm_gpio)) + gpio_set_value_cansleep(dev->firm_gpio, 0); + gpio_set_value_cansleep(dev->ven_gpio, 1); + msleep(100); + } + else if (MODE_FW == mode) { + /* power on with firmware download (requires hw reset) + */ + pr_info("%s power on with firmware\n", __func__); + gpio_set_value(dev->ven_gpio, 1); + msleep(20); + if (gpio_is_valid(dev->firm_gpio)) { + gpio_set_value(dev->firm_gpio, 1); + } + else { + pr_err("%s Unused Firm GPIO %d\n", __func__, mode); + return GPIO_UNUSED; + } + msleep(20); + gpio_set_value(dev->ven_gpio, 0); + msleep(100); + gpio_set_value(dev->ven_gpio, 1); + msleep(20); + } + else { + pr_err("%s bad arg %d\n", __func__, mode); + return -EINVAL; + } + + return 0; + +enable_exit2: + if(dev->pmuvcc_reg) regulator_disable(dev->pmuvcc_reg); +enable_exit1: + if(dev->vbat_reg) regulator_disable(dev->vbat_reg); +enable_exit0: + if(dev->pvdd_reg) regulator_disable(dev->pvdd_reg); + + return r; +} + +static void pn544_disable(struct pn54x_dev *dev) +{ + /* power off */ + pr_info("%s power off\n", __func__); + if (gpio_is_valid(dev->firm_gpio)) + gpio_set_value_cansleep(dev->firm_gpio, 0); + gpio_set_value_cansleep(dev->ven_gpio, 0); + msleep(100); + + if(dev->sevdd_reg) regulator_disable(dev->sevdd_reg); + if(dev->pmuvcc_reg) regulator_disable(dev->pmuvcc_reg); + if(dev->vbat_reg) regulator_disable(dev->vbat_reg); + if(dev->pvdd_reg) regulator_disable(dev->pvdd_reg); + +} + +/********************************************************** + * driver functions + **********************************************************/ +static ssize_t pn54x_dev_read(struct file *filp, char __user *buf, + size_t count, loff_t *offset) +{ + struct pn54x_dev *pn54x_dev = filp->private_data; + char tmp[MAX_BUFFER_SIZE]; + int ret; + + if (count > MAX_BUFFER_SIZE) + count = MAX_BUFFER_SIZE; + + pr_debug("%s : reading %zu bytes.\n", __func__, count); + + mutex_lock(&pn54x_dev->read_mutex); + + if (!gpio_get_value(pn54x_dev->irq_gpio)) { + if (filp->f_flags & O_NONBLOCK) { + ret = -EAGAIN; + goto fail; + } + + while (1) { + pn54x_dev->irq_enabled = true; + enable_irq(pn54x_dev->client->irq); + ret = wait_event_interruptible( + pn54x_dev->read_wq, + !pn54x_dev->irq_enabled); + + pn54x_disable_irq(pn54x_dev); + + if (ret) + goto fail; + + if (gpio_get_value(pn54x_dev->irq_gpio)) + break; + + pr_warn("%s: spurious interrupt detected\n", __func__); + } + } + + /* Read data */ + ret = i2c_master_recv(pn54x_dev->client, tmp, count); + + mutex_unlock(&pn54x_dev->read_mutex); + + /* pn54x seems to be slow in handling I2C read requests + * so add 1ms delay after recv operation */ + udelay(1000); + + if (ret < 0) { + pr_err("%s: i2c_master_recv returned %d\n", __func__, ret); + return ret; + } + if (ret > count) { + pr_err("%s: received too many bytes from i2c (%d)\n", + __func__, ret); + return -EIO; + } + if (copy_to_user(buf, tmp, ret)) { + pr_warn("%s : failed to copy to user space\n", __func__); + return -EFAULT; + } + return ret; + +fail: + mutex_unlock(&pn54x_dev->read_mutex); + return ret; +} + +static ssize_t pn54x_dev_write(struct file *filp, const char __user *buf, + size_t count, loff_t *offset) +{ + struct pn54x_dev *pn54x_dev; + char tmp[MAX_BUFFER_SIZE]; + int ret; + + pn54x_dev = filp->private_data; + + if (count > MAX_BUFFER_SIZE) + count = MAX_BUFFER_SIZE; + + if (copy_from_user(tmp, buf, count)) { + pr_err("%s : failed to copy from user space\n", __func__); + return -EFAULT; + } + + pr_debug("%s : writing %zu bytes.\n", __func__, count); + /* Write data */ + ret = i2c_master_send(pn54x_dev->client, tmp, count); + if (ret != count) { + pr_err("%s : i2c_master_send returned %d\n", __func__, ret); + ret = -EIO; + } + + /* pn54x seems to be slow in handling I2C write requests + * so add 1ms delay after I2C send oparation */ + udelay(1000); + + return ret; +} + +static int pn54x_dev_open(struct inode *inode, struct file *filp) +{ + struct pn54x_dev *pn54x_dev = container_of(filp->private_data, + struct pn54x_dev, + pn54x_device); + + filp->private_data = pn54x_dev; + + pr_info("%s : %d,%d\n", __func__, imajor(inode), iminor(inode)); + + // pn544_enable(pn54x_dev, MODE_RUN); + + return 0; +} + +static int pn54x_dev_release(struct inode *inode, struct file *filp) +{ + // struct pn54x_dev *pn54x_dev = container_of(filp->private_data, + // struct pn54x_dev, + // pn54x_device); + + pr_info("%s : closing %d,%d\n", __func__, imajor(inode), iminor(inode)); + + // pn544_disable(pn54x_dev); + + return 0; +} + +static long pn54x_dev_ioctl(struct file *filp, unsigned int cmd, + unsigned long arg) +{ + struct pn54x_dev *pn54x_dev = filp->private_data; + + pr_info("%s, cmd=%d, arg=%lu\n", __func__, cmd, arg); + switch (cmd) { + case PN544_SET_PWR: + if (arg == 2) { + /* power on w/FW */ + if (GPIO_UNUSED == pn544_enable(pn54x_dev, arg)) { + return GPIO_UNUSED; + } + } else if (arg == 1) { + /* power on */ + pn544_enable(pn54x_dev, arg); + } else if (arg == 0) { + /* power off */ + pn544_disable(pn54x_dev); + } else { + pr_err("%s bad SET_PWR arg %lu\n", __func__, arg); + return -EINVAL; + } + break; + case PN54X_CLK_REQ: + if(1 == arg){ + if(gpio_is_valid(pn54x_dev->clkreq_gpio)){ + gpio_set_value(pn54x_dev->clkreq_gpio, 1); + } + else { + pr_err("%s Unused Clkreq GPIO %lu\n", __func__, arg); + return GPIO_UNUSED; + } + } + else if(0 == arg) { + if(gpio_is_valid(pn54x_dev->clkreq_gpio)){ + gpio_set_value(pn54x_dev->clkreq_gpio, 0); + } + else { + pr_err("%s Unused Clkreq GPIO %lu\n", __func__, arg); + return GPIO_UNUSED; + } + } else { + pr_err("%s bad CLK_REQ arg %lu\n", __func__, arg); + return -EINVAL; + } + break; + default: + pr_err("%s bad ioctl %u\n", __func__, cmd); + return -EINVAL; + } + + return 0; +} + +static const struct file_operations pn54x_dev_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .read = pn54x_dev_read, + .write = pn54x_dev_write, + .open = pn54x_dev_open, + .release = pn54x_dev_release, + .unlocked_ioctl = pn54x_dev_ioctl, +}; + + +/* + * Handlers for alternative sources of platform_data + */ +static int pn54x_get_pdata(struct device *dev, + struct pn544_i2c_platform_data *pdata) +{ + memset(pdata, 0, sizeof(*pdata)); + pr_info("%s\n", __func__); + + // Voltage enable. + struct gpio_desc* desc = gpiod_get_index(dev, NULL, 2, 0); + if (IS_ERR(desc)) { + pr_err("Could not get VEN_GPIO!"); + return PTR_ERR(desc); + } + pdata->ven_gpio = desc_to_gpio(desc); + + // Interrupt. + desc = gpiod_get_index(dev, NULL, 0, 0); + if (IS_ERR(desc)) { + pr_err("Could not get IRQ_GPIO!"); + return PTR_ERR(desc); + } + pdata->irq_gpio = desc_to_gpio(desc); + + // Bootloader request. + desc = gpiod_get_index(dev, NULL, 1, 0); + if (IS_ERR(desc)) { + pr_err("Could not get FIRM_GPIO!"); + return PTR_ERR(desc); + } + pdata->firm_gpio = desc_to_gpio(desc); + + // Lenovo never provides a CLKREQ pin. + pdata->clkreq_gpio = GPIO_UNUSED; + + return 0; +} + + +/* + * pn54x_probe + */ +static int pn54x_probe(struct i2c_client *client) +{ + int ret; + struct pn544_i2c_platform_data *pdata; // gpio values, from board file or DT + struct pn544_i2c_platform_data tmp_pdata; + struct pn54x_dev *pn54x_dev; // internal device specific data + + pr_info("%s\n", __func__); + + /* ---- retrieve the platform data ---- */ + /* If the dev.platform_data is NULL, then */ + /* attempt to read from the device tree */ + if(!client->dev.platform_data) + { + ret = pn54x_get_pdata(&(client->dev), &tmp_pdata); + if(ret){ + return ret; + } + + pdata = &tmp_pdata; + } + else + { + pdata = client->dev.platform_data; + } + + if (pdata == NULL) { + pr_err("%s : nfc probe fail\n", __func__); + return -ENODEV; + } + + /* validate the the adapter has basic I2C functionality */ + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { + pr_err("%s : need I2C_FUNC_I2C\n", __func__); + return -ENODEV; + } + + /* note:reserving the pins was handled when populating pdata */ + + /* allocate the pn54x driver information structure */ + pn54x_dev = kzalloc(sizeof(*pn54x_dev), GFP_KERNEL); + if (pn54x_dev == NULL) { + dev_err(&client->dev, "failed to allocate memory for module data\n"); + ret = -ENOMEM; + goto err_exit; + } + + /* store the platform data in the driver info struct */ + pn54x_dev->irq_gpio = pdata->irq_gpio; + pn54x_dev->ven_gpio = pdata->ven_gpio; + pn54x_dev->firm_gpio = pdata->firm_gpio; + pn54x_dev->clkreq_gpio = pdata->clkreq_gpio; + pn54x_dev->pvdd_reg = pdata->pvdd_reg; + pn54x_dev->vbat_reg = pdata->vbat_reg; + pn54x_dev->pmuvcc_reg = pdata->pmuvcc_reg; + pn54x_dev->sevdd_reg = pdata->sevdd_reg; + + pn54x_dev->client = client; + + /* finish configuring the I/O */ + ret = gpio_direction_input(pn54x_dev->irq_gpio); + if (ret < 0) { + pr_err("%s :not able to set irq_gpio as input\n", __func__); + goto err_exit; + } + + ret = gpio_direction_output(pn54x_dev->ven_gpio, 0); + if (ret < 0) { + pr_err("%s : not able to set ven_gpio as output\n", __func__); + goto err_exit; + } + + if (gpio_is_valid(pn54x_dev->firm_gpio)) { + ret = gpio_direction_output(pn54x_dev->firm_gpio, 0); + if (ret < 0) { + pr_err("%s : not able to set firm_gpio as output\n", + __func__); + goto err_exit; + } + } + + if (gpio_is_valid(pn54x_dev->clkreq_gpio)) { + ret = gpio_direction_output(pn54x_dev->clkreq_gpio, 0); + if (ret < 0) { + pr_err("%s : not able to set clkreq_gpio as output\n", + __func__); + goto err_exit; + } + } + + /* init mutex and queues */ + init_waitqueue_head(&pn54x_dev->read_wq); + mutex_init(&pn54x_dev->read_mutex); + spin_lock_init(&pn54x_dev->irq_enabled_lock); + + /* register as a misc device - character based with one entry point */ + pn54x_dev->pn54x_device.minor = MISC_DYNAMIC_MINOR; + pn54x_dev->pn54x_device.name = CHIP; + pn54x_dev->pn54x_device.fops = &pn54x_dev_fops; + ret = misc_register(&pn54x_dev->pn54x_device); + if (ret) { + pr_err("%s : misc_register failed\n", __FILE__); + goto err_misc_register; + } + + /* request irq. the irq is set whenever the chip has data available + * for reading. it is cleared when all data has been read. + */ + pr_info("%s : requesting IRQ %d\n", __func__, client->irq); + pn54x_dev->irq_enabled = true; + ret = request_irq(client->irq, pn54x_dev_irq_handler, + IRQF_TRIGGER_HIGH, client->name, pn54x_dev); + if (ret) { + dev_err(&client->dev, "request_irq failed\n"); + goto err_request_irq_failed; + } + pn54x_disable_irq(pn54x_dev); + + i2c_set_clientdata(client, pn54x_dev); + + return 0; + +err_request_irq_failed: + misc_deregister(&pn54x_dev->pn54x_device); +err_misc_register: +err_exit: + if (gpio_is_valid(pdata->clkreq_gpio)) + gpio_free(pdata->clkreq_gpio); +err_clkreq: + if (gpio_is_valid(pdata->firm_gpio)) + gpio_free(pdata->firm_gpio); +err_firm: + gpio_free(pdata->ven_gpio); +err_ven: + gpio_free(pdata->irq_gpio); + return ret; +} + +static void pn54x_remove(struct i2c_client *client) +{ + struct pn54x_dev *pn54x_dev; + + pr_info("%s\n", __func__); + + pn54x_dev = i2c_get_clientdata(client); + free_irq(client->irq, pn54x_dev); + misc_deregister(&pn54x_dev->pn54x_device); + mutex_destroy(&pn54x_dev->read_mutex); + gpio_free(pn54x_dev->irq_gpio); + gpio_free(pn54x_dev->ven_gpio); + if (gpio_is_valid(pn54x_dev->firm_gpio)) + gpio_free(pn54x_dev->firm_gpio); + if (gpio_is_valid(pn54x_dev->clkreq_gpio)) + gpio_free(pn54x_dev->clkreq_gpio); + regulator_put(pn54x_dev->pvdd_reg); + regulator_put(pn54x_dev->vbat_reg); + regulator_put(pn54x_dev->pmuvcc_reg); + regulator_put(pn54x_dev->sevdd_reg); + + kfree(pn54x_dev); +} + +/* + * + */ +static struct acpi_device_id pn54x_acpi_match[] = { + { "NXP1001", 0 }, + {}, +}; +MODULE_DEVICE_TABLE(acpi, pn54x_acpi_match); + +static const struct i2c_device_id pn54x_id[] = { + { "pn548", 0 }, + { "pn547", 0 }, + { }, +}; +MODULE_DEVICE_TABLE(i2c, pn54x_id); + +static struct i2c_driver pn54x_driver = { + .id_table = pn54x_id, + .probe = pn54x_probe, + .remove = pn54x_remove, + .driver = { + .owner = THIS_MODULE, + .name = "pn544", + .acpi_match_table = ACPI_PTR(pn54x_acpi_match), + }, +}; + +/* + * module load/unload record keeping + */ + +static int __init pn54x_dev_init(void) +{ + pr_info("%s\n", __func__); + return i2c_add_driver(&pn54x_driver); +} + +static void __exit pn54x_dev_exit(void) +{ + pr_info("%s\n", __func__); + i2c_del_driver(&pn54x_driver); +} + +module_init(pn54x_dev_init); +module_exit(pn54x_dev_exit); + +MODULE_AUTHOR("Sylvain Fonteneau"); +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_LICENSE("GPL"); diff --git a/packages/linux-nfc-lenovo/src/pn5xx_i2c.h b/packages/linux-nfc-lenovo/src/pn5xx_i2c.h new file mode 100644 index 0000000..fce4eda --- /dev/null +++ b/packages/linux-nfc-lenovo/src/pn5xx_i2c.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2010 Trusted Logic S.A. + * modifications copyright (C) 2015 NXP B.V. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define PN544_MAGIC 0xE9 + +/* + * PN544 power control via ioctl + * PN544_SET_PWR(0): power off + * PN544_SET_PWR(1): power on + * PN544_SET_PWR(2): reset and power on with firmware download enabled + */ + +#define PWR_OFF 0 +#define PWR_ON 1 +#define PWR_FW 2 + +#define CLK_OFF 0 +#define CLK_ON 1 + +#define GPIO_UNUSED -1 + +#define PN544_SET_PWR _IOW(PN544_MAGIC, 0x01, unsigned int) +#define PN54X_CLK_REQ _IOW(PN544_MAGIC, 0x02, unsigned int) + +struct pn544_i2c_platform_data { + unsigned int irq_gpio; + unsigned int ven_gpio; + unsigned int firm_gpio; + unsigned int clkreq_gpio; + struct regulator *pvdd_reg; + struct regulator *vbat_reg; + struct regulator *pmuvcc_reg; + struct regulator *sevdd_reg; +}; diff --git a/packages/linux-nfc-lenovo/udev.nix b/packages/linux-nfc-lenovo/udev.nix new file mode 100644 index 0000000..8a58627 --- /dev/null +++ b/packages/linux-nfc-lenovo/udev.nix @@ -0,0 +1,19 @@ +# +# udev rules for Tilt Five devices +# +{ pkgs }: +pkgs.stdenv.mkDerivation rec { + pname = "linux-nfc-lenovo-udev"; + meta.description = "udev rules for Lenovo devices"; + version = "0.0.1"; + + dontBuild = true; + dontConfigure = true; + + src = ./udev; + + installPhase = '' + mkdir -p $out/lib/udev/rules.d + cp $src/60-lenovo-nfc.rules $out/lib/udev/rules.d/60-lenovo-nfc.rules + ''; +} diff --git a/packages/linux-nfc-lenovo/udev/60-lenovo-nfc.rules b/packages/linux-nfc-lenovo/udev/60-lenovo-nfc.rules new file mode 100644 index 0000000..a1600b5 --- /dev/null +++ b/packages/linux-nfc-lenovo/udev/60-lenovo-nfc.rules @@ -0,0 +1 @@ +KERNEL=="pn544", GROUP="plugdev", TAG+="uaccess" diff --git a/packages/navit.nix b/packages/navit.nix new file mode 100644 index 0000000..c8b8248 --- /dev/null +++ b/packages/navit.nix @@ -0,0 +1,95 @@ +# +# GPS navigation suite for cars +# +# vim: et:ts=2:sw=2: +# +{ pkgs, lib, cmake, glib, with_maps ? false, ... }: +pkgs.stdenv.mkDerivation rec { + pname = "navit"; + version = "0.5.6"; + + src = pkgs.fetchFromGitHub { + owner = "navit-gps"; + repo = "navit"; + rev = "v${version}"; + sha256 = "sha256-ugT3AAZNwtf+npeEWs86cQq1engFJVkW5qgWpoGLFMo="; + }; + + # Maps, if included. + map_archive = if with_maps then pkgs.fetchurl { + url = "https://onedrive.live.com/download?resid=AF3B2FBA31DE500C%21161772&authkey=!AA9oOcY1Z0EcnW8"; + sha256 = "sha256-etAVQsseHfK4UTXIomDbPfRrjPtg8WgIdo2ZaOP7SkQ="; + } else ""; + + nativeBuildInputs = with pkgs; [ + cmake + libtool + automake + autoconf + glib + pkg-config + saxon + inkscape + qt5.qmake + qt5.wrapQtAppsHook + ]; + + buildInputs = with pkgs; [ + gettext + glib + gcc + protobuf + protobufc + SDL + SDL_image + cegui + freeglut + quesoglc + freetype + espeak + gpsd + geoclue2 + fontconfig + fribidi + + # GTK + gtk2 + + # Qt + qt5.qtbase + qt5.qtquick1 + qt5.qtquickcontrols + qt5.qtwayland + qt5.qt3d + qt5.qtdeclarative + qt5.qtmultimedia + qt5.qtspeech + + ]; + + + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=Release" + "-DSAMPLE_MAP=n" + "-DGTK2_GDKCONFIG_INCLUDE_DIR=${pkgs.gtk2}/lib/gtk-2.0/include" + "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${pkgs.glib}/lib/glib-2.0/include" + ]; + + # + # Map bundling. + # + + mapHook = '' + mkdir -p $out/share/navit/maps + echo '' >> $out/share/navit/maps/world_map.xml + ''; + + # Create our bundled maps. + postInstall = if with_maps then mapHook else ""; + + meta = { + description = "open source GPS/car-navigation frontend"; + homepage = "https://www.navit-project.org"; + license = pkgs.lib.licenses.gpl2; + }; +} diff --git a/packages/neard.nix b/packages/neard.nix new file mode 100644 index 0000000..00d13aa --- /dev/null +++ b/packages/neard.nix @@ -0,0 +1,95 @@ +{ stdenv +, lib +, autoreconfHook +, autoconf-archive +, pkg-config +, systemd +, glib +, dbus +, libnl +, pcsclite +, python3 +, fetchFromGitHub +, gobject-introspection +, wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "neard"; + version = "git-2024-07-02"; + + outputs = [ "out" "dev" ]; + + src = fetchFromGitHub { + owner = "linux-nfc"; + repo = "neard"; + rev = "a0a7d4d677800a39346f0c89d93d0fe43a95efad"; + hash = "sha256-6BgX7cJwxX+1RX3wU+HY/PIBgzomzOKemnl0SDLJNro="; + }; + + nativeBuildInputs = [ + autoreconfHook + autoconf-archive + pkg-config + python3 + wrapGAppsHook + ]; + + buildInputs = [ + systemd + glib + dbus + libnl + pcsclite + pcsclite.dev + python3 + python3.pkgs.wrapPython + glib + gobject-introspection + ]; + + propagatedBuildInputs = [ + glib + gobject-introspection + ]; + + pythonPath = with python3.pkgs; [ + pygobject3 + dbus-python + glib + gobject-introspection + ]; + + enableParallelBuilding = true; + + configureFlags = [ + "--disable-debug" + "--enable-tools" + "--enable-ese" + "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + ]; + + postInstall = '' + install -m 0755 tools/snep-send $out/bin/ + + install -D -m644 src/main.conf $out/etc/neard/main.conf + + # INFO: the config option "--enable-test" would copy the apps to $out/lib/neard/test/ instead + install -d $out/lib/neard + install -m 0755 test/* $out/bin + + wrapPythonPrograms + mv $out/bin/neard-ui.py $out/bin/neard-ui + ''; + + postFixup = '' + mv $out/bin/.neardutils.py-wrapped $out/bin/neardutils.py + ''; + + meta = with lib; { + description = "Near Field Communication manager"; + homepage = "https://01.org/linux-nfc"; + license = licenses.gpl2Only; + platforms = platforms.unix; + }; +} diff --git a/packages/notion-app/default.nix b/packages/notion-app/default.nix new file mode 100644 index 0000000..ba21aff --- /dev/null +++ b/packages/notion-app/default.nix @@ -0,0 +1,123 @@ +{ + stdenv, + fetchurl, + fetchzip, + electron_31, + _7zz, + asar, + writeScriptBin, + bash, +}: +let + better-sqlite3-version = "11.3.0"; + bufferutil-version = "4.0.8"; + electron-version = "125"; + + notion-app-unwrapped = stdenv.mkDerivation rec { + name = "notion-app-unwrapped"; + version = "3.15.0"; + + src = fetchurl { + url = "https://desktop-release.notion-static.com/Notion-${version}.dmg"; + hash = "sha256-Pdd2/aS2xtZoM9awc0CO4I7wpumJ6OkZZc9kTKZHkE8="; + }; + + betterSqlite3 = fetchzip { + url = "https://github.com/WiseLibs/better-sqlite3/releases/download/v${better-sqlite3-version}/better-sqlite3-v${better-sqlite3-version}-electron-v${electron-version}-linux-x64.tar.gz"; + hash = "sha256-6obP+VIJiRxN3Mmy1+A+k9KkoB8iBbbaDJ+cdznjVig="; + }; + + bufferUtil = fetchzip { + url = "https://github.com/websockets/bufferutil/releases/download/v${bufferutil-version}/v${bufferutil-version}-linux-x64.tar"; + hash = "sha256-uNvLdiXDqtaKYLfCiwcWNTYjPbAvN2mjDlAK7c8WMY0="; + }; + + nativeBuildInputs = [ + _7zz + asar + ]; + + unpackPhase = '' + 7zz x $src || true + ''; + + buildPhase = '' + asar e "Notion/Notion.app/Contents/Resources/app.asar" asar_patched + + # replace the native dependencies with linux versions + cp "$betterSqlite3/Release/better_sqlite3.node" "asar_patched/node_modules/better-sqlite3/build/Release/" + cp "$bufferUtil/node.napi.node" "asar_patched/node_modules/bufferutil/build/Release/bufferutil.node" + + # fully disabling auto updates + sed -i 's/if("darwin"===process.platform){const e=s.systemPreferences?.getUserDefault(E,"boolean"),t=_.Store.getState().app.preferences?.isAutoUpdaterDisabled;return Boolean(e||t)}return!1/return!0/g' "asar_patched/.webpack/main/index.js" + + # fix tray icon and right click menu + mkdir -p asar_patched/.webpack/main + cp ${./notion.png} asar_patched/.webpack/main/trayIcon.png + sed -i 's|this.tray.on("click",(()=>{this.onClick()}))|this.tray.setContextMenu(this.trayMenu),this.tray.on("click",(()=>{this.onClick()}))|g' "asar_patched/.webpack/main/index.js" + sed -i 's|getIcon(){[^}]*}|getIcon(){return s.default.join(__dirname, "trayIcon.png");}|g' "asar_patched/.webpack/main/index.js" + + # avoid running duplicated instances, fixes url opening + sed -i 's|o.app.on("open-url",w.handleOpenUrl)):"win32"===process.platform|o.app.on("open-url",w.handleOpenUrl)):"linux"===process.platform|g' "asar_patched/.webpack/main/index.js" + + # fake the useragent as windows to fix the spellchecker languages selector and other issues + sed -i 's|e.setUserAgent(`''${e.getUserAgent()} WantsServiceWorker`),|e.setUserAgent(`''${e.getUserAgent().replace("Linux", "Windows")} WantsServiceWorker`),|g' "asar_patched/.webpack/main/index.js" + + # re-pack the asar + asar p asar_patched app.asar --unpack "*.node" + ''; + + installPhase = '' + mkdir -p $out/bin + mkdir -p $out/lib/notion-app + + cp -r asar_patched $out/lib/notion-app/app + ''; + }; +in +stdenv.mkDerivation rec { + pname = "notion-app"; + version = notion-app-unwrapped.version; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + src = ./notion.png; + + runScript = writeScriptBin "notion-app" '' + #!${bash}/bin/bash + + # Enable Wayland when appropriate. + [[ $NIXOS_OZONE_WL -eq 1 ]] && WL_ARGS="--enable-features=UseOzonePlatform --ozone-platform=wayland" || WL_ARGS="" + + # Launch + cd ${notion-app-unwrapped}/lib/notion-app/app + exec ${electron_31}/bin/electron . $WL_ARGS "$@" + ''; + + desktopFile = '' + [Desktop Entry] + Version=1.0 + Type=Application + Name=Notion + GenericName=Online Document Editor + Comment=Your connected workspace for wiki, docs & projects + Exec=${placeholder "out"}/bin/notion-app %U + Icon=${src} + Categories=Office; + MimeType=x-scheme-handler/notion; + StartupNotify=false + ''; + + installPhase = '' + mkdir -p $out/bin + mkdir -p $out/share/applications + mkdir -p $out/share/icons/hicolor/256x256/apps + + cp $runScript/bin/notion-app $out/bin/notion-app + cp $src $out/share/icons/hicolor/256x256/apps + + echo "$desktopFile" > $out/share/applications/notion.desktop + ''; +} diff --git a/packages/notion-app/notion.png b/packages/notion-app/notion.png new file mode 100644 index 0000000..fe886ad Binary files /dev/null and b/packages/notion-app/notion.png differ diff --git a/packages/okc-agents.nix b/packages/okc-agents.nix new file mode 100644 index 0000000..275394e --- /dev/null +++ b/packages/okc-agents.nix @@ -0,0 +1,27 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, +}: + +rustPlatform.buildRustPackage rec { + pname = "okc-agents"; + version = "0.1.2"; + + src = fetchFromGitHub { + owner = "DDoSolitary"; + repo = "okc-agents"; + rev = "v${version}"; + hash = "sha256-UFcsnzsoN15xXDY7hVyRjAj6+/ffefu/gcnxSjt6l+E="; + }; + + cargoHash = "sha256-g2GQmi4OBgZoX/qlX+PK5he5UBBKIdHoEAkdd4RhiBI="; + + meta = { + description = ""; + homepage = "https://github.com/DDoSolitary/okc-agents.git"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ]; + mainProgram = "okc-agents"; + }; +} diff --git a/packages/oxfs.nix b/packages/oxfs.nix new file mode 100644 index 0000000..936ea77 --- /dev/null +++ b/packages/oxfs.nix @@ -0,0 +1,25 @@ +# +# oxfs faster sshfs (asynchronous ops) +# +# vim: et:ts=2:sw=2: +# +{ + fetchPypi, + lib, + python3Packages, +}: +python3Packages.buildPythonApplication rec { + pname = "oxfs"; + version = "0.5.5"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-iHtUfrf91vr5UOn5vr6679OsGh5xipgbCeCRxluf9Pc="; + }; + + dependencies = with python3Packages; [ + fusepy + paramiko + xxhash + ]; +} diff --git a/packages/pcsc-relay.nix b/packages/pcsc-relay.nix new file mode 100644 index 0000000..3a94fd6 --- /dev/null +++ b/packages/pcsc-relay.nix @@ -0,0 +1,38 @@ +# +# Smartcard Emulation Tools +# +{ pkgs, autoconf269, autoreconfHook269, autoconf-archive, pkg-config, python3, pcsclite, help2man, qrencode, gengetopt, lib }: +pkgs.stdenv.mkDerivation rec { + pname = "pcsc-relay"; + version = "0.9"; + + src = pkgs.fetchgit { + url = "https://github.com/frankmorgner/vsmartcard"; + rev = "virtualsmartcard-${version}"; + sha256 = "sha256-SBF7i+eVoW4hZOLxp4qhr+iSeGHvXCPHQsc2oYvPXI4="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + python3 + autoconf269 + autoreconfHook269 + pkg-config + help2man + pcsclite + gengetopt + ]; + + buildInputs = [ + ]; + + preAutoreconf = '' + cd ${pname} + ''; + + meta = { + description = "smart card emulation and relay tools"; + homepage = "https://frankmorgner.github.io/vsmartcard/virtualsmartcard"; + license = pkgs.lib.licenses.gpl2; + }; +} diff --git a/packages/pcsclite.nix b/packages/pcsclite.nix new file mode 100644 index 0000000..16173cd --- /dev/null +++ b/packages/pcsclite.nix @@ -0,0 +1,118 @@ +{ stdenv +, lib +, fetchFromGitLab +, autoreconfHook +, autoconf-archive +, flex +, pkg-config +, perl +, python3 +, dbus +, polkit +, systemdLibs +, dbusSupport ? stdenv.isLinux +, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemdLibs +, udevSupport ? dbusSupport +, libusb1 +, IOKit ? null +, testers +, nix-update-script +, pname ? "pcsclite" +, polkitSupport ? false +}: + +assert polkitSupport -> dbusSupport; +assert systemdSupport -> dbusSupport; + +stdenv.mkDerivation (finalAttrs: { + inherit pname; + version = "2.1.0"; + + outputs = [ "out" "lib" "dev" "doc" "man" ]; + + src = fetchFromGitLab { + domain = "salsa.debian.org"; + owner = "rousseau"; + repo = "PCSC"; + rev = "refs/tags/${finalAttrs.version}"; + hash = "sha256-aJKI6pWrZJFmiTxZ9wgCuxKRWRMFVRAkzlo+tSqV8B4="; + }; + + configureFlags = [ + "--enable-confdir=/etc" + # The OS should care on preparing the drivers into this location + "--enable-usbdropdir=/var/lib/pcsc/drivers" + (lib.enableFeature systemdSupport "libsystemd") + (lib.enableFeature polkitSupport "polkit") + "--enable-ipcdir=/run/pcscd" + ] ++ lib.optionals systemdSupport [ + "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + ] ++ lib.optionals (!udevSupport) [ + "--disable-libudev" + ]; + + makeFlags = [ + "POLICY_DIR=$(out)/share/polkit-1/actions" + ]; + + # disable building pcsc-wirecheck{,-gen} when cross compiling + # see also: https://github.com/LudovicRousseau/PCSC/issues/25 + postPatch = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + substituteInPlace src/Makefile.am \ + --replace-fail "noinst_PROGRAMS = testpcsc pcsc-wirecheck pcsc-wirecheck-gen" \ + "noinst_PROGRAMS = testpcsc" + '' + '' + substituteInPlace src/libredirect.c src/spy/libpcscspy.c \ + --replace-fail "libpcsclite_real.so.1" "$lib/lib/libpcsclite_real.so.1" + ''; + + postInstall = '' + # pcsc-spy is a debugging utility and it drags python into the closure + moveToOutput bin/pcsc-spy "$dev" + + # libpcsclite loads its delegate (libpcsclite_real) dynamically. + # To avoid downstream wrapping/patching, we add libpcsclite_real to the lib + # Relevant code: https://salsa.debian.org/rousseau/PCSC/-/blob/773be65d160da07de2fc34616af475e06dbaa343/src/libredirect.c#L128 + patchelf $lib/lib/libpcsclite.so.1 \ + --add-needed libpcsclite_real.so.1 + ''; + + enableParallelBuilding = true; + + nativeBuildInputs = [ + autoreconfHook + autoconf-archive + flex + pkg-config + perl + ]; + + buildInputs = [ python3 ] + ++ lib.optionals systemdSupport [ systemdLibs ] + ++ lib.optionals stdenv.isDarwin [ IOKit ] + ++ lib.optionals dbusSupport [ dbus ] + ++ lib.optionals polkitSupport [ polkit ] + ++ lib.optionals (!udevSupport) [ libusb1 ]; + + passthru = { + tests = { + pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + version = testers.testVersion { + package = finalAttrs.finalPackage; + command = "pcscd --version"; + }; + }; + updateScript = nix-update-script { }; + }; + + meta = { + description = "Middleware to access a smart card using SCard API (PC/SC)"; + homepage = "https://pcsclite.apdu.fr/"; + changelog = "https://salsa.debian.org/rousseau/PCSC/-/blob/${finalAttrs.version}/ChangeLog"; + license = lib.licenses.bsd3; + mainProgram = "pcscd"; + maintainers = [ lib.maintainers.anthonyroussel ]; + pkgConfigModules = [ "libpcsclite" ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/packages/ruby-gems.nix b/packages/ruby-gems.nix new file mode 100644 index 0000000..48727bd --- /dev/null +++ b/packages/ruby-gems.nix @@ -0,0 +1,14 @@ +# +# Colleciton of ruby gems for us to use. +# +{ buildRubyGem, ruby, ... }: +{ + + chronic = buildRubyGem rec { + name = "chronic-${version}"; + inherit ruby; + gemName = "chronic"; + version = "0.10.2"; + source.sha256 = "sha256-dm8vzOasPMFSJJ7Q8rgndw0+UX4uh8X7p+109IidLcM="; + }; +} diff --git a/packages/ryzen-ppd/default.nix b/packages/ryzen-ppd/default.nix new file mode 100644 index 0000000..7dcfd5c --- /dev/null +++ b/packages/ryzen-ppd/default.nix @@ -0,0 +1,47 @@ +{ + lib, + python3, + fetchFromGitHub, + wrapGAppsHook, + ryzenadj +}: + +python3.pkgs.buildPythonApplication rec { + pname = "ryzen-ppd"; + version = "0.4.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xsmile"; + repo = "ryzen-ppd"; + rev = version; + hash = "sha256-ZXQ1lsJ+HPAlttIwWr0ACsUbwIKo1psz1rhxO8S70fw="; + }; + + build-system = [ + python3.pkgs.setuptools + python3.pkgs.wheel + wrapGAppsHook + ]; + + dependencies = with python3.pkgs; [ + dbus-next + pygobject3 + ]; + + pythonImportsCheck = [ + "ryzen_ppd" + ]; + + preFixup = '' + gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${ryzenadj}/lib") + ''; + + meta = { + description = ""; + homepage = "https://github.com/xsmile/ryzen-ppd"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ ]; + mainProgram = "ryzen-ppd"; + }; +} diff --git a/packages/scopehal-apps/default.nix b/packages/scopehal-apps/default.nix new file mode 100644 index 0000000..9000273 --- /dev/null +++ b/packages/scopehal-apps/default.nix @@ -0,0 +1,114 @@ +# +# scopehal apps, including glscopeclient and optionally ngscopeclient +# +# vim: et:ts=2:sw=2: +# +{ deprekages, pkgs, lib, cmake, pkg-config, patchelf, ... }: +pkgs.stdenv.mkDerivation rec { + pname = "scopehal-apps"; + version = "git"; + + # If this is set to true, we'll also install ngscopeclient. + includeUnstableNextGenClient = true; + + src = pkgs.fetchgit { + url = "https://github.com/glscopeclient/scopehal-apps.git"; + rev = "617b6ee1230d19be4b883f676413664c3d7c0d7e"; + sha256 = "sha256-LJo1rcxDBYYngIU3+BiCV41HuQh/Ac/LG4wX9+IvVb8="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + cmake + pkg-config + patchelf + pkgs.git + ]; + + buildInputs = with pkgs; [ + deprekages.ffts + shaderc + deprekages.vulkan-sdk + + # located via cmake module + glfw3 + glew + libyamlcpp + libpng + + # pkg-config + gtkmm3 + pcre + pcre2 + util-linux + libselinux + libsepol + libthai + libdatrie + ]; + + cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]; + + patches = [ + # Fix a format string vulnerability that's preventing us from building with -Werror=format-security. + # Currently necessary due to https://github.com/glscopeclient/scopehal-apps/issues/571. + (pkgs.writeText "fix-format-security.patch" '' + --- scopehal-apps-0.0.1.orig/src/ngscopeclient/Dialog.cpp + +++ scopehal-apps-0.0.1/src/ngscopeclient/Dialog.cpp + @@ -207,7 +207,7 @@ void Dialog::HelpMarker(const string& he + ImGui::PushTextWrapPos(ImGui::GetFontSize() * 50); + ImGui::TextUnformatted(header.c_str()); + for(auto s : bullets) + - ImGui::BulletText(s.c_str()); + + ImGui::BulletText("%s", s.c_str()); + ImGui::PopTextWrapPos(); + ImGui::EndTooltip(); + } + '') + ] + + # If we're configured to, include ngscopeclient; though it's unstable enough that we + # won't create a desktop entry for it, yet. + ++ lib.lists.optional (includeUnstableNextGenClient) (pkgs.writeText "install-ng-client.patch" '' + diff --git a/src/ngscopeclient/CMakeLists.txt b/src/ngscopeclient/CMakeLists.txt + index 79171e0..b340af1 100644 + --- a/src/ngscopeclient/CMakeLists.txt + +++ b/src/ngscopeclient/CMakeLists.txt + @@ -153,3 +153,11 @@ target_link_libraries(ngscopeclient + $${SIGCXX_LIBRARIES} + ) + + + + +install(TARGETS ngscopeclient RUNTIME) + +install(DIRECTORY fonts + + DESTINATION share/ngscopeclient) + +install(DIRECTORY shaders + + DESTINATION share/ngscopeclient) + +install(DIRECTORY icons + + DESTINATION share/ngscopeclient) + ''); + + # scopehal's cmake files expect to find vulkan libraries using the VULKAN_SDK environment variable. + # (The top level's vulkan can be specified with -DVulkan_LIBRARY, but the environment variable is still + # used by the lower layers; which makes it better just to use this, here. + preConfigure = "export VULKAN_SDK=${deprekages.vulkan-sdk}"; + + # Link our e.g. stylesheets into places that Qt is willing to find them. + # TODO: figure out if there's a build define that changes this + postInstall = '' + cp -r $out/share/glscopeclient/* $out/bin/ + cp -r $out/share/ngscopeclient/* $out/bin/ + ''; + + meta = { + description = "test and measurement tool control applications"; + + longDescription = + '' Tools for remote controlling test and measurement tools. + Provides advanced visualization and decoding of output from oscilloscopes and control of various instruments. + ''; + + homepage = "https://www.antikernel.net/temp/glscopeclient-manual.pdf"; + license = pkgs.lib.licenses.bsd3; + }; +} diff --git a/packages/scopehal-apps/ffts.nix b/packages/scopehal-apps/ffts.nix new file mode 100644 index 0000000..7157ec6 --- /dev/null +++ b/packages/scopehal-apps/ffts.nix @@ -0,0 +1,31 @@ +# +# FFTS FFT library +# +# vim: et:ts=2:sw=2: +# +{ pkgs ? import , cmake, ... }: +pkgs.stdenv.mkDerivation rec { + pname = "ffts"; + version = "git"; + + nativeBuildInputs = [ cmake ]; + + src = pkgs.fetchFromGitHub { + owner = "anthonix"; + repo = "ffts"; + rev = "fe86885ecafd0d16eb122f3212403d1d5a86e24e"; + sha256 = "sha256-arBXkEbKGd0y6XpyynUSFQmNs7fndhEK7y1NNZI9MnI="; + }; + + meta = { + description = "fast general-purpose FFT library"; + + longDescription = + '' The 'fastest fourier transform' library in the south. + A FFT library that works almost anywhere. + ''; + + homepage = "https://github.com/anthonix/ffts"; + license = pkgs.lib.licenses.mit; + }; +} diff --git a/packages/scopehal-apps/libsigrok4DSL.nix b/packages/scopehal-apps/libsigrok4DSL.nix new file mode 100644 index 0000000..04dc646 --- /dev/null +++ b/packages/scopehal-apps/libsigrok4DSL.nix @@ -0,0 +1,78 @@ +# +# libsigrok with added DreamSourceLab device support, from DSView +# +# vim: et:ts=2:sw=2: +# +{ lib +, pkgs +, pkg-config +, cmake +, libzip +, boost +, fftw +, libusb1 +, python3 +, fetchpatch +, glib +}: +pkgs.stdenv.mkDerivation rec { + pname = "libsigrok4DSL"; + + version = "1.2.2"; + + src = pkgs.fetchFromGitHub { + owner = "DreamSourceLab"; + repo = "DSView"; + rev = "v${version}"; + sha256 = "sha256-QaCVu/n9PDbAiJgPDVN6SJMILeUO/KRkKcHYAstm86Q="; + }; + + patches = [ + # Build specifically libsigrok4DSL, not the rest of dsview. + ./only_libsigrok.patch + ]; + + nativeBuildInputs = [ cmake pkg-config ]; + + buildInputs = [ + libusb1 + glib + ]; + + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=Release" + ]; + + postInstall = '' + mkdir -p $out/share/pkgconfig + + # Convert our libsigrok to the structure scopehal likes. + mkdir -p $out/include/libsigrok4DSL + cp $out/include/*.h $out/include/libsigrok4DSL/ + + mkdir -p $out/include/log + cp $out/include/xlog.h $out/include/log/ + + # Also generate a pkg-config file. + cat << EOF > $out/share/pkgconfig/libsigrok4DSL.pc + prefix = $out + libdir = $out/lib + includedir = $out/include + + Name: libsigrok4DSL + Description: libsigrok with DreamSourceLab devices + Version: ${version} + + Libs: -L$out/lib -lsigrok4DSL -lglib-2.0 + Cflags: -I$out/include -I${glib.dev}/include/glib-2.0 -I${glib.out}/lib/glib-2.0/include + EOF + ''; + + meta = with lib; + { + description = "sigrok with support for instruments from DreamSourceLab, including logic analyzer, oscilloscope, etc"; + homepage = "https://www.dreamsourcelab.com/"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; +} diff --git a/packages/scopehal-apps/only_libsigrok.patch b/packages/scopehal-apps/only_libsigrok.patch new file mode 100644 index 0000000..c652e89 --- /dev/null +++ b/packages/scopehal-apps/only_libsigrok.patch @@ -0,0 +1,265 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c7e1c4..ef35300 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,24 +21,7 @@ + + cmake_minimum_required(VERSION 2.8.6) + +-project(DSView) +- +-#=============================================================================== +-#= Config Header +-#------------------------------------------------------------------------------- +- +-set(DS_TITLE DSView) +-set(DS_DESCRIPTION "A GUI for instruments of DreamSourceLab") +- +-set(DS_VERSION_MAJOR 1) +-set(DS_VERSION_MINOR 2) +-set(DS_VERSION_MICRO 2) +-set(DS_VERSION_STRING ${DS_VERSION_MAJOR}.${DS_VERSION_MINOR}.${DS_VERSION_MICRO} ) +- +-configure_file ( +- ${PROJECT_SOURCE_DIR}/DSView/config.h.in +- ${PROJECT_BINARY_DIR}/DSView/config.h +-) ++project(sigrok4DSL) + + #=============================================================================== + #=pkg config +@@ -83,7 +66,6 @@ endif() + #= first search path + #------------------------------------------------------------------------------- + include_directories( +- ./DSView + ./libsigrok4DSL + ./libsigrokdecode4DSL + ./common +@@ -95,55 +77,15 @@ include_directories( + pkg_search_module(GLIB glib-2.0) + + if(NOT GLIB_FOUND) +- message(FATAL_ERROR "Please install glib!") ++ message(FATAL_ERROR "Please install glib!") + endif() + + message("----- glib-2.0:") +-message(STATUS " includes:" ${GLIB_INCLUDE_DIRS}) +-message(STATUS " libraries:" ${GLIB_LIBDIR}/libglib-2.0.*) ++message(STATUS " includes:" ${GLIB_INCLUDE_DIRS}) ++message(STATUS " libraries:" ${GLIB_LIBDIR}/libglib-2.0.*) + include_directories(${GLIB_INCLUDE_DIRS}) + link_directories(${GLIB_LIBDIR}) + +-#=============================================================================== +-#= python3 +-#------------------------------------------------------------------------------- +- +-find_package(Python3 COMPONENTS Development QUIET) +- +-if (Python3_FOUND) +- message("----- python3:") +- message(STATUS " includes:" ${Python3_INCLUDE_DIRS}) +- message(STATUS " libraries:" ${Python3_LIBRARIES}) +- include_directories(${Python3_INCLUDE_DIRS}) +- set(PY_LIB ${Python3_LIBRARIES}) +-else() +- find_package(PythonLibs 3 QUIET) +- +- if(PYTHONLIBS_FOUND) +- message("----- python(${PYTHONLIBS_VERSION_STRING}):") +- message(STATUS " includes:" ${PYTHON_INCLUDE_DIRS}) +- message(STATUS " libraries:" ${PYTHON_LIBRARIES}) +- include_directories(${PYTHON_INCLUDE_DIRS}) +- set(PY_LIB ${PYTHON_LIBRARIES}) +- else() +- message(FATAL_ERROR "Please install lib python3!") +- endif() +-endif() +- +-#=============================================================================== +-#= FFTW +-#------------------------------------------------------------------------------- +-find_package(FFTW) +- +-if(NOT FFTW_FOUND) +- message(FATAL_ERROR "Please install lib fftw!") +-endif() +- +-message("----- FFTW:") +-message(STATUS " includes:" ${FFTW_INCLUDE_DIRS}) +-message(STATUS " libraries:" ${FFTW_LIBRARIES}) +-include_directories(${FFTW_INCLUDE_DIRS}) +- + #=============================================================================== + #= libusb-1.0 + #------------------------------------------------------------------------------- +@@ -158,72 +100,6 @@ message(STATUS " includes:" ${LIBUSB_1_INCLUDE_DIRS}) + message(STATUS " libraries:" ${LIBUSB_1_LIBRARIES}) + include_directories(${LIBUSB_1_INCLUDE_DIRS}) + +-#=============================================================================== +-#= zlib +-#------------------------------------------------------------------------------- +-find_package(ZLIB QUIET) +- +-if(NOT ZLIB_FOUND) +- message(FATAL_ERROR "Please install zlib!") +-endif() +- +-message("----- zlib:") +-message(STATUS " includes:" ${ZLIB_INCLUDE_DIRS}) +-message(STATUS " libraries:" ${ZLIB_LIBRARIES}) +-include_directories(${ZLIB_INCLUDE_DIRS}) +- +-#=============================================================================== +-#= Qt5 or Qt6 +-#------------------------------------------------------------------------------- +- +-find_package(Qt5Core QUIET) +- +-if(Qt5Core_FOUND) +- message("----- Qt5:") +- message(STATUS " includes:" ${Qt5Core_INCLUDE_DIRS}) +- find_package(Qt5Widgets REQUIRED) +- find_package(Qt5Gui REQUIRED) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") +- set(QT_INCLUDE_DIRS ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) +- set(QT_LIBRARIES Qt5::Gui Qt5::Widgets) +- add_definitions(${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}) +-else() +- find_package(Qt6Core QUIET) +-endif() +- +-if(Qt6Core_FOUND) +- message("----- Qt6:") +- message(STATUS " includes:" ${Qt6Core_INCLUDE_DIRS}) +- find_package(Qt6Widgets REQUIRED) +- find_package(Qt6Gui REQUIRED) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt6Widgets_EXECUTABLE_COMPILE_FLAGS}") +- set(QT_INCLUDE_DIRS ${Qt6Gui_INCLUDE_DIRS} ${Qt6Widgets_INCLUDE_DIRS}) +- set(QT_LIBRARIES Qt6::Gui Qt6::Widgets) +- add_definitions(${Qt6Gui_DEFINITIONS} ${Qt6Widgets_DEFINITIONS}) +-endif() +- +-if(NOT Qt5Core_FOUND AND NOT Qt6Core_FOUND) +- message(FATAL_ERROR "Please install Qt5 or Qt6!") +-endif() +- +-#=============================================================================== +-#= boost +-#------------------------------------------------------------------------------- +-find_package(Boost 1.42 QUIET) +- +-if(NOT Boost_FOUND) +- message(FATAL_ERROR "Please install boost!") +-endif() +- +-message("----- boost:") +-message(STATUS " includes:" ${Boost_INCLUDE_DIRS}) +-include_directories(${Boost_INCLUDE_DIRS}) +- +-#=============================================================================== +-#= Dependencies +-#------------------------------------------------------------------------------- +- +-find_package(Threads) + + #=============================================================================== + #= DSView sources +@@ -625,86 +501,23 @@ else() + list(APPEND DSVIEW_LINK_LIBS ${PKGDEPS_LIBRARIES}) + endif() + +-add_executable(${PROJECT_NAME} +- ${common_SOURCES} +- ${DSView_SOURCES} +- ${DSView_HEADERS_MOC} +- ${DSView_FORMS_HEADERS} +- ${DSView_RESOURCES_RCC} ++add_library(${PROJECT_NAME} SHARED + ${libsigrok4DSL_SOURCES} +- ${libsigrokdecode4DSL_SOURCES} ++ ${common_SOURCES} + ) + + target_link_libraries(${PROJECT_NAME} ${DSVIEW_LINK_LIBS}) + +-if(WIN32) +-# Pass -mwindows so that no "DOS box" will open when PulseView is started. +-set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-mwindows") +-endif() +- +-if(ENABLE_COTIRE) +- include(cotire) +- cotire(${PROJECT_NAME}) +-endif() ++set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "libsigrok4DSL/libsigrok.h;libsigrok4DSL/proto.h;libsigrok4DSL/version.h;common/log/xlog.h") + + message(STATUS "Output dir: ${CMAKE_CURRENT_SOURCE_DIR}/build.dir") +-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build.dir") + + #=============================================================================== + #= Installation + #------------------------------------------------------------------------------- + +-# Install the executable. +-install(TARGETS ${PROJECT_NAME} DESTINATION bin) +-install(DIRECTORY DSView/res DESTINATION share/DSView) +-install(FILES DSView/icons/logo.svg DESTINATION share/DSView RENAME logo.svg) +-install(FILES DSView/icons/logo.svg DESTINATION share/icons/hicolor/scalable/apps RENAME dsview.svg) +-install(FILES DSView/icons/logo.svg DESTINATION share/pixmaps RENAME dsview.svg) +- +-if(CMAKE_SYSTEM_NAME MATCHES "Linux") +- install(FILES DSView/DSView.desktop DESTINATION /usr/share/applications RENAME dsview.desktop) +- +- if(IS_DIRECTORY /usr/lib/udev/rules.d) +- install(FILES DSView/DreamSourceLab.rules DESTINATION /usr/lib/udev/rules.d RENAME 60-dreamsourcelab.rules) +- elseif(IS_DIRECTORY /lib/udev/rules.d) +- install(FILES DSView/DreamSourceLab.rules DESTINATION /lib/udev/rules.d RENAME 60-dreamsourcelab.rules) +- elseif(IS_DIRECTORY /etc/udev/rules.d) +- install(FILES DSView/DreamSourceLab.rules DESTINATION /etc/udev/rules.d RENAME 60-dreamsourcelab.rules) +- endif() +- +-endif() +- +-install(FILES NEWS25 DESTINATION share/DSView RENAME NEWS25) +-install(FILES NEWS31 DESTINATION share/DSView RENAME NEWS31) +-install(FILES ug25.pdf DESTINATION share/DSView RENAME ug25.pdf) +-install(FILES ug31.pdf DESTINATION share/DSView RENAME ug31.pdf) +- +-install(DIRECTORY libsigrokdecode4DSL/decoders DESTINATION share/libsigrokdecode4DSL) +- +-#=============================================================================== +-#= Packaging (handled by CPack) +-#------------------------------------------------------------------------------- +- +-set(CPACK_PACKAGE_VERSION_MAJOR ${DS_VERSION_MAJOR}) +-set(CPACK_PACKAGE_VERSION_MINOR ${DS_VERSION_MINOR}) +-set(CPACK_PACKAGE_VERSION_PATCH ${DS_VERSION_MICRO}) +-set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/DSView/README) +-set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/DSView/COPYING) +-set(CPACK_SOURCE_IGNORE_FILES ${CMAKE_CURRENT_BINARY_DIR} ".gitignore" ".git") +-set(CPACK_SOURCE_PACKAGE_FILE_NAME +- "${CMAKE_PROJECT_NAME}-${DS_VERSION_MAJOR}.${DS_VERSION_MINOR}.${DS_VERSION_MICRO}") +-set(CPACK_SOURCE_GENERATOR "TGZ") +- +-include(CPack) +- +-#=============================================================================== +-#= Tests +-#------------------------------------------------------------------------------- +- +-if(ENABLE_TESTS) +- add_subdirectory(test) +- enable_testing() +- add_test(test ${CMAKE_CURRENT_BINARY_DIR}/DSView/test/DSView-test) +-endif(ENABLE_TESTS) +- +- ++# Install the library. ++install(TARGETS ${PROJECT_NAME} ++ LIBRARY DESTINATION lib ++ PUBLIC_HEADER DESTINATION include ++) diff --git a/packages/scopehal-apps/sigrok-bridge.nix b/packages/scopehal-apps/sigrok-bridge.nix new file mode 100644 index 0000000..85bbff8 --- /dev/null +++ b/packages/scopehal-apps/sigrok-bridge.nix @@ -0,0 +1,59 @@ +# +# scopehal apps, including glscopeclient and optionally ngscopeclient +# +# vim: et:ts=2:sw=2: +# +{ deprekages, pkgs, lib, cmake, pkg-config, glib, ... }: +pkgs.stdenv.mkDerivation rec { + pname = "scopehal-sigrok-bridge"; + version = "git"; + + src = pkgs.fetchgit { + url = "https://github.com/glscopeclient/scopehal-sigrok-bridge.git"; + rev = "cdd4d31e8c362561592b7551617d681a2ffd1c05"; + sha256 = "sha256-9dz5poVUSyDMCQ3BwJsAerVudPuxpEGfK1clPqeoqGc="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + cmake + pkg-config + pkgs.git + ]; + + buildInputs = with pkgs; [ + libusb1 + glib + glib.dev + deprekages.libsigrok4DSL + ]; + + cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]; + + # Currently, this fails to build because it's passing __PRETTY_FUNCTION__ to printf. + # __PRETTY_FUNCTION__ resolves to a function, rather than a string, which triggers -Wformat-security. + # We know we control that, so we'll just disable the error. + patches = [ + # Build specifically libsigrok4DSL, not the rest of dsview. + ./sigrok-bridge_noformat.patch + ]; + + # This cmake recipe has no install step; so we'll just splork it in place. + installPhase = '' + mkdir -p $out/bin + cp scopehal-sigrok-bridge $out/bin/ + ''; + + + meta = { + description = "bridge from libsigrok (with DreamSourceLabs devices) to libscopehal/glscopeclient"; + + longDescription = + '' Bridge that allows glscopeclient -- or other libscopehal apps -- to access devices provided by libsigrok. + Can be connected to using the _twinlan_ endpoint. + ''; + + homepage = "https://www.antikernel.net/temp/glscopeclient-manual.pdf"; + license = pkgs.lib.licenses.bsd3; + }; +} diff --git a/packages/scopehal-apps/sigrok-bridge_noformat.patch b/packages/scopehal-apps/sigrok-bridge_noformat.patch new file mode 100644 index 0000000..b0fbec3 --- /dev/null +++ b/packages/scopehal-apps/sigrok-bridge_noformat.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 49bf30f..8bc00f1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.3) + project(scopehal-sigrok-bridge) + + set(WARNINGS "-Wall -Wextra -Wuninitialized ") +-set(WARNINGS "${WARNINGS} -Wshadow -Wunsafe-loop-optimizations -Wpedantic -Wcast-align -Wwrite-strings") ++set(WARNINGS "${WARNINGS} -Wshadow -Wunsafe-loop-optimizations -Wpedantic -Wcast-align -Wwrite-strings -Wno-error=format-security") + set(WARNINGS "${WARNINGS} -Wvla") + set(CMAKE_CXX_FLAGS "-g -fopenmp ${WARNINGS} --std=c++17 -mtune=native -ffast-math") + set(CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/packages/scopehal-apps/vulkan-sdk.nix b/packages/scopehal-apps/vulkan-sdk.nix new file mode 100644 index 0000000..47e7db0 --- /dev/null +++ b/packages/scopehal-apps/vulkan-sdk.nix @@ -0,0 +1,30 @@ +# +# Vulkan SDK for Linux +# +# vim: et:ts=2:sw=2: +# +{ pkgs ? import , lib, stdenv, ... }: +pkgs.stdenv.mkDerivation rec { + pname = "vulkan-sdk"; + version = "1.3.224.1"; + + src = pkgs.fetchzip { + url = "https://sdk.lunarg.com/sdk/download/${version}/linux/vulkansdk-linux-x86_64-${version}.tar.gz"; + sha256 = "sha256-XsMXXk+h3B/y8sITXlchYUHFbCBiPx16BIWn9rQVMDo="; + }; + + # We only need to copy the SDK into place. + dontBuild = true; + dontConfigure = true; + + # Select only the target architecture for this machine. + installPhase = '' + cp -r ${src}/${stdenv.targetPlatform.linuxArch} $out + ''; + + meta = { + description = "Vulkan SDK for Linux"; + homepage = "https://www.lunarg.com/vulkan-sdk/"; + license = lib.licenses.mit; + }; +} diff --git a/packages/t5-udev-rules/default.nix b/packages/t5-udev-rules/default.nix new file mode 100644 index 0000000..f7b2016 --- /dev/null +++ b/packages/t5-udev-rules/default.nix @@ -0,0 +1,20 @@ +# +# udev rules for Tilt Five devices +# +{ pkgs }: +pkgs.stdenv.mkDerivation rec { + pname = "t5-udev-rules"; + meta.description = "udev rules for t5 devices"; + + version = "0.1.1"; + + dontBuild = true; + dontConfigure = true; + + src = ./.; + + installPhase = '' + mkdir -p $out/lib/udev/rules.d + cp $src/tiltfive-dev.rules $out/lib/udev/rules.d/99_TiltFive.rules + ''; +} diff --git a/packages/t5-udev-rules/tiltfive-dev.rules b/packages/t5-udev-rules/tiltfive-dev.rules new file mode 100644 index 0000000..3017296 --- /dev/null +++ b/packages/t5-udev-rules/tiltfive-dev.rules @@ -0,0 +1,17 @@ +# Tilt Five glasses +SUBSYSTEMS=="usb", ATTRS{idVendor}=="32f8", ATTRS{idProduct}=="9200", GROUP="tiltfive" + +# Tilt Five glasses (wrong speed) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="32f8", ATTRS{idProduct}=="2510", GROUP="tiltfive" + +# Tilt Five glasses bootloader +SUBSYSTEMS=="usb", ATTRS{idVendor}=="32f8", ATTRS{idProduct}=="424c", GROUP="tiltfive" + +# Tilt Five Bootloader Updater (blupdate) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="32f8", ATTRS{idProduct}=="f001", GROUP="plugdev" + +# Intel Movidius bootloader +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03e7", ATTRS{idProduct}=="2485", GROUP="plugdev" + +# Olimex ARM-USB-TINY-H +SUBSYSTEMS=="usb", ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", GROUP="plugdev" diff --git a/packages/todoist-electron.nix b/packages/todoist-electron.nix new file mode 100644 index 0000000..53e3946 --- /dev/null +++ b/packages/todoist-electron.nix @@ -0,0 +1,46 @@ +# +# Todoist app. +# +# vim: et:ts=2:sw=2: +{ lib, appimageTools, fetchurl, asar }: let + pname = "todoist-electron"; + version = "9.4.0"; + + src = fetchurl { + url = "https://electron-dl.todoist.net/linux/Todoist-linux-${version}-x86_64.AppImage"; + hash = "sha256-tZVn8PLjGz3i3IHvoxr8vgtwCG2wShmXhj9I/+8j/M4="; + }; + + appimageContents = (appimageTools.extract { inherit pname version src; }).overrideAttrs (oA: { + buildCommand = '' + ${oA.buildCommand} + + # Get rid of the autoupdater + ${asar}/bin/asar extract $out/resources/app.asar app + sed -i 's/async isUpdateAvailable.*/async isUpdateAvailable(updateInfo) { return false;/g' app/node_modules/electron-updater/out/AppUpdater.js + ${asar}/bin/asar pack app $out/resources/app.asar + ''; + }); + +in appimageTools.wrapAppImage { + inherit pname version; + src = appimageContents; + + extraPkgs = { pkgs, ... }@args: [ + pkgs.hidapi + ] ++ appimageTools.defaultFhsEnvArgs.multiPkgs args; + + extraInstallCommands = '' + # Add desktop convencience stuff + install -Dm444 ${appimageContents}/todoist.desktop -t $out/share/applications + install -Dm444 ${appimageContents}/todoist.png -t $out/share/pixmaps + substituteInPlace $out/share/applications/todoist.desktop \ + --replace 'Exec=AppRun' "Exec=$out/bin/${pname} --ozone-platform-hint=auto --" + ''; + + meta = with lib; { + homepage = "https://todoist.com"; + description = "The official Todoist electron app"; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/packages/vsmartcard.nix b/packages/vsmartcard.nix new file mode 100644 index 0000000..f01a369 --- /dev/null +++ b/packages/vsmartcard.nix @@ -0,0 +1,43 @@ +# +# Smartcard Emulation Tools +# +{ pkgs, autoconf264, autoreconfHook264, autoconf-archive, pkg-config, python3, pcsclite, libusb1, help2man, qrencode }: +pkgs.stdenv.mkDerivation rec { + pname = "vsmartcard"; + version = "0.9"; + + src = pkgs.fetchFromGitHub { + owner = "frankmorgner"; + repo = pname; + rev = "virtualsmartcard-${version}"; + sha256 = "sha256-ohvdC8Pz/HN2kfq8wVpB9EW6kkBCRCh0wvcgwMjHWcQ="; + }; + + nativeBuildInputs = [ + autoconf264 + autoreconfHook264 + pkg-config + help2man + ]; + + buildInputs = [ + python3 + pcsclite + libusb1 + qrencode + ]; + + propagatedBuildInputs = [ + python3.pkgs.pycryptodome + ]; + + preAutoreconf = '' + cd virtualsmartcard + ''; + + meta = { + description = "smart card emulation and relay tools"; + homepage = "https://frankmorgner.github.io/vsmartcard/virtualsmartcard"; + license = pkgs.lib.licenses.gpl2; + }; +} diff --git a/packages/weechat-discord/Cargo.lock b/packages/weechat-discord/Cargo.lock new file mode 100644 index 0000000..46c5353 --- /dev/null +++ b/packages/weechat-discord/Cargo.lock @@ -0,0 +1,2302 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "autocfg" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +dependencies = [ + "byteorder", +] + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + +[[package]] +name = "bindgen" +version = "0.55.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b13ce559e6433d360c26305643803cb52cfbabbc2b9c47ce04a58493dfb443" +dependencies = [ + "bitflags", + "cexpr", + "cfg-if 0.1.10", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "either", + "iovec", +] + +[[package]] +name = "cc" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cexpr" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "serde", + "time", + "wasm-bindgen", + "winapi 0.3.9", +] + +[[package]] +name = "clang-sys" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" +dependencies = [ + "glob", + "libc", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "cookie" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" +dependencies = [ + "time", + "url 1.7.2", +] + +[[package]] +name = "cookie_store" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" +dependencies = [ + "cookie", + "failure", + "idna 0.1.5", + "log", + "publicsuffix", + "serde", + "serde_json", + "time", + "try_from", + "url 1.7.2", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg 1.1.0", + "cfg-if 0.1.10", + "crossbeam-utils", + "lazy_static", + "maybe-uninit", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +dependencies = [ + "cfg-if 0.1.10", + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg 1.1.0", + "cfg-if 0.1.10", + "lazy_static", +] + +[[package]] +name = "ct-logs" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113" +dependencies = [ + "sct", +] + +[[package]] +name = "cxx" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b61a7545f753a88bcbe0a70de1fcc0221e10bfc752f576754fa91e663db1622e" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f464457d494b5ed6905c63b0c4704842aba319084a0a3561cdc1359536b53200" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43c7119ce3a3701ed81aca8410b9acf6fc399d2629d057b87e2efa4e63a3aaea" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65e07508b90551e610910fa648a1878991d367064997a596135b86df30daf07e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "dirs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" +dependencies = [ + "cfg-if 0.1.10", + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + +[[package]] +name = "dtoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "flate2" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "flexi_logger" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab94b6ac8eb69f1496a6993f26f785b5fd6d99b7416023eb2a6175c0b242b1" +dependencies = [ + "atty", + "chrono", + "glob", + "lazy_static", + "log", + "regex", + "thiserror", + "yansi", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding 2.2.0", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +dependencies = [ + "futures", + "num_cpus", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "h2" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +dependencies = [ + "byteorder", + "bytes", + "fnv", + "futures", + "http", + "indexmap", + "log", + "slab", + "string", + "tokio-io", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "http" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +dependencies = [ + "bytes", + "fnv", + "itoa 0.4.8", +] + +[[package]] +name = "http-body" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +dependencies = [ + "bytes", + "futures", + "http", + "tokio-buf", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "hyper" +version = "0.12.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" +dependencies = [ + "bytes", + "futures", + "futures-cpupool", + "h2", + "http", + "http-body", + "httparse", + "iovec", + "itoa 0.4.8", + "log", + "net2", + "rustc_version", + "time", + "tokio", + "tokio-buf", + "tokio-executor", + "tokio-io", + "tokio-reactor", + "tokio-tcp", + "tokio-threadpool", + "tokio-timer", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719d85c7df4a7f309a77d145340a063ea929dcb2e025bae46a80345cffec2952" +dependencies = [ + "bytes", + "ct-logs", + "futures", + "hyper", + "rustls", + "tokio-io", + "tokio-rustls", + "webpki", + "webpki-roots", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi 0.3.9", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg 1.1.0", + "hashbrown", +] + +[[package]] +name = "input_buffer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1b822cc844905551931d6f81608ed5f50a79c1078a4e2b4d42dbc7c1eedfbf" +dependencies = [ + "bytes", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" + +[[package]] +name = "jobserver" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "json" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" + +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + +[[package]] +name = "lock_api" +version = "0.3.1" +source = "git+https://github.com/terminal-discord/parking_lot?rev=046a171#046a17142065ea47e2ae8073ba1fd55a4ce9efdd" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "net2" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "nom" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +dependencies = [ + "memchr", + "version_check", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg 1.1.0", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "object" +version = "0.30.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" + +[[package]] +name = "onig" +version = "4.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8518fcb2b1b8c2f45f0ad499df4fda6087fc3475ca69a185c173b8315d2fb383" +dependencies = [ + "bitflags", + "lazy_static", + "libc", + "onig_sys", +] + +[[package]] +name = "onig_sys" +version = "69.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388410bf5fa341f10e58e6db3975f4bea1ac30247dd79d37a9e5ced3cb4cc3b0" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +dependencies = [ + "lock_api 0.3.4", + "parking_lot_core 0.6.3", + "rustc_version", +] + +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "git+https://github.com/terminal-discord/parking_lot?rev=046a171#046a17142065ea47e2ae8073ba1fd55a4ce9efdd" +dependencies = [ + "autocfg 0.1.8", + "lock_api 0.3.1", + "parking_lot_core 0.6.2", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.2" +source = "git+https://github.com/terminal-discord/parking_lot?rev=046a171#046a17142065ea47e2ae8073ba1fd55a4ce9efdd" +dependencies = [ + "autocfg 0.1.8", + "cfg-if 0.1.10", + "cloudabi", + "libc", + "redox_syscall 0.1.57", + "smallvec 1.10.0", + "winapi 0.3.9", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66b810a62be75176a80873726630147a5ca780cd33921e0b5709033e66b0a" +dependencies = [ + "cfg-if 0.1.10", + "cloudabi", + "libc", + "redox_syscall 0.1.57", + "rustc_version", + "smallvec 0.6.14", + "winapi 0.3.9", +] + +[[package]] +name = "parsing" +version = "0.1.0" +dependencies = [ + "lazy_static", + "simple_ast", +] + +[[package]] +name = "pcre2" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b30f2f69903b439dd9dc9e824119b82a55bf113b29af8d70948a03c1b11ab1" +dependencies = [ + "libc", + "log", + "pcre2-sys", + "thread_local", +] + +[[package]] +name = "pcre2-sys" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec30e5e9ec37eb8fbf1dea5989bc957fd3df56fbee5061aa7b7a99dbb37b722" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "publicsuffix" +version = "1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b4ce31ff0a27d93c8de1849cf58162283752f065a90d508f1105fa6c9a213f" +dependencies = [ + "idna 0.2.3", + "url 2.3.1", +] + +[[package]] +name = "quote" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.8", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift", + "winapi 0.3.9", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.8", + "rand_core 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi 0.3.9", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi 0.3.9", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.8", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.8", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "reqwest" +version = "0.9.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" +dependencies = [ + "base64 0.10.1", + "bytes", + "cookie", + "cookie_store", + "encoding_rs", + "flate2", + "futures", + "http", + "hyper", + "hyper-rustls", + "log", + "mime", + "mime_guess", + "rustls", + "serde", + "serde_json", + "serde_urlencoded", + "time", + "tokio", + "tokio-executor", + "tokio-io", + "tokio-rustls", + "tokio-threadpool", + "tokio-timer", + "url 1.7.2", + "uuid", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi 0.3.9", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" +dependencies = [ + "base64 0.10.1", + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" + +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +dependencies = [ + "itoa 1.0.5", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" +dependencies = [ + "dtoa", + "itoa 0.4.8", + "serde", + "url 1.7.2", +] + +[[package]] +name = "serenity" +version = "0.7.0" +source = "git+https://github.com/terminal-discord/serenity?rev=c4ae4c61#c4ae4c61ace1c37c4cb6e5041389fc4a10f4d27b" +dependencies = [ + "base64 0.10.1", + "bitflags", + "chrono", + "flate2", + "log", + "parking_lot 0.9.0 (git+https://github.com/terminal-discord/parking_lot?rev=046a171)", + "reqwest", + "rustls", + "serde", + "serde_json", + "threadpool", + "tungstenite", + "typemap", + "url 2.3.1", + "webpki", + "webpki-roots", +] + +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +dependencies = [ + "block-buffer", + "digest", + "fake-simd", + "opaque-debug", +] + +[[package]] +name = "shlex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" + +[[package]] +name = "simple_ast" +version = "0.1.0" +source = "git+https://github.com/Noskcaj19/simple-ast?rev=7b9d765#7b9d765376c8adcc11384bb5cd64a61dd74b1513" +dependencies = [ + "lazy_static", + "onig", + "pcre2", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "smallvec" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" +dependencies = [ + "maybe-uninit", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "string" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" +dependencies = [ + "bytes", +] + +[[package]] +name = "syn" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +dependencies = [ + "bytes", + "futures", + "mio", + "num_cpus", + "tokio-current-thread", + "tokio-executor", + "tokio-io", + "tokio-reactor", + "tokio-tcp", + "tokio-threadpool", + "tokio-timer", +] + +[[package]] +name = "tokio-buf" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" +dependencies = [ + "bytes", + "either", + "futures", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" +dependencies = [ + "futures", + "tokio-executor", +] + +[[package]] +name = "tokio-executor" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +dependencies = [ + "crossbeam-utils", + "futures", +] + +[[package]] +name = "tokio-io" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +dependencies = [ + "bytes", + "futures", + "log", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" +dependencies = [ + "crossbeam-utils", + "futures", + "lazy_static", + "log", + "mio", + "num_cpus", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab", + "tokio-executor", + "tokio-io", + "tokio-sync", +] + +[[package]] +name = "tokio-rustls" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7cf08f990090abd6c6a73cab46fed62f85e8aef8b99e4b918a9f4a637f0676" +dependencies = [ + "bytes", + "futures", + "iovec", + "rustls", + "tokio-io", + "webpki", +] + +[[package]] +name = "tokio-sync" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +dependencies = [ + "fnv", + "futures", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" +dependencies = [ + "bytes", + "futures", + "iovec", + "mio", + "tokio-io", + "tokio-reactor", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +dependencies = [ + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", + "futures", + "lazy_static", + "log", + "num_cpus", + "slab", + "tokio-executor", +] + +[[package]] +name = "tokio-timer" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +dependencies = [ + "crossbeam-utils", + "futures", + "slab", + "tokio-executor", +] + +[[package]] +name = "traitobject" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "try_from" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" +dependencies = [ + "cfg-if 0.1.10", +] + +[[package]] +name = "tungstenite" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0c2bd5aeb7dcd2bb32e472c8872759308495e5eccc942e929a513cd8d36110" +dependencies = [ + "base64 0.11.0", + "byteorder", + "bytes", + "http", + "httparse", + "input_buffer", + "log", + "rand 0.7.3", + "sha-1", + "url 2.3.1", + "utf-8", +] + +[[package]] +name = "typemap" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" +dependencies = [ + "unsafe-any", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "unsafe-any" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" +dependencies = [ + "traitobject", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +dependencies = [ + "idna 0.1.5", + "matches", + "percent-encoding 1.0.1", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna 0.3.0", + "percent-encoding 2.2.0", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "uuid" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" +dependencies = [ + "rand 0.6.5", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +dependencies = [ + "futures", + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" +dependencies = [ + "webpki", +] + +[[package]] +name = "weechat" +version = "0.1.0" +source = "git+https://github.com/terminal-discord/rust-weechat?rev=d49cdd0#d49cdd068ee9ce59f4029c55b15c647616211d4a" +dependencies = [ + "chrono", + "libc", + "weechat-macro", + "weechat-sys", +] + +[[package]] +name = "weechat-discord" +version = "0.2.0" +dependencies = [ + "crossbeam-channel", + "dirs", + "flexi_logger", + "indexmap", + "json", + "lazy_static", + "libc", + "parking_lot 0.9.0 (git+https://github.com/terminal-discord/parking_lot?rev=046a171)", + "parsing", + "regex", + "serenity", + "weechat", + "weechat-sys", +] + +[[package]] +name = "weechat-macro" +version = "0.1.0" +source = "git+https://github.com/terminal-discord/rust-weechat?rev=d49cdd0#d49cdd068ee9ce59f4029c55b15c647616211d4a" +dependencies = [ + "libc", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "weechat-sys" +version = "0.1.0" +source = "git+https://github.com/terminal-discord/rust-weechat?rev=d49cdd0#d49cdd068ee9ce59f4029c55b15c647616211d4a" +dependencies = [ + "bindgen", + "libc", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff --git a/packages/weechat-discord/default.nix b/packages/weechat-discord/default.nix new file mode 100644 index 0000000..106aaee --- /dev/null +++ b/packages/weechat-discord/default.nix @@ -0,0 +1,25 @@ +# +# Argos standalone MPD client. +# +# vim: et:ts=2:sw=2: +{ + lib, + rustPlatform, + fetchFromGitHub, + ... +}: +rustPlatform.buildRustPackage rec { + pname = "weechat-discord"; + version = "2023-01-22"; + + src = fetchFromGitHub { + owner = "terminal-discord"; + repo = "weechat-discord"; + rev = "b035b20a34abacb1e9dcd6e767f31f81c6cb2322"; + hash = lib.fakeHash; + }; + + cargoHash = lib.fakeHash; + + pluginFile = "$out/lib/weechat/plugins/${pname}.so"; +} diff --git a/packages/ws-server.nix b/packages/ws-server.nix new file mode 100644 index 0000000..024bf54 --- /dev/null +++ b/packages/ws-server.nix @@ -0,0 +1,39 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +}: + +stdenv.mkDerivation rec { + pname = "ws-server"; + version = "unstable-2024-08-12"; + + src = fetchFromGitHub { + owner = "Theldus"; + repo = "wsServer"; + rev = "476a67448c05ba2057bae43eaa6e704f8b2d6625"; + hash = "sha256-irPEv40uTmQPQ09ITFoUzl44BeWOCVnsHPioE4Zt6SE="; + }; + + patches = [ + ]; + + + # Let their makefile run cmake, since the install defs are in make. + dontConfigure = true; + nativeBuildInputs = [ + cmake + ]; + + # Prod things into the proper path. + PREFIX = placeholder "out"; + + meta = with lib; { + description = "WsServer - a tiny WebSocket server library written in C"; + homepage = "https://github.com/Theldus/wsServer"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ ]; + mainProgram = "ws-server"; + platforms = platforms.all; + }; +} diff --git a/packages/ws-server/00-be-quiet.patch b/packages/ws-server/00-be-quiet.patch new file mode 100644 index 0000000..a889853 --- /dev/null +++ b/packages/ws-server/00-be-quiet.patch @@ -0,0 +1,12 @@ +diff --git a/src/ws.c b/src/ws.c +index 0916d9b..69b9058 100644 +--- a/src/ws.c ++++ b/src/ws.c +@@ -1698,7 +1698,6 @@ int ws_socket(struct ws_events *evs, uint16_t port, int thread_loop, + listen(*sock, MAX_CLIENTS); + + /* Wait for incoming connections. */ +- printf("Waiting for incoming connections...\n"); + memset(client_socks, -1, sizeof(client_socks)); + + /* Accept connections. */ diff --git a/packages/ws-server/default.nix b/packages/ws-server/default.nix new file mode 100644 index 0000000..41bbce5 --- /dev/null +++ b/packages/ws-server/default.nix @@ -0,0 +1,41 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +}: + +stdenv.mkDerivation rec { + pname = "ws-server"; + version = "unstable-2024-08-12"; + + src = fetchFromGitHub { + owner = "Theldus"; + repo = "wsServer"; + rev = "476a67448c05ba2057bae43eaa6e704f8b2d6625"; + hash = "sha256-irPEv40uTmQPQ09ITFoUzl44BeWOCVnsHPioE4Zt6SE="; + }; + + # If we don't silence this program, it prints to stdout, which in turn + # makes Firefox plugins using it angry. + patches = [ + ./00-be-quiet.patch + ]; + + # Let their makefile run cmake, since the install defs are in make. + dontConfigure = true; + nativeBuildInputs = [ + cmake + ]; + + # Prod things into the proper path. + PREFIX = placeholder "out"; + + meta = with lib; { + description = "WsServer - a tiny WebSocket server library written in C"; + homepage = "https://github.com/Theldus/wsServer"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ ]; + mainProgram = "ws-server"; + platforms = platforms.all; + }; +} diff --git a/packages/xonsh-python-package.nix b/packages/xonsh-python-package.nix new file mode 100644 index 0000000..15a5592 --- /dev/null +++ b/packages/xonsh-python-package.nix @@ -0,0 +1,28 @@ +# +# Xonsh, but as a python package. +# +# vim: et:ts=2:sw=2: +# +{ + fetchFromGitHub, + python3Packages, + xonsh +}: +python3Packages.buildPythonPackage rec { + pname = "xonsh"; + version = xonsh.version; + format = "pyproject"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-ZrPKKa/vl06QAjGr16ZzKF/DAByFHr6ze2WVOCa+wf8="; + }; + + nativeBuildInputs = with python3Packages; [ + setuptools + wheel + ]; +} + diff --git a/packages/xontrib-sh.nix b/packages/xontrib-sh.nix new file mode 100644 index 0000000..32e744e --- /dev/null +++ b/packages/xontrib-sh.nix @@ -0,0 +1,34 @@ +# +# Sh xontrib for Xonsh. +# +# vim: et:ts=2:sw=2: +# +{ + lib, + callPackage, + fetchPypi, + python3Packages, + xonsh +}: +let + + # Create a version of xonsh as a python package, + # matching the version installed on the syste, + xonsh-python = callPackage ./xonsh-python-package.nix { inherit xonsh; }; + +in python3Packages.buildPythonPackage rec { + pname = "xontrib_sh"; + version = "0.3.1"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-qIr/VKCdcSBrtz/4ttpxV2i/4D9t3hw1D0AuzGA9DMk="; + }; + + nativeBuildInputs = with python3Packages; [ + setuptools + wheel + ]; + + buildInputs = [ xonsh-python ]; +} diff --git a/packages/xontrib-term-integrations.nix b/packages/xontrib-term-integrations.nix new file mode 100644 index 0000000..a958c19 --- /dev/null +++ b/packages/xontrib-term-integrations.nix @@ -0,0 +1,37 @@ +# +# oxfs faster sshfs (asynchronous ops) +# +# vim: et:ts=2:sw=2: +# +{ + callPackage, + fetchPypi, + python3Packages, + xonsh +}: +let + + # Create a version of xonsh as a python package, + # matching the version installed on the syste, + xonsh-python = callPackage ./xonsh-python-package.nix { inherit xonsh; }; + +in python3Packages.buildPythonPackage rec { + pname = "xontrib-term-integrations"; + version = "0.2.0"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-ofxOtNGPNWiuUBtiLgARLqInKdkH4Ui8oSAROmSv6GA="; + }; + + nativeBuildInputs = with python3Packages; [ + setuptools + wheel + ]; + + buildInputs = with python3Packages; [ + xonsh-python + pdm-pep517 + ]; +} diff --git a/packages/xontrib-whole-word-jumping.nix b/packages/xontrib-whole-word-jumping.nix new file mode 100644 index 0000000..024ecdd --- /dev/null +++ b/packages/xontrib-whole-word-jumping.nix @@ -0,0 +1,33 @@ +# +# oxfs faster sshfs (asynchronous ops) +# +# vim: et:ts=2:sw=2: +# +{ + callPackage, + fetchPypi, + python3Packages, + xonsh +}: +let + xonsh-python = callPackage ./xonsh-python-package.nix { inherit xonsh; }; +in python3Packages.buildPythonPackage rec { + pname = "xontrib-whole-word-jumping"; + version = "0.0.1"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-lILsJxptxmAJ3EVruPmq85re57YOmtUfYRltvo3VerI="; + }; + + nativeBuildInputs = with python3Packages; [ + setuptools + wheel + ]; + + buildInputs = with python3Packages; [ + prompt-toolkit + xonsh-python + ]; +} diff --git a/packages/xwayland-satellite.nix b/packages/xwayland-satellite.nix new file mode 100644 index 0000000..120a7df --- /dev/null +++ b/packages/xwayland-satellite.nix @@ -0,0 +1,59 @@ +# +# Wayland-satellite Xwayland implementation. +# +# vim: et:ts=2:sw=2: +{ + lib, + libclang, + stdenv, + llvmPackages, + rustPlatform, + xcb-util-cursor, + xorg, + fetchFromGitHub, +}: +let + owner = "Supreeeme"; +in +rustPlatform.buildRustPackage rec { + pname = "xwayland-satellite"; + version = "0.2"; + + src = fetchFromGitHub { + owner = owner; + repo = pname; + rev = "v${version}"; + hash = "sha256-jeveB4SWPWYuPLi6Dvd3Lyu3obMYcZZmdo356ujp8rA="; + }; + + cargoHash = "sha256-X+4VGmpnwEgTLCvNUF0Kc7CP53tSZteJjr2zolSDfjA="; + + buildInputs = [ + libclang + llvmPackages.clang-unwrapped + xorg.libxcb + xcb-util-cursor + ]; + + doCheck = false; + buildType = "debug"; + + # Ensure that the -sys packages can find libclang. + LIBCLANG_PATH = "${llvmPackages.clang-unwrapped.lib}/lib"; + + # Ensure that bindgen can find our headers. + BINDGEN_EXTRA_CLANG_ARGS = builtins.concatStringsSep " " [ + "-I${xcb-util-cursor.dev}/include" + "-I${xorg.libxcb.dev}/include" + "-I${stdenv.cc.libc_dev}/include" + "-I${libclang.lib}/lib/clang/17/include/" + ]; + + meta = with lib; { + description = "XWayland without Wayland"; + mainProgram = pname; + homepage = "https://github.com/${owner}/${pname}"; + license = with licenses; [ mpl20 ]; + #maintainers = with maintainers; [ deprekages ]; + }; +} diff --git a/packages/ykush-udev-rules/default.nix b/packages/ykush-udev-rules/default.nix new file mode 100644 index 0000000..0909722 --- /dev/null +++ b/packages/ykush-udev-rules/default.nix @@ -0,0 +1,18 @@ +# +# udev rules for YKUSH hubs +# +{ pkgs }: +pkgs.stdenv.mkDerivation rec { + pname = "ykush-udev-rules"; + meta.description = "udev rules for YepKit USB hubs"; + version = "0.1.1"; + + dontBuild = true; + dontConfigure = true; + + src = ./.; + + installPhase = '' mkdir -p $out/lib/udev/rules.d + cp $src/ykush.rules $out/lib/udev/rules.d/99_ykush.rules + ''; +} diff --git a/packages/ykush-udev-rules/ykush.rules b/packages/ykush-udev-rules/ykush.rules new file mode 100644 index 0000000..8314833 --- /dev/null +++ b/packages/ykush-udev-rules/ykush.rules @@ -0,0 +1 @@ +SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f11b", GROUP="users" diff --git a/packages/ykush.nix b/packages/ykush.nix new file mode 100644 index 0000000..8a5832f --- /dev/null +++ b/packages/ykush.nix @@ -0,0 +1,35 @@ +# +# YKUSH USB hub utility +# +{ stdenv, lib, libusb1, gcc, fetchurl, ... }: +stdenv.mkDerivation { + pname = "ykushcmd"; + version = "1.3.0"; + + buildInputs = [ + libusb1 + gcc + ]; + + src = fetchurl { + url = "https://github.com/Yepkit/ykush/archive/refs/tags/v1.3.0.tar.gz"; + sha256 = "sha256-K7OycmtEbU0ZsoYMoGga/glW8NbcB4l97WmWZfZspAE="; + }; + + # The package just has a single binary, but doesn't install it with `make install`. :( + installPhase = '' + install -D bin/ykushcmd $out/bin/ykushcmd + ''; + + meta = { + description = "Control utility for YepKit USB hubs."; + + longDescription = + '' ykush(cmd) contols the features of YepKit USB hubs, allowing one to + arbitrarily turn ports on and off and otherwise control the hub. + ''; + + homepage = "https://github.com/Yepkit/ykush"; + license = lib.licenses.afl20; + }; +} diff --git a/proprietary/README.md b/proprietary/README.md new file mode 100644 index 0000000..9ecc1c1 --- /dev/null +++ b/proprietary/README.md @@ -0,0 +1,3 @@ +# HOW DID YOU GET THIS + +You're not supposed to have this! You did either a very good or a very bad job. diff --git a/proprietary/binja/binaryninja_personal_linux.zip b/proprietary/binja/binaryninja_personal_linux.zip new file mode 100644 index 0000000..dcb5028 Binary files /dev/null and b/proprietary/binja/binaryninja_personal_linux.zip differ diff --git a/proprietary/binja/license.txt b/proprietary/binja/license.txt new file mode 100644 index 0000000..bc29761 --- /dev/null +++ b/proprietary/binja/license.txt @@ -0,0 +1,13 @@ +[ + { + "product": "Binary Ninja Personal", + "email": "k@ktemkin.com", + "serial": "ac76e3049f55955c05ed62c3bd77a4ce", + "created": "2023-02-26T02:30:39.809000+00:00", + "type": "User", + "count": 1, + "data": "he+Axy6gIaDWVWvVix3RCij+nInOacMhEquRCLAUNxoOw77VMI1IPkAgNzMRjHCsnmj0EmnQgi/XLAN6+3EH7Gbo+OCymD0btZiF+KSy6Nl5zpPB0yfTv3HvJwkaNv/d7d9c+isq4JxDNszYhwLle0arNtLbYoipJJxXvL38/pnJikZvTtWY6ecckj6EjSmL56mhr/Sdrsm8rbpVCO0uQ4Cd/07lNEAK5ckqeWzxTdwtBZuGnKU0lWaXchEIC/Pbz0KTeFoE/L31ELi+bk86g5bPfve9/nvDTuMow9nyf/Fsl4IoXmSrgKsGj6gsZQtUad3NCoUoMm6a61yxF8qBKin/Gps4g9R0r/Hevo+mHh1w4fQQRpNsCQ==", + "signature": "eg0roDW61A86TAzL7e0gUq50B8aHatGMaAHYeG0770Eqq2/01j7lQbP8tGHMTvYIs77Q1ZBQ1GgFIwz+iLo/nwmzL8CHvmMtF1tCPwKitgtr2lUg6m1xrR62FJ55PAByb9rOtB8lpSuEAF66BkWzJXnzbpY5we185AHkhREwTnMCi1J1LPO7A4GKfzXQ+3JVK/KsQrKA5/M4+4qNqs5t0Ez4uWehnraBfhDQnxBGGBBiMTNMSC3i5PzSgIS2FacS2fwZt2jfotATgBCxPnbBr+k6n1qinDPSr3YMwCGa5QaFHQtg9d314KOHSi0vNcPcWj7wt5R8G4huPFgIXYLSmg==", + "expiresEpoch": 1740537039 + } +] \ No newline at end of file diff --git a/proprietary/flexbv5/FlexBV-5.0345-linux-3N5871753H701314U.tgz b/proprietary/flexbv5/FlexBV-5.0345-linux-3N5871753H701314U.tgz new file mode 100644 index 0000000..b278b83 Binary files /dev/null and b/proprietary/flexbv5/FlexBV-5.0345-linux-3N5871753H701314U.tgz differ diff --git a/setup-macos.sh b/setup-macos.sh new file mode 100755 index 0000000..82f53c3 --- /dev/null +++ b/setup-macos.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +# Get the current directory. +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# Get the target hostname. +echo -n "Enter this machine's hostname as in flake.nix: " +read HOSTNAME + +# Install Nix. Interactive. +if [ ! -d "/nix" ] || [ z"$FORCE_REINSTALL_NIX" != z"" ]; then + sh <(curl -L https://nixos.org/nix/install) +fi + +# Let Nix set things up. :) +/nix/var/nix/profiles/default/bin/nix shell --extra-experimental-features nix-command --extra-experimental-features flakes nix-darwin nix-darwin --command \ + darwin-rebuild --flake "${SCRIPT_DIR}#${HOSTNAME}" switch + diff --git a/setup-nixos.sh b/setup-nixos.sh new file mode 100755 index 0000000..adad006 --- /dev/null +++ b/setup-nixos.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e + +# Get the current directory. +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# Get the target hostname. +echo -n "Enter this machine's hostname as in flake.nix: " +read HOSTNAME + +# Let Nix set things up. :) +sudo nixos-rebuild --flake "${SCRIPT_DIR}#${HOSTNAME}" $@ switch + diff --git a/setup-windows.ps1 b/setup-windows.ps1 new file mode 100644 index 0000000..912b319 --- /dev/null +++ b/setup-windows.ps1 @@ -0,0 +1,10 @@ + +# Install Scoop. +Set-ExecutionPolicy RemoteSigned -Scope CurrentUser +irm get.scoop.sh | iex + +# FIXME: install scoop packages from scoop config +# FIXME: install winget packages + +# FIXME: create a symlink for each thing in nixos/configs/dotfiles.nix + diff --git a/taskwarrior/hooks/on-add-allow-shorthands.sh b/taskwarrior/hooks/on-add-allow-shorthands.sh new file mode 100755 index 0000000..faef19c --- /dev/null +++ b/taskwarrior/hooks/on-add-allow-shorthands.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +$SCRIPT_DIR/on-modify-allow-shorthands.rb $@ diff --git a/taskwarrior/hooks/on-modify-allow-shorthands.rb b/taskwarrior/hooks/on-modify-allow-shorthands.rb new file mode 100755 index 0000000..c60dce2 --- /dev/null +++ b/taskwarrior/hooks/on-modify-allow-shorthands.rb @@ -0,0 +1,68 @@ +#!/usr/bin/env ruby + +require 'json' +require 'chronic' + +# First, figure out if we have tasks to deal with. +tasks = $stdin.filter { |line| line.start_with? '{' } + +# If this is a creation, we'll only get one event. Count is as both the original and the new. +original_json_task, json_task = case tasks.length + when 2 then tasks + else + [tasks.first, tasks.first] +end + +# Finally, actually handle the shorthands. +task = JSON.parse(json_task) +original_task = JSON.parse(original_json_task) + +loop do + + case task['description'] + + # Wait + when /w:([^ ]+)/ + task['wait'] = Chronic.parse($1) + task['description'].sub!("w:#{$1}", "") + + # Project + when /p:([^ ]+)/ + task['project'] = $1 + task['description'].sub!("p:#{$1}", "") + + # Due + when /d:([^ ]+)/ + task['due'] = Chronic.parse($1) + task['description'].sub!("d:#{$1}", "") + + # Depends + when /dep:([^ ]+)/ + task['depends'] = $1 + task['description'].sub!("dep:#{$1}", "") + + # Every + when /e:([^ ]+)/ + task['every'] = $1 + task['description'].sub!("e:#{$1}", "") + + # RecurAfter + when /a:([^ ]+)/ + task['recur_after'] = $1 + task['description'].sub!("a:#{$1}", "") + + # Scheduled + when /s:([^ ]+)/ + task['scheduled'] = Chronic.parse($1) + task['description'].sub!("s:#{$1}", "") + + # Once we're out of things to expand, start parsing, and emit. + else + raise StopIteration + end +end + +# If we wound up with no description; e.g. because we were just given things to mod, use the original description. +task['description'] = original_task['description'] if task['description'].strip.empty? + +print task.to_json diff --git a/taskwarrior/hooks/on-modify-apply-every.rb b/taskwarrior/hooks/on-modify-apply-every.rb new file mode 100755 index 0000000..9624a7e --- /dev/null +++ b/taskwarrior/hooks/on-modify-apply-every.rb @@ -0,0 +1,61 @@ +#!/usr/bin/env ruby + +require 'json' +require 'time' + +DAYS = 60 * 60 * 24 +WEEKS = DAYS * 7 + +TASKWARRIOR_DATE_FORMAT = "%Y%m%dT060000Z" + +# Find the -final- task state that's passed to us. +json_task = $stdin.map{ |line| line }.last + +task = JSON.parse(json_task) +last_task_form = json_task + +# Only modify tasks that are done, but have a recur. +# Emit all other tasks' final states unchanged. +unless task.has_key?('status') && task.has_key?('every') && (task['status'] == 'completed') + puts(json_task) + exit 0 +end + +# +# We have an every-recurring task -- modify it! +# + +unless task.has_key? 'due' + puts "ERROR: task #{task['id']} has an 'every' recurrance, but no due date!" + exit -1 +end + +# Figure our our next recurrance based on the taskwarrior period/duration syntax. +previous_due_date = Time.parse(task['due']) +recur_date = case task['every'] + when /P(\d+)D/ then previous_due_date + ($1.to_i * DAYS) + when /P(\d+)W/ then previous_due_date + ($1.to_i * WEEKS) + when /P(\d+)M/ then Time.new(previous_due_date.year, previous_due_date.month + $1.to_i, previous_due_date.day) + when /P(\d+)H/ then Time.new(previous_due_date.year + $1.to_i, previous_due_date.month, previous_due_date.day) + else + puts "ERROR: task #{task['id']} has unsupported'every' duration #{task['every']}" + exit -1 +end + +# Mutate the task to be pending, still, but with new dates. +task['status'] = 'pending' +task['due'] = recur_date.strftime(TASKWARRIOR_DATE_FORMAT) + + +# If this task has ancillary dates, maintain the offset between them and the due date. +['wait', 'start'].each do |field| + if task.has_key?(field) + field_offset = previous_due_date - Time.parse(task[field]) + new_field_date = Time.parse(task['due']) - field_offset + + task[field] = new_field_date.strftime(TASKWARRIOR_DATE_FORMAT) + end +end + +# Emit the task back to TaskWarrior. +puts task.to_json diff --git a/taskwarrior/hooks/on-modify-apply-recur_after.rb b/taskwarrior/hooks/on-modify-apply-recur_after.rb new file mode 100755 index 0000000..618e4cb --- /dev/null +++ b/taskwarrior/hooks/on-modify-apply-recur_after.rb @@ -0,0 +1,63 @@ +#!/usr/bin/env ruby + +require 'json' +require 'time' + +DAYS = 60 * 60 * 24 +WEEKS = DAYS * 7 + +TASKWARRIOR_DATE_FORMAT = "%Y%m%dT060000Z" + +# Find the -final- task state that's passed to us. +json_task = $stdin.map{ |line| line }.last + +task = JSON.parse(json_task) +last_task_form = json_task + +# Only modify tasks that are done, but have a recur. +# Emit all other tasks' final states unchanged. +unless task.has_key?('status') && task.has_key?('recur_after') && (task['status'] == 'completed') + puts(json_task) + exit 0 +end + +# +# We have an recur-after recurring task -- modify it! +# + +unless task.has_key? 'due' + puts "ERROR: task #{task['id']} has an 'recur_after' recurrance, but no due date!" + exit -1 +end + +completed_date = Time.parse(task['end']) +previous_due_date = Time.parse(task['due']) + +# Figure our our next recurrance based on the taskwarrior period/duration syntax. +recur_date = case task['recur_after'] + when /P(\d+)D/ then completed_date + ($1.to_i * DAYS) + when /P(\d+)W/ then completed_date + ($1.to_i * WEEKS) + when /P(\d+)M/ then Time.new(completed_date.year, completed_date.month + $1.to_i, completed_date.day) + when /P(\d+)H/ then Time.new(completed_date.year + $1.to_i, completed_date.month, completed_date.day) + else + puts "ERROR: task #{task['id']} has unsupported 'recur_after' duration #{task['recur_after']}" + exit -1 +end + +# Mutate the task to be pending, still, but with new dates. +task['status'] = 'pending' +task['due'] = recur_date.strftime(TASKWARRIOR_DATE_FORMAT) + + +# If this task has ancillary dates, maintain the offset between them and the due date. +['wait', 'start'].each do |field| + if task.has_key?(field) + field_offset = previous_due_date - Time.parse(task[field]) + new_field_date = Time.parse(task['due']) - field_offset + + task[field] = new_field_date.strftime(TASKWARRIOR_DATE_FORMAT) + end +end + +# Emit the task back to TaskWarrior. +puts task.to_json diff --git a/taskwarrior/taskrc b/taskwarrior/taskrc new file mode 100644 index 0000000..f894b79 --- /dev/null +++ b/taskwarrior/taskrc @@ -0,0 +1,61 @@ +# Use XDG data directories. +data.location=~/.local/share/task/ + +# Start our weeks on Monday, like a non-American. +weekstart=monday + +# Don't tell me to read the news on updates. +news.version=3.1.0 + +# Show only a short span into the future by default. +default.command=next status:pending -BLOCKED -WAITING + +# Use nice formatting. +include solarized-dark-256.theme + +# Re-work our colors +color.due=color2 +color.due.today=color6 +color.blocked=color15 on rgb000 +color.blocking=color15 on rgb100 + +# Limit what we show in reports to the relevant. +report.next.columns=id,depends,priority,project,tags,every,recur_after,due.relative,due,until.remaining,description,urgency +report.next.labels=ID,Deps,P,Project,Tag,Every,RecurAfter,Due In,Due,Until,Description,Urg + +# Set up synchronization. +sync.server.url=https://tasks.lab.ktemk.in +sync.server.client_id=e479ef9a-05b5-4963-9e1b-7ae0f89995e9 +include ~/dotfiles/taskwarrior/taskrc-local + +# Support a custom "every N days" hook. +uda.every.type=duration +uda.every.label=Every +uda.recur_after.type=duration +uda.recur_after.label=Every + +# Priority up work tasks. +urgency.user.project.Reilabs.coefficient = 4.0 +urgency.user.project.TMLLC.coefficient = 4.0 + +# Priority down tasks explicitly set as "idle goals". +urgency.user.project.Goals.coefficient = 0.5 + +# Don't include age as heavily. +urgency.age.coefficient = 1.0 +urgency.due.coefficient = 8.0 + +# Don't bump blocking up quite so much. +urgency.blocking.coefficient = 4.0 + +# Use our recurrence scheme, not TaskWarrior's. +sync.recurrence=0 +recurrence=0 + +# Tasksh. +uda.reviewed.type=date +uda.reviewed.label=Reviewed +report._reviewed.description=Tasksh review report. Adjust the filter to your needs. +report._reviewed.columns=uuid +report._reviewed.sort=reviewed+,modified+ +report._reviewed.filter=( reviewed.none: or reviewed.before:now-6days ) and ( +PENDING or +WAITING ) diff --git a/taskwarrior/taskrc-local.example b/taskwarrior/taskrc-local.example new file mode 100644 index 0000000..7a3e4c0 --- /dev/null +++ b/taskwarrior/taskrc-local.example @@ -0,0 +1 @@ +sync.encryption_secret= diff --git a/tmux/linux.conf b/tmux/linux.conf new file mode 100644 index 0000000..cc620a2 --- /dev/null +++ b/tmux/linux.conf @@ -0,0 +1,2 @@ +# Copy to miko's clipboard. +set -g @override_copy_command 'xclip -in -selection clipboard' diff --git a/tmux/macos.conf b/tmux/macos.conf new file mode 100644 index 0000000..e2d7d29 --- /dev/null +++ b/tmux/macos.conf @@ -0,0 +1,5 @@ + +# Allow = as an alternate prefix. +# set -g prefix2 = +#bind-key = send-prefix -2 + diff --git a/tmux/tmux b/tmux/tmux new file mode 120000 index 0000000..945c9b4 --- /dev/null +++ b/tmux/tmux @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/tmux/tmux.conf b/tmux/tmux.conf new file mode 100644 index 0000000..242640f --- /dev/null +++ b/tmux/tmux.conf @@ -0,0 +1,107 @@ + +# Use ` as a prefix +set -g prefix ` +unbind-key C-b + +# Allow `` to enter a backtick. +bind-key ` send-prefix + +# Inherit some environment stuffs. +set-option -g update-environment " \ + XDG_SESSION_TYPE XDG_CURRENT_DESKTOP XDG_RUNTIME_DIR XDG_SESSION_CLASS XDG_SESSION_DESKTOP \ + SESSION_MANAGER DESKTOP_SESSION DBUS_SESSION_BUS_ADDRESS GDMSESSION GDM_LANG GDM_LANG INVOCATION_ID \ + JOURNAL_STREAM DISPLAY WAYLAND_DISPLAY XAUTHORITY SWAYSOCK SS_CLIENT SSH_CONNECTION DISPLAY SSH_ASKPASS \ + SSH_AUTH_SOCK SSH_AGENT_PID XAUTHORITY " + +# Order our panes to start at one, matching our keyboard. +set -g base-index 1 +set-window-option -g pane-base-index 1 + +# Have zero select the tenth panel. +bind-key 0 select-window -t :=10 + +# Setup Window Titles [Ara] +set-window-option -g automatic-rename on +set-option -g set-titles on +setw -g monitor-activity on +set -g visual-activity on + +# Configure mouse control. +set -g mouse on + +# Emulation of vi's normal mode [Ara]. +setw -g mode-keys vi +unbind [ +unbind ] +bind Escape copy-mode # Esc now enters copy mode +unbind p +bind -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi Escape send -X cancel +bind-key -T copy-mode-vi 'V' send -X rectangle-toggle + +# Platform-Specific Config [Ara] +if-shell "uname | grep -q Darwin" "source-file ~/dotfiles/tmux/macos.conf" "source-file ~/dotfiles/tmux/linux.conf" + +# Configuration reloading. +unbind r +bind r source-file ~/.config/tmux/tmux.conf + +# Always keep our history length. +set-option -g history-limit 1000000 + +#### COLORS (Solarized dark) + +# default statusbar colors +set-option -g status-style fg=yellow,bg=black #yellow and base02 + +# default window title colors +set-window-option -g window-status-style fg=brightblue,bg=default #base0 and default +#set-window-option -g window-status-style dim + +# active window title colors +set-window-option -g window-status-current-style fg=brightred,bg=default #orange and default +#set-window-option -g window-status-current-style bright + +# pane border +set-option -g pane-border-style fg=black #base02 +set-option -g pane-active-border-style fg=brightgreen #base01 + +# message text +set-option -g message-style fg=brightred,bg=black #orange and base01 + +# pane number display +set-option -g display-panes-active-colour blue #blue +set-option -g display-panes-colour brightred #orange + +# clock +set-window-option -g clock-mode-colour green #green + +# bell +set-window-option -g window-status-bell-style fg=black,bg=red #base02, red + +# tmux-wormhole: save wormhole files with tmux-wormhole to tmp +set -g @wormhole-save-folder '/tmp/' + +# tmux-wormhole: don't open wormhole files by default +set -g @wormhole-no-default-open false + +# always install plugins +if "test ! -d ~/.tmux/plugins/tpm" \ + "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" + +# plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-cowboy' +set -g @plugin 'tmux-plugins/tmux-logging' +set -g @plugin 'gcla/tmux-wormhole' +set -g @plugin 'tmux-plugins/tmux-pain-control' +set -g @plugin 'Alkindi42/tmux-bitwarden' +set -g @plugin 'nhdaly/tmux-better-mouse-mode' +set -g @plugin 'fcsonline/tmux-thumbs' +set -g @plugin 'tmux-plugins/tmux-sessionist' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' diff --git a/vdirsyncer/config b/vdirsyncer/config new file mode 100644 index 0000000..0f97664 --- /dev/null +++ b/vdirsyncer/config @@ -0,0 +1,21 @@ +[general] +status_path = "~/.local/share/vdirsyncer/status/" + +[pair metrology_calendar] +a = "metrology_calendar_local" +b = "metrology_calendar_remote" +collections = ["from a", "from b"] +metadata = ["color", "displayname", "description", "order"] +conflict_resolution = "b wins" + +[storage metrology_calendar_local] +type = "filesystem" +path = "~/.local/share/calendars" +fileext = ".ics" + +[storage metrology_calendar_remote] +type = "caldav" + +url = "https://caldav.fastmail.com" +username = "kate@metrolo.gy" +password.fetch = ["command", "secret-tool", "lookup", "fastmail", "dav_password"] diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua new file mode 100644 index 0000000..16dee5d --- /dev/null +++ b/wezterm/wezterm.lua @@ -0,0 +1,247 @@ +local wezterm = require("wezterm") +local act = wezterm.action + +local hostname = wezterm.hostname() + +-- +-- Main configuration. +-- + +config = { + + -- Set up our font. + font = wezterm.font_with_fallback({ + "MonoLisa", + "Codicons", + }), + font_size = 14, + + -- Color scheme stuff. + color_scheme = "Solarized Dark - Patched", + + -- Generel config. + term = "wezterm", + + -- Get rid of the annoying update popups we can't do anything about. + check_for_updates = false, + + -- Automatically reload our config on changes. + automatically_reload_config = true, + + -- Improve tab viewing by disabling native wonk, + -- and make it behave more like Tmux. + use_fancy_tab_bar = false, + tab_bar_at_bottom = true, + tab_max_width = 32, + + -- Disable window styling, where possible. + window_decorations = "RESIZE", + + -- Use WebGpu, when we can. + front_end = "WebGpu", + + -- Tab bar styling. + colors = { + tab_bar = { + background = "#002b36", + active_tab = { + bg_color = "#073642", + fg_color = "#268bd2", + intensity = "Bold", + }, + inactive_tab = { + bg_color = "#002b36", + fg_color = "#586e75", + }, + new_tab = { + bg_color = "#002b36", + fg_color = "#586e75", + }, + }, + }, + + -- Set up multiplexing. + unix_domains = { { name = "unix" } }, + ssh_domains = { + { + name = "trailblazer", + remote_address = "trailblazer", + remote_wezterm_path = "/run/current-system/sw/bin/wezterm", + }, + { name = "valere", remote_address = "valere", remote_wezterm_path = "/run/current-system/sw/bin/wezterm" }, + { name = "hinata", remote_address = "hinata", remote_wezterm_path = "/run/current-system/sw/bin/wezterm" }, + }, + + -- Key bindings. + leader = { key = "`" }, + keys = { + + -- Tmux keybindings: tabs and splits. + { + key = "c", + mods = "LEADER", + action = act.SpawnTab("CurrentPaneDomain"), + }, + { + key = "RightArrow", + mods = "LEADER", + action = act.ActivatePaneDirection("Right"), + }, + { + key = "UpArrow", + mods = "LEADER", + action = act.ActivatePaneDirection("Up"), + }, + { + key = "DownArrow", + mods = "LEADER", + action = act.ActivatePaneDirection("Down"), + }, + { + key = ";", + mods = "LEADER", + action = act.ActivatePaneDirection("Next"), + }, + { + key = "v", + mods = "LEADER", + action = act.SplitVertical({ domain = "CurrentPaneDomain" }), + }, + { + key = "h", + mods = "LEADER", + action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }), + }, + { + key = "5", + mods = "LEADER|SHIFT", + action = act.SplitVertical({ domain = "CurrentPaneDomain" }), + }, + { + key = "'", + mods = "LEADER|SHIFT", + action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }), + }, + { + key = "1", + mods = "LEADER", + action = act.ActivateTab(0), + }, + { + key = "2", + mods = "LEADER", + action = act.ActivateTab(1), + }, + { + key = "3", + mods = "LEADER", + action = act.ActivateTab(2), + }, + { + key = "4", + mods = "LEADER", + action = act.ActivateTab(3), + }, + { + key = "5", + mods = "LEADER", + action = act.ActivateTab(4), + }, + { + key = "6", + mods = "LEADER", + action = act.ActivateTab(5), + }, + { + key = "7", + mods = "LEADER", + action = act.ActivateTab(6), + }, + { + key = "8", + mods = "LEADER", + action = act.ActivateTab(7), + }, + { + key = "9", + mods = "LEADER", + action = act.ActivateTab(8), + }, + { + key = "0", + mods = "LEADER", + action = act.ActivateTab(10), + }, + { + key = "x", + mods = "LEADER", + action = act.CloseCurrentPane({ confirm = true }), + }, + + -- Tmux keybindings: misc. + { + key = "`", + mods = "LEADER", + action = act.SendKey({ key = "`" }), + }, + { + key = "d", + mods = "LEADER", + action = act.DetachDomain("CurrentPaneDomain"), + }, + { + key = "z", + mods = "LEADER", + action = act.TogglePaneZoomState, + }, + + -- Generic customization. + { key = "l", mods = "SHIFT|CTRL", action = "ShowDebugOverlay" }, + { key = "Enter", mods = "ALT", action = "DisableDefaultAssignment" }, + { key = "Enter", mods = "SUPER", action = "ToggleFullScreen" }, + }, +} + +-- +-- Font Size Tweaks +-- + +if (hostname == "miko") or (hostname == "hinata") then + config["font_size"] = 16 +end + +if (hostname == "valere") or (hostname == "utol") then + config["font_size"] = 13 +end + +if (hostname == "trailblazer") then + config["font_size"] = 12 +end + +if hostname == "tohru" then + config["font_size"] = 17 +end + +if hostname == "veth" then + config["font_size"] = 32 +end + +-- +-- Increase tab bar spacing. +-- +wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width) + -- Truncate our title so we have room for a padding space at the end. + local title = wezterm.truncate_right(tab.active_pane.title, max_width - 6) + local number = tostring((tab.tab_index + 1) % 10) + + -- Generate the tab format. + return " " .. number .. ": " .. title .. " " +end) + +-- Windows support. +-- Possibly replace with a per-platform equivalent?' +--if (hostname == "hinata") then +-- config['default_prog'] = {"C:\\Users\\deprekated\\scoop\\apps\\python\\current\\Scripts\\xonsh.exe"} +--end + +return config diff --git a/xonsh/aigis.xsh b/xonsh/aigis.xsh new file mode 100644 index 0000000..5701577 --- /dev/null +++ b/xonsh/aigis.xsh @@ -0,0 +1,66 @@ +# +# Dotfile specifics for aigis +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/opt/homebrew/opt/coreutils/libexec/gnubin", + "/opt/homebrew/opt/findutils/libexec/gnubin", + "/opt/homebrew/bin", + "/opt/homebrew/opt/gnu-sed/libexec/gnubin", + "/opt/homebrew/bin", + "/Users/deprekated/.cargo/bin", + "/opt/homebrew/sbin", + "/opt/homebrew/bin", + "/opt/homebrew/Cellar/ruby/2.3.3/bin", + "/opt/homebrew/opt/llvm/bin", + "/Users/deprekated/.bin/", + "/opt/homebrew/opt/e2fsprogs/sbin", + "/opt/homebrew/opt/grep/libexec/gnubin", + "/opt/homebrew/opt/ruby/bin", + "/opt/homebrew/lib/ruby/gems/3.1.0/bin", + "/opt/homebrew/opt/bison@2.7/bin", + "/etc/profiles/per-user/deprekated/bin/", + "/run/current-system/sw/bin" +] + + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Helper to make every system have the same rebuild. +aliases['rebuild'] = 'darwin-rebuild --flake ~/dotfiles' + +# Python +$PYTHONPATH="" +$PYTHONPATH.extend([ +]) + +# Smartcard auth +$GPG_TTY=$(tty).strip() + +try: + $ORIGINAL_SSH_AUTH_SOCK=$SSH_AUTH_SOCK +except: + pass + + +#$SSH_AUTH_SOCK=$(/usr/local/MacGPG2/bin/gpgconf --list-dirs agent-ssh-socket).strip() +#/usr/local/MacGPG2/bin/gpgconf --launch gpg-agent + +# Python +$PYTHONPATH=[ + '/Applications/Binary Ninja.app/Contents/Resources/python', + '/Users/deprekated/Projects/amaranth/amaranth', + '/Users/deprekated/Projects/luna', + '/Users/deprekated/Projects/amaranth/amaranth-boards', + '/Users/deprekated/Projects/t5/t5gw' +] + +# Nix +source-bash '/etc/bashrc' + +# Temporary hack. +$TERMINFO_DIRS = [ "/usr/share/terminfo", "/Users/deprekated/.terminfo"] diff --git a/xonsh/ashyn.xsh b/xonsh/ashyn.xsh new file mode 100644 index 0000000..79a013c --- /dev/null +++ b/xonsh/ashyn.xsh @@ -0,0 +1,17 @@ +# +# Dotfile specifics for Ashyn +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Use "rebuild" as a platform-agnostic rebuilding system. +aliases['rebuild'] = 'sudo -E nixos-rebuild --flake ~/dotfiles' diff --git a/xonsh/beretta.xsh b/xonsh/beretta.xsh new file mode 100644 index 0000000..98e4efa --- /dev/null +++ b/xonsh/beretta.xsh @@ -0,0 +1,35 @@ +# +# Dotfile specifics for Beretta +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ ] + +# Aliases +#aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Smartcard auth +if ('SSH_AUTH_SOCK' not in ${...}) or not $SSH_AUTH_SOCK.startswith('/tmp/ssh'): + $GPG_TTY=$(tty).strip() + gpg-connect-agent updatestartuptty /bye 2>&1 >/dev/null + $SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket).strip() + +# Convenience hacks: +def cycle_t5_power(): + yk -d 1 + yk -u 1 + +# Use mob to pass our branches around +$MOB_REMOTE_NAME="mob-remote" + +# Use "rebuild" as a platform-agnostic rebuilding system. +aliases['rebuild'] = 'sudo nixos-rebuild --flake ~/dotfiles' + +aliases['t5cycle'] = cycle_t5_power +aliases['yk'] = "ykushcmd ykush3" + +aliases['logdog'] = "bazel run //hmd/tools/logdog --" +aliases['hmdctl'] = "bazel run //hmd/tools/hmdctl --" +aliases['imgproj'] = "bazel run //hmd/tools/imgproj --" diff --git a/xonsh/braize.xsh b/xonsh/braize.xsh new file mode 100644 index 0000000..ebd529e --- /dev/null +++ b/xonsh/braize.xsh @@ -0,0 +1,17 @@ +# +# Dotfile specifics for Braize +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Use "rebuild" as a platform-agnostic rebuilding system. +aliases['rebuild'] = 'sudo -E nixos-rebuild --flake ~/dotfiles' diff --git a/xonsh/hinata-windows.xsh b/xonsh/hinata-windows.xsh new file mode 100644 index 0000000..7159a9d --- /dev/null +++ b/xonsh/hinata-windows.xsh @@ -0,0 +1,48 @@ +# +# Dotfile specifics for Pike +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "C:\\Program Files\\LLVM\\bin", + "C:\\Users\\deprekated\\scoop\\shims", + "C:\\Users\\deprekated\\.local\\bin", +] + + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Replace some of Xonsh's aliases with our own. +aliases['mkdir'] = 'mkdir.exe' +aliases['sudo'] = r'C:\Users\deprekated\scoop\shims\sudo.cmd' + +# Use a proper GNU find. +aliases['find'] = r'C:\Users\deprekated\scoop\shims\find.exe' + +# Git LFS is broken when sshConfig is set, but it accepts configuration +# from the environment, first. Take advantage to make everything work. +$GIT_SSH_COMMAND=r"C:\\\Windows\\\System32\\\OpenSSH\\\ssh.exe" + +# Use mob to pass our branches around +$MOB_REMOTE_NAME="mob-remote" + +# Windows behaves better when TERM isn't defined. What? +del $TERM + +# Don't bother with Windows paths. They're icky. +$FORCE_POSIX_PATHS=True + +# Add an open command, as Osiria wanted. +def xopen_impl(args): + argstr = " ".join(args) + PowerShell -Command @("(New-Object -com 'Shell.Application').ShellExecute(\"" + argstr + "\")") +aliases['xopen'] = xopen_impl + +# Don't break neovim when called from Git. +__xonsh__.commands_cache.threadable_predictors['git'] = lambda *a, **kw: False + +# Use our standard gpg4win SSH. +$SSH_AUTH_SOCK=r"\\.\pipe\ssh-pageant" diff --git a/xonsh/hinata.xsh b/xonsh/hinata.xsh new file mode 100644 index 0000000..7c0fd1d --- /dev/null +++ b/xonsh/hinata.xsh @@ -0,0 +1,17 @@ +# +# Dotfile specifics for Hinata +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Use "rebuild" as a platform-agnostic rebuilding system. +aliases['rebuild'] = 'sudo -E nixos-rebuild --flake ~/dotfiles' diff --git a/xonsh/includes/add-ssh-keys.xsh b/xonsh/includes/add-ssh-keys.xsh new file mode 100644 index 0000000..4fb1d9d --- /dev/null +++ b/xonsh/includes/add-ssh-keys.xsh @@ -0,0 +1,21 @@ +# +# Include snippet for adding our local keys to our ssh-agent. +# + +def add_ssh_keys(): + """ Adds any keys found to our ssh-agent. """ + + # Don't mess with SSH keys if we're using a remote agent. + try: + if $SSH_AUTH_SOCK.startswith("/tmp"): + return + except KeyError: + return + + # Automatically add each of our SSH keys. + for f in g`~/.ssh/id*`: + if not f.endswith('.pub'): + ssh-add -q @(f) + + +add_ssh_keys() diff --git a/xonsh/includes/cellular.xsh b/xonsh/includes/cellular.xsh new file mode 100644 index 0000000..eff35ce --- /dev/null +++ b/xonsh/includes/cellular.xsh @@ -0,0 +1,12 @@ +# +# Cellular helpers. +# + +def _at_command(args, stdin=None): + """ Helper for running one or more AT commands. """ + echo @(args) | sudo atinout - $XONSH_AT_MODEM - + +aliases['at'] = _at_command + + + diff --git a/xonsh/includes/nixos.xsh b/xonsh/includes/nixos.xsh new file mode 100644 index 0000000..31ac651 --- /dev/null +++ b/xonsh/includes/nixos.xsh @@ -0,0 +1,92 @@ +# +# NixOS functions. +# + +# Quote comments so we can avoid +try_source("quote-comments") + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Helper aliases. +aliases['push-store'] = 'nix path-info --all | cachix push polytheon' + +# Use "rebuild" as a platform-agnostic rebuilding system. +aliases['rebuild'] = 'sudo nixos-rebuild --flake "/home/deprekated/dotfiles?submodules=1"' + +# Allow non-free for regular commands. +$NIXPKGS_ALLOW_UNFREE=1 + + +def _nix_locate(args, stdin=None, silent=False): + """ Helper for finding a direct provider of a nix package. """ + + raw_args = " ".join(args) + nix-locate @(raw_args) | grep -v "^(" + + +def _pkg_path(args, stdin=None, silent=False): + + raw_args = " ".join(args) + result = $(nix eval --impure --expr @('(import {}).' + raw_args + '.outPath')) + + if not silent: + print(result.strip()[1:-1]) + + return result.strip()[1:-1] + + +def _bin_path(args, stdin=None, silent=False): + import pathlib + + # First, find the real path for our string. + raw_args = " ".join(args) + linkpath = $(which @(raw_args)) + + if not linkpath: + return None + + target = $(realpath @(linkpath)) + + # If this is a Nix store path, trim it to just the package. + if target.startswith("/nix/store"): + target = pathlib.Path(target) + + while target.parent != p"/nix/store": + target = target.parent + + if not silent: + print(target) + + return target + + +def _pkg_bins(args, stdin=None, silent=False): + import pathlib + + raw_args = " ".join(args) + target_path = None + + # If this is a file, get its path from that. + # Otherwise, assume it's a nixpkgs name. + if not pathlib.Path(raw_args).exists(): + target_path = _pkg_path(args, stdin, silent=True) + else: + target_path = _bin_path(args, stdin, silent=True) + + if not target_path: + return + + bin_path = pf"{target_path}/bin" + usr_path = pf"{target_path}/usr/bin" + + if bin_path.exists(): + ls @(bin_path) + if usr_path.exists(): + ls @(usr_path) + +aliases['nlocate'] = _nix_locate +aliases['pkgpath'] = _pkg_path +aliases['binpath'] = _bin_path +aliases['pkgbins'] = _pkg_bins diff --git a/xonsh/includes/quote-comments.xsh b/xonsh/includes/quote-comments.xsh new file mode 100644 index 0000000..7316d05 --- /dev/null +++ b/xonsh/includes/quote-comments.xsh @@ -0,0 +1,25 @@ +""" Input transformer that automatically quotes #s for e.g. nix. """ + +from xonsh.events import events + +@events.on_transform_command +def _autoquote_for_nix(cmd): + new_command = [] + + # Process each word individually. + words = cmd.strip().split(" ") + for word in words: + + # If this is unquoted, and it has a comment in it without spaces, + # consider it something that we should auto-quote. + has_comment = '#' in word + is_comment = word.startswith("#") + is_quoted = ('"' in word) or ("'" in word) + if has_comment and not is_comment and not is_quoted: + word = '"' + word + '"' + + new_command.append(word) + + # Reconstruct our command. + return " ".join(new_command) + "\n" + diff --git a/xonsh/iterm2.xsh b/xonsh/iterm2.xsh new file mode 100644 index 0000000..2095493 --- /dev/null +++ b/xonsh/iterm2.xsh @@ -0,0 +1,66 @@ +# vim: ft=python + +import sys +import base64 +import socket +import xonsh + +from prompt_toolkit import print_formatted_text +from prompt_toolkit.formatted_text import PygmentsTokens +from xonsh.pyghooks import partial_color_tokenize + +# +# Helpers. +# + +iterm2_signal = lambda contents : f"\033]133;{contents}\a" +iterm2_variable = lambda contents : f"\033]1337;{contents}\a" +iterm2_hostname = socket.gethostname().strip().replace("\n", "") + + +def printr(raw): + print(raw, flush=True, end='') + +# +def get_iterm2_hostname(): + return iterm2_variable(f"RemoteHost={$USER}@{iterm2_hostname}") + +def get_iterm2_cwd(): + return iterm2_variable(f"CurrentDir={$PWD}") + +# +# iterm2 integration +# + +@events.on_precommand +def iterm2_precmd(cmd=None): + printr(iterm2_signal('C;')) + + +@events.on_postcommand +def iterm2_postcmd(cmd, rtn, out, ts): + printr(iterm2_signal(f"D;{rtn}")) + + +def iterm2_prompt_formatter(params): + + for index, token in enumerate(params.tokens): + if token.field == 'iterm2_start': + prologue = iterm2_signal('A') + get_iterm2_hostname() + get_iterm2_cwd() + params.update(index, prologue, None, None) + + if token.field == 'iterm2_end': + epilogue = iterm2_signal('B') + params.update(index, epilogue, None, None) + + return xonsh.prompt.base.prompt_tokens_formatter_default(params) + +# +# Activate shell integration. +# +$SHELL_TYPE = 'readline' +$PROMPT_TOKENS_FORMATTER = iterm2_prompt_formatter + +printr(get_iterm2_hostname()) +printr(get_iterm2_cwd()) +printr(iterm2_variable("ShellIntegrationVersion=16;shell=xonsh")) diff --git a/xonsh/komashi.xsh b/xonsh/komashi.xsh new file mode 100644 index 0000000..74fc3e8 --- /dev/null +++ b/xonsh/komashi.xsh @@ -0,0 +1,21 @@ +# +# Dotfile specifics for Komashi. +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/home/deprekated/.local/bin" + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# SSH key management. +try_source("includes/add-ssh-keys") + +# NixOS compatibility. +try_source("includes/nixos") + +# Cellular helpers. +$XONSH_AT_MODEM = "/dev/wwan0at0" +try_source("includes/cellular") diff --git a/xonsh/localhost.xsh b/xonsh/localhost.xsh new file mode 100644 index 0000000..c8a2771 --- /dev/null +++ b/xonsh/localhost.xsh @@ -0,0 +1,25 @@ +# +# Dotfiles specifics for Termux instances, which force hostname to localhost. +# + +# Use a much abbreviated prompt. +$PROMPT = "{BOLD_BLUE}{cwd}{RESET}{RED}{last_return_code_if_nonzero:[{BOLD_INTENSE_RED}{}{RED}] }{RESET}{BOLD_BLUE}{prompt_end}{RESET} " + +# Add things to our path. +PATH_ADDS = [ + "/nix/var/nix/profiles/default/bin/", + "/home/deprekated/.nix-profile/bin" +] + +$DISPLAY=":0" +$PULSE_SERVER="tcp:127.0.0.1:4713" + +try_source("includes/add-ssh-keys.xsh") +try_source("includes/nixos.xsh") +aliases['rebuild'] = "nix-on-droid --flake '~/dotfiles#design'" + +$XDG_DATA_DIRS = [ + "/usr/share", + "/usr/local/share", + "/home/deprekated/.nix-profile/share" +] diff --git a/xonsh/maho.xsh b/xonsh/maho.xsh new file mode 100644 index 0000000..40c4321 --- /dev/null +++ b/xonsh/maho.xsh @@ -0,0 +1,61 @@ +# +# Dotfile specifics for maho +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/usr/local/opt/coreutils/libexec/gnubin", + "/usr/local/opt/findutils/libexec/gnubin", + "/usr/local/bin", + "/usr/local/opt/gnu-sed/libexec/gnubin", + "/opt/local/bin", + "/Users/deprekated/.cargo/bin", + "/Applications/VMware Fusion.app/Contents/Library", + "/usr/local/opt/go/libexec/bin", + "$GOPATH/bin", + "/usr/local/sbin", + "/usr/local/bin", + "/usr/local/Cellar/ruby/2.3.3/bin", + "/usr/local/opt/llvm/bin", + "/Users/deprekated/.bin/", + "/usr/local/opt/e2fsprogs/sbin", + "/usr/local/opt/grep/libexec/gnubin", + "/Users/deprekated/Library/Python/3.7/bin" + #"/Library/Frameworks/Python.framework/Versions/3.7/bin" +] + + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# allow us an easy alias for using the yubikey for SSH +aliases['reagent'] = "source-bash $(ssh-agent -s); launchctl setenv SSH_AUTH_SOCK $SSH_AUTH_SOCK" +aliases['ssh-add-piv'] = "ssh-add -s /usr/local/lib/opensc-pkcs11.so" +aliases['ssh-keygen-piv'] = "ssh-keygen -D /usr/local/lib/opensc-pkcs11.so -e" +aliases['gfcycle'] = "uhubctl -l 20-1 -p 4 -a cycle" +aliases['gtkwave'] = "/Applications/gtkwave.app/Contents/Resources/bin/gtkwave" + +# Python +$PYTHONPATH="" +$PYTHONPATH.extend([ + $HOME + "/Projects/greatfet/libgreat/host", + $HOME + "/Projects/greatfet/host" +]) + + + +# Smartcard auth +$GPG_TTY=$(tty).strip() + +if 'SSH_AUTH_SOCK' in ${...}: + $ORIGINAL_SSH_AUTH_SOCK=$SSH_AUTH_SOCK + +$SSH_AUTH_SOCK=$(/usr/local/MacGPG2/bin/gpgconf --list-dirs agent-ssh-socket).strip() +/usr/local/MacGPG2/bin/gpgconf --launch gpg-agent + + +# Such convenience. +$RHODODENDRON_M0_BIN="/home/deprekated/Projects/greatfet/firmware/build/greatfet_usb/rhododendron_m0.bin" + diff --git a/xonsh/mako.xsh b/xonsh/mako.xsh new file mode 100644 index 0000000..98e4efa --- /dev/null +++ b/xonsh/mako.xsh @@ -0,0 +1,35 @@ +# +# Dotfile specifics for Beretta +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ ] + +# Aliases +#aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Smartcard auth +if ('SSH_AUTH_SOCK' not in ${...}) or not $SSH_AUTH_SOCK.startswith('/tmp/ssh'): + $GPG_TTY=$(tty).strip() + gpg-connect-agent updatestartuptty /bye 2>&1 >/dev/null + $SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket).strip() + +# Convenience hacks: +def cycle_t5_power(): + yk -d 1 + yk -u 1 + +# Use mob to pass our branches around +$MOB_REMOTE_NAME="mob-remote" + +# Use "rebuild" as a platform-agnostic rebuilding system. +aliases['rebuild'] = 'sudo nixos-rebuild --flake ~/dotfiles' + +aliases['t5cycle'] = cycle_t5_power +aliases['yk'] = "ykushcmd ykush3" + +aliases['logdog'] = "bazel run //hmd/tools/logdog --" +aliases['hmdctl'] = "bazel run //hmd/tools/hmdctl --" +aliases['imgproj'] = "bazel run //hmd/tools/imgproj --" diff --git a/xonsh/makoto.xsh b/xonsh/makoto.xsh new file mode 100644 index 0000000..a7ccc03 --- /dev/null +++ b/xonsh/makoto.xsh @@ -0,0 +1,76 @@ + +# Dotfile specifics for Rita +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/opt/Xilinx/Vivado/2020.1/bin/", + "/opt/intel_fpga_lite/19.1/quartus/bin/", + "/opt/Xilinx/14.7/ISE_DS/ISE/bin/lin64/", + "/usr/local/diamond/3.11_x64/bin/lin64/", + "/home/deprekated/.bin", + "/home/deprekated/.local/bin", + "/Users/deprekated/.cargo/bin", + "/usr/local/sbin", + "/usr/local/bin", + "/usr/local/opt/llvm/bin", + "/usr/local/opt/e2fsprogs/sbin", + "/usr/local/opt/grep/libexec/gnubin", + "/home/deprekated/.gem/ruby/2.6.0/bin", + "/home/deprekated/.cargo/bin/", + #"/opt/ecp5-toolchain-linux_x86_64-v1.6.3/bin" +] + + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' +aliases['gfcycle'] = 'uhubctl -l 3-1.3 -p 4 -a cycle' +#aliases['sshot'] = 'grim -g @($(slurp).strip())' +aliases['open'] = 'xdg-open' + + +# Python +$PYTHONPATH="" +$PYTHONPATH.extend([ +# $HOME + "/Projects/greatfet/libgreat/host", +# $HOME + "/Projects/greatfet/host" + $HOME + "/Projects/luna", + $HOME + "/Projects/apollo" +]) + + +# Wayland fanciness +$GDK_BACKEND="wayland" +$CLUTTER_BACKEND="wayland" + +# Environment +$NMIGEN_ENV_Diamond="/usr/local/diamond/3.11_x64/bin/lin64/diamond_env" + + +# Smartcard auth +#$GPG_TTY=$(tty).strip() +#gpg-connect-agent updatestartuptty /bye 2>&1 >/dev/null +#$SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket).strip() + + +# Detect if we're in a chroot +if $(ls -di /).startswith("2 "): + $PROMPT += "[chroot] " + $PROMPT + + +# Convenience hacks: +def cycle_t5_power(): + yk -d 1 + yk -u 1 + +# Use mob to pass our branches around +$MOB_REMOTE_NAME="mob-remote" + +aliases['t5cycle'] = cycle_t5_power +aliases['yk'] = "ykushcmd ykush3" + +aliases['logdog'] = "bazel run //hmd/tools/logdog --" +aliases['hmdctl'] = "bazel run //hmd/tools/hmdctl --" +aliases['imgproj'] = "bazel run //hmd/tools/imgproj --" diff --git a/xonsh/mankanshoku.xsh b/xonsh/mankanshoku.xsh new file mode 100644 index 0000000..60ea12e --- /dev/null +++ b/xonsh/mankanshoku.xsh @@ -0,0 +1,43 @@ +# +# Dotfile specifics for Rita +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/home/deprekated/.bin", + "/home/deprekated/.local/bin", + "/Users/deprekated/.cargo/bin", + "/usr/local/sbin", + "/usr/local/bin", + "/home/deprekated/.gem/ruby/2.6.0/bin", + "/home/deprekated/.cargo/bin/", +] + + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' +aliases['open'] = 'xdg-open' + + +# Python +$PYTHONPATH="" +$PYTHONPATH.extend([ +# $HOME + "/Projects/greatfet/libgreat/host", +# $HOME + "/Projects/greatfet/host" + $HOME + "/Projects/luna", + $HOME + "/Projects/apollo" +]) + + +# Smartcard auth +#$GPG_TTY=$(tty).strip() +#gpg-connect-agent updatestartuptty /bye 2>&1 >/dev/null +#$SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket).strip() + + +# Detect if we're in a chroot +if $(ls -di /).startswith("2 "): + $PROMPT += "[chroot] " + $PROMPT + diff --git a/xonsh/miko.xsh b/xonsh/miko.xsh new file mode 100644 index 0000000..bcf4ace --- /dev/null +++ b/xonsh/miko.xsh @@ -0,0 +1,69 @@ +# +# Dotfile specifics for Miko +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/usr/local/opt/coreutils/libexec/gnubin", + "/usr/local/opt/findutils/libexec/gnubin", + "/usr/local/bin", + "/usr/local/opt/gnu-sed/libexec/gnubin", + "/usr/local/bin", + "/Users/deprekated/.cargo/bin", + "/usr/local/sbin", + "/usr/local/bin", + "/usr/local/Cellar/ruby/2.3.3/bin", + "/usr/local/opt/llvm/bin", + "/Users/deprekated/.bin/", + "/Users/deprekated/.local/bin/", + "/usr/local/opt/e2fsprogs/sbin", + "/usr/local/opt/grep/libexec/gnubin", + "/Users/deprekated/Library/Python/3.9/bin", + "/etc/profiles/per-user/deprekated/bin/", + "/run/current-system/sw/bin" +] + + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +aliases['lsusb'] = 'grc -c lsusb.conf lsusb' +aliases['lsnotes'] = "eza --tree '~/Dropbox/Apps/GoodNotes 5/GoodNotes/'" + +# Helper to make every system have the same rebuild. +aliases['rebuild'] = 'darwin-rebuild --flake ~/dotfiles' + +# Python +$PYTHONPATH=[ + '/Applications/Binary Ninja.app/Contents/Resources/python', + '/Users/deprekated/Projects/amaranth/amaranth', + '/Users/deprekated/Projects/luna', + '/Users/deprekated/Projects/amaranth/amaranth-boards', + '/Users/deprekated/Projects/t5/t5gw' +] + + +# Smartcard auth +$GPG_TTY=$(tty).strip() +try: + $ORIGINAL_SSH_AUTH_SOCK=$SSH_AUTH_SOCK +except: + pass + +if 'SSH_AUTH_SOCK' not in ${...} or $SSH_AUTH_SOCK.startswith('/private'): + $SSH_AUTH_SOCK=$(/usr/local/MacGPG2/bin/gpgconf --list-dirs agent-ssh-socket).strip() + /usr/local/MacGPG2/bin/gpgconf --launch gpg-agent + + +# Make scopehal-apps work on macOS. +$VK_ICD_FILENAMES="/Users/deprekated/VulkanSDK/1.3.231.1/macOS/share/vulkan/icd.d/MoltenVK_icd.json" + +# Nix +source-bash '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' +source-bash '/etc/static/bashrc' +source-bash '/nix/var/nix/profiles/per-user/deprekated/profile/etc/profile.d/hm-session-vars.sh' + +# Temporary hack. +$TERMINFO_DIRS = [ "/usr/share/terminfo", "/Users/deprekated/.terminfo"] diff --git a/xonsh/nahida.xsh b/xonsh/nahida.xsh new file mode 100644 index 0000000..e0459ce --- /dev/null +++ b/xonsh/nahida.xsh @@ -0,0 +1,15 @@ +# +# Dotfile specifics for Nahida +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ ] + +# Aliases +#aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Use "rebuild" as a platform-agnostic rebuilding system. +aliases['rebuild'] = 'sudo nixos-rebuild --flake ~/dotfiles' + diff --git a/xonsh/pike-windows.xsh b/xonsh/pike-windows.xsh new file mode 100644 index 0000000..ce0780b --- /dev/null +++ b/xonsh/pike-windows.xsh @@ -0,0 +1,47 @@ +# +# Dotfile specifics for Pike +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "C:\\Program Files\\LLVM\\bin", + "C:\\Users\\k\\.local\\bin", + "C:\\Users\\k\\scoop\\shims", + "C:\\Users\\k\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\Scripts", + "C:\\Users\\deprekated\\opt\\fpga\\bin", +] + + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Replace some of Xonsh's aliases with our own. +aliases['mkdir'] = 'mkdir.exe' +aliases['sudo'] = r'C:\Users\deprekated\scoop\shims\sudo.cmd' + +# Use a proper GNU find. +aliases['find'] = r'C:\Users\deprekated\scoop\shims\find.exe' + +# Git LFS is broken when sshConfig is set, but it accepts configuration +# from the environment, first. Take advantage to make everything work. +$GIT_SSH_COMMAND=r"C:\\\Windows\\\System32\\\OpenSSH\\\ssh.exe" + +# Use mob to pass our branches around +$MOB_REMOTE_NAME="mob-remote" + +# Windows behaves better when TERM isn't defined. What? +del $TERM + +# Don't bother with Windows paths. They're icky. +$FORCE_POSIX_PATHS=True + +# Add an open command, as Osiria wanted. +def xopen_impl(args): + argstr = " ".join(args) + PowerShell -Command @("(New-Object -com 'Shell.Application').ShellExecute(\"" + argstr + "\")") +aliases['xopen'] = xopen_impl + +# Don't break neovim when called from Git. +__xonsh__.commands_cache.threadable_predictors['git'] = lambda *a, **kw: False diff --git a/xonsh/pike.xsh b/xonsh/pike.xsh new file mode 100644 index 0000000..fe49e39 --- /dev/null +++ b/xonsh/pike.xsh @@ -0,0 +1,16 @@ +# +# Dotfile specifics for Valere +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# SSH key management. +try_source("includes/add-ssh-keys") + +# NixOS compatibility. +try_source("includes/nixos") diff --git a/xonsh/rc.xsh b/xonsh/rc.xsh new file mode 100644 index 0000000..a456159 --- /dev/null +++ b/xonsh/rc.xsh @@ -0,0 +1,115 @@ +# vim: ft=python +# +# Kate Adkins's personal xonshrc +# + +import os +import sys +import socket + +# Override this to debug the Xonshrc. +XONSHRC_VERBOSE = False + +# +# Overrides for warnings +# +import warnings +warnings.filterwarnings("ignore", category=DeprecationWarning) + +def warn(*args, **kwargs): + pass +import warnings +warnings.warn = warn + + +# +# Xonsh configuration +# + +# Load our Xonsh extensions. +xontrib load whole_word_jumping coreutils term_integration sh + +# Squish down long CWD paths, +$DYNAMIC_CWD_WIDTH="30%" +$DYNAMIC_CWD_ELISION_CHAR='…' + +# Allow raw entry of paths; don't require cd. +$AUTO_CD=True + +# Automatically push directories, so we can just popd back. +$AUTO_PUSHD=True + +# Make it easy to type matching parens +$XONSH_AUTOPAIR=True + +# Don't let deprecation warnings spam our console. +__import__('warnings').simplefilter('ignore', DeprecationWarning, 882) + +# +# Helpers +# + +def try_source(filename): + """ Sources a given file iff that file exists. """ + from os import path + from xonsh import aliases + + xshfiles_dir = path.dirname(path.realpath(__file__)) + full_file = path.join(xshfiles_dir, filename + ".xsh") + + if path.exists(full_file): + if XONSHRC_VERBOSE: + print(f"Sourcing {full_file}!") + aliases.source_alias([full_file]) + elif XONSHRC_VERBOSE: + print(f"Not sourcing {full_file}!") + +# +# Environment +# +$GCC_COLOR = "auto" +$GCC_COLORS = "auto" +$EDITOR="kak" +$VISUAL="kak" + + +# Start off with some empty local variables; these will hopefully be populated +# by files we source. +PATH_ADDS = [] + +# +# Per-platform and per-machine environment. +# + +try_source(socket.gethostname().split('.')[0]) +try_source(sys.platform) + + +# Note: lower in the list = higher priority +for component in PATH_ADDS: + $PATH.insert(0, component) + + +# Aliases. +aliases['vim']="nvim" +aliases['t']="task" +aliases['tn']="task next" +aliases['ti']='task \'(project="" or +Inbox)\'' +aliases['tls']='task ls' +aliases['tm']='task mod' + +# Keep thread-subproces on. +$THREAD_SUBPROCS=True + +# Gulp. +try: + import pygments.styles.solarized + $XONSH_COLOR_STYLE='solarized-dark' + + if XONSHRC_VERBOSE: + print("Loaded color scheme.") + +except Exception as e: + if XONSHRC_VERBOSE: + print("Failed to load colors!") + print(e) diff --git a/xonsh/requirements.txt b/xonsh/requirements.txt new file mode 100644 index 0000000..5fed212 --- /dev/null +++ b/xonsh/requirements.txt @@ -0,0 +1,4 @@ +xontrib-whole-word-jumping +xontrib-bashisms +xontrib-term-integrations +xontrib-abbrevs diff --git a/xonsh/rita.xsh b/xonsh/rita.xsh new file mode 100644 index 0000000..32ac333 --- /dev/null +++ b/xonsh/rita.xsh @@ -0,0 +1,55 @@ +# +# Dotfile specifics for Rita +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/usr/local/bin", + "/home/deprekated/.bin", + "/home/deprekated/.local/bin", + "/Users/deprekated/.cargo/bin", + "/usr/local/sbin", + "/usr/local/bin", + "/usr/local/opt/llvm/bin", + "/usr/local/opt/e2fsprogs/sbin", + "/usr/local/opt/grep/libexec/gnubin", + "/home/deprekated/.gem/ruby/2.6.0/bin", + #"/opt/ecp5-toolchain-linux_x86_64-v1.6.3/bin" +] + + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' +aliases['gfcycle'] = 'uhubctl -l 3-1.3 -p 4 -a cycle' +#aliases['sshot'] = 'grim -g @($(slurp).strip())' +aliases['open'] = 'xdg-open' + + +# Python +$PYTHONPATH="" +$PYTHONPATH.extend([ + $HOME + "/Projects/greatfet/libgreat/host", + $HOME + "/Projects/greatfet/host" +]) + + +# Wayland fanciness +$GDK_BACKEND="wayland" +$CLUTTER_BACKEND="wayland" + +# Environment +$DEVKITPRO="/opt/devkitpro" +$DEVKITARM="/opt/devkitpro/devkitARM" + + +# Smartcard auth +$GPG_TTY=$(tty).strip() +gpg-connect-agent updatestartuptty /bye 2>&1 >/dev/null +$SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket).strip() + + +# Such convenience. +$RHODODENDRON_M0_BIN="/home/deprekated/Projects/greatfet/firmware/build/greatfet_usb/rhododendron_m0.bin" + diff --git a/xonsh/roshar.xsh b/xonsh/roshar.xsh new file mode 100644 index 0000000..7567ef9 --- /dev/null +++ b/xonsh/roshar.xsh @@ -0,0 +1,66 @@ +# +# Dotfile specifics for Roshar +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/opt/homebrew/opt/coreutils/libexec/gnubin", + "/opt/homebrew/opt/findutils/libexec/gnubin", + "/opt/homebrew/bin", + "/opt/homebrew/opt/gnu-sed/libexec/gnubin", + "/opt/homebrew/bin", + "/Users/deprekated/.cargo/bin", + "/opt/homebrew/sbin", + "/opt/homebrew/bin", + "/opt/homebrew/Cellar/ruby/2.3.3/bin", + "/opt/homebrew/opt/llvm/bin", + "/Users/deprekated/.bin/", + "/opt/homebrew/opt/e2fsprogs/sbin", + "/opt/homebrew/opt/grep/libexec/gnubin", + "/opt/homebrew/opt/ruby/bin", + "/opt/homebrew/lib/ruby/gems/3.1.0/bin", + "/opt/homebrew/opt/bison@2.7/bin", + "/etc/profiles/per-user/deprekated/bin/", + "/run/current-system/sw/bin" +] + + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Helper to make every system have the same rebuild. +aliases['rebuild'] = 'darwin-rebuild --flake ~/dotfiles' + +# Python +$PYTHONPATH="" +$PYTHONPATH.extend([ +]) + +# Smartcard auth +$GPG_TTY=$(tty).strip() + +try: + $ORIGINAL_SSH_AUTH_SOCK=$SSH_AUTH_SOCK +except: + pass + + +#$SSH_AUTH_SOCK=$(/usr/local/MacGPG2/bin/gpgconf --list-dirs agent-ssh-socket).strip() +#/usr/local/MacGPG2/bin/gpgconf --launch gpg-agent + +# Python +$PYTHONPATH=[ + '/Applications/Binary Ninja.app/Contents/Resources/python', + '/Users/deprekated/Projects/amaranth/amaranth', + '/Users/deprekated/Projects/luna', + '/Users/deprekated/Projects/amaranth/amaranth-boards', + '/Users/deprekated/Projects/t5/t5gw' +] + +# Nix +source-bash '/etc/bashrc' + +# Temporary hack. +$TERMINFO_DIRS = [ "/usr/share/terminfo", "/Users/deprekated/.terminfo"] diff --git a/xonsh/tohru.xsh b/xonsh/tohru.xsh new file mode 100644 index 0000000..bddb3fd --- /dev/null +++ b/xonsh/tohru.xsh @@ -0,0 +1,17 @@ +# +# Dotfile specifics for Yoimiya +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Use "rebuild" as a platform-agnostic rebuilding system. +aliases['rebuild'] = 'sudo -E nixos-rebuild --flake ~/dotfiles' diff --git a/xonsh/trailblazer.xsh b/xonsh/trailblazer.xsh new file mode 100644 index 0000000..b0b30fe --- /dev/null +++ b/xonsh/trailblazer.xsh @@ -0,0 +1,17 @@ +# +# Dotfile specifics for Yoimiya +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# SSH key management. +try_source("includes/add-ssh-keys") + +# NixOS compatibility. +try_source("includes/nixos") + diff --git a/xonsh/utol.xsh b/xonsh/utol.xsh new file mode 100644 index 0000000..aaaec73 --- /dev/null +++ b/xonsh/utol.xsh @@ -0,0 +1,20 @@ +# +# Dotfile specifics for Scadrial. +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# SSH key management. +try_source("includes/add-ssh-keys") + +# NixOS compatibility. +try_source("includes/nixos") + +# Cellular helpers. +$XONSH_AT_MODEM = "/dev/wwan0at0" +try_source("includes/cellular") diff --git a/xonsh/valere.xsh b/xonsh/valere.xsh new file mode 100644 index 0000000..fe49e39 --- /dev/null +++ b/xonsh/valere.xsh @@ -0,0 +1,16 @@ +# +# Dotfile specifics for Valere +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# SSH key management. +try_source("includes/add-ssh-keys") + +# NixOS compatibility. +try_source("includes/nixos") diff --git a/xonsh/veth-windows.xsh b/xonsh/veth-windows.xsh new file mode 100644 index 0000000..e259b9d --- /dev/null +++ b/xonsh/veth-windows.xsh @@ -0,0 +1,75 @@ +# +# Dotfile specifics for Trailblazer (non-WSL) +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + r"C:\\Program Files\\Git\\bin", + r"C:\\Users\\deprekated\\.local\\bin", +] + +# Aliases +aliases['ls'] = 'eza -gb' +aliases['tree'] = 'eza --tree' + +# Replace some of Xonsh's aliases with our own. +aliases['mkdir'] = 'mkdir.exe' +aliases['sudo'] = r'C:\Users\deprekated\scoop\shims\sudo.cmd' + +# Use a proper GNU find. +aliases['find'] = r'C:\Users\deprekated\scoop\shims\find.exe' + +# Make it easy to go into our t5 build environment. +aliases['t5wsl'] = 'wsl -d t5sw --cd ~/Projects/t5' + +# lsusb equivalent +def _lsusb(args): + PowerShell "Get-PnpDevice -InstanceId 'USB*' -Status OK | Format-Table -property InstanceID,FriendlyName,Class" | grep -v Hub | sed -e "s|USB.VID_||" -e "s|&PID_|:|" -e "s|[&\\][^ ]* *| |" -e "/FriendlyName/d" -e "/----/d" +aliases['lsusb'] = _lsusb + +# Aliases for our power-controlled USB3 hub. +aliases['ykushcmd'] = "~/.local/bin/ykushcmd.bat" +aliases['yk'] = "~/.local/bin/ykushcmd.bat ykush3" + +# Convenience hacks: +def cycle_t5_power(): + import time + + yk -d 1 + time.sleep(0.5) + yk -u 1 + +aliases['t5cycle'] = cycle_t5_power + +# Git LFS is broken when sshConfig is set, but it accepts configuration +# from the environment, first. Take advantage to make everything work. +$GIT_SSH_COMMAND=r"C:\\\Windows\\\System32\\\OpenSSH\\\ssh.exe" + +# Use mob to pass our branches around +$MOB_REMOTE_NAME="mob-remote" + +# Windows behaves better when TERM isn't defined. What? +del $TERM + +# Don't bother with Windows paths. They're icky. +$FORCE_POSIX_PATHS=True + +# Don't bother with bash completion, on Windows. +if 'bash' in __xonsh__.completers: + del __xonsh__.completers['bash'] + +# Set up Amaranth to use our local tools. +$AMARANTH_ENV_TRELLIS = r'C:\Users\deprekated\scoop\apps\oss-cad-suite-nightly\current\environment.bat' + +# Add an open command, as Osiria wanted. +def xopen_impl(args): + argstr = " ".join(args) + PowerShell -Command @("(New-Object -com 'Shell.Application').ShellExecute(\"" + argstr + "\")") +aliases['xopen'] = xopen_impl + +# Don't break neovim when called from Git. +__xonsh__.commands_cache.threadable_predictors['git'] = lambda *a, **kw: False + +# Use our standard gpg4win SSH. +$SSH_AUTH_SOCK=r"\\.\pipe\ssh-pageant" diff --git a/xonsh/veth.xsh b/xonsh/veth.xsh new file mode 100644 index 0000000..2eea907 --- /dev/null +++ b/xonsh/veth.xsh @@ -0,0 +1,16 @@ +# +# Dotfile specifics for Veth. +# + +# Path +# Note: lower in the list = higher priority +PATH_ADDS = [ + "/run/current-system/sw/bin" + "/run/wrappers/bin" +] + +# SSH key management. +try_source("includes/add-ssh-keys") + +# NixOS compatibility. +try_source("includes/nixos")