From eeb48df35a4600ac0c0db59fff260ff8f59444c7 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 29 Aug 2022 22:09:05 +0200 Subject: [PATCH] Migrate the libimobiledevice to a normal module The reason is because I want to have the usbmuxd service in that config as well. --- .../software/libimobiledevice/default.nix | 22 ---------------- modules/libimobiledevice/default.nix | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+), 22 deletions(-) delete mode 100644 home-manager/software/libimobiledevice/default.nix create mode 100644 modules/libimobiledevice/default.nix diff --git a/home-manager/software/libimobiledevice/default.nix b/home-manager/software/libimobiledevice/default.nix deleted file mode 100644 index 589e2db..0000000 --- a/home-manager/software/libimobiledevice/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - libimobiledevice - ]; - home.shellAliases = { - iphone-backup = '' - backup_dir=~/Downloads/$(date -I)_iphone && - mkdir -p $backup_dir && - idevicebackup2 backup $backup_dir && - tar cjf $backup_dir.tar.bz2 $backup_dir && - rm -r $backup_dir - ''; - ipad-backup = '' - backup_dir=~/Downloads/$(date -I)_ipad && - mkdir -p $backup_dir && - idevicebackup2 backup $backup_dir && - tar cjf $backup_dir.tar.bz2 $backup_dir && - rm -r $backup_dir - ''; - }; -} diff --git a/modules/libimobiledevice/default.nix b/modules/libimobiledevice/default.nix new file mode 100644 index 0000000..489c474 --- /dev/null +++ b/modules/libimobiledevice/default.nix @@ -0,0 +1,26 @@ +{ custom, pkgs, ... }: +{ + services.usbmuxd.enable = true; + environment.systemPackages = with pkgs; + [ + libimobiledevice + ]; + + home-manager.users.${custom.username} = { + home.shellAliases = { + iphone-backup = '' + backup_dir=~/Downloads/$(date -I)_iphone && + mkdir -p $backup_dir && + ${pkgs.libimobiledevice}/bin/idevicebackup2 backup $backup_dir && + ${pkgs.gnutar}/bin/tar cjf $backup_dir.tar.bz2 $backup_dir && + rm -r $backup_dir''; + + ipad-backup = '' + backup_dir=~/Downloads/$(date -I)_ipad && + mkdir -p $backup_dir && + ${pkgs.libimobiledevice}/bin/idevicebackup2 backup $backup_dir && + ${pkgs.gnutar}/bin/tar cjf $backup_dir.tar.bz2 $backup_dir && + rm -r $backup_dir''; + }; + }; +}