summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-01-30 23:43:04 +0100
committermakefu <github@syntax-fehler.de>2023-01-30 23:43:04 +0100
commit369fa6b7eb3f0fa3e1034bcad438eeda017949f8 (patch)
tree22f7891595fba32a7e66b755617e0d49b91993f3 /lass/5pkgs
parentdbc3870841223051e4f617b4c06065c168c69c10 (diff)
parentc7417c8bc1b50d466dae493ac3619d9f324f34f8 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lass/5pkgs')
-rw-r--r--lass/5pkgs/install-system/default.nix19
-rw-r--r--lass/5pkgs/unimenu/default.nix91
2 files changed, 105 insertions, 5 deletions
diff --git a/lass/5pkgs/install-system/default.nix b/lass/5pkgs/install-system/default.nix
index 9a392e669..0e13265f6 100644
--- a/lass/5pkgs/install-system/default.nix
+++ b/lass/5pkgs/install-system/default.nix
@@ -5,13 +5,21 @@ pkgs.writers.writeDashBin "install-system" ''
TARGET=$2
# format
if ! (sshn "$TARGET" -- mountpoint /mnt); then
- nix run github:numtide/nixos-remote -- --stop-after-disko --store-paths "$(nix-build --no-out-link -I stockholm="$HOME"/sync/stockholm -I nixos-config="$HOME"/sync/stockholm/lass/1systems/"$SYSTEM"/physical.nix '<nixpkgs/nixos>' -A config.system.build.diskoNoDeps)" /dev/null "$TARGET"
+ if ! (sshn "$TARGET" -- type -p nix); then
+ nix run github:numtide/nixos-remote -- --stop-after-disko --store-paths "$(nix-build --no-out-link -I stockholm="$HOME"/sync/stockholm -I nixos-config="$HOME"/sync/stockholm/lass/1systems/"$SYSTEM"/physical.nix '<nixpkgs/nixos>' -A config.system.build.diskoNoDeps)" /dev/null "$TARGET"
+ else
+ disko=$(nix-build -I stockholm=$HOME/sync/stockholm -I secrets=$HOME/sync/stockholm/lass/2configs/tests/dummy-secrets -I nixos-config=$HOME/sync/stockholm/lass/1systems/$SYSTEM/physical.nix '<nixpkgs/nixos>' -A config.system.build.disko)
+ NIX_SSHOPTS='-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' nix-copy-closure --to "$TARGET" "$disko"
+ sshn -t "$TARGET" -- "$disko"
+ fi
fi
# install dependencies
sshn "$TARGET" << SSH
- nix-channel --update
- nix-env -iA nixos.git
+ if ! type -p git; then
+ nix-channel --update
+ nix-env -iA nixos.git
+ fi
SSH
# populate
@@ -19,8 +27,9 @@ pkgs.writers.writeDashBin "install-system" ''
# install
sshn "$TARGET" << SSH
- ln -s /mnt/var/src /var/src
- NIXOS_CONFIG=/var/src/nixos-config nixos-install --no-root-password -I /var/src
+ NIXOS_CONFIG=/var/src/nixos-config nixos-install --no-root-password -I /mnt/var/src
+ nixos-enter -- nixos-rebuild -I /var/src switch --install-bootloader
+ umount -R /mnt
zpool export -fa
SSH
''
diff --git a/lass/5pkgs/unimenu/default.nix b/lass/5pkgs/unimenu/default.nix
new file mode 100644
index 000000000..d452195fc
--- /dev/null
+++ b/lass/5pkgs/unimenu/default.nix
@@ -0,0 +1,91 @@
+{
+ lib,
+ runCommand,
+ fetchurl,
+ writeText,
+ writers,
+ coreutils,
+ dmenu,
+ gnused,
+ libnotify,
+ xclip,
+ xdotool,
+ gawk,
+}: let
+ unicode-file = runCommand "unicode.txt" {} ''
+ ${
+ writers.writePython3 "generate.py" {flakeIgnore = ["E501" "E722"];} ''
+ import csv
+
+ with open("${
+ fetchurl {
+ url = "https://unicode.org/Public/UCD/latest/ucd/UnicodeData.txt";
+ sha256 = "sha256-NgGOaGV/3LNIX2NmMP/oyFMuAcl3cD0oA/W4nWxf6vs=";
+ }
+ }", "r") as unicode_data:
+ reader = csv.reader(unicode_data, delimiter=";")
+ next(reader) # skip first row containing \0
+ for row in reader:
+ codepoint = row[0]
+ name = row[1]
+ alternate_name = row[10]
+ try:
+ print(chr(int(codepoint, 16)), codepoint, name, alternate_name, sep=" ")
+ except:
+ continue
+ ''
+ } > $out
+ '';
+ kaomoji-file = writeText "kaomoji.txt" ''
+ ¯\(°_o)/¯ dunno lol shrug dlol
+ ¯\_(ツ)_/¯ dunno lol shrug dlol
+ ( ͡° ͜ʖ ͡°) lenny
+ ¯\_( ͡° ͜ʖ ͡°)_/¯ lenny shrug dlol
+ ( ゚д゚) aaah sad noo
+ ヽ(^o^)丿 hi yay hello
+ (^o^: ups hehe
+ (^∇^) yay
+ ┗(`皿´)┛ angry argh
+ ヾ(^_^) byebye!! bye
+ <(^.^<) <(^.^)> (>^.^)> (7^.^)7 (>^.^<) dance
+ (-.-)Zzz... sleep
+ (∩╹□╹∩) oh noes woot
+ (╯°□°)╯ ┻━┻ table flip
+ (」゜ロ゜)」 why woot
+ (_゜_゜_) gloom I see you
+ ༼ ༎ຶ ෴ ༎ຶ༽ sad
+ (\/) (°,,,,°) (\/) krebs
+ ┳━┳ ヽ(ಠل͜ಠ)ノ putting table back
+ ┻━┻︵ \(°□°)/ ︵ ┻━┻ flip all dem tablez
+ (`・ω・´) bear look
+ ᕦ(ຈل͜ຈ)ᕤ strong flex muscle bicep
+ ᕦ(ò_óˇ)ᕤ strong flex muscle bicep
+ (๑>ᴗ<๑) excite
+ (∩ ` -´)⊃━━☆゚.*・。゚ wizard spell magic
+ ◕ ◡ ◕ puss in boots big eye
+ ≋≋≋≋≋̯̫⌧̯̫(ˆ•̮ ̮•ˆ) nyan cat
+ ʕ•ᴥ•ʔ bear
+ (ԾɷԾ) adventure time
+ (⁀ᗢ⁀) happy yay
+ (≧◡≦) happy yay
+ \(º □ º )/ panic
+ 𓂺 penis
+ 𓂸 penis
+ '';
+in
+ # ref https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode
+ writers.writeDashBin "unimenu" ''
+ history_file=$HOME/.cache/unimenu
+ PATH=${lib.makeBinPath [coreutils dmenu gnused libnotify xclip xdotool]}
+ chosen=$(cat "$history_file" ${kaomoji-file} ${unicode-file} | dmenu -p unicode -i -l 10 | tee --append "$history_file" | sed "s/ .*//")
+
+ [ "$chosen" != "" ] || exit
+
+ echo "$chosen" | tr -d '\n' | xclip -selection clipboard
+
+ if [ -n "$1" ]; then
+ xdotool key Shift+Insert
+ else
+ notify-send --app-name="$(basename "$0")" "'$chosen' copied to clipboard." &
+ fi
+ ''