From 47fba6cb75e7a02a19cfdecd2df9c669c8c39fd1 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Thu, 12 Oct 2023 13:58:03 -0400 Subject: [PATCH] feat(nix): create bash script to update stuff and update indent-blankline-nvim --- nixos/home/nvim.nix | 4 ++-- nixos/updateSha.sh | 46 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100755 nixos/updateSha.sh diff --git a/nixos/home/nvim.nix b/nixos/home/nvim.nix index 596a357..515536d 100644 --- a/nixos/home/nvim.nix +++ b/nixos/home/nvim.nix @@ -100,8 +100,8 @@ in dracula-nvim (plugin "lukas-reineke" "indent-blankline.nvim" - "1e79f3dd6e750c5cb4ce99d1755a3e17025c0f47" - "sha256-YhfMeA+bnXlGSZPNsK1rRls9iMXUlXYKVFjHwXlnE4E=") + "0fe34b4c1b926e106d105d3ae88ef6cbf6743572" + "sha256-e8gn4pJYALaQ6sGA66SFf8p6VLJBPxT/BimQhOd5eBs=") gitsigns-nvim lualine-nvim minimap-vim diff --git a/nixos/updateSha.sh b/nixos/updateSha.sh new file mode 100755 index 0000000..4b7e503 --- /dev/null +++ b/nixos/updateSha.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +parseNurl() { + REV=$(nurl -j "$1" | jq '.["args"].["rev"]') + HASH=$(nurl -j "$1" | jq '.["args"].["hash"]') + + echo $REV $HASH +} + +# TODO +parseNurl "https://github.com/lukas-reineke/indent-blankline.nvim" + +# https://github.com/dracula/xresources +# https://github.com/dracula/plymouth +# https://github.com/dracula/gtk + +# https://gitlab.com/mishakmak/pam-fprint-grosshack +# https://github.com/tio/input-emulator + +# https://github.com/ErikReider/SwayOSD + +updateFirefoxAddons() { + echo "Updating firefox addons using mozilla-addons-to-nix" + + (cd /home/matt/.nix/nixos/home/firefox/addons || return; + + file=generated-firefox-addons.nix + if [[ -f $file ]]; then + printf "\nOld versions: \n" + + grep -A 1 --no-group-separator 'pname' "$file" | + awk '{ gsub(/"/, ""); gsub(/;/, ""); print $3 }' | + awk 'NR%2{printf $0" version ";next;}1' | paste -sd'\n' - + + printf "\nNew versions: \n" + fi + + mozilla-addons-to-nix addons.json generated-firefox-addons.nix) +} + +doAll() { + updateFirefoxAddons +} + +[[ "$1" == "-a" || "$1" == "--all" ]] && doAll +[[ "$1" == "-f" || "$1" == "--firefox" ]] && updateFirefoxAddons