diff --git a/modules/home/default.nix b/modules/home/default.nix index 4dcfc35..8ba3a8d 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -23,7 +23,6 @@ ./gtk ./htop ./jq - ./keyboard ./mail ./mpv ./nix diff --git a/modules/home/firefox/tridactyl/tridactylrc b/modules/home/firefox/tridactyl/tridactylrc index 0401292..31d3cb7 100644 --- a/modules/home/firefox/tridactyl/tridactylrc +++ b/modules/home/firefox/tridactyl/tridactylrc @@ -22,8 +22,8 @@ bind ;c hint -Jc [class*="expand"],[class*="togg"],[class="comment_folder"] bindurl reddit.com gu urlparent 3 " Only hint search results on Google -bindurl www.google.com f hint -Jc #search a -bindurl www.google.com F hint -Jbc #search a +bindurl www.google.com f hint -Jc #search div:not(.action-menu) > a +bindurl www.google.com F hint -Jbc #search div:not(.action-menu) > a " Only hint search results on DuckDuckGo bindurl ^https://duckduckgo.com f hint -Jc [data-testid="result-title-a"] diff --git a/modules/home/mpv/default.nix b/modules/home/mpv/default.nix index 931c252..9aef379 100644 --- a/modules/home/mpv/default.nix +++ b/modules/home/mpv/default.nix @@ -13,7 +13,6 @@ in scripts = [ pkgs.mpvScripts.mpris # Allow controlling using media keys - pkgs.mpvScripts.uosc # Nicer UI ]; }; }; diff --git a/modules/home/wm/i3bar/default.nix b/modules/home/wm/i3bar/default.nix index 5ae0e7d..5dbb505 100644 --- a/modules/home/wm/i3bar/default.nix +++ b/modules/home/wm/i3bar/default.nix @@ -74,7 +74,7 @@ in ) { block = "net"; - format = " $icon{| $ssid|}{| $ip|}{| $signal_strength|} "; + format = " $icon{| $ssid|} $ip{| $signal_strength|} "; } { block = "backlight"; diff --git a/modules/home/x/default.nix b/modules/home/x/default.nix index c320e52..0312bc4 100644 --- a/modules/home/x/default.nix +++ b/modules/home/x/default.nix @@ -3,6 +3,10 @@ let cfg = config.my.home.x; in { + imports = [ + ./keyboard + ]; + options.my.home.x = with lib; { enable = mkEnableOption "X server configuration"; }; diff --git a/modules/home/keyboard/default.nix b/modules/home/x/keyboard/default.nix similarity index 50% rename from modules/home/keyboard/default.nix rename to modules/home/x/keyboard/default.nix index 2216a08..40af800 100644 --- a/modules/home/keyboard/default.nix +++ b/modules/home/x/keyboard/default.nix @@ -1,12 +1,8 @@ { config, lib, ... }: let - cfg = config.my.home.keyboard; + cfg = config.my.home.x; in { - options.my.home.keyboard = with lib; { - enable = my.mkDisableOption "keyboard configuration"; - }; - config = lib.mkIf cfg.enable { home.keyboard = { layout = "fr"; diff --git a/pkgs/default.nix b/pkgs/default.nix index 6b7fce1..f5036fe 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -14,6 +14,8 @@ pkgs.lib.makeScope pkgs.newScope (pkgs: { drone-rsync = pkgs.callPackage ./drone-rsync { }; + drone-scp = pkgs.callPackage ./drone-scp { }; + i3-get-window-criteria = pkgs.callPackage ./i3-get-window-criteria { }; lohr = pkgs.callPackage ./lohr { }; @@ -28,5 +30,9 @@ pkgs.lib.makeScope pkgs.newScope (pkgs: { unbound-zones-adblock = pkgs.callPackage ./unbound-zones-adblock { }; + unified-hosts-lists = pkgs.callPackage ./unified-hosts-lists { }; + + wifi-qr = pkgs.callPackage ./wifi-qr { }; + zsh-done = pkgs.callPackage ./zsh-done { }; }) diff --git a/pkgs/drone-scp/default.nix b/pkgs/drone-scp/default.nix new file mode 100644 index 0000000..7437b06 --- /dev/null +++ b/pkgs/drone-scp/default.nix @@ -0,0 +1,25 @@ +{ lib, buildGoModule, fetchFromGitHub }: +buildGoModule rec { + pname = "drone-scp"; + version = "1.6.3"; + + src = fetchFromGitHub { + owner = "appleboy"; + repo = "drone-scp"; + rev = "v${version}"; + hash = "sha256-ELjPqoRR4O6gmc/PgthQuSXuSTQNzBZoAUT80zVVbV0="; + }; + + vendorHash = "sha256-/c103hTJ/Qdz2KTkdl/ACvAaSSTKcl1DQY3+Us6OxaI="; + + doCheck = false; # Needs a specific user... + + meta = with lib; { + description = '' + Copy files and artifacts via SSH using a binary, docker or Drone CI + ''; + homepage = "https://github.com/appleboy/drone-scp"; + license = licenses.mit; + mainProgram = "drone-scp"; + }; +} diff --git a/pkgs/unbound-zones-adblock/default.nix b/pkgs/unbound-zones-adblock/default.nix index 642ac41..b8392ae 100644 --- a/pkgs/unbound-zones-adblock/default.nix +++ b/pkgs/unbound-zones-adblock/default.nix @@ -1,9 +1,9 @@ -{ lib, gawk, stdenvNoCC, stevenblack-blocklist }: +{ lib, gawk, stdenvNoCC, unified-hosts-lists }: stdenvNoCC.mkDerivation { name = "unbound-zones-adblock"; - version = stevenblack-blocklist.rev; + version = unified-hosts-lists.version; - src = stevenblack-blocklist; + src = unified-hosts-lists; dontUnpack = true; @@ -18,11 +18,9 @@ stdenvNoCC.mkDerivation { ]; in '' - shopt -s globstar - for file in $src/**/hosts; do - outFile="$out/''${file#$src}" - mkdir -p "$(dirname "$outFile")" - ${gawkCmd} $file | tr '[:upper:]' '[:lower:]' | sort -u > "$outFile" + mkdir -p $out + for file in $src/*; do + ${gawkCmd} $file | tr '[:upper:]' '[:lower:]' | sort -u > $out/$(basename $file) done ''; diff --git a/pkgs/unified-hosts-lists/default.nix b/pkgs/unified-hosts-lists/default.nix new file mode 100644 index 0000000..6a71fdf --- /dev/null +++ b/pkgs/unified-hosts-lists/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchFromGitHub, stdenvNoCC }: +stdenvNoCC.mkDerivation rec { + pname = "unified-hosts-lists"; + version = "3.14.37"; + + src = fetchFromGitHub { + owner = "StevenBlack"; + repo = "hosts"; + rev = version; + hash = "sha256-HoNX57lCoIr36B/7HMuazWSWeAPPfWY1oZf6dXnxYIE="; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out + cp -r $src/hosts $out + for file in $src/alternates/*/hosts; do + cp $file $out/$(basename $(dirname $file)) + done + ''; + + meta = with lib; { + description = "Unified host lists"; + longDescription = '' + Consolidating and extending hosts files from several well-curated sources. + Optionally pick extensions for porn, social media, and other categories. + ''; + homepage = "https://github.com/StevenBlack/hosts"; + license = licenses.mit; + maintainers = with maintainers; [ ambroisie ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/wifi-qr/default.nix b/pkgs/wifi-qr/default.nix new file mode 100644 index 0000000..88164e5 --- /dev/null +++ b/pkgs/wifi-qr/default.nix @@ -0,0 +1,81 @@ +{ lib +, fetchFromGitHub +, gnome +, installShellFiles +, makeWrapper +, networkmanager +, qrencode +, stdenvNoCC +, xdg-utils +, zbar +}: +stdenvNoCC.mkDerivation rec { + pname = "wifi-qr"; + version = "unstable-2023-04-19"; + + outputs = [ "out" "man" ]; + + src = fetchFromGitHub { + owner = "kokoye2007"; + repo = "wifi-qr"; + rev = "b81d4a44257252f07e745464879aa5618ae3d434"; + hash = "sha256-oGTAr+raJGpK4PV4GdBxX8fIUE8gcbXw7W0SvQJAee0="; + }; + + nativeBuildInputs = [ + installShellFiles + makeWrapper + ]; + + dontBuild = true; + + dontConfigure = true; + + postPatch = '' + substituteInPlace wifi-qr.desktop \ + --replace "Exec=sh -c 'wifi-qr g'" "Exec=$out/bin/wifi-qr g" \ + --replace "Exec=sh -c 'wifi-qr q'" "Exec=$out/bin/wifi-qr q" \ + --replace "Exec=sh -c 'wifi-qr p'" "Exec=$out/bin/wifi-qr p" \ + --replace "Exec=sh -c 'wifi-qr c'" "Exec=$out/bin/wifi-qr c" \ + --replace "Icon=wifi-qr.svg" "Icon=wifi-qr" + ''; + + installPhase = '' + runHook preInstall + + install -Dm755 wifi-qr $out/bin/wifi-qr + + install -Dm644 wifi-qr.desktop $out/share/applications/wifi-qr.desktop + install -Dm644 wifi-qr.svg $out/share/icons/hicolor/scalable/apps/wifi-qr.svg + + installManPage wifi-qr.1 + + runHook postInstall + ''; + + wrapperPath = lib.makeBinPath [ + gnome.zenity + networkmanager + qrencode + xdg-utils + zbar + ]; + + fixupPhase = '' + runHook preFixup + + patchShebangs $out/bin/wifi-qr + wrapProgram $out/bin/wifi-qr --suffix PATH : "${wrapperPath}" + + runHook postFixup + ''; + + meta = with lib; { + description = "WiFi password sharing via QR codes"; + homepage = "https://github.com/kokoye2007/wifi-qr"; + license = with licenses; [ gpl3Plus ]; + mainProgram = "wifi-qr"; + maintainers = with maintainers; [ ambroisie ]; + platforms = platforms.linux; + }; +}