about summary refs log tree commit diff stats
path: root/sys/nixpkgs/pkgs/scripts/source/small_functions
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-05-20 16:10:21 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-05-20 16:14:26 +0200
commit368cb6b0d25db2ae23be42ad51584de059997e51 (patch)
tree3282e45d3ebced63c8498a47e83a255c35de620b /sys/nixpkgs/pkgs/scripts/source/small_functions
parentrefactor(hm): Rename to `modules/home` (diff)
downloadnixos-config-368cb6b0d25db2ae23be42ad51584de059997e51.tar.gz
nixos-config-368cb6b0d25db2ae23be42ad51584de059997e51.zip
refactor(sys): Modularize and move to `modules/system` or `pkgs`
Diffstat (limited to 'sys/nixpkgs/pkgs/scripts/source/small_functions')
-rwxr-xr-xsys/nixpkgs/pkgs/scripts/source/small_functions/nato.py106
-rwxr-xr-xsys/nixpkgs/pkgs/scripts/source/small_functions/screenshot_persistent.sh22
-rwxr-xr-xsys/nixpkgs/pkgs/scripts/source/small_functions/screenshot_temporary.sh8
-rwxr-xr-xsys/nixpkgs/pkgs/scripts/source/small_functions/update-sys.sh85
4 files changed, 0 insertions, 221 deletions
diff --git a/sys/nixpkgs/pkgs/scripts/source/small_functions/nato.py b/sys/nixpkgs/pkgs/scripts/source/small_functions/nato.py
deleted file mode 100755
index e9d15f56..00000000
--- a/sys/nixpkgs/pkgs/scripts/source/small_functions/nato.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python3
-# originally from here: https://cgit.pacien.net/desktop-utilities/
-
-import sys
-
-alphabet = {
-    "nato": {
-        "A": "Alfa",  # No idea why this is not just 'Alpha' ..
-        "B": "Bravo",
-        "C": "Charlie",
-        "D": "Delta",
-        "E": "Echo",
-        "F": "Foxtrot",
-        "G": "Golf",
-        "H": "Hotel",
-        "I": "India",
-        "J": "Juliett",
-        "K": "Kilo",
-        "L": "Lima",
-        "M": "Mike",
-        "N": "November",
-        "O": "Oscar",
-        "P": "Papa",
-        "Q": "Quebec",
-        "R": "Romeo",
-        "S": "Sierra",
-        "T": "Tango",
-        "U": "Uniform",
-        "V": "Victor",
-        "W": "Whiskey",
-        "X": "X-ray",
-        "Y": "Yankee",
-        "Z": "Zulu",
-        "0": "Nadazero",
-        "1": "Unaone",
-        "2": "Bissotwo",
-        "3": "Terrathree",
-        "4": "Kartefour",
-        "5": "Pantafive",
-        "6": "Soxisix",
-        "7": "Setteseven",
-        "8": "Oktoeight",
-        "9": "Novenine",
-        ",": "Comma",
-        "/": "Forward slash",
-        ".": "Stop/Decimal",
-    },
-    "german": {
-        "A": "Aachen",
-        "Ä": "Umlaut Aachen",
-        "B": "Berlin",
-        "C": "Chemnitz",
-        "D": "Düsseldorf",
-        "E": "Essen",
-        "F": "Frankfurt",
-        "G": "Goslar",
-        "H": "Hamburg",
-        "I": "Ingelheim",
-        "J": "Jena",
-        "K": "Köln",
-        "L": "Leipzig",
-        "M": "München",
-        "N": "Nürnberg",
-        "O": "Offenbach",
-        "Ö": "Umlaut Offenbach",
-        "P": "Potsdam",
-        "Q": "Quickborn",
-        "R": "Rostock",
-        "S": "Salzwedel",
-        "ẞ": "Eszett",
-        "T": "Tübingen",
-        "U": "Unna",
-        "Ü": "Umlaut Unna",
-        "V": "Völklingen",
-        "W": "Wuppertal",
-        "X": "Xanten",
-        "Y": "Ypsilon",
-        "Z": "Zwickau",
-    },
-}
-
-
-def str_to_telephony(phrase, language):
-    language_alphabet = alphabet[language]
-
-    return [
-        language_alphabet[c] if c in language_alphabet else c for c in phrase.upper()
-    ]
-
-
-language = sys.argv[1]
-if language not in ["nato", "german"]:
-    print(
-        f"Langugae '{language}' is not a valid language, only 'nato' and 'german' are!",
-        file=sys.stderr,
-    )
-    exit(1)
-
-print(
-    "\n".join(
-        str_to_telephony(
-            " ".join(sys.argv[2:]),
-            language,
-        )
-    )
-)
diff --git a/sys/nixpkgs/pkgs/scripts/source/small_functions/screenshot_persistent.sh b/sys/nixpkgs/pkgs/scripts/source/small_functions/screenshot_persistent.sh
deleted file mode 100755
index 4308b8d2..00000000
--- a/sys/nixpkgs/pkgs/scripts/source/small_functions/screenshot_persistent.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /usr/bin/env dash
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
-
-# only generate a path (this could lead to a time-of-check/time-of-use bug)
-tmp="$(mktmp --dry-run)"
-
-if grim -g "$(slurp)" "$tmp"; then
-    name="$(rofi -dmenu -p "Name of screenshot: " -l 0)"
-    screen_shot_path="$HOME/media/pictures/screenshots/$name.png"
-    while [ -f "$screen_shot_path" ]; do
-        notify-send "Warning" 'Screenshot name already in use!'
-        name="$(rofi -dmenu -p "New name of screenshot: " -l 0)"
-        screen_shot_path="$HOME/media/pictures/screenshots/$name.png"
-    done
-
-    mv "$tmp" "$screen_shot_path"
-    alacritty -e lf -command ":{{ set sortby atime; set reverse!; }}"
-fi
-
-# vim: ft=sh
diff --git a/sys/nixpkgs/pkgs/scripts/source/small_functions/screenshot_temporary.sh b/sys/nixpkgs/pkgs/scripts/source/small_functions/screenshot_temporary.sh
deleted file mode 100755
index 8968ca79..00000000
--- a/sys/nixpkgs/pkgs/scripts/source/small_functions/screenshot_temporary.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /usr/bin/env dash
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
-
-grim -g "$(slurp)" | wl-copy
-
-# vim: ft=sh
diff --git a/sys/nixpkgs/pkgs/scripts/source/small_functions/update-sys.sh b/sys/nixpkgs/pkgs/scripts/source/small_functions/update-sys.sh
deleted file mode 100755
index d28247f6..00000000
--- a/sys/nixpkgs/pkgs/scripts/source/small_functions/update-sys.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env dash
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
-
-help() {
-    cat <<EOF
-This is a NixOS System flake update manager.
-
-USAGE:
-    $NAME [--branch <branchname>] [--help]
-
-OPTIONS:
-    --branch | -b  BRANCHNAME
-                                select a branch to update from.
-
-    --mode   | -m  MODE
-                                select a mode to update with
-
-    --help   | -h
-                                output this help.
-ARGUMENTS:
-    BRANCHNAME := [[ git branch --list --format '%(refname:short)' ]]
-                                The name of the branch to deploy the config from
-
-    MODE := switch|boot|test|build|dry-build|dry-activate|edit|repl|build-vm|build-vm-with-bootloader
-                                See the 'nixos-rebuild' manpage for more information about these modes.
-EOF
-    exit "$1"
-}
-default_branch=$(mktmp)
-BRANCH=""
-
-while [ "$#" -gt 0 ]; do
-    case "$1" in
-    "--help" | "-h")
-        help 0
-        ;;
-    "--branch" | "-b")
-        if [ -n "$2" ]; then
-            BRANCH="$2"
-        else
-            error "$1 requires an argument"
-            help 1
-        fi
-        shift 2
-        ;;
-    "--mode" | "-m")
-        if [ -n "$2" ]; then
-            MODE="$2"
-        else
-            error "$1 requires an argument"
-            help 1
-        fi
-        shift 2
-        ;;
-    *)
-        error "the option $1 does not exist!"
-        help 1
-        ;;
-    esac
-done
-
-cd /etc/nixos || die "No /etc/nixos"
-msg "Starting system update..."
-git remote update origin --prune >/dev/null 2>&1
-if ! [ "$BRANCH" = "" ]; then
-    git switch "$BRANCH" >/dev/null 2>&1 && msg2 "Switched to branch '$BRANCH'"
-fi
-msg2 "Updating git repository..."
-git pull --rebase
-
-git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g' >"$default_branch" &
-
-msg2 "Updating system..."
-if [ -n "$MODE" ]; then
-    nixos-rebuild "$MODE"
-else
-    nixos-rebuild switch
-fi
-
-git switch "$(cat "$default_branch")" >/dev/null 2>&1 && msg2 "Switched to branch '$(cat "$default_branch")'"
-msg "Finished Update!"
-
-# vim: ft=sh