blob: a4599952648a19f584b6aa6a3c7b0838135f553b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
{ 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 album-to-nas tools.ipconverter ]
++ cfg.additionalPackages);
}
|