diff options
author | Tim Keller <tjkeller.xyz> | 2025-02-06 22:03:18 -0600 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2025-02-06 22:03:18 -0600 |
commit | b03202e3ff9af9c961f813332c962913b6f81d22 (patch) | |
tree | a542f59b2c77c50622988155ce58d363c37f884b /modules | |
parent | 56aa812441c150da6f27d7c848d3e3eb2ded4435 (diff) | |
download | nixos-b03202e3ff9af9c961f813332c962913b6f81d22.tar.xz nixos-b03202e3ff9af9c961f813332c962913b6f81d22.zip |
pull repos if existing and firefox add search engine for nixos options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/home/firefox.nix | 19 | ||||
-rw-r--r-- | modules/home/resources/activation-scripts/clone-repos.sh | 8 |
2 files changed, 20 insertions, 7 deletions
diff --git a/modules/home/firefox.nix b/modules/home/firefox.nix index 5e015ff..eff786c 100644 --- a/modules/home/firefox.nix +++ b/modules/home/firefox.nix @@ -9,21 +9,28 @@ search = { engines = { "Timmy Search" = { - urls = [{ template = "https://search.tjkeller.xyz/search?q={searchTerms}"; }]; # Don't know how to do w/ POST but I prefer GET anyways + urls = [{ + template = "https://search.tjkeller.xyz/search"; + params = [ { name = "q"; value = "{searchTerms}}"; } ]; + }]; iconURI = "https://search.tjkeller.xyz/static/themes/simple/img/favicon.svg"; # TODO doesn't seem to work }; "Nix Packages" = { urls = [{ template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; + params = [ { name = "query"; value = "{searchTerms}"; } ]; }]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; + "NixOS Options" = { + urls = [{ + template = "https://search.nixos.org/options"; + params = [ { name = "query"; value = "{searchTerms}"; } ]; + }]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@no" ]; + }; }; default = "Timmy Search"; privateDefault = "Timmy Search"; diff --git a/modules/home/resources/activation-scripts/clone-repos.sh b/modules/home/resources/activation-scripts/clone-repos.sh index 887968b..eaee4dc 100644 --- a/modules/home/resources/activation-scripts/clone-repos.sh +++ b/modules/home/resources/activation-scripts/clone-repos.sh @@ -3,8 +3,14 @@ server="https://git.tjkeller.xyz/" clonemissing() { + # pull and return if already existing + if [ -d "$2"/.git ]; then + run cd $VERBOSE_ARG "$2" + run git pull $VERBOSE_ARG || echo "$2: failed to pull from remote" + return + fi + # clone to $2 - [ -d "$2"/.git ] && return run mkdir -p $VERBOSE_ARG "$2" run git clone $VERBOSE_ARG "$server$1" "$2" |