{ config, lib, pkgs, ... }: let cfg = config.my.home.packages; album-to-nas = pkgs.writeShellScriptBin "album-to-nas" '' set -euo pipefail ALBUM_PATH="''${1}" ALBUM_NAME=$(basename "''${ALBUM_PATH}") NAS=$(${pkgs.tailscale}/bin/tailscale status --json | ${pkgs.jq}/bin/jq -r '.Peer | map(select(.HostName == "tahoe"))[0].TailscaleIPs[0]') scp "''${ALBUM_PATH}" "''${NAS}:~/import/album.zip" ssh "''${NAS}" bc-to-beet ~/import/album.zip ''; in { options.my.home.packages = with lib; { enable = mkEnableOption "user packages"; additionalPackages = mkOption { type = with types; listOf package; default = [ ]; example = literalExample '' with pkgs; [ pavucontrol ] ''; }; }; config.home.packages = with pkgs; lib.mkIf cfg.enable ([ util-linux jq ripgrep # custom tools album-to-nas tools.ipconverter tools.seqstat tools.git-blame-stats x509-info gh-ssh-keys ] ++ cfg.additionalPackages); }