From 9546908dbf367daf221b3b08b6769115f9ae6a56 Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 2 Jul 2023 23:01:56 +0000 Subject: [PATCH] remove unused sane-mount-* helpers --- hosts/common/fs.nix | 28 ------------------- pkgs/additional/sane-scripts/default.nix | 12 +------- .../sane-scripts/src/sane-mount-servo | 24 ---------------- .../sane-scripts/src/sane-mount-servo-root | 24 ---------------- .../sane-scripts/src/sane-sync-from-servo | 7 +++-- 5 files changed, 5 insertions(+), 90 deletions(-) delete mode 100755 pkgs/additional/sane-scripts/src/sane-mount-servo delete mode 100755 pkgs/additional/sane-scripts/src/sane-mount-servo-root diff --git a/hosts/common/fs.nix b/hosts/common/fs.nix index 01533fab..ab3ef1c9 100644 --- a/hosts/common/fs.nix +++ b/hosts/common/fs.nix @@ -77,34 +77,6 @@ in # }; sane.fs."/mnt/servo-media" = sane-lib.fs.wantedSymlinkTo "/mnt/servo-nfs/media"; - fileSystems."/mnt/servo-media-wan" = { - device = "colin@uninsane.org:/var/lib/uninsane/media"; - fsType = "fuse.sshfs"; - options = fsOpts.sshColin ++ fsOpts.noauto; - noCheck = true; - }; - sane.fs."/mnt/servo-media-wan" = sane-lib.fs.wantedDir; - fileSystems."/mnt/servo-media-lan" = { - device = "colin@servo:/var/lib/uninsane/media"; - fsType = "fuse.sshfs"; - options = fsOpts.sshColin ++ fsOpts.noauto; - noCheck = true; - }; - sane.fs."/mnt/servo-media-lan" = sane-lib.fs.wantedDir; - fileSystems."/mnt/servo-root-wan" = { - device = "colin@uninsane.org:/"; - fsType = "fuse.sshfs"; - options = fsOpts.sshRoot ++ fsOpts.noauto; - noCheck = true; - }; - sane.fs."/mnt/servo-root-wan" = sane-lib.fs.wantedDir; - fileSystems."/mnt/servo-root-lan" = { - device = "colin@servo:/"; - fsType = "fuse.sshfs"; - options = fsOpts.sshRoot ++ fsOpts.noauto; - noCheck = true; - }; - sane.fs."/mnt/servo-root-lan" = sane-lib.fs.wantedDir; fileSystems."/mnt/desko-home" = { device = "colin@desko:/home/colin"; fsType = "fuse.sshfs"; diff --git a/pkgs/additional/sane-scripts/default.nix b/pkgs/additional/sane-scripts/default.nix index c6c75788..cacfc946 100644 --- a/pkgs/additional/sane-scripts/default.nix +++ b/pkgs/additional/sane-scripts/default.nix @@ -107,16 +107,6 @@ let pname = "sane-ip-reconnect"; src = ./src; }; - mount-servo = static-nix-shell.mkBash { - pname = "sane-mount-servo"; - src = ./src; - pkgs = [ "coreutils-full" ]; - }; - mount-servo-root = static-nix-shell.mkBash { - pname = "sane-mount-servo-root"; - src = ./src; - pkgs = [ "coreutils-full" ]; - }; private-change-passwd = static-nix-shell.mkBash { pname = "sane-private-change-passwd"; src = ./src; @@ -203,7 +193,7 @@ let sync-from-servo = static-nix-shell.mkBash { pname = "sane-sync-from-servo"; src = ./src; - pkgs = [ "rsync" "sane-scripts.mount-servo" ]; + pkgs = [ "rsync" ]; }; vpn-down = static-nix-shell.mkBash { pname = "sane-vpn-down"; diff --git a/pkgs/additional/sane-scripts/src/sane-mount-servo b/pkgs/additional/sane-scripts/src/sane-mount-servo deleted file mode 100755 index 9011a9d9..00000000 --- a/pkgs/additional/sane-scripts/src/sane-mount-servo +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p coreutils-full -#^ requires `sudo` and `mount` to be installed system-wide (suid) - -set -ex - -# if lan not mounted, then try to mount it -if ! (test -d /mnt/servo-media-lan/Music) -then - sudo mount /mnt/servo-media-lan -fi -# not much reason not to mount the wan while we're here. -if ! (test -d /mnt/servo-media-wan/Music) -then - sudo mount /mnt/servo-media-wan -fi - -mnt=/mnt/servo-media-wan -# if the LAN is accessible, prefer that -test -d /mnt/servo-media-wan/Music && mnt=/mnt/servo-media-lan - -# symlink the fastest mount point into place -# uncomment if i see the bug again: sudo unlink /mnt/servo-media # XXX ln gets confused if the destination is a symlink to a stale mount -sudo ln -sf --no-dereference $mnt /mnt/servo-media diff --git a/pkgs/additional/sane-scripts/src/sane-mount-servo-root b/pkgs/additional/sane-scripts/src/sane-mount-servo-root deleted file mode 100755 index d89054ab..00000000 --- a/pkgs/additional/sane-scripts/src/sane-mount-servo-root +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p coreutils-full -#^ requires `sudo` and `mount` to be installed system-wide (suid) -# -set -ex - -# if lan not mounted, then try to mount it -if ! (test -d /mnt/servo-root-lan/nix) -then - sudo mount /mnt/servo-root-lan -fi -# not much reason not to mount the wan while we're here. -if ! (test -d /mnt/servo-root-wan/nix) -then - sudo mount /mnt/servo-root-wan -fi - -mnt=/mnt/servo-root-wan -# if the LAN is accessible, prefer that -test -d /mnt/servo-root-wan/nix && mnt=/mnt/servo-root-lan - -# symlink the fastest mount point into place -# uncomment if i see the bug again: sudo unlink /mnt/servo-root # XXX ln gets confused if the destination is a symlink to a stale mount -sudo ln -sf --no-dereference $mnt /mnt/servo-root diff --git a/pkgs/additional/sane-scripts/src/sane-sync-from-servo b/pkgs/additional/sane-scripts/src/sane-sync-from-servo index 64f9c142..66fb06d7 100755 --- a/pkgs/additional/sane-scripts/src/sane-sync-from-servo +++ b/pkgs/additional/sane-scripts/src/sane-sync-from-servo @@ -1,7 +1,8 @@ #!/usr/bin/env nix-shell -#!nix-shell -i bash -p rsync -p sane-scripts.mount-servo +#!nix-shell -i bash -p rsync set -ex -sane-mount-servo -rsync -arv --delete --progress $mnt/Music/ ~/Music/ +REMOTE_MUSIC=/mnt/servo-media/Music +test -d "$REMOTE_MUSIC" && \ + rsync -arv --delete --progress "$REMOTE_MUSIC/" ~/Music/